92
92
guint flags = OPTFLG_NONE, OptionGUI gui = OPTGUI_NONE,
93
93
std::string gui_name = std::string(""));
95
virtual ~Option () {};
97
virtual std::string type_string (void) {return "none";};
98
virtual std::string to_string (void) {return std::string("");};
99
virtual gboolean from_string (const std::string &value) {return false;};
100
virtual void set_gui (std::vector<GtkWidget *> &widgets) {};
101
virtual void get_gui (std::vector<GtkWidget *> &widgets) {};
97
virtual std::string type_string (void) {return "none";}
98
virtual std::string to_string (void) {return std::string("");}
99
virtual gboolean from_string (const std::string &value) {return false;}
100
virtual void set_gui (std::vector<GtkWidget *> &widgets) {}
101
virtual void get_gui (std::vector<GtkWidget *> &widgets) {}
103
103
* Reset the option to the default value.
105
105
* Remark: Instead of calling this function directly better call
106
106
* Options::reset(). This function handles flags like OPTFLG_CHANGE!
108
virtual void reset (void) {};
109
virtual gboolean is_default (void) {return false;};
110
virtual std::string default_string (void) {return std::string("");};
111
virtual Option *copy (void) {return new Option(*this);};
108
virtual void reset (void) {}
109
virtual gboolean is_default (void) {return false;}
110
virtual std::string default_string (void) {return std::string("");}
111
virtual Option *copy (void) {return new Option(*this);}
112
112
std::string flags_string (std::string sep = std::string("; "));
114
114
/// Access function to Option::flags_
155
155
OptionGUI gui = OPTGUI_NONE,
156
156
std::string gui_name = std::string(""));
158
std::string type_string (void) {return ((flags_ & OPTFLG_ID_INT_STRICT) ? "enum" : "unsigned int");};
158
std::string type_string (void) {return ((flags_ & OPTFLG_ID_INT_STRICT) ? "enum" : "unsigned int");}
159
159
std::string to_string (void);
160
160
std::string default_string (void);
161
161
gboolean from_string (const std::string &value);
163
163
void set_gui (std::vector<GtkWidget *> &widgets);
164
164
void reset (void);
165
165
std::string allowed_ids (std::string sep = std::string(" "));
166
gboolean is_default (void) {return value_ == default_;};
167
Option *copy (void) {return new Option_UInt(*this);};
166
gboolean is_default (void) {return value_ == default_;}
167
Option *copy (void) {return new Option_UInt(*this);}
169
169
/// Access function to Option_UInt::value_
170
guint value (void) {return value_;};
170
guint value (void) {return value_;}
171
171
/// Access function to Option_UInt::value_
172
void value (guint val) {value_ = val;};
172
void value (guint val) {value_ = val;}
174
174
const std::string value_to_string (guint val);
175
175
guint string_to_value (const std::string &str);
192
192
const gchar *gui_sensitive[] = NULL,
193
193
const gchar *gui_show[] = NULL);
195
Option *copy (void) {return new Option_Bool(*this);};
196
std::string type_string (void) {return "bool";};
195
Option *copy (void) {return new Option_Bool(*this);}
196
std::string type_string (void) {return "bool";}
198
198
/// Access function to Option_UInt::value_
199
gboolean value (void) {return (gboolean)value_;};
199
gboolean value (void) {return (gboolean)value_;}
200
200
/// Access function to Option_UInt::value_
201
void value (gboolean val) {value_ = (guint)val;};
201
void value (gboolean val) {value_ = (guint)val;}
202
202
/// Access function to Option_UInt::gui_sensitive_
203
void gui_sensitive (std::set<std::string> &gs) {gs = gui_sensitive_;};
203
void gui_sensitive (std::set<std::string> &gs) {gs = gui_sensitive_;}
204
204
/// Access function to Option_UInt::gui_sensitive_neg_
205
void gui_show (std::set<std::string> &gs) {gs = gui_show_;};
205
void gui_show (std::set<std::string> &gs) {gs = gui_show_;}
207
207
static const gchar *ids_[3];
208
208
static const guint ints_[3];
223
223
OptionGUI gui = OPTGUI_NONE,
224
224
std::string gui_name = std::string(""));
226
std::string type_string (void) {return ((flags_ & OPTFLG_STRINGLIST) ? "list (strings)" : "string");};
226
std::string type_string (void) {return ((flags_ & OPTFLG_STRINGLIST) ? "list (strings)" : "string");}
227
227
std::string to_string (void);
228
228
std::string default_string (void);
229
229
gboolean from_string (const std::string &value);
230
230
void get_gui (std::vector<GtkWidget *> &widgets);
231
231
void set_gui (std::vector<GtkWidget *> &widgets);
232
232
void reset (void);
233
gboolean is_default (void) {return value_ == default_;};
234
Option *copy (void) {return new Option_String(*this);};
233
gboolean is_default (void) {return value_ == default_;}
234
Option *copy (void) {return new Option_String(*this);}
236
236
void set_values (const std::set<std::string> &values, gboolean empty=true);
237
237
void get_values (std::set<std::string> &values, gboolean empty = true);
240
240
gboolean empty = true);
242
242
/// Access function to Option_UInt::value_
243
std::string value (void) {return value_;};
243
std::string value (void) {return value_;}
244
244
/// Access function to Option_UInt::value_
245
void value (const std::string val) {from_string (val);};
245
void value (const std::string val) {from_string (val);}
247
247
/// Value of the option
248
248
std::string value_;