00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef BAKERY_APP_H
00020 #define BAKERY_APP_H
00021
00022 #include <bakery/App/AppInstanceManager.h>
00023 #include <glibmm/object.h>
00024
00025 #include <vector>
00026 #include <list>
00027 #include <map>
00028
00029 namespace Bakery
00030 {
00031
00032 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00033 class HelpInfo
00034 {
00035 public:
00036 typedef std::vector<Glib::ustring> type_vecStrings;
00037 Glib::ustring m_strVersion, m_strCopyright, m_strDescription, m_strTranslatorCredits;
00038
00039 type_vecStrings m_vecAuthors, m_vecDocumenters;
00040 };
00041 #endif //DOXYGEN_SHOULD_SKIP_THIS
00042
00060 class App : virtual public Glib::ObjectBase
00061 {
00062 public:
00063 friend class AppInstanceManager;
00064
00065
00066
00067
00068
00070 App(const Glib::ustring& appname = Glib::ustring());
00071
00072 virtual ~App();
00073
00074 virtual void init();
00075
00076
00077 typedef std::vector<Glib::ustring> type_vecStrings;
00078 static void set_about_information(const Glib::ustring& strVersion, const type_vecStrings& vecAuthors, const Glib::ustring& strCopyright, const Glib::ustring& strDescription);
00079 static void set_about_information(const Glib::ustring& strVersion, const type_vecStrings& vecAuthors, const Glib::ustring& strCopyright, const Glib::ustring& strDescription, const type_vecStrings& vecDocumenters, const Glib::ustring& strTranslatorCredits);
00080 virtual Glib::ustring get_version() const;
00081
00082 static void set_command_line_args(int argc, char** &argv);
00083
00084 typedef sigc::signal<void> type_signal_hide;
00085 type_signal_hide ui_signal_hide();
00086
00087 protected:
00088 static void init_app_name(const Glib::ustring& appname);
00089
00093 virtual void init_ui_manager();
00094
00097 virtual void init_menus();
00098
00101 virtual void init_menus_file() = 0;
00102
00105 virtual void init_menus_edit() = 0;
00106
00109 virtual void init_menus_help() = 0;
00110
00111 virtual void init_toolbars();
00112
00113 virtual App* new_instance() = 0;
00114
00115
00116
00117
00118
00119 public:
00120
00121
00122 virtual void on_menu_file_new();
00123 virtual void on_menu_file_close();
00124 virtual void on_menu_file_exit();
00125
00126
00127 virtual void on_menu_edit_cut();
00128 virtual void on_menu_edit_copy();
00129 virtual void on_menu_edit_paste();
00130 virtual void on_menu_edit_clear();
00131
00132 virtual void on_menu_help_about() = 0;
00133
00134
00135 virtual void on_about_close();
00136
00137 protected:
00138
00139 virtual void ui_hide() = 0;
00140 virtual void ui_bring_to_front() = 0;
00141
00142
00143
00144
00145 static void set_operation_cancelled(bool bVal = true);
00146 static bool get_operation_cancelled();
00147
00148
00149
00150
00151 static Glib::ustring m_strAppName;
00152
00153
00154 static HelpInfo m_HelpInfo;
00155
00156
00157 static AppInstanceManager m_AppInstanceManager;
00158
00159 static bool m_bOperationCancelled;
00160
00161
00162 static bool m_bAboutShown;
00163
00164
00165 static Glib::ustring m_strCommandLine_0;
00166
00167 type_signal_hide m_signal_hide;
00168
00169
00170
00171
00172
00173 };
00174
00175 }
00176
00177 #endif //BAKERY_APP_H