• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDE3Support

k3fileview.h

Go to the documentation of this file.
00001 // -*- c++ -*-
00002 /* This file is part of the KDE libraries
00003     Copyright (C) 1997 Stephan Kulow <coolo@kde.org>
00004     Copyright (C) 2001 Carsten Pfeiffer <pfeiffer@kde.org>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
00020 */
00021 
00022 #ifndef KFILEVIEW_H
00023 #define KFILEVIEW_H
00024 
00025 class QPoint;
00026 class QWidget;
00027 class QDropEvent;
00028 class KActionCollection;
00029 
00030 #include "kde3support_export.h"
00031 #include "kfileitem.h"
00032 #include "kfile.h"
00033 
00038 class KDE3SUPPORT_EXPORT K3FileViewSignaler : public QObject
00039 {
00040     Q_OBJECT
00041 
00042 public:
00047     void activate( const KFileItem &item );
00048 
00053     void highlightFile( const KFileItem &item );
00054 
00055     void activateMenu( const KFileItem &item, const QPoint& pos );
00056 
00057     void changeSorting( QDir::SortFlags sorting );
00058 
00059     void dropURLs( const KFileItem &item, QDropEvent *event, const KUrl::List &urls);
00060 
00061 Q_SIGNALS:
00062     void dirActivated( const KFileItem &item );
00063 
00064     void sortingChanged( QDir::SortFlags );
00065 
00070     void fileHighlighted( const KFileItem &item );
00071     void fileSelected( const KFileItem &item );
00072     void activatedMenu( const KFileItem &item, const QPoint &pos );
00073     void dropped( const KFileItem &item, QDropEvent *event, const KUrl::List &urls );
00074 };
00075 
00089 class KDE3SUPPORT_EXPORT K3FileView {
00090 
00091 public:
00095     K3FileView();
00096 
00100     virtual ~K3FileView();
00101 
00105     void addItemList(const KFileItemList &list);
00106 
00112     virtual QWidget *widget() = 0;
00113 
00117     QWidget *widget() const;
00118 
00122     void setCurrentItem( const QString &filename );
00123 
00128     virtual void setCurrentItem( const KFileItem &item ) = 0;
00129 
00135     virtual KFileItem currentFileItem() const = 0;
00136 
00140     virtual void clear();
00141 
00150     virtual void updateView(bool f = true);
00151 
00152     virtual void updateView(const KFileItem&);
00153 
00158     virtual void removeItem(const KFileItem &item);
00159 
00165     virtual void listingCompleted();
00166 
00171     QDir::SortFlags sorting() const;
00172 
00187     virtual void setSorting(QDir::SortFlags sort);
00188 
00193     bool isReversed() const;
00194 
00195     void sortReversed();
00196 
00200     uint count() const;
00201 
00205     uint numFiles() const;
00206 
00210     uint numDirs() const;
00211 
00212     virtual void setSelectionMode( KFile::SelectionMode sm );
00213     virtual KFile::SelectionMode selectionMode() const;
00214 
00215     enum ViewMode {
00216         Files       = 1,
00217         Directories = 2,
00218         All = Files | Directories
00219     };
00220     virtual void setViewMode( ViewMode vm );
00221     virtual ViewMode viewMode() const;
00222 
00228     QString viewName() const;
00229 
00234     void setViewName( const QString& name );
00235 
00236     virtual void setParentView(K3FileView *parent);
00237 
00246     virtual void insertItem( const KFileItem &i);
00247 
00252     virtual void clearView() = 0;
00253 
00258     virtual void ensureItemVisible( const KFileItem &i ) = 0;
00259 
00264     virtual void clearSelection() = 0;
00265 
00271     virtual void selectAll();
00272 
00277     virtual void invertSelection();
00278 
00283     virtual void setSelected(const KFileItem &, bool enable) = 0;
00284 
00289     virtual bool isSelected( const KFileItem & ) const = 0;
00290 
00294     KFileItemList selectedItems() const;
00295 
00299     KFileItemList items() const;
00300 
00301     virtual KFileItem firstFileItem() const = 0;
00302     virtual KFileItem nextItem( const KFileItem & ) const = 0;
00303     virtual KFileItem prevItem( const KFileItem & ) const = 0;
00304 
00315     void setOnlyDoubleClickSelectsFiles( bool enable );
00316 
00322     bool onlyDoubleClickSelectsFiles() const;
00323 
00328     bool updateNumbers(const KFileItem &i);
00329 
00335     virtual KActionCollection * actionCollection() const;
00336 
00337     K3FileViewSignaler * signaler() const;
00338 
00339     virtual void readConfig( KConfigGroup *);
00340     virtual void writeConfig( KConfigGroup *);
00341 
00348     enum DropOptions {
00349         AutoOpenDirs  = 1
00350     };
00355     virtual void setDropOptions(int options);
00356 
00361     int dropOptions();
00362 
00376     static QString sortingKey( const QString& value, bool isDir, QDir::SortFlags SortFlags);
00377 
00384     static QString sortingKey( KIO::filesize_t value, bool isDir,QDir::SortFlags SortFlags);
00385 
00390     static int autoOpenDelay();
00391 
00392 protected:
00397     K3FileViewSignaler *sig;
00398 
00399 private:
00400     class K3FileViewPrivate;
00401     K3FileViewPrivate* const d;
00402 };
00403 
00404 #endif // KFILEINFOLISTWIDGET_H

KDE3Support

Skip menu "KDE3Support"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal