digiKam
thememanager.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-08-02
7  * Description : colors theme manager
8  *
9  * Copyright (C) 2006-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_THEME_MANAGER_H
25 #define DIGIKAM_THEME_MANAGER_H
26 
27 // Qt includes
28 
29 #include <QObject>
30 #include <QPixmap>
31 #include <QString>
32 
33 // Local includes
34 
35 #include "digikam_export.h"
36 
37 class QMenu;
38 
39 namespace Digikam
40 {
41 
42 class DXmlGuiWindow;
43 class Theme;
44 
45 class DIGIKAM_EXPORT ThemeManager : public QObject
46 {
47  Q_OBJECT
48 
49 public:
50 
51  ~ThemeManager() override;
52  static ThemeManager* instance();
53 
54  QString currentThemeName() const;
55  void setCurrentTheme(const QString& name);
56 
57  QString defaultThemeName() const;
58 
59  void setThemeMenuAction(QMenu* const action);
60  void registerThemeActions(DXmlGuiWindow* const win);
61 
62  void updateThemeMenu();
63 
64 Q_SIGNALS:
65 
67 
68 private Q_SLOTS:
69 
70  void slotChangePalette();
71 
72 private:
73 
74  // Disable
75  ThemeManager();
76  explicit ThemeManager(QObject*);
77 
78  void populateThemeMenu();
79  QString currentDesktopdefaultTheme() const;
80  void updateCurrentDesktopDefaultThemePreview();
81 
82 private:
83 
84  friend class ThemeManagerCreator;
85 
86  class Private;
87  Private* const d;
88 };
89 
90 } // namespace Digikam
91 
92 #endif // DIGIKAM_THEME_MANAGER_H
Definition: dxmlguiwindow.h:98
Definition: thememanager_p.h:518
Definition: thememanager.h:46
Definition: datefolderview.cpp:43