From c55ac460033175c5f0bef51e100d88c48e9d05d6 Mon Sep 17 00:00:00 2001 From: Rafael Fernández López Date: Sun, 14 Mar 2010 16:31:16 +0000 Subject: Adapt DolphinCategoryDrawer to new changes on kdelibs :) svn path=/trunk/KDE/kdebase/apps/; revision=1103215 --- src/dolphincategorydrawer.h | 51 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 2 deletions(-) (limited to 'src/dolphincategorydrawer.h') 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 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 -- cgit v1.3.1