digiKam
camerafolderview.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 : 2003-01-23
7  * Description : A widget to display a list of camera folders.
8  *
9  * Copyright (C) 2003-2005 by Renchi Raju <renchi dot raju at gmail dot com>
10  * Copyright (C) 2006-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_CAMERA_FOLDER_VIEW_H
26 #define DIGIKAM_CAMERA_FOLDER_VIEW_H
27 
28 // Qt includes
29 
30 #include <QString>
31 #include <QPixmap>
32 #include <QTreeWidget>
33 #include <QIcon>
34 
35 namespace Digikam
36 {
37 
38 class CameraFolderItem;
39 
40 class CameraFolderView : public QTreeWidget
41 {
42  Q_OBJECT
43 
44 public:
45 
46  explicit CameraFolderView(QWidget* const parent);
47  ~CameraFolderView() override;
48 
49  void addVirtualFolder(const QString& name, const QIcon &icon = QIcon::fromTheme(QLatin1String("camera-photo")));
50  void addRootFolder(const QString& folder, int nbItems = -1, const QIcon& icon = QIcon::fromTheme(QLatin1String("folder")));
51 
52  CameraFolderItem* addFolder(const QString& folder, const QString& subFolder, int nbItems,
53  const QIcon& icon = QIcon::fromTheme(QLatin1String("folder")));
54 
55  CameraFolderItem* findFolder(const QString& folderPath);
56 
59 
60  virtual void clear();
61 
62 Q_SIGNALS:
63 
65  void signalCleared();
66 
67 private Q_SLOTS:
68 
69  void slotCurrentChanged(QTreeWidgetItem*, int);
70 
71 private:
72 
73  class Private;
74  Private* const d;
75 };
76 
77 } // namespace Digikam
78 
79 #endif // DIGIKAM_CAMERA_FOLDER_VIEW_H
Definition: camerafolderitem.h:39
Definition: camerafolderview.h:41
CameraFolderItem * addFolder(const QString &folder, const QString &subFolder, int nbItems, const QIcon &icon=QIcon::fromTheme(QLatin1String("folder")))
Definition: camerafolderview.cpp:106
CameraFolderItem * findFolder(const QString &folderPath)
Definition: camerafolderview.cpp:147
~CameraFolderView() override
Definition: camerafolderview.cpp:77
void addRootFolder(const QString &folder, int nbItems=-1, const QIcon &icon=QIcon::fromTheme(QLatin1String("folder")))
Definition: camerafolderview.cpp:95
CameraFolderItem * virtualFolder() const
Definition: camerafolderview.cpp:178
CameraFolderView(QWidget *const parent)
Definition: camerafolderview.cpp:56
void addVirtualFolder(const QString &name, const QIcon &icon=QIcon::fromTheme(QLatin1String("camera-photo")))
Definition: camerafolderview.cpp:82
virtual void clear()
Definition: camerafolderview.cpp:188
CameraFolderItem * rootFolder() const
Definition: camerafolderview.cpp:183
void signalFolderChanged(CameraFolderItem *)
Definition: datefolderview.cpp:43