1 
2 /*
3  * Osmo - a handy personal organizer
4  *
5  * Copyright (C) 2007 Tomasz Maka <pasp@users.sourceforge.net>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20  */
21 
22 #ifndef _OPTIONS_PREFS_H
23 #define _OPTIONS_PREFS_H
24 
25 #include "gui.h"
26 
27 #define CONFIG_SUBDIR       "osmo"
28 #define CONFIG_FILENAME     "config.xml"
29 #define CONFIG_NAME         "osmo_config"
30 
31 #define MAXNAME             1024
32 #define MAXFONTNAME         512
33 #define MAXCOLORNAME        128
34 #define MAXHELPERCMD        1024
35 #define MAXCONTACTFIELDS    512
36 #define MAXADDRESS          64
37 
38 #define DEFAULT_DATE_HEADER_FORMAT  "%e %B %Y"      /* example: 1 January 2008 */
39 
40 #define DEFAULT_PANED_SPLIT_POSITION    275
41 
42 struct osmo_prefs
43 {
44     /* OSMO */
45     gint        window_x;
46     gint        window_y;
47     gint        window_size_x;
48     gint        window_size_y;
49     gint        fullscreen;
50     gint        enable_tooltips;
51     gint        latest_tab;
52     gint        tabs_position;
53     gint        remember_latest_tab;
54     gint        save_data_after_modification;
55     gint        disable_underline_links;
56     gint        toolbar_exit_button;
57     gint        date_format;
58     gint        time_format;
59     gint        enable_systray;
60     gint        start_minimised_in_systray;
61     gint        ignore_day_note_events;
62     gint        run_counter;
63     gint        lastrun_date;
64     gint        lastrun_time;
65     gint        hide_calendar;
66     gint        hide_tasks;
67     gint        hide_contacts;
68     gint        hide_notes;
69 	gint        override_locale_settings;
70 	gint        gui_layout;
71 	gint        sound_alarm_repeat;
72     gchar       link_color[MAXCOLORNAME];
73     gchar       spell_lang[MAXNAME];
74     gchar       web_browser[MAXHELPERCMD];
75     gchar       email_client[MAXHELPERCMD];
76     gchar       sound_player[MAXHELPERCMD];
77 
78     /* CALENDAR */
79     gint        fy_window_size_x;
80     gint        fy_window_size_y;
81     gint        fy_simple_view;
82     gint        fy_alternative_view;
83     gint        cb_window_size_x;
84     gint        cb_window_size_y;
85     gint        ib_window_size_x;
86     gint        ib_window_size_y;
87     gint        display_options;
88     gint        day_notes_visible;
89     gint        timeline_start;
90     gint        timeline_end;
91     gint        timeline_step;
92     gint        di_show_current_time;
93     gint        di_show_current_time_seconds;
94     gint        di_show_day_number;
95     gint        di_show_current_day_distance;
96     gint        di_show_marked_days;
97     gint        di_show_week_number;
98     gint        di_show_weekend_days;
99     gint        di_show_day_category;
100     gint        di_show_moon_phase;
101     gint        di_show_notes;
102     gint        di_show_zodiac_sign;
103     gint        cursor_type;
104     gint        frame_cursor_thickness;
105     gint        enable_auxilary_calendars;
106     gint        enable_day_mark;
107     gint        strikethrough_past_notes;
108     gint        ascending_sorting_in_day_notes_browser;
109     gint        auxilary_calendars_state;
110     gint        day_note_spell_checker;
111     gchar       day_note_marker[MAXNAME];
112     gchar       date_header_format[MAXNAME];
113     gint        event_marker_type;
114     gint        today_marker_type;
115     gint        day_notes_browser_filter;
116     gint        ical_export_pane_pos;
117     gchar       background_color[MAXCOLORNAME];
118     gchar       header_bg_color[MAXCOLORNAME];
119     gchar       header_fg_color[MAXCOLORNAME];
120     gchar       day_color[MAXCOLORNAME];
121     gchar       pf_day_color[MAXCOLORNAME];
122     gchar       weekend_color[MAXCOLORNAME];
123     gchar       selection_color[MAXCOLORNAME];
124     gint        selector_alpha;
125     gchar       mark_color[MAXCOLORNAME];
126     gchar       mark_current_day_color[MAXCOLORNAME];
127     gint        mark_current_day_alpha;
128     gchar       birthday_mark_color[MAXCOLORNAME];
129     gchar       day_name_font[MAXFONTNAME];
130     gchar       calendar_font[MAXFONTNAME];
131     gchar       notes_font[MAXFONTNAME];
132 	gchar       cal_print_month_name_font[MAXFONTNAME];
133 	gchar       cal_print_day_name_font[MAXFONTNAME];
134 	gchar       cal_print_day_num_font[MAXFONTNAME];
135 	gchar       cal_print_event_font[MAXFONTNAME];
136 	gint        cal_print_event_length;
137 	gint        cal_print_padding;
138 	gint        cal_print_page_orientation;
139 	gint        cal_print_tasks;
140 	gint        cal_print_birthdays;
141 	gint        cal_print_namedays;
142 	gint        cal_print_day_notes;
143 	gint        cal_print_ical;
144 	gint        cal_print_disable_background;
145 
146     /* TASKS */
147     gint        tasks_high_in_bold;
148     gint        hide_completed;
149     gint        delete_completed;
150     gint        add_edit;
151     gint        remember_category_in_tasks;
152     gint        current_category_in_tasks;
153     gint        tasks_pane_pos;
154     gint        tasks_sorting_order;
155     gint        tasks_sorting_column;
156     gint        tsk_visible_due_date_column;
157     gint        tsk_visible_type_column;
158     gint        tsk_visible_priority_column;
159     gint        tsk_visible_category_column;
160     gint        tasks_addedit_win_x;
161     gint        tasks_addedit_win_y;
162     gint        tasks_addedit_win_w;
163     gint        tasks_addedit_win_h;
164     gint        postpone_time;
165 	gint        tasks_column_idx_0;
166 	gint        tasks_column_idx_0_width;
167 	gint        tasks_column_idx_1;
168 	gint        tasks_column_idx_1_width;
169 	gint        tasks_column_idx_2;
170 	gint        tasks_column_idx_2_width;
171 	gint        tasks_column_idx_3;
172 	gint        tasks_column_idx_3_width;
173 	gint        tasks_column_idx_4;
174 	gint        tasks_column_idx_4_width;
175 	gint        tasks_column_idx_5;
176 	gint        tasks_column_idx_5_width;
177     gchar       due_today_color[MAXCOLORNAME];
178     gchar       due_7days_color[MAXCOLORNAME];
179     gchar       past_due_color[MAXCOLORNAME];
180     gchar       task_info_font[MAXFONTNAME];
181     gchar       global_notification_command[MAXHELPERCMD];
182 
183     /* CONTACTS */
184     gint        find_mode;
185     gint        hide_group_column;
186     gint        maps_provider;
187     gint        contacts_pane_pos;
188     gint        photo_width;
189     gint        cnt_visible_age_column;
190     gint        cnt_visible_birthday_date_column;
191     gint        cnt_visible_zodiac_sign_column;
192     gint        contacts_sorting_order;
193     gint        contacts_sorting_column;
194     gint        contacts_addedit_win_x;
195     gint        contacts_addedit_win_y;
196     gint        contacts_addedit_win_w;
197     gint        contacts_addedit_win_h;
198     gint        contacts_export_win_x;
199     gint        contacts_export_win_y;
200     gint        contacts_export_win_w;
201     gint        contacts_export_win_h;
202     gint        contacts_import_sel_win_x;
203     gint        contacts_import_sel_win_y;
204     gint        contacts_import_win_x;
205     gint        contacts_import_win_y;
206     gint        contacts_import_win_w;
207     gint        contacts_import_win_h;
208     gint        contacts_birthdays_win_w;
209     gint        contacts_birthdays_win_h;
210 	gint        contacts_column_idx_0;
211 	gint        contacts_column_idx_0_width;
212 	gint        contacts_column_idx_1;
213 	gint        contacts_column_idx_1_width;
214 	gint        contacts_column_idx_2;
215 	gint        contacts_column_idx_2_width;
216     gchar       contact_tag_color[MAXCOLORNAME];
217     gchar       contact_link_color[MAXCOLORNAME];
218     gint        contact_name_font_size;
219     gint        contact_item_font_size;
220     gint        import_type;
221     gint        import_interface_type;
222     gint        import_bluetooth_channel;
223     gint        import_usb_interface;
224     gint        import_binary_xml;
225     gchar       import_bluetooth_address[MAXADDRESS];
226     gint        export_format;
227     gchar       export_fields[MAXCONTACTFIELDS];
228 
229     /* NOTES */
230     gint        notes_enc_algorithm;
231     gint        notes_enc_hashing;
232     gint        notes_comp_algorithm;
233     gint        notes_comp_ratio;
234     gint        notes_sorting_order;
235     gint        notes_sorting_column;
236     gint        nte_visible_type_column;
237     gint        nte_visible_category_column;
238     gint        nte_visible_last_changes_column;
239     gint        nte_visible_created_column;
240 	gint        notes_column_idx_0;
241 	gint        notes_column_idx_0_width;
242 	gint        notes_column_idx_1;
243 	gint        notes_column_idx_1_width;
244 	gint        notes_column_idx_2;
245 	gint        notes_column_idx_2_width;
246 	gint        notes_column_idx_3;
247 	gint        notes_column_idx_3_width;
248 	gint        notes_column_idx_4;
249 	gint        notes_column_idx_4_width;
250     gint        remember_category_in_notes;
251     gint        current_category_in_notes;
252     gint        use_system_date_in_notes;
253     gchar       text_separator;
254     gchar       notes_editor_font[MAXFONTNAME];
255 };
256 
257 extern  struct osmo_prefs     config;
258 
259 gchar*  prefs_get_config_dir        (GUI *appGUI);
260 gchar*  prefs_get_data_dir          (GUI *appGUI);
261 gchar*  prefs_get_config_filename   (gchar *filename, GUI *appGUI);
262 gchar*  prefs_get_data_filename     (gchar *filename, GUI *appGUI);
263 gchar*  prefs_get_cache_filename    (gchar *filename);
264 gchar*  prefs_get_runtime_filename  (gchar *filename, GUI *appGUI);
265 void    prefs_read_config           (GUI *appGUI);
266 void    prefs_write_config          (GUI *appGUI);
267 gboolean prefs_restore              (gchar *source_dir, GUI *appGUI);
268 
269 #endif /* _OPTIONS_PREFS_H */
270 
271