diff options
| author | Rafael Fernández López <[email protected]> | 2010-03-14 16:31:16 +0000 |
|---|---|---|
| committer | Rafael Fernández López <[email protected]> | 2010-03-14 16:31:16 +0000 |
| commit | c55ac460033175c5f0bef51e100d88c48e9d05d6 (patch) | |
| tree | 6841a4e52830b20e471f11b6cee5a5cc758d9835 /src/dolphincategorydrawer.h | |
| parent | f2885d1ac237dcf1a3536e7a619275158fe2825d (diff) | |
Adapt DolphinCategoryDrawer to new changes on kdelibs :)
svn path=/trunk/KDE/kdebase/apps/; revision=1103215
Diffstat (limited to 'src/dolphincategorydrawer.h')
| -rw-r--r-- | src/dolphincategorydrawer.h | 51 |
1 files changed, 49 insertions, 2 deletions
diff --git a/src/dolphincategorydrawer.h b/src/dolphincategorydrawer.h index 2eb0e310c..e5ba041f3 100644 --- a/src/dolphincategorydrawer.h +++ b/src/dolphincategorydrawer.h @@ -28,17 +28,64 @@ #include <libdolphin_export.h> class LIBDOLPHINPRIVATE_EXPORT DolphinCategoryDrawer - : public KCategoryDrawer + : public KCategoryDrawerV3 { public: - DolphinCategoryDrawer(); + enum Action { + SelectAll = 0, + UnselectAll + }; + + DolphinCategoryDrawer(KCategorizedView *view); virtual ~DolphinCategoryDrawer(); + bool allCategorySelected(const QString &category) const; + + bool someCategorySelected(const QString &category) const; + virtual void drawCategory(const QModelIndex &index, int sortRole, const QStyleOption &option, QPainter *painter) const; virtual int categoryHeight(const QModelIndex &index, const QStyleOption &option) const; + + /** + * @warning You explicitly have to determine whether the event has been accepted or not. You + * have to call event->accept() or event->ignore() at all possible case branches in + * your code. + */ + virtual void mouseButtonPressed(const QModelIndex &index, const QRect &blockRect, QMouseEvent *event); + + /** + * @warning You explicitly have to determine whether the event has been accepted or not. You + * have to call event->accept() or event->ignore() at all possible case branches in + * your code. + */ + virtual void mouseButtonReleased(const QModelIndex &index, const QRect &blockRect, QMouseEvent *event); + + virtual void mouseMoved(const QModelIndex &index, const QRect &blockRect, QMouseEvent *event); + + virtual void mouseLeft(const QModelIndex &index,const QRect &blockRect); + +private: + enum HotSpot { + NoneHotSpot = 0, + SelectAllHotSpot, + UnselectAllHotSpot + }; + + HotSpot hotSpotPressed; + QModelIndex categoryPressed; + + QPixmap selectAll; + QPixmap selectAllHovered; + QPixmap selectAllDisabled; + QPixmap unselectAll; + QPixmap unselectAllHovered; + QPixmap unselectAllDisabled; + + QPoint pos; + QString category; }; #endif // DOLPHINCATEGORYDRAWER_H |
