digiKam
itemthumbnaildelegate.h
Go to the documentation of this file.
1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date : 2009-02-06
7  * Description : thumbnail bar for items - the delegate
8  *
9  * Copyright (C) 2010-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
10  * Copyright (C) 2010-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
11  *
12  * This program is free software; you can redistribute it
13  * and/or modify it under the terms of the GNU General
14  * Public License as published by the Free Software Foundation;
15  * either version 2, or (at your option)
16  * any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * ============================================================ */
24 
25 #ifndef DIGIKAM_ITEM_THUMBNAIL_DELEGATE_H
26 #define DIGIKAM_ITEM_THUMBNAIL_DELEGATE_H
27 
28 // Qt includes
29 
30 #include <QListView>
31 
32 // Local includes
33 
34 #include "itemdelegate.h"
35 
36 namespace Digikam
37 {
38 
39 class ItemCategoryDrawer;
40 class ItemThumbnailDelegatePrivate;
41 
43 {
44  Q_OBJECT
45 
46 public:
47 
48  explicit ItemThumbnailDelegate(ItemCategorizedView* const parent);
49  ~ItemThumbnailDelegate() override;
50 
51  void setFlow(QListView::Flow flow);
52 
56  int maximumSize() const;
57  int minimumSize() const;
58 
59  void setDefaultViewOptions(const QStyleOptionViewItem& option) override;
60  bool acceptsActivation(const QPoint& pos,
61  const QRect& visualRect,
62  const QModelIndex& index,
63  QRect* activationRect) const override;
64 
65 protected:
66 
67  void updateContentWidth() override;
68  void updateRects() override;
69 
70 private:
71 
72  Q_DECLARE_PRIVATE(ItemThumbnailDelegate)
73 };
74 
75 } // namespace Digikam
76 
77 #endif // DIGIKAM_ITEM_THUMBNAIL_DELEGATE_H
Definition: itemcategorizedview.h:49
Definition: itemdelegate.h:44
Definition: itemthumbnaildelegate.h:43
void updateContentWidth() override
Definition: itemthumbnaildelegate.cpp:98
int minimumSize() const
Definition: itemthumbnaildelegate.cpp:83
int maximumSize() const
Definition: itemthumbnaildelegate.cpp:76
void updateRects() override
Definition: itemthumbnaildelegate.cpp:117
ItemThumbnailDelegate(ItemCategorizedView *const parent)
Definition: itemthumbnaildelegate.cpp:49
~ItemThumbnailDelegate() override
Definition: itemthumbnaildelegate.cpp:56
bool acceptsActivation(const QPoint &pos, const QRect &visualRect, const QModelIndex &index, QRect *activationRect) const override
Definition: itemthumbnaildelegate.cpp:90
void setFlow(QListView::Flow flow)
Definition: itemthumbnaildelegate.cpp:60
void setDefaultViewOptions(const QStyleOptionViewItem &option) override
Definition: itemthumbnaildelegate.cpp:66
Definition: datefolderview.cpp:43