digiKam
cameramessagebox.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 : 2012-01-04
7  * Description : a message box to manage camera items
8  *
9  * Copyright (C) 2012-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * 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_CAMERA_MESSAGE_BOX_H
25 #define DIGIKAM_CAMERA_MESSAGE_BOX_H
26 
27 // Qt includes
28 
29 #include <QWidget>
30 #include <QTreeWidget>
31 
32 // Local includes
33 
34 #include "camerathumbsctrl.h"
35 #include "digikam_export.h"
36 
37 class QDialog;
38 class QDialogButtonBox;
39 
40 namespace Digikam
41 {
42 
43 class DIGIKAM_GUI_EXPORT CameraItem : public QTreeWidgetItem
44 {
45 
46 public:
47 
48  CameraItem(QTreeWidget* const parent, const CamItemInfo& info);
49  ~CameraItem() override;
50 
51  bool hasValidThumbnail() const;
52  CamItemInfo info() const;
53 
54  void setThumb(const QPixmap& pix, bool hasThumb = true);
55 
56 private:
57 
58  class Private;
59  Private* const d;
60 
61 private:
62 
63  Q_DISABLE_COPY(CameraItem)
64 };
65 
66 // -----------------------------------------------------------
67 
68 class DIGIKAM_GUI_EXPORT CameraItemList : public QTreeWidget
69 {
70  Q_OBJECT
71 
72 public:
73 
74  explicit CameraItemList(QWidget* const parent = nullptr);
75  ~CameraItemList() override;
76 
77  void setThumbCtrl(CameraThumbsCtrl* const ctrl);
78  void setItems(const CamItemInfoList& items);
79 
80 private:
81 
82  void drawRow(QPainter* p,
83  const QStyleOptionViewItem& opt,
84  const QModelIndex& index) const override;
85 
86 private Q_SLOTS:
87 
88  void slotThumbnailLoaded(const CamItemInfo&);
89 
90 private:
91 
92  class Private;
93  Private* const d;
94 };
95 
96 // -----------------------------------------------------------
97 
98 class DIGIKAM_GUI_EXPORT CameraMessageBox
99 {
100 
101 public:
102 
106  static void informationList(CameraThumbsCtrl* const ctrl,
107  QWidget* const parent,
108  const QString& caption,
109  const QString& text,
110  const CamItemInfoList& items,
111  const QString& dontShowAgainName = QString());
112 
117  static int warningContinueCancelList(CameraThumbsCtrl* const ctrl,
118  QWidget* const parent,
119  const QString& caption,
120  const QString& text,
121  const CamItemInfoList& items,
122  const QString& dontAskAgainName = QString());
123 };
124 
125 } // namespace Digikam
126 
127 #endif // DIGIKAM_CAMERA_MESSAGE_BOX_H
Definition: camiteminfo.h:48
Definition: cameramessagebox.h:69
Definition: cameramessagebox.h:44
Definition: cameramessagebox.h:99
Definition: camerathumbsctrl.h:48
Definition: datefolderview.cpp:43