OSDN Git Service

fe384c78e6215007d48d8350d0e9c4ff73a22c6c
[tpi/lychee.git] / src / lychee / cls_config.h
1 /*******************************************************************************\r
2   TPI - flexible but useless plug-in framework.\r
3   Copyright (C) 2002-2009 Silky\r
4 \r
5   This library is free software; you can redistribute it and/or modify it under\r
6   the terms of the GNU Lesser General Public License as published by the Free\r
7   Software Foundation; either version 2.1 of the License, or (at your option)\r
8   any later version.\r
9 \r
10   This library is distributed in the hope that it will be useful, but WITHOUT\r
11   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or \r
12   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License\r
13   for more details.\r
14 \r
15   You should have received a copy of the GNU Lesser General Public License along\r
16   with this library; if not, write to the Free Software Foundation, Inc.,\r
17   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA\r
18 \r
19   $Id$\r
20 *******************************************************************************/\r
21 \r
22 #include <wx/fileconf.h>\r
23 \r
24 #ifndef H_LOADED_CLS_CONF\r
25 #define H_LOADED_CLS_CONF\r
26 \r
27 // Config ID.\r
28 enum myConfigId\r
29 {\r
30         CONF_WINDOW_HEIGHT,\r
31         CONF_WINDOW_WIDTH,\r
32         CONF_WINDOW_X,\r
33         CONF_WINDOW_Y,\r
34         CONF_WINDOW_SPLITTER_POS,\r
35         CONF_WINDOW_STATUSBAR,\r
36         CONF_WINDOW_TOOLBAR,\r
37         CONF_LISTVIEW_SHOWMODE,\r
38         CONF_LISTVIEW_C_FILENAME,\r
39         CONF_LISTVIEW_C_UNPACKED,\r
40         CONF_LISTVIEW_C_PACKED,\r
41         CONF_LISTVIEW_C_RATIO,\r
42         CONF_LISTVIEW_C_METHOD,\r
43         CONF_LISTVIEW_C_ATTR,\r
44         CONF_LISTVIEW_C_LASTMOD,\r
45         CONF_LISTVIEW_C_PATH,\r
46         CONF_LISTVIEW_C_TYPE,\r
47         CONF_LISTVIEW_C_NO,\r
48         CONF_LISTVIEW_C_COMMENT,\r
49         CONF_LISTVIEW_S_COLUMN,\r
50         CONF_LISTVIEW_S_ASCEND,\r
51 \r
52         CONF_DEFAULT_EXT,\r
53         CONF_DEFAULT_PATH,\r
54 \r
55         CONF_HISTORY_PATH,\r
56         CONF_HISTORY_NAME,\r
57         CONF_HISTORY_FULL,\r
58         CONF_HISTORY_COUNT,\r
59 \r
60         CONF_LAST\r
61 };\r
62 \r
63 class myConfig : public wxFileConfig\r
64 {\r
65 public:\r
66         myConfig();\r
67         ~myConfig();\r
68 \r
69         // General\r
70         wxString ReadId(myConfigId confId, const wxString & defaultVal);\r
71         long ReadId(myConfigId confId, long defaultVal);\r
72         bool ReadId(myConfigId confId, bool defaultVal);\r
73 \r
74         bool WriteId(myConfigId confId, const wxString & value);\r
75         bool WriteId(myConfigId confId, int value);\r
76         bool WriteId(myConfigId confId, bool value);\r
77 \r
78         // History\r
79         size_t GetHistoryCount(myConfigId confId);\r
80         wxString ReadHistory(myConfigId confId, size_t i);\r
81         void WriteHistory(myConfigId confId, const wxString & sz);\r
82 \r
83 private:\r
84         wxString label[CONF_LAST];\r
85         wxArrayString asHistory[CONF_HISTORY_COUNT - CONF_HISTORY_PATH];\r
86         bool bWriteHistory;\r
87 \r
88         void myReadHistory(myConfigId confId, size_t i);\r
89         void myWriteHistory(myConfigId confId, size_t i);\r
90 };\r
91 \r
92 #endif\r