digiKam
importui.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 : 2004-09-16
7  * Description : Camera interface
8  *
9  * Copyright (C) 2004-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  * Copyright (C) 2006-2011 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
12  * Copyright (C) 2012 by Islam Wazery <wazery at ubuntu dot com>
13  *
14  * This program is free software; you can redistribute it
15  * and/or modify it under the terms of the GNU General
16  * Public License as published by the Free Software Foundation;
17  * either version 2, or (at your option)
18  * any later version.
19  *
20  * This program is distributed in the hope that it will be useful,
21  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23  * GNU General Public License for more details.
24  *
25  * ============================================================ */
26 
27 #ifndef DIGIKAM_IMPORTUI_H
28 #define DIGIKAM_IMPORTUI_H
29 
30 // Qt includes
31 
32 #include <QDateTime>
33 #include <QString>
34 #include <QImage>
35 #include <QKeyEvent>
36 #include <QCloseEvent>
37 #include <QMultiMap>
38 #include <QUrl>
39 
40 // Local includes
41 
42 #include "camiteminfo.h"
43 #include "dhistoryview.h"
44 #include "dmetadata.h"
45 //#include "camerahistoryupdater.h"
46 #include "downloadsettings.h"
47 #include "importiconview.h"
48 #include "dxmlguiwindow.h"
49 #include "digikam_export.h"
50 
51 namespace Digikam
52 {
53 
54 class Album;
55 class PAlbum;
56 class CollectionLocation;
57 class CameraHistoryUpdater;
58 class ImportIconView;
59 class CameraThumbsCtrl;
60 
61 class DIGIKAM_GUI_EXPORT ImportUI : public DXmlGuiWindow
62 {
63  Q_OBJECT
64 
65 public:
66 
67  explicit ImportUI(const QString& cameraTitle,
68  const QString& model,
69  const QString& port,
70  const QString& path,
71  int startIndex);
72  ~ImportUI() override;
73 
74  static ImportUI* instance();
75 
76  bool isBusy() const;
77  bool isClosed() const;
78 
79  bool cameraDeleteSupport() const;
80  bool cameraUploadSupport() const;
81  bool cameraMkDirSupport() const;
82  bool cameraDelDirSupport() const;
83  bool cameraUseUMSDriver() const;
84  bool cameraUseGPhotoDriver() const;
85  QString cameraTitle() const;
86 
87  void enableZoomPlusAction(bool val);
88  void enableZoomMinusAction(bool val);
89 
90  DownloadSettings downloadSettings() const;
91 
92  CameraThumbsCtrl* getCameraThumbsCtrl() const;
93 
94 public:
95 
97  {
98  return nullptr;
99  };
100 
101 Q_SIGNALS:
102 
103  void signalLastDestination(const QUrl&);
107  void signalNewSelection(bool);
108 
109 public Q_SLOTS:
110 
111  void slotDownload(bool onlySelected, bool deleteAfter, Album* pAlbum = nullptr);
112  void slotUploadItems(const QList<QUrl>&); // public to be used in drag'n'drop
113 
114 protected:
115 
116  void closeEvent(QCloseEvent* e) override;
117  void moveEvent(QMoveEvent* e) override;
118 
119 private:
120 
121  void setupActions();
122  void updateActions();
123  void setupConnections();
124  void setupUserArea();
125  void setupStatusBar();
126  void setupAccelerators();
127  void setupCameraController(const QString& model, const QString& port, const QString& path);
128 
129  void readSettings();
130  void saveSettings();
131  bool createAutoAlbum(const QUrl& parentURL, const QString& sub,
132  const QDate& date, QString& errMsg) const;
133 
134  bool dialogClosed();
135  void finishDialog();
136  void refreshFreeSpace();
137  void refreshCollectionFreeSpace();
138  void deleteItems(bool onlySelected, bool onlyDownloaded);
139  void toggleLock(CamItemInfo& info);
140  void setDownloaded(CamItemInfo& itemInfo, int status);
141  void itemsSelectionSizeInfo(unsigned long& fSizeKB, unsigned long& dSizeKB);
142  QMap<QString, int> countItemsByFolders() const;
143  void checkItem4Deletion(const CamItemInfo& info, QStringList& folders, QStringList& files,
144  CamItemInfoList& deleteList, CamItemInfoList& lockedList);
145 
146  QString identifyCategoryforMime(const QString& mime);
147  void autoRotateItems();
148 
149  bool checkDiskSpace(PAlbum* pAlbum);
150  bool downloadCameraItems(PAlbum* pAlbum, bool onlySelected, bool deleteAfter);
151  bool createSubAlbums(QUrl& downloadUrl, const CamItemInfo& info);
152  bool createSubAlbum(QUrl& downloadUrl, const QString& subalbum, const QDate& date);
153  bool createDateBasedSubAlbum(QUrl& downloadUrl, const CamItemInfo& info);
154  bool createExtBasedSubAlbum(QUrl& downloadUrl, const CamItemInfo& info);
155 
156  void showThumbBar(bool visible) override;
157  void showSideBars(bool visible) override;
158  bool thumbbarVisibility() const override;
159  void customizedFullScreenMode(bool set) override;
160  void toogleShowBar();
161  void setInitialSorting();
162  void sidebarTabTitleStyleChanged();
163  void updateRightSideBar(const CamItemInfo& info);
164 
165 private Q_SLOTS:
166 
167  void slotClose();
168  void slotCancelButton();
169 
170  void slotShowLog();
171  void slotConnected(bool val);
172  void slotBusy(bool val);
173  void slotLogMsg(const QString& msg, DHistoryView::EntryType type, const QString& folder, const QString& file);
174  void slotInformation();
175  void slotCapture();
176  void slotCameraInformation(const QString&, const QString&, const QString&);
177  void slotCameraFreeSpaceInfo(unsigned long kBSize, unsigned long kBAvail);
178  void slotCollectionLocationStatusChanged(const CollectionLocation& location, int oldStatus);
179  void slotHistoryEntryClicked(const QVariant&);
180 
181  void slotFolderList(const QStringList& folderList);
182 
183  void slotZoomSliderChanged(int size);
184  void slotZoomChanged(double zoom);
185  void slotThumbSizeChanged(int size);
186 
187  void slotUpload();
188 
189  void slotDownloadNew();
190  void slotDownloadSelected();
191  void slotDownloadAll();
192 
193  void slotDownloadAndDeleteNew();
194  void slotDownloadAndDeleteSelected();
195  void slotDownloadAndDeleteAll();
196 
197  void slotDeleteAfterDownload();
198  void slotDeleteSelected();
199  void slotDeleteNew();
200  void slotDeleteAll();
201 
202  void slotToggleLock();
203  void slotMarkAsDownloaded();
204 
205  void slotUploaded(const CamItemInfo&);
206  void slotDownloaded(const QString&, const QString&, int);
207  void slotDownloadComplete(const QString& sourceFolder, const QString& sourceFile,
208  const QString& destFolder, const QString& destFile);
209  void slotSkipped(const QString&, const QString&);
210  void slotDeleted(const QString&, const QString&, bool);
211  void slotLocked(const QString&, const QString&, bool);
212 
213  void slotUpdateDownloadName();
214  void slotSelectNew();
215  void slotSelectLocked();
216  void slotProgressTimerDone();
217 
218  void slotNewSelection(bool);
219  void slotImageSelected(const CamItemInfoList& selection, const CamItemInfoList& listAll);
220 
221  void slotSwitchedToPreview();
222  void slotSwitchedToIconView();
223  void slotSwitchedToMapView();
224 
225  void slotMetadata(const QString& folder, const QString& file, const MetaEngineData& meta);
226 
227  void setFilter(Filter*);
228 
229  void slotToggleShowBar();
230  void slotColorManagementOptionsChanged();
231  void slotToggleColorManagedView();
232  void slotSetup() override;
233  void slotComponentsInfo() override;
234  void slotDBStat() override;
235  void slotOnlineVersionCheck() override;
236  void slotToggleRightSideBar() override;
237  void slotPreviousRightSideBarTab() override;
238  void slotNextRightSideBarTab() override;
239 
240  void slotSetupChanged();
241 
242 private:
243 
244  // Disable
245  ImportUI(QWidget*) = delete;
246 
247 private:
248 
249  class Private;
250  Private* const d;
251 
252  static ImportUI* m_instance;
253 };
254 
255 } // namespace Digikam
256 
257 #endif // DIGIKAM_IMPORTUI_H
Abstract base class for all album types.
Definition: album.h:67
Definition: camiteminfo.h:48
Definition: camerathumbsctrl.h:48
Definition: collectionlocation.h:41
EntryType
Definition: dhistoryview.h:48
Definition: dinfointerface.h:56
Definition: dpluginaction.h:40
Definition: dxmlguiwindow.h:98
Definition: downloadsettings.h:41
Definition: filter.h:44
Definition: importui_p.h:155
Definition: importui.h:62
DInfoInterface * infoIface(DPluginAction *const) override
Definition: importui.h:96
void signalWindowHasMoved()
void signalNewSelection(bool)
void signalEscapePressed()
void signalPreviewRequested(const CamItemInfo &, bool)
void signalLastDestination(const QUrl &)
Definition: metaengine_data.h:41
Definition: album.h:357
@ Album
Definition: coredbfields.h:58
std::vector< T > location(const std::vector< T > &shape, unsigned long idx)
Definition: shapepredictor.h:109
Definition: datefolderview.cpp:43