1 #ifndef __INK_EXTENSION_PARAM_H__
2 #define __INK_EXTENSION_PARAM_H__
4 /** \file
5 * Parameters for extensions.
6 */
8 /*
9 * Authors:
10 * Ted Gould <ted@gould.cx>
11 *
12 * Copyright (C) 2005 Authors
13 *
14 * Released under GNU GPL, read the file 'COPYING' for more information
15 */
16 #include <gtkmm/widget.h>
18 #include "xml/document.h"
19 #include "extension-forward.h"
21 namespace Inkscape {
22 namespace Extension {
24 class Parameter {
25 private:
26 /** \brief Which extension is this parameter attached to? */
27 Inkscape::Extension::Extension * extension;
28 /** \brief The name of this parameter. */
29 gchar * _name;
31 protected:
32 /** \brief Text for the GUI selection of this. */
33 gchar * _text;
34 gchar * pref_name (void);
36 public:
37 Parameter (const gchar * name, const gchar * guitext, Inkscape::Extension::Extension * ext);
38 virtual ~Parameter(void);
39 bool get_bool (const Inkscape::XML::Document * doc);
40 int get_int (const Inkscape::XML::Document * doc);
41 float get_float (const Inkscape::XML::Document * doc);
42 const gchar * get_string (const Inkscape::XML::Document * doc);
44 bool set_bool (bool in, Inkscape::XML::Document * doc);
45 int set_int (int in, Inkscape::XML::Document * doc);
46 float set_float (float in, Inkscape::XML::Document * doc);
47 const gchar * set_string (const gchar * in, Inkscape::XML::Document * doc);
49 const gchar * name (void) {return _name;}
51 static Parameter * make (Inkscape::XML::Node * in_repr, Inkscape::Extension::Extension * in_ext);
52 virtual Gtk::Widget * get_widget (void);
53 virtual Glib::ustring * string (void);
54 };
57 } /* namespace Extension */
58 } /* namespace Inkscape */
60 #endif /* __INK_EXTENSION_PARAM_H__ */
62 /*
63 Local Variables:
64 mode:c++
65 c-file-style:"stroustrup"
66 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
67 indent-tabs-mode:nil
68 fill-column:99
69 End:
70 */
71 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :