1 #ifndef INK_EXTENSION_PARAMRADIOBUTTON_H_SEEN
2 #define INK_EXTENSION_PARAMRADIOBUTTON_H_SEEN
4 /** \file
5 * Radiobutton parameter for extensions.
6 */
8 /*
9 * Author:
10 * Johan Engelen <johan@shouraizou.nl>
11 *
12 * Copyright (C) 2006-2007 Johan Engelen
13 *
14 * Released under GNU GPL, read the file 'COPYING' for more information
15 */
17 #include <gtkmm/widget.h>
19 #include "xml/document.h"
20 #include <extension/extension-forward.h>
22 #include "parameter.h"
24 namespace Inkscape {
25 namespace Extension {
29 // \brief A class to represent a radiobutton parameter of an extension
30 class ParamRadioButton : public Parameter {
31 public:
32 enum AppearanceMode {
33 FULL, COMPACT, MINIMAL
34 };
36 ParamRadioButton(const gchar * name,
37 const gchar * guitext,
38 const gchar * desc,
39 const Parameter::_scope_t scope,
40 bool gui_hidden,
41 const gchar * gui_tip,
42 Inkscape::Extension::Extension * ext,
43 Inkscape::XML::Node * xml,
44 AppearanceMode mode);
45 virtual ~ParamRadioButton(void);
46 Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal);
47 void string (std::string &string);
49 const gchar * get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; }
50 const gchar * set (const gchar * in, SPDocument * doc, Inkscape::XML::Node * node);
52 private:
53 /** \brief Internal value. This should point to a string that has
54 been allocated in memory. And should be free'd.
55 It is the value of the current selected string */
56 gchar * _value;
57 AppearanceMode _mode;
59 GSList * choices; /**< A table to store the choice strings */
61 }; /* class ParamRadioButton */
67 } /* namespace Extension */
68 } /* namespace Inkscape */
70 #endif /* INK_EXTENSION_PARAMRADIOBUTTON_H_SEEN */