digiKam
digikamapp_p.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 : 2007-31-01
7  * Description : main digiKam interface implementation
8  *
9  * Copyright (C) 2007-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2014 by Mohamed_Anwer <m_dot_anwer at gmx 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_APP_PRIVATE_H
26 #define DIGIKAM_APP_PRIVATE_H
27 
28 #include "digikamapp.h"
29 
30 // Qt includes
31 
32 #include <QEventLoop>
33 #include <QMap>
34 #include <QPointer>
35 #include <QScopedPointer>
36 #include <QString>
37 #include <QAction>
38 #include <QActionGroup>
39 #include <QMenu>
40 #include <QApplication>
41 #include <QStringList>
42 #include <QDomDocument>
43 #include <QStandardPaths>
44 #include <QKeySequence>
45 #include <QMenuBar>
46 #include <QTimer>
47 #include <QIcon>
48 #include <QMessageBox>
49 #include <QStatusBar>
50 #include <QDir>
51 #include <QMetaType>
52 
53 // KDE includes
54 
55 #if !defined(Q_OS_DARWIN) && defined(Q_CC_GNU)
56 # pragma GCC diagnostic push
57 # pragma GCC diagnostic ignored "-Wdeprecated-declarations"
58 #endif
59 
60 #if defined(Q_CC_CLANG)
61 # pragma clang diagnostic push
62 # pragma clang diagnostic ignored "-Wdeprecated-declarations"
63 #endif
64 
65 #include <kconfiggroup.h>
66 #include <klocalizedstring.h>
67 #include <kactioncollection.h>
68 #include <ktoolbar.h>
69 #include <ktoolbarpopupaction.h>
70 #include <kwindowsystem.h>
71 #include <kselectaction.h>
72 #include <ksharedconfig.h>
73 
74 // Restore warnings
75 #if !defined(Q_OS_DARWIN) && defined(Q_CC_GNU)
76 # pragma GCC diagnostic pop
77 #endif
78 
79 #if defined(Q_CC_CLANG)
80 # pragma clang diagnostic pop
81 #endif
82 
83 // Local includes
84 
85 #include "digikam_config.h"
86 #include "digikam_debug.h"
87 #include "albummanager.h"
88 #include "applicationsettings.h"
89 #include "cameralist.h"
90 #include "cameratype.h"
91 #include "cameranamehelper.h"
92 #include "dsplashscreen.h"
93 #include "dzoombar.h"
94 #include "itemiconview.h"
95 #include "metadatastatusbar.h"
96 #include "itempropertiestab.h"
97 #include "importui.h"
98 #include "setup.h"
99 #include "actioncategorizedview.h"
100 #include "drawdecoder.h"
101 #include "dlayoutbox.h"
102 #include "album.h"
103 #include "coredb.h"
104 #include "albummodel.h"
105 #include "albumselectdialog.h"
106 #include "albumthumbnailloader.h"
107 #include "dbinfoiface.h"
108 #include "categorizeditemmodel.h"
109 #include "collectionscanner.h"
110 #include "collectionmanager.h"
111 #include "componentsinfodlg.h"
112 #include "coredbthumbinfoprovider.h"
113 #include "dio.h"
114 #include "dlogoaction.h"
115 #include "fileactionmngr.h"
116 #include "filterstatusbar.h"
117 #include "iccsettings.h"
118 #include "itemattributeswatch.h"
119 #include "iteminfo.h"
120 #include "imagewindow.h"
121 #include "lighttablewindow.h"
122 #include "queuemgrwindow.h"
123 #include "loadingcache.h"
124 #include "loadingcacheinterface.h"
125 #include "loadsavethread.h"
126 #include "metaengine_rotation.h"
127 #include "scancontroller.h"
128 #include "setupeditor.h"
129 #include "setupicc.h"
130 #include "thememanager.h"
131 #include "thumbnailloadthread.h"
132 #include "thumbnailsize.h"
133 #include "dmetadata.h"
134 #include "tagscache.h"
135 #include "tagsactionmngr.h"
136 #include "databaseserverstarter.h"
137 #include "metaenginesettings.h"
138 #include "statusbarprogresswidget.h"
139 #include "dbmigrationdlg.h"
140 #include "progressmanager.h"
141 #include "progressview.h"
142 #include "maintenancedlg.h"
143 #include "maintenancemngr.h"
144 #include "newitemsfinder.h"
145 #include "dbcleaner.h"
146 #include "tagsmanager.h"
147 #include "itemsortsettings.h"
148 #include "metadatahubmngr.h"
149 #include "metadataedit.h"
150 #include "dfiledialog.h"
151 #include "dpluginloader.h"
152 #include "exiftoolparser.h"
153 #include "facesdetector.h"
154 
155 #ifdef HAVE_MARBLE
156 # include "geolocationedit.h"
157 #endif
158 
159 #ifdef HAVE_DBUS
160 # include "digikamadaptor.h"
161 #endif
162 
163 #ifdef HAVE_KFILEMETADATA
164 # include "baloowrap.h"
165 #endif
166 
167 class KToolBarPopupAction;
168 
169 namespace Digikam
170 {
171 
172 class SearchTextBar;
173 class FilterStatusBar;
174 class TagsActionMngr;
175 class DAdjustableLabel;
176 
177 class Q_DECL_HIDDEN ProgressEntry
178 {
179 public:
180 
181  explicit ProgressEntry()
182  : progress (0),
183  canCancel(false)
184  {
185  }
186 
187  QString message;
188  float progress;
189  bool canCancel;
190 };
191 
192 // ------------------------------------------------------------------------------
193 
194 class Q_DECL_HIDDEN DigikamApp::Private
195 {
196 public:
197 
198  explicit Private()
199  : autoShowZoomToolTip (false),
200  validIccPath (true),
201  cameraMenu (nullptr),
202  usbMediaMenu (nullptr),
203  cardReaderMenu (nullptr),
204  quickImportMenu (nullptr),
205  config (nullptr),
206  newAction (nullptr),
207  moveSelectionToAlbumAction (nullptr),
208  copySelectionToAction (nullptr),
209  deleteAction (nullptr),
210  renameAction (nullptr),
211  imageDeletePermanentlyAction (nullptr),
212  imageDeletePermanentlyDirectlyAction(nullptr),
213  imageTrashDirectlyAction (nullptr),
214  backwardActionMenu (nullptr),
215  forwardActionMenu (nullptr),
216  addImagesAction (nullptr),
217  propsEditAction (nullptr),
218  addFoldersAction (nullptr),
219  openInFileManagerAction (nullptr),
220  refreshAction (nullptr),
221  writeAlbumMetadataAction (nullptr),
222  readAlbumMetadataAction (nullptr),
223  browseTagsAction (nullptr),
224  openTagMngrAction (nullptr),
225  newTagAction (nullptr),
226  deleteTagAction (nullptr),
227  editTagAction (nullptr),
228  assignTagAction (nullptr),
229  imageViewSelectionAction (nullptr),
230  imagePreviewAction (nullptr),
231 
232 #ifdef HAVE_MARBLE
233 
234  imageMapViewAction (nullptr),
235 
236 #endif // HAVE_MARBLE
237 
238  imageTableViewAction (nullptr),
239  imageIconViewAction (nullptr),
240  imageLightTableAction (nullptr),
241  imageAddLightTableAction (nullptr),
242  imageAddCurrentQueueAction (nullptr),
243  imageAddNewQueueAction (nullptr),
244  imageViewAction (nullptr),
245  imageWriteMetadataAction (nullptr),
246  imageReadMetadataAction (nullptr),
247  imageScanForFacesAction (nullptr),
248  imageFindSimilarAction (nullptr),
249  imageSetExifOrientation1Action (nullptr),
250  imageSetExifOrientation2Action (nullptr),
251  imageSetExifOrientation3Action (nullptr),
252  imageSetExifOrientation4Action (nullptr),
253  imageSetExifOrientation5Action (nullptr),
254  imageSetExifOrientation6Action (nullptr),
255  imageSetExifOrientation7Action (nullptr),
256  imageSetExifOrientation8Action (nullptr),
257  imageRenameAction (nullptr),
258  imageRotateActionMenu (nullptr),
259  imageFlipActionMenu (nullptr),
260  imageAutoExifActionMenu (nullptr),
261  imageDeleteAction (nullptr),
262  imageExifOrientationActionMenu (nullptr),
263  openWithAction (nullptr),
264  ieAction (nullptr),
265  ltAction (nullptr),
266  cutItemsAction (nullptr),
267  copyItemsAction (nullptr),
268  pasteItemsAction (nullptr),
269  selectAllAction (nullptr),
270  selectNoneAction (nullptr),
271  selectInvertAction (nullptr),
272  zoomPlusAction (nullptr),
273  zoomMinusAction (nullptr),
274  zoomFitToWindowAction (nullptr),
275  zoomTo100percents (nullptr),
276  imageSortAction (nullptr),
277  imageSortOrderAction (nullptr),
278  imageSeparationAction (nullptr),
279  imageSeparationSortOrderAction (nullptr),
280  albumSortAction (nullptr),
281  allGroupsOpenAction (nullptr),
282  recurseAlbumsAction (nullptr),
283  recurseTagsAction (nullptr),
284  showBarAction (nullptr),
285  viewCMViewAction (nullptr),
286  bqmAction (nullptr),
287  maintenanceAction (nullptr),
288  scanNewItemsAction (nullptr),
289  qualityAction (nullptr),
290  advSearchAction (nullptr),
291  addCameraSeparatorAction (nullptr),
292  quitAction (nullptr),
293  tipAction (nullptr),
294  manualCameraActionGroup (nullptr),
295  solidCameraActionGroup (nullptr),
296  solidUsmActionGroup (nullptr),
297  exifOrientationActionGroup (nullptr),
298  eventLoop (nullptr),
299  metadataStatusBar (nullptr),
300  filterStatusBar (nullptr),
301  splashScreen (nullptr),
302  view (nullptr),
303  cameraList (nullptr),
304  tagsActionManager (nullptr),
305  zoomBar (nullptr),
306  statusLabel (nullptr),
307  modelCollection (nullptr)
308  {
309  }
310 
313 
314  QMenu* cameraMenu;
315  QMenu* usbMediaMenu;
318  QHash<QString, QDateTime> cameraAppearanceTimes;
319 
320  KSharedConfig::Ptr config;
321 
323  QAction* newAction;
326  QAction* deleteAction;
327  QAction* renameAction;
331  KToolBarPopupAction* backwardActionMenu;
332  KToolBarPopupAction* forwardActionMenu;
333 
334  QAction* addImagesAction;
335  QAction* propsEditAction;
338  QAction* refreshAction;
341 
345  QAction* newTagAction;
346  QAction* deleteTagAction;
347  QAction* editTagAction;
348  QAction* assignTagAction;
349 
351  KSelectAction* imageViewSelectionAction;
353 
354 #ifdef HAVE_MARBLE
355 
356  QAction* imageMapViewAction;
357 
358 #endif // HAVE_MARBLE
359 
366  QAction* imageViewAction;
385  QAction* openWithAction;
386  QAction* ieAction;
387  QAction* ltAction;
388 
390  QAction* cutItemsAction;
391  QAction* copyItemsAction;
393  QAction* selectAllAction;
396 
398  QAction* zoomPlusAction;
399  QAction* zoomMinusAction;
402  KSelectAction* imageSortAction;
403  KSelectAction* imageSortOrderAction;
404  KSelectAction* imageSeparationAction;
406  KSelectAction* albumSortAction;
410  QAction* showBarAction;
412 
414  QAction* bqmAction;
417  QAction* qualityAction;
418  QAction* advSearchAction;
419 
422  QAction* quitAction;
423  QAction* tipAction;
424 
425  QActionGroup* manualCameraActionGroup;
426  QActionGroup* solidCameraActionGroup;
427  QActionGroup* solidUsmActionGroup;
429 
430  QMap<QString, QPointer<ImportUI> > cameraUIMap;
431 
432  QEventLoop* eventLoop;
434 
443 
445 };
446 
447 } // namespace Digikam
448 
449 #endif // DIGIKAM_APP_PRIVATE_H
Definition: cameralist.h:47
Definition: dexpanderbox.h:66
Definition: dmodelfactory.h:49
Definition: dsplashscreen.h:41
Definition: dzoombar.h:42
Definition: digikamapp_p.h:195
QAction * cutItemsAction
Edit Actions.
Definition: digikamapp_p.h:390
QAction * openInFileManagerAction
Definition: digikamapp_p.h:337
QAction * moveSelectionToAlbumAction
Definition: digikamapp_p.h:324
QAction * recurseTagsAction
Definition: digikamapp_p.h:409
QMenu * usbMediaMenu
Definition: digikamapp_p.h:315
QAction * imageSetExifOrientation7Action
Definition: digikamapp_p.h:377
QMenu * imageRotateActionMenu
Definition: digikamapp_p.h:380
QAction * editTagAction
Definition: digikamapp_p.h:347
QAction * imageSetExifOrientation8Action
Definition: digikamapp_p.h:378
QAction * imageRenameAction
Definition: digikamapp_p.h:379
QAction * imageSetExifOrientation1Action
Definition: digikamapp_p.h:371
KSelectAction * imageSortOrderAction
Definition: digikamapp_p.h:403
QAction * imageScanForFacesAction
Definition: digikamapp_p.h:369
CameraList * cameraList
Definition: digikamapp_p.h:439
QAction * imageAddNewQueueAction
Definition: digikamapp_p.h:365
QAction * imageDeletePermanentlyDirectlyAction
Definition: digikamapp_p.h:329
QAction * maintenanceAction
Definition: digikamapp_p.h:415
QAction * imageAddLightTableAction
Definition: digikamapp_p.h:363
QAction * imagePreviewAction
Definition: digikamapp_p.h:352
QAction * imageSetExifOrientation6Action
Definition: digikamapp_p.h:376
QAction * readAlbumMetadataAction
Definition: digikamapp_p.h:340
QAction * zoomFitToWindowAction
Definition: digikamapp_p.h:400
QAction * newAction
Album Actions.
Definition: digikamapp_p.h:323
QAction * imageDeletePermanentlyAction
Definition: digikamapp_p.h:328
MetadataStatusBar * metadataStatusBar
Definition: digikamapp_p.h:435
QAction * refreshAction
Definition: digikamapp_p.h:338
QAction * imageWriteMetadataAction
Definition: digikamapp_p.h:367
QAction * deleteAction
Definition: digikamapp_p.h:326
QAction * quitAction
Definition: digikamapp_p.h:422
QAction * selectAllAction
Definition: digikamapp_p.h:393
QAction * copyItemsAction
Definition: digikamapp_p.h:391
QMap< QString, QPointer< ImportUI > > cameraUIMap
Definition: digikamapp_p.h:430
bool validIccPath
Definition: digikamapp_p.h:312
QAction * imageTrashDirectlyAction
Definition: digikamapp_p.h:330
KSelectAction * imageSeparationAction
Definition: digikamapp_p.h:404
QAction * pasteItemsAction
Definition: digikamapp_p.h:392
QAction * addImagesAction
Definition: digikamapp_p.h:334
QAction * openWithAction
Definition: digikamapp_p.h:385
QMenu * imageExifOrientationActionMenu
Definition: digikamapp_p.h:384
QAction * addFoldersAction
Definition: digikamapp_p.h:336
QMenu * quickImportMenu
Definition: digikamapp_p.h:317
QActionGroup * exifOrientationActionGroup
Definition: digikamapp_p.h:428
QAction * browseTagsAction
Tag Actions.
Definition: digikamapp_p.h:343
ItemIconView * view
Definition: digikamapp_p.h:438
QAction * ieAction
Definition: digikamapp_p.h:386
DZoomBar * zoomBar
Definition: digikamapp_p.h:441
QAction * imageIconViewAction
Definition: digikamapp_p.h:361
QAction * imageSetExifOrientation2Action
Definition: digikamapp_p.h:372
KToolBarPopupAction * backwardActionMenu
Definition: digikamapp_p.h:331
KSelectAction * imageSortAction
Definition: digikamapp_p.h:402
QAction * renameAction
Definition: digikamapp_p.h:327
QAction * imageTableViewAction
Definition: digikamapp_p.h:360
QAction * scanNewItemsAction
Definition: digikamapp_p.h:416
QAction * recurseAlbumsAction
Definition: digikamapp_p.h:408
DModelFactory * modelCollection
Definition: digikamapp_p.h:444
KSelectAction * albumSortAction
Definition: digikamapp_p.h:406
QAction * bqmAction
Tools Actions.
Definition: digikamapp_p.h:414
QString solidErrorMessage
Definition: digikamapp_p.h:433
QAction * advSearchAction
Definition: digikamapp_p.h:418
QAction * newTagAction
Definition: digikamapp_p.h:345
QAction * copySelectionToAction
Definition: digikamapp_p.h:325
QAction * writeAlbumMetadataAction
Definition: digikamapp_p.h:339
QAction * imageSetExifOrientation3Action
Definition: digikamapp_p.h:373
Private()
Definition: digikamapp_p.h:198
QAction * deleteTagAction
Definition: digikamapp_p.h:346
QAction * zoomMinusAction
Definition: digikamapp_p.h:399
QAction * assignTagAction
Definition: digikamapp_p.h:348
KSharedConfig::Ptr config
Definition: digikamapp_p.h:320
QAction * openTagMngrAction
Definition: digikamapp_p.h:344
QAction * zoomTo100percents
Definition: digikamapp_p.h:401
QActionGroup * manualCameraActionGroup
Definition: digikamapp_p.h:425
QAction * imageDeleteAction
Definition: digikamapp_p.h:383
QAction * imageSetExifOrientation4Action
Definition: digikamapp_p.h:374
QMenu * cameraMenu
Definition: digikamapp_p.h:314
QAction * imageFindSimilarAction
Definition: digikamapp_p.h:370
QAction * addCameraSeparatorAction
Application Actions.
Definition: digikamapp_p.h:421
QAction * imageAutoExifActionMenu
Definition: digikamapp_p.h:382
QAction * ltAction
Definition: digikamapp_p.h:387
TagsActionMngr * tagsActionManager
Definition: digikamapp_p.h:440
KToolBarPopupAction * forwardActionMenu
Definition: digikamapp_p.h:332
QEventLoop * eventLoop
Definition: digikamapp_p.h:432
QAction * zoomPlusAction
View Actions.
Definition: digikamapp_p.h:398
QAction * qualityAction
Definition: digikamapp_p.h:417
KSelectAction * imageViewSelectionAction
Image Actions.
Definition: digikamapp_p.h:351
DSplashScreen * splashScreen
Definition: digikamapp_p.h:437
QAction * imageLightTableAction
Definition: digikamapp_p.h:362
QAction * viewCMViewAction
Definition: digikamapp_p.h:411
QAction * selectNoneAction
Definition: digikamapp_p.h:394
QActionGroup * solidUsmActionGroup
Definition: digikamapp_p.h:427
QAction * imageViewAction
Definition: digikamapp_p.h:366
QAction * tipAction
Definition: digikamapp_p.h:423
QAction * imageReadMetadataAction
Definition: digikamapp_p.h:368
FilterStatusBar * filterStatusBar
Definition: digikamapp_p.h:436
QAction * allGroupsOpenAction
Definition: digikamapp_p.h:407
QAction * selectInvertAction
Definition: digikamapp_p.h:395
QAction * propsEditAction
Definition: digikamapp_p.h:335
bool autoShowZoomToolTip
Definition: digikamapp_p.h:311
QHash< QString, QDateTime > cameraAppearanceTimes
Definition: digikamapp_p.h:318
QMenu * imageFlipActionMenu
Definition: digikamapp_p.h:381
DAdjustableLabel * statusLabel
Definition: digikamapp_p.h:442
QAction * imageAddCurrentQueueAction
Definition: digikamapp_p.h:364
KSelectAction * imageSeparationSortOrderAction
Definition: digikamapp_p.h:405
QAction * imageSetExifOrientation5Action
Definition: digikamapp_p.h:375
QAction * showBarAction
Definition: digikamapp_p.h:410
QMenu * cardReaderMenu
Definition: digikamapp_p.h:316
QActionGroup * solidCameraActionGroup
Definition: digikamapp_p.h:426
Definition: digikamapp.h:56
Definition: filterstatusbar.h:39
Definition: itemiconview.h:60
Definition: metadatastatusbar.h:39
Definition: digikamapp_p.h:178
QString message
Definition: digikamapp_p.h:187
ProgressEntry()
Definition: digikamapp_p.h:181
bool canCancel
Definition: digikamapp_p.h:189
float progress
Definition: digikamapp_p.h:188
Definition: searchtextbar.h:65
Definition: tagsactionmngr.h:41
Definition: datefolderview.cpp:43