diff options
| author | MenTaLguY <mental@rydia.net> | 2006-01-16 02:36:01 +0000 |
|---|---|---|
| committer | mental <mental@users.sourceforge.net> | 2006-01-16 02:36:01 +0000 |
| commit | 179fa413b047bede6e32109e2ce82437c5fb8d34 (patch) | |
| tree | a5a6ac2c1708bd02288fbd8edb2ff500ff2e0916 /src/ui/dialog/dialog-manager.h | |
| download | inkscape-179fa413b047bede6e32109e2ce82437c5fb8d34.tar.gz inkscape-179fa413b047bede6e32109e2ce82437c5fb8d34.zip | |
moving trunk for module inkscape
(bzr r1)
Diffstat (limited to 'src/ui/dialog/dialog-manager.h')
| -rw-r--r-- | src/ui/dialog/dialog-manager.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/src/ui/dialog/dialog-manager.h b/src/ui/dialog/dialog-manager.h new file mode 100644 index 000000000..cf5a23712 --- /dev/null +++ b/src/ui/dialog/dialog-manager.h @@ -0,0 +1,72 @@ +/** + * \brief Object for managing a set of dialogs, including their signals and + * construction/caching/destruction of them. + * + * Author: + * Bryce W. Harrington <bryce@bryceharrington.org> + * Jon Phillips <jon@rejon.org> + * + * Copyright (C) 2004, 2005 Authors + * + * Released under GNU GPL. Read the file 'COPYING' for more information. + */ + +#ifndef INKSCAPE_UI_DIALOG_MANAGER_H +#define INKSCAPE_UI_DIALOG_MANAGER_H + +#include <glib/gquark.h> +#include "dialog.h" +#include <map> + +namespace Inkscape { +namespace UI { +namespace Dialog { + +class DialogManager { +public: + typedef Dialog *(*DialogFactory)(); + + DialogManager(); + virtual ~DialogManager(); + + sigc::signal<void> show_dialogs; + sigc::signal<void> show_f12; + sigc::signal<void> hide_dialogs; + sigc::signal<void> hide_f12; + sigc::signal<void> transientize; + + /* generic dialog management start */ + typedef std::map<GQuark, DialogFactory> FactoryMap; + typedef std::map<GQuark, Dialog*> DialogMap; + + void registerFactory(gchar const *name, DialogFactory factory); + void registerFactory(GQuark name, DialogFactory factory); + Dialog *getDialog(gchar const* dlgName); + Dialog *getDialog(GQuark dlgName); + void showDialog(gchar const *name); + void showDialog(GQuark name); + +protected: + DialogManager(DialogManager const &d); // no copy + DialogManager& operator=(DialogManager const &d); // no assign + + FactoryMap _factory_map; //< factories to create dialogs + DialogMap _dialog_map; //< map of already created dialogs +}; + +} // namespace Dialog +} // namespace UI +} // namespace Inkscape + +#endif //INKSCAPE_UI_DIALOG_MANAGER_H + +/* + Local Variables: + mode:c++ + c-file-style:"stroustrup" + c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) + indent-tabs-mode:nil + fill-column:99 + End: +*/ +// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 : |
