Code

Changed preference to use file chooser button
[inkscape.git] / src / extension / prefdialog.h
1 /*
2  * Authors:
3  *   Ted Gould <ted@gould.cx>
4  *
5  * Copyright (C) 2005 Authors
6  *
7  * Released under GNU GPL, read the file 'COPYING' for more information
8  */
10 #ifndef INKSCAPE_EXTENSION_DIALOG_H__
11 #define INKSCAPE_EXTENSION_DIALOG_H__
13 #include <glibmm/ustring.h>
15 #include <gdkmm/types.h>
17 #include <gtkmm/dialog.h>
18 #include <gtkmm/checkbutton.h>
19 #include <gtkmm/socket.h>
21 #include "execution-env.h"
22 #include "parameter.h"
24 namespace Inkscape {
25 namespace Extension {
27 /** \brief  A class to represent the preferences for an extension */
28 class PrefDialog : public Gtk::Dialog {
29     /** \brief  Help string if it exists */
30     gchar const * _help;
31     /** \brief  Name of the extension */
32     Glib::ustring _name;
33     /** \brief  An execution environment if there is one */
34     ExecutionEnv * _exEnv;
35     /** \brief  Whether we created the \a _exEnv variable */
36     bool _createdExEnv;
38     /** \brief  A pointer to the OK button */
39     Gtk::Button * _button_ok;
40     /** \brief  A pointer to the CANCEL button */
41     Gtk::Button * _button_cancel;
43     /** \brief  Button to control live preview */
44     Gtk::Widget * _button_preview;
45     /** \brief  Button to control whether the dialog is pinned */
46     Gtk::Widget * _button_pinned;
48     /** \brief  Parameter to control live preview */
49     Parameter * _param_preview;
50     /** \brief  Parameter to control pinning the dialog */
51     Parameter * _param_pinned;
53     /** \brief  XML to define the pinned parameter on the dialog */
54     static const char * pinned_param_xml;
55     /** \brief  XML to define the live effects parameter on the dialog */
56     static const char * live_param_xml;
58     /** \brief Signal that the user is changing the live effect state */
59     sigc::signal<void> _signal_preview;
60     /** \brief Signal that the user is changing the pinned state */
61     sigc::signal<void> _signal_pinned;
62     /** \brief Signal that one of the parameters change */
63     sigc::signal<void> * _signal_param_change;
65     Effect * _effect;
67     void preview_toggle(void);
68     void pinned_toggle(void);
70     void on_response (int signal);
72 public:
73     PrefDialog (Glib::ustring name,
74                 gchar const * help,
75                 Gtk::Widget * controls,
76                 ExecutionEnv * exEnv = NULL,
77                 Effect * effect = NULL,
78                 sigc::signal<void> * changeSignal = NULL);
79     ~PrefDialog ();
80     int run (void);
82     void setPreviewState (Glib::ustring state);
83 };
86 };}; /* namespace Inkscape, Extension */
88 #endif /* INKSCAPE_EXTENSION_DIALOG_H__ */
90 /*
91   Local Variables:
92   mode:c++
93   c-file-style:"stroustrup"
94   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
95   indent-tabs-mode:nil
96   fill-column:99
97   End:
98 */
99 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :