digiKam
tableview_column_thumbnail.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 : 2013-02-25
7  * Description : Table view column helpers: Thumbnail column
8  *
9  * Copyright (C) 2017-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2013 by Michael G. Hansen <mike at mghansen dot de>
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) any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_TABLE_VIEW_COLUMN_THUMBNAIL_H
25 #define DIGIKAM_TABLE_VIEW_COLUMN_THUMBNAIL_H
26 
27 // Local includes
28 
30 
31 namespace Digikam
32 {
33 
34 class LoadingDescription;
35 
36 namespace TableViewColumns
37 {
38 
40 {
41  Q_OBJECT
42 
43 private:
44 
45  explicit ColumnThumbnail(TableViewShared* const tableViewShared,
46  const TableViewColumnConfiguration& pConfiguration,
47  QObject* const parent = nullptr);
48  ~ColumnThumbnail() override;
49 
50 public:
51 
52  ColumnFlags getColumnFlags() const override;
53  QString getTitle() const override;
54  QVariant data(TableViewModel::Item* const item, const int role) const override;
55  bool paint(QPainter* const painter, const QStyleOptionViewItem& option, TableViewModel::Item* const item) const override;
56  QSize sizeHint(const QStyleOptionViewItem& option, TableViewModel::Item* const item) const override;
57  void updateThumbnailSize() override;
58 
59  static bool CreateFromConfiguration(TableViewShared* const tableViewShared,
60  const TableViewColumnConfiguration& pConfiguration,
61  TableViewColumn** const pNewColumn,
62  QObject* const parent = nullptr);
63 
65 
66 private Q_SLOTS:
67 
68  void slotThumbnailLoaded(const LoadingDescription& loadingDescription, const QPixmap& thumb);
69 
70 private:
71 
72  int m_thumbnailSize;
73 };
74 
75 } // namespace TableViewColumns
76 
77 } // namespace Digikam
78 
79 #endif // DIGIKAM_TABLE_VIEW_COLUMN_THUMBNAIL_H
Definition: loadingdescription.h:45
Definition: tableview_columnfactory.h:50
Definition: tableview_columnfactory.h:81
Definition: tableview_columnfactory.h:196
Definition: tableview_column_thumbnail.h:40
QString getTitle() const override
Definition: tableview_column_thumbnail.cpp:94
QVariant data(TableViewModel::Item *const item, const int role) const override
Definition: tableview_column_thumbnail.cpp:99
static bool CreateFromConfiguration(TableViewShared *const tableViewShared, const TableViewColumnConfiguration &pConfiguration, TableViewColumn **const pNewColumn, QObject *const parent=nullptr)
Definition: tableview_column_thumbnail.cpp:69
static TableViewColumnDescription getDescription()
Definition: tableview_column_thumbnail.cpp:84
ColumnFlags getColumnFlags() const override
Definition: tableview_column_thumbnail.cpp:89
void updateThumbnailSize() override
Definition: tableview_column_thumbnail.cpp:213
bool paint(QPainter *const painter, const QStyleOptionViewItem &option, TableViewModel::Item *const item) const override
Definition: tableview_column_thumbnail.cpp:109
QSize sizeHint(const QStyleOptionViewItem &option, TableViewModel::Item *const item) const override
Definition: tableview_column_thumbnail.cpp:180
Definition: tableview_model.h:71
Definition: tableview_shared.h:44
Definition: datefolderview.cpp:43