Bakery::App_WithDoc
Bakery::App
Bakery::App_WithDoc_Gtk
App_WithDoc.h
enumSaveChanges
SAVECHANGES_Save
SAVECHANGES_Cancel
SAVECHANGES_Discard
Document * Document* Bakery::App_WithDoc::m_pDocument m_pDocument
bool bool Bakery::App_WithDoc::m_bCloseAfterSave m_bCloseAfterSave
std::list< Glib::ustring > typedef std::list<Glib::ustring> Bakery::App_WithDoc::type_list_strings type_list_strings
type_list_strings type_list_strings Bakery::App_WithDoc::m_mime_types m_mime_types
Bakery::App_WithDoc::App_WithDoc
(const Glib::ustring &appname="")
App_WithDoc
const Glib::ustring & appname ""

Don't forget to call init() too.

virtual Bakery::App_WithDoc::~App_WithDoc
()
~App_WithDoc
void virtual void Bakery::App_WithDoc::init () init init init
void virtual void Bakery::App_WithDoc::on_menu_file_open () on_menu_file_open
void virtual void Bakery::App_WithDoc::on_menu_file_saveas () on_menu_file_saveas
void virtual void Bakery::App_WithDoc::offer_saveas () offer_saveas
void virtual void Bakery::App_WithDoc::on_menu_file_save () on_menu_file_save
void virtual void Bakery::App_WithDoc::on_menu_file_close () on_menu_file_close on_menu_file_close
void virtual void Bakery::App_WithDoc::on_menu_edit_copy () on_menu_edit_copy on_menu_edit_copy
void virtual void Bakery::App_WithDoc::on_menu_edit_paste () on_menu_edit_paste on_menu_edit_paste
void virtual void Bakery::App_WithDoc::on_menu_edit_clear () on_menu_edit_clear on_menu_edit_clear
bool static bool Bakery::App_WithDoc::file_exists (const Glib::ustring &uri) file_exists const Glib::ustring & uri
void virtual void Bakery::App_WithDoc::init_create_document () init_create_document
Document * virtual Document* Bakery::App_WithDoc::get_document () get_document

static_cast<> or dynamic_cast<> this pointer to the correct type.

const Document * virtual const Document* Bakery::App_WithDoc::get_document () const get_document

static_cast<> or dynamic_cast<> this pointer to the correct type.

void virtual void Bakery::App_WithDoc::set_document_modified (bool bModified=true) set_document_modified bool bModified true
bool virtual bool Bakery::App_WithDoc::open_document (const Glib::ustring &file_uri) open_document const Glib::ustring & file_uri

Open the document from a file at a URI.

This will check whether the document is already open.

true indicates success.

bool bool Bakery::App_WithDoc::open_document_from_data (const guchar *data, std::size_t length) open_document_from_data const guchar * data std::size_t length

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.

true indicates success.

void virtual void Bakery::App_WithDoc::document_history_add (const Glib::ustring &file_uri) document_history_add document_history_add const Glib::ustring & file_uri
void virtual void Bakery::App_WithDoc::document_history_remove (const Glib::ustring &file_uri) document_history_remove document_history_remove const Glib::ustring & file_uri
void virtual void Bakery::App_WithDoc::on_document_modified (bool modified) on_document_modified bool modified

Update visual status.

bool virtual bool Bakery::App_WithDoc::on_document_load () on_document_load

override this to show document contents.

void virtual void Bakery::App_WithDoc::offer_to_save_changes () offer_to_save_changes
void virtual void Bakery::App_WithDoc::cancel_close_or_exit () cancel_close_or_exit

Stop the File|Close or the File|Exit.

void virtual void Bakery::App_WithDoc::close_mark_or_destroy () close_mark_or_destroy

destroy it or mark it for destruction.

void virtual void Bakery::App_WithDoc::update_window_title () update_window_title update_window_title
void virtual void Bakery::App_WithDoc::after_successful_save () after_successful_save
void virtual void Bakery::App_WithDoc::ui_warning (const Glib::ustring &text, const Glib::ustring &secondary_text)=0 ui_warning ui_warning const Glib::ustring & text const Glib::ustring & secondary_text
Glib::ustring virtual Glib::ustring Bakery::App_WithDoc::ui_file_select_open (const Glib::ustring &ui_file_select_open=Glib::ustring())=0 ui_file_select_open ui_file_select_open const Glib::ustring & ui_file_select_open Glib::ustring()
Glib::ustring virtual Glib::ustring Bakery::App_WithDoc::ui_file_select_save (const Glib::ustring &old_file_uri)=0 ui_file_select_save ui_file_select_save const Glib::ustring & old_file_uri

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.

The URI of the file chosen by the user.

void virtual void Bakery::App_WithDoc::ui_show_modification_status ()=0 ui_show_modification_status ui_show_modification_status
enumSaveChanges virtual enumSaveChanges Bakery::App_WithDoc::ui_offer_to_save_changes ()=0 ui_offer_to_save_changes ui_offer_to_save_changes
void static void Bakery::App_WithDoc::add_mime_type (const Glib::ustring &mime_type) add_mime_type const Glib::ustring & mime_type

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

Glib::ustring static Glib::ustring Bakery::App_WithDoc::get_conf_fullkey (const Glib::ustring &key) get_conf_fullkey const Glib::ustring & key

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:

- 1 document per application instance. Uses Document-derived class polymorphically.

- Override init_create_document() to create new blank document.

- Appropriate Default handling of document open, save, save as.

- Appropriate checking of document 'modified' status - asks user about unsaved changes.

- Asks user about overwriting existing documents.

- Override methods to add/change menus/toolbars/statusbar.

  - Default is basic File, Edit, Help menus and toolbar icons.

- Shows document name (or 'untitled') in window title.

- Shows * in title bar for unsaved docs. Overridable to e.g. shade a Save icon.

- Enforces a file extension.

- Recent Documents menu item - if you use add_mime_type().

TODO:

- Printing -?

  - Print Setup

  - Print Preview

  - Multiple document-types:

  - File/New sub menu

  - Some way to associate a view with a document type: class factory.

Bakery::App_WithDoc_Gtk
Glib::ObjectBase
sigc::trackable
Bakery::App
Bakery::App_WithDoc
Glib::ustring
Bakery::AppInstanceManager
Bakery::ViewBase
Glib::ObjectBase
sigc::trackable
Bakery::App
m_strCommandLine_0 m_strAppName
m_AppInstanceManager
Bakery::Document
m_pView
m_file_uri m_strContents m_file_extension
Bakery::App_WithDoc
m_pDocument
- Bakery::App_WithDoc
  add_mime_type
- Bakery::App_WithDoc
  after_successful_save
- Bakery::App_WithDoc
  App
- Bakery::App_WithDoc
  App_WithDoc
- Bakery::App_WithDoc
  AppInstanceManager
- Bakery::App_WithDoc
  cancel_close_or_exit
- Bakery::App_WithDoc
  close_mark_or_destroy
- Bakery::App_WithDoc
  connect_property_changed
- Bakery::App_WithDoc
  connect_property_changed_with_return
- Bakery::App_WithDoc
  document_history_add
- Bakery::App_WithDoc
  document_history_remove
- Bakery::App_WithDoc
  enumSaveChanges
- Bakery::App_WithDoc
  file_exists
- Bakery::App_WithDoc
  get_conf_fullkey
- Bakery::App_WithDoc
  get_document
- Bakery::App_WithDoc
  get_document
- Bakery::App_WithDoc
  get_operation_cancelled
- Bakery::App_WithDoc
  get_property
- Bakery::App_WithDoc
  get_property_value
- Bakery::App_WithDoc
  get_version
- Bakery::App_WithDoc
  gobj
- Bakery::App_WithDoc
  gobj
- Bakery::App_WithDoc
  gobj_copy
- Bakery::App_WithDoc
  init
- Bakery::App_WithDoc
  init_app_name
- Bakery::App_WithDoc
  init_create_document
- Bakery::App_WithDoc
  init_menus
- Bakery::App_WithDoc
  init_menus_edit
- Bakery::App_WithDoc
  init_menus_file
- Bakery::App_WithDoc
  init_menus_help
- Bakery::App_WithDoc
  init_toolbars
- Bakery::App_WithDoc
  init_ui_manager
- Bakery::App_WithDoc
  initialize
- Bakery::App_WithDoc
  m_AppInstanceManager
- Bakery::App_WithDoc
  m_bAboutShown
- Bakery::App_WithDoc
  m_bCloseAfterSave
- Bakery::App_WithDoc
  m_bOperationCancelled
- Bakery::App_WithDoc
  m_HelpInfo
- Bakery::App_WithDoc
  m_mime_types
- Bakery::App_WithDoc
  m_pDocument
- Bakery::App_WithDoc
  m_signal_hide
- Bakery::App_WithDoc
  m_strAppName
- Bakery::App_WithDoc
  m_strCommandLine_0
- Bakery::App_WithDoc
  new_instance
- Bakery::App_WithDoc
  ObjectBase
- Bakery::App_WithDoc
  ObjectBase
- Bakery::App_WithDoc
  ObjectBase
- Bakery::App_WithDoc
  offer_saveas
- Bakery::App_WithDoc
  offer_to_save_changes
- Bakery::App_WithDoc
  on_about_close
- Bakery::App_WithDoc
  on_document_load
- Bakery::App_WithDoc
  on_document_modified
- Bakery::App_WithDoc
  on_menu_edit_clear
- Bakery::App_WithDoc
  on_menu_edit_copy
- Bakery::App_WithDoc
  on_menu_edit_cut
- Bakery::App_WithDoc
  on_menu_edit_paste
- Bakery::App_WithDoc
  on_menu_file_close
- Bakery::App_WithDoc
  on_menu_file_exit
- Bakery::App_WithDoc
  on_menu_file_new
- Bakery::App_WithDoc
  on_menu_file_open
- Bakery::App_WithDoc
  on_menu_file_save
- Bakery::App_WithDoc
  on_menu_file_saveas
- Bakery::App_WithDoc
  on_menu_help_about
- Bakery::App_WithDoc
  open_document
- Bakery::App_WithDoc
  open_document_from_data
- Bakery::App_WithDoc
  reference
- Bakery::App_WithDoc
  SAVECHANGES_Cancel
- Bakery::App_WithDoc
  SAVECHANGES_Discard
- Bakery::App_WithDoc
  SAVECHANGES_Save
- Bakery::App_WithDoc
  set_about_information
- Bakery::App_WithDoc
  set_about_information
- Bakery::App_WithDoc
  set_command_line_args
- Bakery::App_WithDoc
  set_document_modified
- Bakery::App_WithDoc
  set_operation_cancelled
- Bakery::App_WithDoc
  set_property
- Bakery::App_WithDoc
  set_property_value
- Bakery::App_WithDoc
  type_list_strings
- Bakery::App_WithDoc
  type_signal_hide
- Bakery::App_WithDoc
  type_vecStrings
- Bakery::App_WithDoc
  ui_bring_to_front
- Bakery::App_WithDoc
  ui_file_select_open
- Bakery::App_WithDoc
  ui_file_select_save
- Bakery::App_WithDoc
  ui_hide
- Bakery::App_WithDoc
  ui_offer_to_save_changes
- Bakery::App_WithDoc
  ui_show_modification_status
- Bakery::App_WithDoc
  ui_signal_hide
- Bakery::App_WithDoc
  ui_warning
- Bakery::App_WithDoc
  unreference
- Bakery::App_WithDoc
  update_window_title
- Bakery::App_WithDoc
  ~App
- Bakery::App_WithDoc
  ~App_WithDoc
- Bakery::App_WithDoc
  ~ObjectBase