digiKam
showfoto.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-11-22
7  * Description : stand alone digiKam image editor GUI
8  *
9  * Copyright (C) 2004-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  * Copyright (C) 2006-2012 by Marcel Wiesweg <marcel dot wiesweg at gmx dot de>
11  * Copyright (C) 2009-2011 by Andi Clemens <andi dot clemens at gmail dot com>
12  * Copyright (C) 2004-2005 by Renchi Raju <renchi dot raju at gmail dot com>
13  * Copyright (C) 2005-2006 by Tom Albers <tomalbers at kde dot nl>
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 SHOW_FOTO_H
29 #define SHOW_FOTO_H
30 
31 // Qt includes
32 
33 #include <QUrl>
34 
35 // Local includes
36 
37 #include "editorwindow.h"
38 #include "showfotoiteminfo.h"
39 
40 namespace ShowFoto
41 {
42 
44 {
45  Q_OBJECT
46 
47 public:
48 
49  explicit Showfoto(const QList<QUrl>& urlList, QWidget* const parent = nullptr);
50  ~Showfoto() override;
51 
52 public:
53 
54  DInfoInterface* infoIface(DPluginAction* const ac) override;
55 
56  virtual void show();
57 
58 private:
59 
60  bool queryClose() override;
61 
62  Digikam::ThumbBarDock* thumbBar() const override;
63  Digikam::Sidebar* rightSideBar() const override;
64 
65 private Q_SLOTS:
66 
67  void slotForward() override;
68  void slotBackward() override;
69  void slotLast() override;
70  void slotFirst() override;
71  void slotShowfotoItemInfoActivated(const ShowfotoItemInfo& info);
72  void slotClearThumbBar();
73  void slotRemoveItemInfos(const QList<ShowfotoItemInfo>& infos);
74 
75  void slotChanged() override;
76  void slotUpdateItemInfo() override;
77 
78  void slotOnlineVersionCheck() override;
79 
80 Q_SIGNALS:
81 
83 
84 // -- Internal IO file methods implemented in showfoto_iofiles.cpp ----------------------------------------
85 
86 private:
87 
88  bool save() override;
89  bool saveAs() override;
90  void moveFile() override;
91  void finishSaving(bool success) override;
92  QUrl saveDestinationUrl() override;
93  bool saveNewVersion() override;
94  bool saveCurrentVersion() override;
95  bool saveNewVersionAs() override;
96  bool saveNewVersionInFormat(const QString&) override;
97 
98  void saveIsComplete() override;
99  void saveAsIsComplete() override;
100  void saveVersionIsComplete() override;
101 
102 private Q_SLOTS:
103 
104  void slotRemoveImageFromAlbum(const QUrl& url);
105  void slotDeleteCurrentItem() override;
106 
107  void slotPrepareToLoad() override;
108  void slotLoadingStarted(const QString& filename) override;
109  void slotLoadingFinished(const QString& filename,
110  bool success) override;
111  void slotSavingStarted(const QString& filename) override;
112 
113  void slotRevert() override;
114 
115 Q_SIGNALS:
116 
117  void signalLoadCurrentItem(const QList<QUrl>& urlList);
118 
119 // -- Internal open file methods implemented in showfoto_open.cpp ----------------------------------------
120 
121 private:
122 
123  void openFolder(const QUrl& url);
124  void openUrls(const QList<QUrl>& urls);
125 
126 private Q_SLOTS:
127 
128  void slotFileWithDefaultApplication() override;
129  void slotOpenWith(QAction* action = nullptr) override;
130  void slotOpenFile();
131  void slotOpenFolder();
132  void slotOpenFolderFromPath(const QString& path);
133  void slotOpenUrl(const ShowfotoItemInfo& info);
134  void slotAddedDropedItems(QDropEvent*) override;
135  void slotDroppedUrls(const QList<QUrl>& droppedUrls, bool dropped, const QUrl& current);
136  void slotOpenFilesfromPath(const QStringList& files, const QString& current);
137  void slotAppendFilesfromPath(const QStringList& files, const QString& current);
138 
139 Q_SIGNALS:
140 
141  void signalOpenFolder(const QUrl&);
142  void signalOpenFile(const QList<QUrl>& urls);
143 
144 // -- Internal setup methods implemented in showfoto_config.cpp ----------------------------------------
145 
146 public Q_SLOTS:
147 
148  void slotSetup() override;
149  void slotSetupICC() override;
150 
151 private Q_SLOTS:
152 
153  void slotThemeChanged();
154 
155 private:
156 
157  bool setup(bool iccSetupPage = false);
158  void applySettings();
159 
163  void applySortSettings();
164 
165  void readSettings() override;
166  void saveSettings() override;
167 
168 private Q_SLOTS:
169 
170  void slotSetupMetadataFilters(int);
171  void slotSetupExifTool();
172 
173 // -- Internal setup methods implemented in showfoto_setup.cpp ----------------------------------------
174 
175 private:
176 
177  void setupActions() override;
178  void setupConnections() override;
179  void setupUserArea() override;
180 
181  void toggleActions(bool val) override;
182  void toggleNavigation(int index);
183  void addServicesMenu() override;
184 
185 private Q_SLOTS:
186 
187  void slotContextMenu() override;
188 
189 // -- Import tools methods implemented in showfoto_import.cpp -------------------------------------
190 
191 private Q_SLOTS:
192 
193  void slotImportedImagefromScanner(const QUrl& url);
194 
195 // -- Internal private container --------------------------------------------------------------------
196 
197 private:
198 
199  class Private;
200  Private* const d;
201 };
202 
203 } // namespace ShowFoto
204 
205 #endif // SHOW_FOTO_H
Definition: dinfointerface.h:56
Definition: dpluginaction.h:40
Definition: editorwindow.h:78
Definition: sidebar.h:333
Definition: thumbbardock.h:84
Definition: showfotoiteminfo.h:48
Definition: showfoto_p.h:116
Definition: showfoto.h:44
void signalOpenFolder(const QUrl &)
void signalInfoList(const ShowfotoItemInfoList &)
void slotSetup() override
Definition: showfoto_config.cpp:29
virtual void show()
Definition: showfoto.cpp:182
void signalOpenFile(const QList< QUrl > &urls)
~Showfoto() override
Definition: showfoto.cpp:146
DInfoInterface * infoIface(DPluginAction *const ac) override
Definition: showfoto.cpp:278
void signalLoadCurrentItem(const QList< QUrl > &urlList)
void slotSetupICC() override
Definition: showfoto_config.cpp:34
Showfoto(const QList< QUrl > &urlList, QWidget *const parent=nullptr)
Definition: showfoto.cpp:35
Definition: showfotofolderviewbar.cpp:52