1 /* ============================================================
2  *
3  * This file is a part of digiKam project
4  * https://www.digikam.org
5  *
6  * Date        : 2013-12-20
7  * Description : Settings for Showfoto
8  *
9  * Copyright (C) 2013-2014 by Mohamed_Anwer <m_dot_anwer at gmx dot com>
10  * Copyright (C) 2013-2021 by Gilles Caulier <caulier dot gilles at gmail 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 SHOW_FOTO_SETTINGS_H
26 #define SHOW_FOTO_SETTINGS_H
27 
28 // Qt includes
29 
30 #include <QObject>
31 #include <QFont>
32 #include <QString>
33 
34 namespace ShowFoto
35 {
36 
37 class ShowfotoSettings : public QObject
38 {
39     Q_OBJECT
40 
41 public:
42 
43     static ShowfotoSettings* instance();
44 
45     void readSettings();
46     void syncConfig();
47 
48     // -- Misc. Settings ---------------------------------------
49 
50     QString getLastOpenedDir() const;
51     void setLastOpenedDir(const QString& dir);
52 
53     bool getDeleteItem2Trash() const;
54     void setDeleteItem2Trash(bool D2t);
55 
56     QString getCurrentTheme() const;
57     void setCurrentTheme(const QString& theme);
58 
59     int getRightSideBarStyle() const;
60     void setRightSideBarStyle(int style);
61 
62     int getUpdateType() const;
63     void setUpdateType(int type);
64 
65     bool getUpdateWithDebug() const;
66     void setUpdateWithDebug(bool dbg);
67 
68     QString getApplicationStyle() const;
69     void setApplicationStyle(const QString& style);
70 
71     QString getIconTheme() const;
72     void setIconTheme(const QString& theme);
73 
74     void setApplicationFont(const QFont& fnt);
75     QFont getApplicationFont() const;
76 
77     bool getShowFormatOverThumbnail() const;
78     void setShowFormatOverThumbnail(bool show);
79 
80     bool getShowCoordinates() const;
81     void setShowCoordinates(bool show);
82 
83     bool getShowSplash() const;
84     void setShowSplash(bool show);
85 
86     bool getNativeFileDialog() const;
87     void setNativeFileDialog(bool item);
88 
89     bool getItemCenter() const;
90     void setItemCenter(bool item);
91 
92     int  getSortRole() const;
93     void setSortRole(int order);
94 
95     bool getReverseSort() const;
96     void setReverseSort(bool reverse);
97 
98     // -- ToolTip Settings --------------------------------------
99 
100     bool getShowToolTip() const;
101     void setShowToolTip(bool show);
102 
103     bool getShowFileName() const;
104     void setShowFileName(bool show);
105 
106     bool getShowFileDate() const;
107     void setShowFileDate(bool show);
108 
109     bool getShowFileSize() const;
110     void setShowFileSize(bool show);
111 
112     bool getShowFileType() const;
113     void setShowFileType(bool show);
114 
115     bool getShowFileDim() const;
116     void setShowFileDim(bool show);
117 
118     bool getShowPhotoMake() const;
119     void setShowPhotoMake(bool show);
120 
121     bool getShowPhotoLens() const;
122     void setShowPhotoLens(bool show);
123 
124     bool getShowPhotoFocal() const;
125     void setShowPhotoFocal(bool show);
126 
127     bool getShowPhotoExpo() const;
128     void setShowPhotoExpo(bool show);
129 
130     bool getShowPhotoFlash() const;
131     void setShowPhotoFlash(bool show);
132 
133     bool getShowPhotoWB() const;
134     void setShowPhotoWB(bool show);
135 
136     bool getShowPhotoDate() const;
137     void setShowPhotoDate(bool show);
138 
139     bool getShowPhotoMode() const;
140     void setShowPhotoMode(bool show);
141 
142     QFont getToolTipFont() const;
143     void setToolTipFont(const QFont& font);
144 
145 private:
146 
147     // Disable
148     ShowfotoSettings();
149     explicit ShowfotoSettings(QObject*) = delete;
150     ~ShowfotoSettings() override;
151 
152 private:
153 
154     void init();
155 
156 private:
157 
158     class Private;
159     Private* const d;
160 
161     friend class ShowfotoSettingsCreator;
162 };
163 
164 } // namespace Showfoto
165 
166 #endif // SHOW_FOTO_SETTINGS_H
167