1 /*
2  */
3 
4 /*
5 
6     Copyright (C) 2014 Ferrero Andrea
7 
8     This program is free software: you can redistribute it and/or modify
9     it under the terms of the GNU General Public License as published by
10     the Free Software Foundation, either version 3 of the License, or
11     (at your option) any later version.
12 
13     This program is distributed in the hope that it will be useful,
14     but WITHOUT ANY WARRANTY; without even the implied warranty of
15     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16     GNU General Public License for more details.
17 
18     You should have received a copy of the GNU General Public License
19     along with this program. If not, see <http://www.gnu.org/licenses/>.
20 
21 
22  */
23 
24 /*
25 
26     These files are distributed with PhotoFlow - http://aferrero2707.github.io/PhotoFlow/
27 
28  */
29 
30 #ifndef PF_OPTIONS_H
31 #define PF_OPTIONS_H
32 
33 #include <string>
34 #include <lcms2.h>
35 #include <glibmm.h>
36 
37 namespace PF
38 {
39 
40 enum display_profile_t
41 {
42   PF_DISPLAY_PROF_sRGB = 0,
43   PF_DISPLAY_PROF_SYSTEM = 1,
44   PF_DISPLAY_PROF_CUSTOM = 2,
45   PF_DISPLAY_PROF_MAX
46 };
47 
48 
49 enum layers_list_placement_t
50 {
51   PF_LAYERS_LIST_PLACEMENT_LEFT = 0,
52   PF_LAYERS_LIST_PLACEMENT_RIGHT = 1
53 };
54 
55 
56   class Options
57   {
58     profile_type_t working_profile_type;
59     TRC_type working_trc_type;
60     Glib::ustring custom_working_profile_name;
61 
62     display_profile_t display_profile_type;
63     Glib::ustring custom_display_profile_name;
64     int display_profile_intent;
65     bool display_profile_bpc;
66 
67     int tile_cache_size;
68 
69     Glib::ustring last_visited_image_folder;
70     Glib::ustring last_visited_preset_folder;
71     Glib::ustring last_visited_icc_folder;
72 
73     bool ui_use_system_theme;
74     bool ui_use_inverted_icons;
75     layers_list_placement_t ui_layers_list_placement;
76     bool ui_floating_tool_dialogs;
77     bool ui_multiple_tool_dialogs;
78 
79     int save_sidecar_files;
80     int use_default_preset;
81 
82     int layerlist_widget_width;
83 
84   public:
85     Options();
86 
87     void set_working_profile_type(int t);
get_working_profile_type()88     profile_type_t get_working_profile_type() { return working_profile_type; }
89     void set_working_trc_type(int t);
get_working_trc_type()90     TRC_type get_working_trc_type() { return working_trc_type; }
set_custom_working_profile_name(std::string n)91     void set_custom_working_profile_name( std::string n )
92     {
93       custom_working_profile_name = n;
94     }
get_custom_working_profile_name()95     std::string get_custom_working_profile_name() { return custom_working_profile_name; }
96 
97 
98     void set_display_profile_type(int t);
get_display_profile_type()99     display_profile_t get_display_profile_type() { return display_profile_type; }
100 
set_custom_display_profile_name(std::string n)101     void set_custom_display_profile_name( std::string n )
102     {
103       custom_display_profile_name = n;
104     }
get_custom_display_profile_name()105     std::string get_custom_display_profile_name() { return custom_display_profile_name; }
106 
set_display_profile_intent(int n)107     void set_display_profile_intent( int n )
108     {
109       display_profile_intent = n;
110     }
get_display_profile_intent()111     int get_display_profile_intent() { return display_profile_intent; }
112 
set_display_profile_bpc(bool n)113     void set_display_profile_bpc( bool n )
114     {
115       display_profile_bpc = n;
116     }
get_display_profile_bpc()117     bool get_display_profile_bpc() { return display_profile_bpc; }
118 
get_tile_cache_size()119     int get_tile_cache_size() { return tile_cache_size; }
set_tile_cache_size(int sz)120     void set_tile_cache_size(int sz){ tile_cache_size = sz; }
121 
122     // last visited folders
set_last_visited_image_folder(std::string f)123     void set_last_visited_image_folder( std::string f ) { last_visited_image_folder = f; }
get_last_visited_image_folder()124     std::string get_last_visited_image_folder() { return last_visited_image_folder; }
set_last_visited_preset_folder(std::string f)125     void set_last_visited_preset_folder( std::string f ) { last_visited_preset_folder = f; }
get_last_visited_preset_folder()126     std::string get_last_visited_preset_folder() { return last_visited_preset_folder; }
set_last_visited_icc_folder(std::string f)127     void set_last_visited_icc_folder( std::string f ) { last_visited_icc_folder = f; }
get_last_visited_icc_folder()128     std::string get_last_visited_icc_folder() { return last_visited_icc_folder; }
129 
set_save_sidecar_files(int val)130     void set_save_sidecar_files(int val) { save_sidecar_files = val; }
get_save_sidecar_files()131     int get_save_sidecar_files() { return save_sidecar_files; }
132 
set_apply_default_preset(int val)133     void set_apply_default_preset(int val) { use_default_preset = val; }
get_apply_default_preset()134     int get_apply_default_preset() { return use_default_preset; }
135 
get_layerlist_widget_width()136     int get_layerlist_widget_width() { return layerlist_widget_width; }
set_layerlist_widget_width(int w)137     void set_layerlist_widget_width(int w) { layerlist_widget_width = w; }
138 
139     // UI options
set_ui_use_system_theme(bool b)140     void set_ui_use_system_theme(bool b) { ui_use_system_theme = b; }
get_ui_use_system_theme()141     bool get_ui_use_system_theme() { return ui_use_system_theme; }
142 
set_ui_use_inverted_icons(bool b)143     void set_ui_use_inverted_icons(bool b) { ui_use_inverted_icons = b; }
get_ui_use_inverted_icons()144     bool get_ui_use_inverted_icons() { return ui_use_inverted_icons; }
145 
set_ui_layers_list_placement(layers_list_placement_t p)146     void set_ui_layers_list_placement(layers_list_placement_t p) { ui_layers_list_placement = p; }
get_ui_layers_list_placement()147     layers_list_placement_t get_ui_layers_list_placement() { return ui_layers_list_placement; }
148 
set_ui_floating_tool_dialogs(bool b)149     void set_ui_floating_tool_dialogs(bool b) { ui_floating_tool_dialogs = b; }
get_ui_floating_tool_dialogs()150     bool get_ui_floating_tool_dialogs() { return ui_floating_tool_dialogs; }
151 
set_ui_multiple_tool_dialogs(bool b)152     void set_ui_multiple_tool_dialogs(bool b) { ui_multiple_tool_dialogs = b; }
get_ui_multiple_tool_dialogs()153     bool get_ui_multiple_tool_dialogs() { return ui_multiple_tool_dialogs; }
154 
155 
156     void load();
157     void save();
158   };
159 
160 }
161 
162 
163 #endif
164 
165 
166