digiKam
dxmlguiwindow.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 : 2013-04-29
7  * Description : digiKam XML GUI window
8  *
9  * Copyright (C) 2013-2022 by Gilles Caulier <caulier dot gilles at gmail dot com>
10  *
11  * This program is free software; you can redistribute it
12  * and/or modify it under the terms of the GNU General
13  * Public License as published by the Free Software Foundation;
14  * either version 2, or (at your option)
15  * any later version.
16  *
17  * This program is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * ============================================================ */
23 
24 #ifndef DIGIKAM_DXML_GUI_WINDOW_H
25 #define DIGIKAM_DXML_GUI_WINDOW_H
26 
27 // Qt includes
28 
29 #include <QWidget>
30 #include <QObject>
31 #include <QAction>
32 #include <QWindow>
33 
34 // KDE includes
35 
36 #include <kxmlguiwindow.h>
37 
38 // Local includes
39 
40 #include "digikam_export.h"
41 #include "digikam_config.h"
42 #include "dlogoaction.h"
43 #include "dinfointerface.h"
44 #include "dpluginaction.h"
45 #include "dpluginloader.h"
46 
47 class QEvent;
48 
49 class KToolBar;
50 class KConfigGroup;
51 
52 namespace Digikam
53 {
54 
59 {
60  FS_TOOLBARS = 0x00000001,
61  FS_THUMBBAR = 0x00000002,
62  FS_SIDEBARS = 0x00000004,
63  FS_STATUSBAR = 0x00000008,
64  FS_NONE = 0x00000010,
65 
70 };
71 
73 {
87 };
88 
89 static const QString s_configFullScreenHideToolBarsEntry(QLatin1String("FullScreen Hide ToolBars"));
90 static const QString s_configFullScreenHideThumbBarEntry(QLatin1String("FullScreen Hide ThumbBar"));
91 static const QString s_configFullScreenHideSideBarsEntry(QLatin1String("FullScreen Hide SideBars"));
92 static const QString s_configFullScreenHideStatusBarEntry(QLatin1String("FullScreen Hide StatusBar"));
93 
97 class DIGIKAM_EXPORT DXmlGuiWindow : public KXmlGuiWindow
98 {
99  Q_OBJECT
100 
101 public:
102 
103  explicit DXmlGuiWindow(QWidget* const parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
104  ~DXmlGuiWindow() override;
105 
109  void setConfigGroupName(const QString& name);
110  QString configGroupName() const;
111 
115  void createSettingsActions();
116 
120  void createHelpActions(bool coreOptions = true);
121 
125  void cleanupActions();
126 
130  void createSidebarActions();
131 
135  void setFullScreenOptions(int options);
136 
142  void createFullScreenAction(const QString& name);
143 
147  void readFullScreenSettings(const KConfigGroup& group);
148 
152  bool fullScreenIsActive() const;
153 
157  QList<QAction*> allActions() const;
158 
159 public:
160 
165  void registerPluginsActions();
166  virtual void registerExtraPluginsActions(QString& /*dom*/) {};
167 
171  virtual DInfoInterface* infoIface(DPluginAction* const ac) = 0;
172 
173 public:
174 
175  static void openHandbook();
176  static void restoreWindowSize(QWindow* const win, const KConfigGroup& group);
177  static void saveWindowSize(QWindow* const win, KConfigGroup& group);
178 
179  static QAction* buildStdAction(StdActionType type,
180  const QObject* const recvr,
181  const char* const slot,
182  QObject* const parent);
183 
187  static void setupIconTheme();
188 
189 protected:
190 
192 
193 protected:
194 
195  QAction* showMenuBarAction() const;
196  QAction* showStatusBarAction() const;
197 
203  void editKeyboardShortcuts(KActionCollection* const extraac = nullptr, const QString& actitle = QString());
204 
205  void closeEvent(QCloseEvent* e) override;
206  void keyPressEvent(QKeyEvent* e) override;
207  bool eventFilter(QObject* obj, QEvent* ev) override;
208 
213  virtual void showSideBars(bool visible);
214 
219  virtual void showThumbBar(bool visible);
220 
225  virtual void customizedFullScreenMode(bool set);
226 
230  virtual bool thumbbarVisibility() const;
231 
232 protected Q_SLOTS:
233 
234  bool slotClose();
235 
236 private Q_SLOTS:
237 
238  void slotToggleFullScreen(bool);
239  void slotShowMenuBar();
240  void slotShowStatusBar();
241  void slotConfNotifications();
242  void slotConfToolbars();
243  void slotNewToolbarConfig();
244 
245  void slotRawCameraList();
246  void slotSolidHardwareList();
247  void slotDonateMoney();
248  void slotRecipesBook();
249  void slotContribute();
250  void slotHelpContents();
251 
255  virtual void slotOnlineVersionCheck() {};
256  virtual void slotComponentsInfo() {};
257  virtual void slotDBStat() {};
258 
262  virtual void slotToggleLeftSideBar() {};
263  virtual void slotToggleRightSideBar() {};
264  virtual void slotPreviousLeftSideBarTab() {};
265  virtual void slotNextLeftSideBarTab() {};
266  virtual void slotPreviousRightSideBarTab() {};
267  virtual void slotNextRightSideBarTab() {};
268 
272  virtual void slotEditKeys() { editKeyboardShortcuts(); };
273  virtual void slotSetup() = 0;
274 
275 private:
276 
280  void showToolBars(bool visible);
281 
285  KToolBar* mainToolBar() const;
286 
290  void checkFullScreenBeforeClosing();
291 
292 private:
293 
294  class Private;
295  Private* const d;
296 };
297 
298 } // namespace Digikam
299 
300 #endif // DIGIKAM_DXML_GUI_WINDOW_H
Definition: dinfointerface.h:56
Definition: dlogoaction.h:39
Definition: dpluginaction.h:40
Definition: dxmlguiwindow.h:98
virtual void registerExtraPluginsActions(QString &)
Definition: dxmlguiwindow.h:166
virtual DInfoInterface * infoIface(DPluginAction *const ac)=0
DLogoAction * m_animLogo
Definition: dxmlguiwindow.h:191
Definition: datefolderview.cpp:43
FullScreenOptions
Definition: dxmlguiwindow.h:59
@ FS_NONE
No full-screen options.
Definition: dxmlguiwindow.h:64
@ FS_EDITOR
Image Editor Config.
Definition: dxmlguiwindow.h:67
@ FS_THUMBBAR
Manage Thumb bar in full-screen mode.
Definition: dxmlguiwindow.h:61
@ FS_SIDEBARS
Manage Side bars in full-screen mode.
Definition: dxmlguiwindow.h:62
@ FS_IMPORTUI
Import UI Config.
Definition: dxmlguiwindow.h:69
@ FS_ALBUMGUI
Album GUI Config.
Definition: dxmlguiwindow.h:66
@ FS_STATUSBAR
Manage Status bar in full-screen mode.
Definition: dxmlguiwindow.h:63
@ FS_TOOLBARS
Manage Tools bar in full-screen mode.
Definition: dxmlguiwindow.h:60
@ FS_LIGHTTABLE
Light Table Config.
Definition: dxmlguiwindow.h:68
StdActionType
Definition: dxmlguiwindow.h:73
@ StdCloseAction
Definition: dxmlguiwindow.h:78
@ StdQuitAction
Definition: dxmlguiwindow.h:77
@ StdCopyAction
Definition: dxmlguiwindow.h:74
@ StdZoomInAction
Definition: dxmlguiwindow.h:79
@ StdRevertAction
Definition: dxmlguiwindow.h:84
@ StdCutAction
Definition: dxmlguiwindow.h:76
@ StdForwardAction
Definition: dxmlguiwindow.h:86
@ StdSaveAction
Definition: dxmlguiwindow.h:82
@ StdOpenAction
Definition: dxmlguiwindow.h:81
@ StdSaveAsAction
Definition: dxmlguiwindow.h:83
@ StdBackAction
Definition: dxmlguiwindow.h:85
@ StdZoomOutAction
Definition: dxmlguiwindow.h:80
@ StdPasteAction
Definition: dxmlguiwindow.h:75