Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

Bakery::App_WithDoc Class Reference

Main Window which supports documents. More...

#include <App_WithDoc.h>

Inheritance diagram for Bakery::App_WithDoc:

Inheritance graph
[legend]
List of all members.

Public Types

enum  enumSaveChanges { SAVECHANGES_Save, SAVECHANGES_Cancel, SAVECHANGES_Discard }

Public Member Functions

 App_WithDoc (const Glib::ustring &appname="")
 Don't forget to call init() too.
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 ()

Protected Types

typedef std::list< Glib::ustringtype_list_strings

Protected Member Functions

virtual void init_create_document ()
virtual Documentget_document ()
 static_cast<> or dynamic_cast<> this pointer to the correct type.
virtual const Documentget_document () const
 static_cast<> or dynamic_cast<> this pointer to the correct type.
virtual void set_document_modified (bool bModified=true)
virtual bool open_document (const Glib::ustring &file_uri)
 bool indicates success.
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.
virtual bool on_document_load ()
 override this to show document contents.
virtual void offer_to_save_changes ()
virtual void cancel_close_or_exit ()
 Stop the File|Close or the File|Exit.
virtual void close_mark_or_destroy ()
 destroy it or mark it for destruction.
virtual void update_window_title ()
virtual void after_successful_save ()
virtual void ui_warning (const Glib::ustring &text)=0
virtual Glib::ustring ui_file_select_open ()=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.
virtual void ui_show_modification_status ()=0
virtual enumSaveChanges ui_offer_to_save_changes ()=0
virtual bool ui_ask_overwrite (const std::string &file_uri)=0

Static Protected Member Functions

void add_mime_type (const Glib::ustring &mime_type)
 Add a MIME-type that this application can support.
Glib::ustring get_conf_fullkey (const Glib::ustring &key)

Protected Attributes

Documentm_pDocument
bool m_bCloseAfterSave

Static Protected Attributes

type_list_strings m_mime_types

Detailed Description

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: Bonobo integration - when Bonobo is ready. (An App subclass?)


Member Typedef Documentation

typedef std::list<Glib::ustring> Bakery::App_WithDoc::type_list_strings [protected]
 


Member Enumeration Documentation

enum Bakery::App_WithDoc::enumSaveChanges
 

Enumeration values:
SAVECHANGES_Save 
SAVECHANGES_Cancel 
SAVECHANGES_Discard 


Constructor & Destructor Documentation

Bakery::App_WithDoc::App_WithDoc const Glib::ustring appname = ""  ) 
 

Don't forget to call init() too.

virtual Bakery::App_WithDoc::~App_WithDoc  )  [virtual]
 


Member Function Documentation

void Bakery::App_WithDoc::add_mime_type const Glib::ustring mime_type  )  [static, protected]
 

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

virtual void Bakery::App_WithDoc::after_successful_save  )  [protected, virtual]
 

virtual void Bakery::App_WithDoc::cancel_close_or_exit  )  [protected, virtual]
 

Stop the File|Close or the File|Exit.

virtual void Bakery::App_WithDoc::close_mark_or_destroy  )  [protected, virtual]
 

destroy it or mark it for destruction.

virtual void Bakery::App_WithDoc::document_history_add const Glib::ustring file_uri  )  [protected, virtual]
 

Reimplemented in Bakery::App_WithDoc_Gtk.

virtual void Bakery::App_WithDoc::document_history_remove const Glib::ustring file_uri  )  [protected, virtual]
 

Reimplemented in Bakery::App_WithDoc_Gtk.

Glib::ustring Bakery::App_WithDoc::get_conf_fullkey const Glib::ustring key  )  [static, protected]
 

virtual const Document* Bakery::App_WithDoc::get_document  )  const [protected, virtual]
 

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

virtual Document* Bakery::App_WithDoc::get_document  )  [protected, virtual]
 

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

virtual void Bakery::App_WithDoc::init  )  [virtual]
 

Reimplemented from Bakery::App.

Reimplemented in Bakery::App_WithDoc_Gtk.

virtual void Bakery::App_WithDoc::init_create_document  )  [protected, virtual]
 

virtual void Bakery::App_WithDoc::offer_saveas  )  [virtual]
 

virtual void Bakery::App_WithDoc::offer_to_save_changes  )  [protected, virtual]
 

virtual bool Bakery::App_WithDoc::on_document_load  )  [protected, virtual]
 

override this to show document contents.

virtual void Bakery::App_WithDoc::on_document_modified bool  modified  )  [protected, virtual]
 

Update visual status.

virtual void Bakery::App_WithDoc::on_menu_edit_clear  )  [virtual]
 

Reimplemented from Bakery::App.

virtual void Bakery::App_WithDoc::on_menu_edit_copy  )  [virtual]
 

Reimplemented from Bakery::App.

virtual void Bakery::App_WithDoc::on_menu_edit_paste  )  [virtual]
 

Reimplemented from Bakery::App.

virtual void Bakery::App_WithDoc::on_menu_file_close  )  [virtual]
 

Reimplemented from Bakery::App.

virtual void Bakery::App_WithDoc::on_menu_file_open  )  [virtual]
 

virtual void Bakery::App_WithDoc::on_menu_file_save  )  [virtual]
 

virtual void Bakery::App_WithDoc::on_menu_file_saveas  )  [virtual]
 

virtual bool Bakery::App_WithDoc::open_document const Glib::ustring file_uri  )  [protected, virtual]
 

bool indicates success.

virtual void Bakery::App_WithDoc::set_document_modified bool  bModified = true  )  [protected, virtual]
 

virtual bool Bakery::App_WithDoc::ui_ask_overwrite const std::string &  file_uri  )  [protected, pure virtual]
 

Implemented in Bakery::App_WithDoc_Gtk.

virtual Glib::ustring Bakery::App_WithDoc::ui_file_select_open  )  [protected, pure virtual]
 

Implemented in Bakery::App_WithDoc_Gtk.

virtual Glib::ustring Bakery::App_WithDoc::ui_file_select_save const Glib::ustring old_file_uri  )  [protected, pure virtual]
 

Present a user interface that allows the user to select a location to save the file.

Parameters:
old_file_uri The existing URI of the file, if any.
Returns:
The URI of the file chosen by the user.

Implemented in Bakery::App_WithDoc_Gtk.

virtual enumSaveChanges Bakery::App_WithDoc::ui_offer_to_save_changes  )  [protected, pure virtual]
 

Implemented in Bakery::App_WithDoc_Gtk.

virtual void Bakery::App_WithDoc::ui_show_modification_status  )  [protected, pure virtual]
 

Implemented in Bakery::App_WithDoc_Gtk.

virtual void Bakery::App_WithDoc::ui_warning const Glib::ustring text  )  [protected, pure virtual]
 

Implemented in Bakery::App_WithDoc_Gtk.

virtual void Bakery::App_WithDoc::update_window_title  )  [protected, virtual]
 

Reimplemented in Bakery::App_WithDoc_Gtk.


Member Data Documentation

bool Bakery::App_WithDoc::m_bCloseAfterSave [protected]
 

type_list_strings Bakery::App_WithDoc::m_mime_types [static, protected]
 

Document* Bakery::App_WithDoc::m_pDocument [protected]
 


The documentation for this class was generated from the following file:
Generated on Tue Jan 4 19:00:23 2005 for bakery by  doxygen 1.3.9.1