1 /** @file
2 * @brief Extension editor dialog
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 "ui/widget/panel.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 UI::Widget::Panel {
33 public:
34 ExtensionEditor();
35 virtual ~ExtensionEditor();
37 static ExtensionEditor &getInstance() { 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 }
62 /** \brief Name of the extension */
63 Gtk::TreeModelColumn<Glib::ustring> _col_name;
64 /** \brief ID of the extension */
65 Gtk::TreeModelColumn<Glib::ustring> _col_id;
66 };
67 PageListModelColumns _page_list_columns;
69 private:
70 /** \brief A 'global' variable to help search through and select
71 an item in the extension list */
72 Glib::ustring _selection_search;
74 ExtensionEditor(ExtensionEditor const &d);
75 ExtensionEditor& operator=(ExtensionEditor const &d);
77 void on_pagelist_selection_changed(void);
78 static void dbfunc (Inkscape::Extension::Extension * in_plug, gpointer in_data);
79 Gtk::TreeModel::iterator add_extension (Inkscape::Extension::Extension * ext);
80 bool setExtensionIter(const Gtk::TreeModel::iterator &iter);
81 public:
82 void setExtension(Glib::ustring extension_id);
83 };
85 } // namespace Dialog
86 } // namespace UI
87 } // namespace Inkscape
89 #endif // INKSCAPE_UI_DIALOG_EXTENSION_EDITOR_H
91 /*
92 Local Variables:
93 mode:c++
94 c-file-style:"stroustrup"
95 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
96 indent-tabs-mode:nil
97 fill-column:99
98 End:
99 */
100 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :