bakery
2.6
|
Main Window which supports documents. More...
#include <App_WithDoc.h>
Public Types | |
enum | enumSaveChanges { SAVECHANGES_Save, SAVECHANGES_Cancel, SAVECHANGES_Discard } |
![]() | |
typedef std::vector< Glib::ustring > | type_vecStrings |
typedef sigc::signal< void > | type_signal_hide |
Public Member Functions | |
App_WithDoc (const Glib::ustring &appname="") | |
Don't forget to call init() too. More... | |
virtual | ~App_WithDoc () |
virtual void | init () |
virtual void | on_menu_file_open () |
virtual void | on_menu_file_saveas () |
virtual void | offer_saveas () |
virtual void | on_menu_file_save () |
virtual void | on_menu_file_close () |
virtual void | on_menu_edit_copy () |
virtual void | on_menu_edit_paste () |
virtual void | on_menu_edit_clear () |
![]() | |
App (const Glib::ustring &appname=Glib::ustring()) | |
Don't forget to call init() too. More... | |
virtual | ~App () |
virtual Glib::ustring | get_version () const |
type_signal_hide | ui_signal_hide () |
virtual void | on_menu_file_new () |
virtual void | on_menu_file_exit () |
virtual void | on_menu_edit_cut () |
virtual void | on_menu_help_about ()=0 |
virtual void | on_about_close () |
Static Public Member Functions | |
static bool | file_exists (const Glib::ustring &uri) |
![]() | |
static void | set_about_information (const Glib::ustring &strVersion, const type_vecStrings &vecAuthors, const Glib::ustring &strCopyright, const Glib::ustring &strDescription) |
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) |
static void | set_command_line_args (int argc, char **&argv) |
Protected Types | |
typedef std::list< Glib::ustring > | type_list_strings |
Protected Member Functions | |
virtual void | init_create_document () |
virtual Document * | get_document () |
static_cast<> or dynamic_cast<> this pointer to the correct type. More... | |
virtual const Document * | get_document () const |
static_cast<> or dynamic_cast<> this pointer to the correct type. More... | |
virtual void | set_document_modified (bool bModified=true) |
virtual bool | open_document (const Glib::ustring &file_uri) |
Open the document from a file at a URI. More... | |
bool | open_document_from_data (const guchar *data, std::size_t length) |
Open the document using the supplied document contents. More... | |
virtual void | document_history_add (const Glib::ustring &file_uri) |
virtual void | document_history_remove (const Glib::ustring &file_uri) |
virtual void | on_document_modified (bool modified) |
Update visual status. More... | |
virtual bool | on_document_load () |
override this to show document contents. More... | |
virtual void | offer_to_save_changes () |
virtual void | cancel_close_or_exit () |
Stop the File|Close or the File|Exit. More... | |
virtual void | close_mark_or_destroy () |
destroy it or mark it for destruction. More... | |
virtual void | update_window_title () |
virtual void | after_successful_save () |
virtual void | ui_warning (const Glib::ustring &text, const Glib::ustring &secondary_text)=0 |
virtual Glib::ustring | ui_file_select_open (const Glib::ustring &ui_file_select_open=Glib::ustring())=0 |
virtual Glib::ustring | ui_file_select_save (const Glib::ustring &old_file_uri)=0 |
Present a user interface that allows the user to select a location to save the file. More... | |
virtual void | ui_show_modification_status ()=0 |
virtual enumSaveChanges | ui_offer_to_save_changes ()=0 |
![]() | |
virtual void | init_ui_manager () |
Builds the intial ui string, with placeholders. More... | |
virtual void | init_menus () |
Override this to add more menus or different menus. More... | |
virtual void | init_menus_file ()=0 |
Call this from init_menus() to add the standard file menu. More... | |
virtual void | init_menus_edit ()=0 |
Call this from init_menus() to add the standard edit menu. More... | |
virtual void | init_menus_help ()=0 |
Call this from init_menus() to add the standard help menu. More... | |
virtual void | init_toolbars () |
virtual App * | new_instance ()=0 |
virtual void | ui_hide ()=0 |
virtual void | ui_bring_to_front ()=0 |
Static Protected Member Functions | |
static void | add_mime_type (const Glib::ustring &mime_type) |
Add a MIME-type that this application can support. More... | |
static Glib::ustring | get_conf_fullkey (const Glib::ustring &key) |
![]() | |
static void | init_app_name (const Glib::ustring &appname) |
static void | set_operation_cancelled (bool bVal=true) |
static bool | get_operation_cancelled () |
Protected Attributes | |
Document * | m_pDocument |
bool | m_bCloseAfterSave |
![]() | |
type_signal_hide | m_signal_hide |
Static Protected Attributes | |
static type_list_strings | m_mime_types |
![]() | |
static Glib::ustring | m_strAppName |
static HelpInfo | m_HelpInfo |
static AppInstanceManager | m_AppInstanceManager |
static bool | m_bOperationCancelled |
static bool | m_bAboutShown |
static Glib::ustring | m_strCommandLine_0 |
Main Window which supports documents.
This is an abstract class. You must use a class such as App_WithDoc_Gtk, which implements the ui_* methods for a particular GUI toolkit.
Features:
TODO:
|
protected |
Bakery::App_WithDoc::App_WithDoc | ( | const Glib::ustring & | appname = "" | ) |
Don't forget to call init() too.
|
virtual |
|
staticprotected |
Add a MIME-type that this application can support.
You should also register the MIME-type when the application is installed: See http://freedesktop.org/Standards/AddingMIMETutor
|
protectedvirtual |
|
protectedvirtual |
Stop the File|Close or the File|Exit.
|
protectedvirtual |
destroy it or mark it for destruction.
|
protectedvirtual |
Reimplemented in Bakery::App_WithDoc_Gtk.
|
protectedvirtual |
Reimplemented in Bakery::App_WithDoc_Gtk.
|
static |
|
staticprotected |
|
protectedvirtual |
static_cast<> or dynamic_cast<> this pointer to the correct type.
|
protectedvirtual |
static_cast<> or dynamic_cast<> this pointer to the correct type.
|
virtual |
Reimplemented from Bakery::App.
Reimplemented in Bakery::App_WithDoc_Gtk.
|
protectedvirtual |
|
virtual |
|
protectedvirtual |
|
protectedvirtual |
override this to show document contents.
|
protectedvirtual |
Update visual status.
|
virtual |
Reimplemented from Bakery::App.
|
virtual |
Reimplemented from Bakery::App.
|
virtual |
Reimplemented from Bakery::App.
|
virtual |
Reimplemented from Bakery::App.
|
virtual |
|
virtual |
|
virtual |
|
protectedvirtual |
Open the document from a file at a URI.
This will check whether the document is already open.
|
protected |
Open the document using the supplied document contents.
Unlike open_document(), this has no way to know whether the document is already open.
data | A pointer to the bytes of the document contents. |
length | The number of bytes in the data. |
|
protectedvirtual |
|
protectedpure virtual |
Implemented in Bakery::App_WithDoc_Gtk.
|
protectedpure virtual |
Present a user interface that allows the user to select a location to save the file.
old_file_uri | The existing URI of the file, if any. |
Implemented in Bakery::App_WithDoc_Gtk.
|
protectedpure virtual |
Implemented in Bakery::App_WithDoc_Gtk.
|
protectedpure virtual |
Implemented in Bakery::App_WithDoc_Gtk.
|
protectedpure virtual |
Implemented in Bakery::App_WithDoc_Gtk.
|
protectedvirtual |
Reimplemented in Bakery::App_WithDoc_Gtk.
|
protected |
|
staticprotected |
|
protected |