Code

r11146@tres: ted | 2006-03-27 22:27:01 -0800
[inkscape.git] / src / extension / parameter.h
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                               const Inkscape::XML::Node * node);
41     int           get_int    (const Inkscape::XML::Document * doc,
42                               const Inkscape::XML::Node * node);
43     float         get_float  (const Inkscape::XML::Document * doc,
44                               const Inkscape::XML::Node * node);
45     const gchar * get_string (const Inkscape::XML::Document * doc,
46                               const Inkscape::XML::Node * node);
48     bool          set_bool   (bool in,          Inkscape::XML::Document * doc, Inkscape::XML::Node * node);
49     int           set_int    (int  in,          Inkscape::XML::Document * doc, Inkscape::XML::Node * node);
50     float         set_float  (float in,         Inkscape::XML::Document * doc, Inkscape::XML::Node * node);
51     const gchar * set_string (const gchar * in, Inkscape::XML::Document * doc, Inkscape::XML::Node * node);
53     const gchar * name       (void) {return _name;}
55     static Parameter * make (Inkscape::XML::Node * in_repr, Inkscape::Extension::Extension * in_ext);
56     virtual Gtk::Widget * get_widget (void);
57     virtual Glib::ustring * string (void);
58 };
61 }  /* namespace Extension */
62 }  /* namespace Inkscape */
64 #endif /* __INK_EXTENSION_PARAM_H__ */
66 /*
67   Local Variables:
68   mode:c++
69   c-file-style:"stroustrup"
70   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
71   indent-tabs-mode:nil
72   fill-column:99
73   End:
74 */
75 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :