OSDN Git Service

Ver0.26
[gefu/Gefu.git] / preferences.h
1 #ifndef PREFERENCES_H
2 #define PREFERENCES_H
3
4 #include <QMainWindow>
5 #include <QSettings>
6 class FolderModel;
7
8 #define DECLARE_BOOL(key)           \
9     bool    is##key() const;        \
10     bool    def##key() const;       \
11     void    set##key(bool value)
12
13 #define DECLARE_OBJECT(Type, key)       \
14     Type    get##key() const;           \
15     Type    def##key() const;           \
16     void    set##key(const Type &value)
17
18 #define DECLARE_PRIMITIVE(Type, key)    \
19     Type    get##key() const;           \
20     Type    def##key() const;           \
21     void    set##key(Type value)
22
23 class Preferences : public QSettings
24 {
25     Q_OBJECT
26 public:
27     explicit Preferences(QObject *parent = 0);
28     Preferences(const QString &path, QObject *parent = 0);
29
30     void    restoreModel(const QString &side, FolderModel *m);
31     void    saveModel(const QString &side, const FolderModel *m);
32
33     void    restoreWindow(QMainWindow *w);
34     void    saveWindow(const QMainWindow *w);
35
36     void    addBookmark(const QString &name, const QString &path);
37     void    clearBookmark();
38     QString getBookmarkEntry(int n) const;
39     QString getBookmarkPath(int n) const;
40
41     QColor folderViewFgColor(bool active) const;
42     QColor folderViewBgColor(bool active) const;
43     QColor folderViewMarkedFgColor(bool active) const;
44     QColor folderViewMarkedBgColor(bool active) const;
45     QColor folderViewSystemColor(bool active) const;
46     QColor folderViewHiddenColor(bool active) const;
47     QColor folderViewReadOnlyColor(bool active) const;
48     QColor locationBoxFgColor(bool active) const;
49     QColor locationBoxBgColor(bool active) const;
50
51     DECLARE_BOOL(Reset);
52     DECLARE_BOOL(CheckUpdate);
53     DECLARE_BOOL(ConfirmQuit);
54     DECLARE_BOOL(ConfirmCopy);
55     DECLARE_BOOL(AutoCloseCopy);
56     DECLARE_BOOL(ConfirmMove);
57     DECLARE_BOOL(AutoCloseMove);
58     DECLARE_BOOL(ConfirmDelete);
59     DECLARE_BOOL(AutoCloseDelete);
60     DECLARE_BOOL(ConfirmRename);
61     DECLARE_BOOL(AutoCloseRename);
62     DECLARE_BOOL(OpenAfterCreation);
63     DECLARE_BOOL(MoveAfterCreation);
64
65     DECLARE_OBJECT(QString, ArchiverPath);
66     DECLARE_OBJECT(QString, EditorPath);
67     DECLARE_OBJECT(QString, TerminalPath);
68     DECLARE_OBJECT(QString, CopyBehavior);
69     DECLARE_OBJECT(QString, PreferExtensions);
70
71     DECLARE_OBJECT(QColor, FolderViewFgColor);
72     DECLARE_OBJECT(QColor, FolderViewBgColor);
73     DECLARE_OBJECT(QColor, FolderViewMarkedFgColor);
74     DECLARE_OBJECT(QColor, FolderViewMarkedBgColor);
75     DECLARE_OBJECT(QColor, FolderViewSystemColor);
76     DECLARE_OBJECT(QColor, FolderViewHiddenColor);
77     DECLARE_OBJECT(QColor, FolderViewReadOnlyColor);
78     DECLARE_OBJECT(QColor, LocationBoxFgColor);
79     DECLARE_OBJECT(QColor, LocationBoxBgColor);
80     DECLARE_OBJECT(QColor, SearchBoxFgColor);
81     DECLARE_OBJECT(QColor, SearchBoxBgColor);
82     DECLARE_OBJECT(QColor, SearchBoxUnmatchFgColor);
83     DECLARE_OBJECT(QColor, SearchBoxUnmatchBgColor);
84     DECLARE_OBJECT(QColor, TextViewFgColor);
85     DECLARE_OBJECT(QColor, TextViewCtrlColor);
86     DECLARE_OBJECT(QColor, TextViewBgColor);
87     DECLARE_OBJECT(QColor, HexViewFgColor);
88     DECLARE_OBJECT(QColor, HexViewBgColor);
89     DECLARE_OBJECT(QColor, ImageViewBgColor);
90
91     DECLARE_PRIMITIVE(double, DarkFacotr);
92     DECLARE_PRIMITIVE(double, LineHeight);
93     DECLARE_PRIMITIVE(double, TextViewLineHeight);
94
95     DECLARE_OBJECT(QFont, FolderViewFont);
96     DECLARE_OBJECT(QFont, LocationBoxFont);
97     DECLARE_OBJECT(QFont, SearchBoxFont);
98     DECLARE_OBJECT(QFont, TextViewFont);
99     DECLARE_OBJECT(QFont, HexViewFont);
100
101 signals:
102
103 public slots:
104
105 };
106
107 #endif // PREFERENCES_H