~ubuntu-branches/ubuntu/saucy/digikam/saucy

« back to all changes in this revision

Viewing changes to libs/widgets/common/itemviewimagedelegate.h

  • Committer: Bazaar Package Importer
  • Author(s): Scott Kitterman
  • Date: 2010-12-21 23:19:11 UTC
  • mfrom: (1.2.33 upstream) (3.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20101221231911-z9jip7s5aht1jqn9
Tags: 2:1.7.0-1ubuntu1
* Merge from Debian Experimental. Remaining Ubuntu changes:
  - Export .pot name and copy to plugins in debian/rules
  - Version build-depends on kipi-plugins-dev to ensure build is against the
    same version on all archs
* Drop debian/patches/kubuntu_01_linker.diff, incoporated upstream
* Remove patches directory and unused patches

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
 
49
49
public:
50
50
 
51
 
    ItemViewImageDelegate(DCategorizedView *parent);
 
51
    ItemViewImageDelegate(DCategorizedView* parent);
52
52
    ~ItemViewImageDelegate();
53
53
 
54
 
    virtual QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex & index) const;
 
54
    virtual QSize sizeHint(const QStyleOptionViewItem& option, const QModelIndex& index) const;
55
55
    virtual QSize gridSize() const;
56
56
 
57
57
    ThumbnailSize thumbnailSize() const;
61
61
    virtual void setSpacing(int spacing);
62
62
    virtual void setDefaultViewOptions(const QStyleOptionViewItem& option);
63
63
    virtual bool acceptsToolTip(const QPoint& pos, const QRect& visualRect,
64
 
                                const QModelIndex& index, QRect *tooltipRect = 0) const;
 
64
                                const QModelIndex& index, QRect* tooltipRect = 0) const;
65
65
    virtual bool acceptsActivation(const QPoint& pos, const QRect& visualRect,
66
 
                                   const QModelIndex& index, QRect *activationRect = 0) const;
 
66
                                   const QModelIndex& index, QRect* activationRect = 0) const;
67
67
 
68
68
    QRect rect() const;
69
69
 
70
70
    /** Can be used to temporarily disable drawing of the rating.
71
71
     *  Call with QModelIndex() afterwards. */
72
 
    void setRatingEdited(const QModelIndex &index);
 
72
    void setRatingEdited(const QModelIndex& index);
73
73
    /** Returns the rectangle where the rating is drawn,
74
74
     *  or a null rectangle if not supported. */
75
75
    virtual QRect ratingRect() const;
76
76
 
77
77
    /** Support for overlays. To be called by the item view only. */
78
 
    void installOverlay(ImageDelegateOverlay *overlay);
79
 
    void removeOverlay(ImageDelegateOverlay *overlay);
 
78
    void installOverlay(ImageDelegateOverlay* overlay);
 
79
    void removeOverlay(ImageDelegateOverlay* overlay);
80
80
    void setAllOverlaysActive(bool active);
81
81
    void removeAllOverlays();
82
 
    void mouseMoved(QMouseEvent *e, const QRect& visualRect, const QModelIndex& index);
 
82
    void mouseMoved(QMouseEvent* e, const QRect& visualRect, const QModelIndex& index);
83
83
 
84
84
protected Q_SLOTS:
85
85
 
89
89
protected:
90
90
 
91
91
    /// Use the tool methods for painting in subclasses
92
 
    QRect drawThumbnail(QPainter *p, const QRect& thumbRect, const QPixmap& background, const QPixmap& thumbnail) const;
93
 
    void drawRating(QPainter *p, const QModelIndex& index, const QRect& ratingRect, int rating, bool isSelected) const;
94
 
    void drawName(QPainter *p,const QRect& nameRect, const QString& name) const;
95
 
    void drawComments(QPainter *p, const QRect& commentsRect, const QString& comments) const;
96
 
    void drawCreationDate(QPainter *p, const QRect& dateRect, const QDateTime& date) const;
97
 
    void drawModificationDate(QPainter *p, const QRect& dateRect, const QDateTime& date) const;
98
 
    void drawImageSize(QPainter *p, const QRect& dimsRect, const QSize& dims) const;
99
 
    void drawFileSize(QPainter *p, const QRect& r, int bytes) const;
100
 
    void drawTags(QPainter *p, const QRect& r, const QString& tagsString, bool isSelected) const;
101
 
    void drawFocusRect(QPainter *p, const QStyleOptionViewItem& option, bool isSelected) const;
102
 
    void drawMouseOverRect(QPainter *p, const QStyleOptionViewItem& option) const;
103
 
    void drawDelegates(QPainter *p, const QStyleOptionViewItem& option, const QModelIndex& index) const;
 
92
    QRect drawThumbnail(QPainter* p, const QRect& thumbRect, const QPixmap& background, const QPixmap& thumbnail) const;
 
93
    void drawRating(QPainter* p, const QModelIndex& index, const QRect& ratingRect, int rating, bool isSelected) const;
 
94
    void drawName(QPainter* p,const QRect& nameRect, const QString& name) const;
 
95
    void drawComments(QPainter* p, const QRect& commentsRect, const QString& comments) const;
 
96
    void drawCreationDate(QPainter* p, const QRect& dateRect, const QDateTime& date) const;
 
97
    void drawModificationDate(QPainter* p, const QRect& dateRect, const QDateTime& date) const;
 
98
    void drawImageSize(QPainter* p, const QRect& dimsRect, const QSize& dims) const;
 
99
    void drawFileSize(QPainter* p, const QRect& r, int bytes) const;
 
100
    void drawTags(QPainter* p, const QRect& r, const QString& tagsString, bool isSelected) const;
 
101
    void drawFocusRect(QPainter* p, const QStyleOptionViewItem& option, bool isSelected) const;
 
102
    void drawMouseOverRect(QPainter* p, const QStyleOptionViewItem& option) const;
 
103
    void drawDelegates(QPainter* p, const QStyleOptionViewItem& option, const QModelIndex& index) const;
104
104
    void prepareFonts();
105
105
    void prepareMetrics(int maxWidth);
106
106
    void prepareBackground();
113
113
    /// Returns the relevant pixmap from the cached rating pixmaps
114
114
    QPixmap ratingPixmap(int rating, bool selected) const;
115
115
 
116
 
    ItemViewImageDelegatePrivate *const d_ptr;
117
 
    ItemViewImageDelegate(ItemViewImageDelegatePrivate &dd, DCategorizedView *parent);
118
 
    
 
116
    ItemViewImageDelegatePrivate* const d_ptr;
 
117
    ItemViewImageDelegate(ItemViewImageDelegatePrivate& dd, DCategorizedView* parent);
 
118
 
119
119
private:
120
120
 
121
121
    Q_DECLARE_PRIVATE(ItemViewImageDelegate)