digiKam
digikamapp.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 : 2002-16-10
7  * Description : main digiKam interface implementation
8  *
9  * Copyright (C) 2002-2005 by Renchi Raju <renchi dot raju at gmail dot com>
10  * Copyright (C) 2006 by Tom Albers <tomalbers at kde dot nl>
11  * Copyright (C) 2002-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
12  * Copyright (C) 2009-2011 by Andi Clemens <andi dot clemens at gmail dot com>
13  * Copyright (C) 2013 by Michael G. Hansen <mike at mghansen dot de>
14  *
15  * This program is free software; you can redistribute it
16  * and/or modify it under the terms of the GNU General
17  * Public License as published by the Free Software Foundation;
18  * either version 2, or (at your option)
19  * any later version.
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24  * GNU General Public License for more details.
25  *
26  * ============================================================ */
27 
28 #ifndef DIGIKAM_APP_H
29 #define DIGIKAM_APP_H
30 
31 // Qt includes
32 
33 #include <QAction>
34 #include <QString>
35 #include <QMenu>
36 
37 // Local includes
38 
39 #include "digikam_config.h"
40 #include "dxmlguiwindow.h"
41 #include "digikam_export.h"
42 #include "facetags.h"
43 
44 namespace Digikam
45 {
46 
47 class Album;
48 class ItemIconView;
49 class FaceScanSettings;
50 class FilterStatusBar;
51 class ItemInfo;
52 class ItemInfoList;
53 class CameraType;
54 
55 class DIGIKAM_GUI_EXPORT DigikamApp : public DXmlGuiWindow
56 {
57  Q_OBJECT
58 
59 public:
60 
61  explicit DigikamApp();
62  ~DigikamApp() override;
63 
64  virtual void show();
65  void restoreSession();
66 
67  void enableZoomPlusAction(bool val);
68  void enableZoomMinusAction(bool val);
69  void enableAlbumBackwardHistory(bool enable);
70  void enableAlbumForwardHistory(bool enable);
71 
72  ItemIconView* view() const;
73 
74  static DigikamApp* instance();
75 
76 public:
77 
78  DInfoInterface* infoIface(DPluginAction* const ac) override;
79 
80 Q_SIGNALS:
81 
90 
92 
93 protected:
94 
95  bool queryClose() override;
96  void moveEvent(QMoveEvent* e) override;
97  void closeEvent(QCloseEvent* e) override;
98 
99 private:
100 
101  void showThumbBar(bool visible) override;
102  void showSideBars(bool visible) override;
103  bool thumbbarVisibility() const override;
104  void customizedFullScreenMode(bool set) override;
105  void customizedTrashView(bool set);
106  void toggleShowBar();
107 
108 private Q_SLOTS:
109 
110  void slotAlbumSelected(Album*);
111  void slotImageSelected(const ItemInfoList&, const ItemInfoList&);
112  void slotTrashSelectionChanged(const QString& text);
113  void slotSelectionChanged(int selectionCount);
114  void slotExit();
115  void slotDBStat() override;
116  void slotComponentsInfo() override;
117  void slotOnlineVersionCheck() override;
118 
119  void slotRecurseAlbums(bool);
120  void slotRecurseTags(bool);
121 
122  void slotAllGroupsOpen(bool);
123 
124  void slotAboutToShowForwardMenu();
125  void slotAboutToShowBackwardMenu();
126 
127  void slotColorManagementOptionsChanged();
128  void slotToggleColorManagedView();
129  void slotSetCheckedExifOrientationAction(const ItemInfo& info);
130  void slotResetExifOrientationActions();
131  void slotTransformAction();
132 
133  void slotToggleLeftSideBar() override;
134  void slotToggleRightSideBar() override;
135  void slotPreviousLeftSideBarTab() override;
136  void slotNextLeftSideBarTab() override;
137  void slotPreviousRightSideBarTab() override;
138  void slotNextRightSideBarTab() override;
139 
140  void slotToggleShowBar();
141 
142  void slotZoomSliderChanged(int);
143  void slotThumbSizeChanged(int);
144  void slotZoomChanged(double);
145 
146  void slotSwitchedToPreview();
147  void slotSwitchedToIconView();
148  void slotSwitchedToMapView();
149  void slotSwitchedToTableView();
150  void slotSwitchedToTrashView();
151 
153 
155 private:
156 
157  void setupView();
158  void setupViewConnections();
159  void setupStatusBar();
160  void setupActions();
161  void setupAccelerators();
162  void setupExifOrientationActions();
163  void setupImageTransformActions();
164  void populateThemes();
165  void preloadWindows();
166  void initGui();
168 
170 
172 private:
173 
174  void setupSelectToolsAction();
175 
176 private Q_SLOTS:
177 
178  void slotMaintenance();
179  void slotScanNewItems();
180  void slotMaintenanceDone();
181  void slotDatabaseMigration();
182  void slotDetectFaces();
184 
186 
188 private:
189 
190  bool setup();
191  bool setupICC();
192 
193 private Q_SLOTS:
194 
195  void slotSetup() override;
196  void slotSetupChanged();
197  void slotEditKeys() override;
198  void slotThemeChanged();
200 
202 // Import tools methods implemented in digikamapp_import.cpp
203 
204 private:
205 
206  void updateQuickImportAction();
207 
208 private Q_SLOTS:
209 
210  void slotImportedImagefromScanner(const QUrl& url);
211  void slotImportAddImages();
212  void slotImportAddFolders();
214 
216 // Camera management methods implemented in digikamapp_camera.cpp
217 
218 public:
219 
220  void autoDetect();
221  void downloadFrom(const QString& cameraGuiPath);
222  void downloadFromUdi(const QString& udi);
223 
224 Q_SIGNALS:
225 
226  void queuedOpenCameraUiFromPath(const QString& path);
227 
228 private:
229 
230  void loadCameras();
231  void updateCameraMenu();
232 
233 private Q_SLOTS:
234 
235  void slotSetupCamera();
236  void slotOpenManualCamera(QAction*);
237  void slotCameraAdded(CameraType*);
238  void slotCameraRemoved(QAction*);
239  void slotCameraAutoDetect();
240  void slotOpenCameraUiFromPath(const QString& path);
241  void downloadImages(const QString& folder);
242  void cameraAutoDetect();
244 
246 // Solid based methods implemented in digikamapp_solid.cpp
247 
248 Q_SIGNALS:
249 
250  void queuedOpenSolidDevice(const QString& udi);
251 
252 private:
253 
254  void fillSolidMenus();
255  void connectToSolidNotifiers();
256  void openSolidCamera(const QString& udi, const QString& label = QString());
257  void openSolidUsmDevice(const QString& udi, const QString& label = QString());
258 
259 private Q_SLOTS:
260 
261  void slotOpenSolidCamera(QAction*);
262  void slotOpenSolidUsmDevice(QAction*);
263  void slotOpenSolidDevice(const QString& udi);
264  void slotSolidDeviceChanged(const QString& udi);
266 
267 private:
268 
269  // Disable
270  DigikamApp(QWidget*) = delete;
271 
272 private:
273 
274  class Private;
275  Private* const d;
276 
277  static DigikamApp* m_instance;
278 };
279 
280 } // namespace Digikam
281 
282 #endif // DIGIKAM_APP_H
Abstract base class for all album types.
Definition: album.h:67
Definition: cameratype.h:41
Definition: dinfointerface.h:56
Definition: dpluginaction.h:40
Definition: dxmlguiwindow.h:98
Definition: digikamapp_p.h:195
Definition: digikamapp.h:56
void queuedOpenSolidDevice(const QString &udi)
void signalCopyAlbumItemsSelection()
void queuedOpenCameraUiFromPath(const QString &path)
void signalCutAlbumItemsSelection()
void signalPasteAlbumItemsSelection()
Definition: itemiconview.h:60
Definition: iteminfolist.h:47
Definition: iteminfo.h:78
@ Album
Definition: coredbfields.h:58
Definition: datefolderview.cpp:43