• Skip to content
  • Skip to link menu
KDE 4.2 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 
00127     Q_PROPERTY(bool showToolTipWhenElided READ showToolTipWhenElided WRITE setShowToolTipWhenElided)
00128 
00129     Q_ENUMS(Information)
00130 
00131 
00132     public:
00154         enum Information {
00155             NoInformation,     
00156             Size,              
00157             Permissions,       
00158             OctalPermissions,  
00159             Owner,             
00160             OwnerAndGroup,     
00161             CreationTime,      
00162             ModificationTime,  
00163             AccessTime,        
00164             MimeType,          
00165             FriendlyMimeType   
00166         };
00167 
00168         typedef QList<Information> InformationList;
00169 
00170 
00176         explicit KFileItemDelegate(QObject *parent = 0);
00177 
00178 
00182         virtual ~KFileItemDelegate();
00183 
00184 
00197         virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
00198 
00199 
00221         virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
00222 
00223 
00227         virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const;
00228 
00229 
00233         virtual bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem & option, const QModelIndex &index);
00234 
00235 
00239         virtual void setEditorData(QWidget *editor, const QModelIndex &index) const;
00240 
00241 
00245         virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const;
00246 
00247 
00251         virtual void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option,const QModelIndex &index) const;
00252 
00253 
00270         void setShowInformation(const InformationList &list);
00271 
00272 
00281         void setShowInformation(Information information);
00282 
00283 
00287         InformationList showInformation() const;
00288 
00289 
00298         void setShadowColor(const QColor &color);
00299 
00300 
00306         QColor shadowColor() const;
00307 
00308 
00314         void setShadowOffset(const QPointF &offset);
00315 
00316 
00322         QPointF shadowOffset() const;
00323 
00324 
00330         void setShadowBlur(qreal radius);
00331 
00332 
00338         qreal shadowBlur() const;
00339 
00346         void setMaximumSize(const QSize &size);
00347 
00354         QSize maximumSize() const;
00355 
00366         void setShowToolTipWhenElided(bool showToolTip);
00367 
00378         bool showToolTipWhenElided() const;
00379 
00383         virtual bool eventFilter(QObject *object, QEvent *event);
00384 
00385 
00386     public Q_SLOTS:
00390         bool helpEvent(QHelpEvent * event, QAbstractItemView *view, const QStyleOptionViewItem &option, const QModelIndex &index);
00391 
00396         QRegion shape(const QStyleOptionViewItem &option, const QModelIndex &index);
00397 
00398 
00399     private:
00400         class Private;
00401         Private * const d; 
00402         Q_DISABLE_COPY(KFileItemDelegate)
00403 };
00404 
00405 #endif // KFILEITEMDELEGATE_H
00406 
00407 // 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
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
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