OSDN Git Service

Ver0.21
[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);
42     QColor folderViewBgColor(bool active);
43     QColor folderViewMarkedFgColor(bool active);
44     QColor folderViewMarkedBgColor(bool active);
45     QColor folderViewSystemColor(bool active);
46     QColor folderViewHiddenColor(bool active);
47     QColor folderViewReadOnlyColor(bool active);
48     QColor locationBoxFgColor(bool active);
49     QColor locationBoxBgColor(bool active);
50
51     DECLARE_BOOL(CheckUpdate);
52     DECLARE_BOOL(ConfirmQuit);
53     DECLARE_BOOL(ConfirmCopy);
54     DECLARE_BOOL(AutoCloseCopy);
55     DECLARE_BOOL(ConfirmMove);
56     DECLARE_BOOL(AutoCloseMove);
57     DECLARE_BOOL(ConfirmDelete);
58     DECLARE_BOOL(AutoCloseDelete);
59     DECLARE_BOOL(ConfirmRename);
60     DECLARE_BOOL(AutoCloseRename);
61     DECLARE_BOOL(OpenAfterCreation);
62     DECLARE_BOOL(MoveAfterCreation);
63
64     DECLARE_OBJECT(QString, ArchiverPath);
65     DECLARE_OBJECT(QString, EditorPath);
66     DECLARE_OBJECT(QString, TerminalPath);
67     DECLARE_OBJECT(QString, CopyBehavior);
68     DECLARE_OBJECT(QString, PreferExtensions);
69
70     DECLARE_OBJECT(QColor, FolderViewFgColor);
71     DECLARE_OBJECT(QColor, FolderViewBgColor);
72     DECLARE_OBJECT(QColor, FolderViewMarkedFgColor);
73     DECLARE_OBJECT(QColor, FolderViewMarkedBgColor);
74     DECLARE_OBJECT(QColor, FolderViewSystemColor);
75     DECLARE_OBJECT(QColor, FolderViewHiddenColor);
76     DECLARE_OBJECT(QColor, FolderViewReadOnlyColor);
77     DECLARE_OBJECT(QColor, LocationBoxFgColor);
78     DECLARE_OBJECT(QColor, LocationBoxBgColor);
79     DECLARE_OBJECT(QColor, SearchBoxFgColor);
80     DECLARE_OBJECT(QColor, SearchBoxBgColor);
81     DECLARE_OBJECT(QColor, SearchBoxUnmatchFgColor);
82     DECLARE_OBJECT(QColor, SearchBoxUnmatchBgColor);
83     DECLARE_OBJECT(QColor, TextViewFgColor);
84     DECLARE_OBJECT(QColor, TextViewBgColor);
85     DECLARE_OBJECT(QColor, ImageViewBgColor);
86
87     DECLARE_PRIMITIVE(double, DarkFacotr);
88     DECLARE_PRIMITIVE(double, LineHeight);
89
90     DECLARE_OBJECT(QFont, FolderViewFont);
91     DECLARE_OBJECT(QFont, LocationBoxFont);
92     DECLARE_OBJECT(QFont, SearchBoxFont);
93     DECLARE_OBJECT(QFont, TextViewFont);
94
95
96
97 signals:
98
99 public slots:
100
101 };
102
103 #endif // PREFERENCES_H