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

KIO

kfileitemdelegate.h

Go to the documentation of this file.
00001 /*
00002    This file is part of the KDE project
00003 
00004    Copyright © 2006-2007, 2008 Fredrik Höglund <fredrik@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 KFILEITEMDELEGATE_H
00023 #define KFILEITEMDELEGATE_H
00024 
00025 #include <QtGui/QAbstractItemDelegate>
00026 #include <kio/global.h>
00027 
00028 
00029 class QAbstractItemModel;
00030 class QAbstractItemView;
00031 class QHelpEvent;
00032 class QModelIndex;
00033 class QPainter;
00034 
00035 
00066 class KIO_EXPORT KFileItemDelegate : public QAbstractItemDelegate
00067 {
00068     Q_OBJECT
00069 
00078     Q_PROPERTY(InformationList information READ showInformation WRITE setShowInformation)
00079 
00080     
00091     Q_PROPERTY(QColor shadowColor READ shadowColor WRITE setShadowColor)
00092 
00101     Q_PROPERTY(QPointF shadowOffset READ shadowOffset WRITE setShadowOffset)
00102 
00111     Q_PROPERTY(qreal shadowBlur READ shadowBlur WRITE setShadowBlur)
00112 
00118     Q_PROPERTY(QSize maximumSize READ maximumSize WRITE setMaximumSize)
00119 
00120     Q_ENUMS(Information)
00121 
00122 
00123     public:
00145         enum Information {
00146             NoInformation,     
00147             Size,              
00148             Permissions,       
00149             OctalPermissions,  
00150             Owner,             
00151             OwnerAndGroup,     
00152             CreationTime,      
00153             ModificationTime,  
00154             AccessTime,        
00155             MimeType,          
00156             FriendlyMimeType   
00157         };
00158 
00159         typedef QList<Information> InformationList;
00160 
00161 
00167         explicit KFileItemDelegate(QObject *parent = 0);
00168 
00169 
00173         virtual ~KFileItemDelegate();
00174 
00175 
00188         virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
00189 
00190 
00212         virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
00213 
00214 
00218         virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
00219 
00220 
00224         virtual bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem & option, const QModelIndex &index);
00225 
00226 
00230         virtual void setEditorData(QWidget *editor, const QModelIndex &index) const;
00231 
00232 
00236         virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
00237 
00238 
00242         virtual void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option,const QModelIndex &index) const;
00243 
00244 
00261         void setShowInformation(const InformationList &list);
00262 
00263 
00272         void setShowInformation(Information information);
00273 
00274 
00278         InformationList showInformation() const;
00279 
00280 
00289         void setShadowColor(const QColor &color);
00290 
00291 
00297         QColor shadowColor() const;
00298 
00299 
00305         void setShadowOffset(const QPointF &offset);
00306 
00307 
00313         QPointF shadowOffset() const;
00314 
00315 
00321         void setShadowBlur(qreal radius);
00322 
00323 
00329         qreal shadowBlur() const;
00330 
00337         void setMaximumSize(const QSize &size);
00338 
00345         QSize maximumSize() const;
00346 
00350         virtual bool eventFilter(QObject *object, QEvent *event);
00351 
00352 
00353     public Q_SLOTS:
00357         bool helpEvent(QHelpEvent * event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index);
00358 
00359 
00360     private:
00361         class Private;
00362         Private * const d; 
00363         Q_DISABLE_COPY(KFileItemDelegate)
00364 };
00365 
00366 #endif // KFILEITEMDELEGATE_H
00367 
00368 // kate: space-indent on; indent-width 4; replace-tabs on;

KIO

Skip menu "KIO"
  • 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