Code

r10987@tres: ted | 2006-02-28 01:06:37 -0800
[inkscape.git] / src / ui / dialog / extension-editor.h
1 /**
2  * \brief Extension editor
3  *
4  * Authors:
5  *   Bryce W. Harrington <bryce@bryceharrington.org>
6  *   Ted Gould <ted@gould.cx>
7  *
8  * Copyright (C) 2004-2006 Authors
9  *
10  * Released under GNU GPL.  Read the file 'COPYING' for more information.
11  */
13 #ifndef INKSCAPE_UI_DIALOG_EXTENSION_EDITOR_H
14 #define INKSCAPE_UI_DIALOG_EXTENSION_EDITOR_H
16 #include "dialog.h"
18 #include <glibmm/i18n.h>
20 #include <gtkmm/treestore.h>
21 #include <gtkmm/treeview.h>
22 #include <gtkmm/label.h>
23 #include <gtkmm/frame.h>
24 #include <gtkmm/scrolledwindow.h>
26 #include "extension/extension.h"
28 namespace Inkscape {
29 namespace UI {
30 namespace Dialog {
32 class ExtensionEditor : public Dialog {
33 public:
34     ExtensionEditor();
35     virtual ~ExtensionEditor();
37     static ExtensionEditor *create() { return new ExtensionEditor(); }
39     static void show_help (gchar const * extension_id);
41 protected:
42     /** \brief  The view of the list of extensions on the left of the dialog */
43     Gtk::TreeView _page_list;
44     /** \brief  The model for the list of extensions */
45     Glib::RefPtr<Gtk::TreeStore> _page_list_model;
46     /** \brief  The notebook page that contains information */
47     Gtk::ScrolledWindow _notebook_info;
48     /** \brief  The notebook page that contains help info */
49     Gtk::ScrolledWindow _notebook_help;
50     /** \brief  The notebook page that holds all the parameters */
51     Gtk::ScrolledWindow _notebook_params;
53     //Pagelist model columns:
54     class PageListModelColumns : public Gtk::TreeModel::ColumnRecord {
55     public:
56         /** \brief  Creates the Page List model by adding all of the
57                     members of the class as column records. */
58         PageListModelColumns() {
59             Gtk::TreeModelColumnRecord::add(_col_name);
60             Gtk::TreeModelColumnRecord::add(_col_id);
61             Gtk::TreeModelColumnRecord::add(_col_info);
62             Gtk::TreeModelColumnRecord::add(_col_help);
63             Gtk::TreeModelColumnRecord::add(_col_params);
64         }
65         /** \brief  Name of the extension */
66         Gtk::TreeModelColumn<Glib::ustring> _col_name;
67         /** \brief  ID of the extension */
68         Gtk::TreeModelColumn<Glib::ustring> _col_id;
69         /** \brief  Info widget for the extension (NULL if unset) */
70         Gtk::TreeModelColumn<Gtk::Widget *> _col_info;
71         /** \brief  Help widget for the extension (NULL if unset) */
72         Gtk::TreeModelColumn<Gtk::Widget *> _col_help;
73         /** \brief  Parameters list of the extension (NULL if unset) */
74         Gtk::TreeModelColumn<Gtk::Widget *> _col_params;
75     };
76     PageListModelColumns _page_list_columns;
78 private:
79     /** \brief  A 'global' variable to help search through and select
80                 an item in the extension list */
81     Glib::ustring _selection_search;
83     ExtensionEditor(ExtensionEditor const &d);
84     ExtensionEditor& operator=(ExtensionEditor const &d);
86     void on_pagelist_selection_changed(void);
87     static void dbfunc (Inkscape::Extension::Extension * in_plug, gpointer in_data);
88     Gtk::TreeModel::iterator add_extension (Inkscape::Extension::Extension * ext);
89     bool setExtensionIter(const Gtk::TreeModel::iterator &iter);
90 public:
91     void setExtension(Glib::ustring extension_id);
92 };
94 } // namespace Dialog
95 } // namespace UI
96 } // namespace Inkscape
98 #endif // INKSCAPE_UI_DIALOG_EXTENSION_EDITOR_H
100 /*
101   Local Variables:
102   mode:c++
103   c-file-style:"stroustrup"
104   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
105   indent-tabs-mode:nil
106   fill-column:99
107   End:
108 */
109 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :