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

Bakery::Document Class Reference

The Document is like the 'Model' in the Model-View-Controller framework. More...

#include <Document.h>

Inheritance diagram for Bakery::Document:

Inheritance graph
[legend]
List of all members.

Public Types

typedef sigc::signal< void,
bool > 
type_signal_modified
 For instance, void on_document_modified(bool modified);.
typedef sigc::signal< void > type_signal_forget

Public Member Functions

 Document ()
virtual ~Document ()
virtual bool save ()
virtual bool load ()
virtual bool get_modified () const
virtual void set_modified (bool bVal=true)
virtual bool get_is_new () const
 Whether this just a default document.
void set_is_new (bool bVal)
 Called by App_WithDoc::init_create_document().
virtual Glib::ustring get_contents () const
virtual void set_contents (const Glib::ustring &strVal)
virtual Glib::ustring get_file_uri_with_extension (const Glib::ustring &uri)
virtual Glib::ustring get_file_uri () const
virtual void set_file_uri (const Glib::ustring &file_uri, bool bEnforceFileExtension=false)
virtual Glib::ustring get_name () const
 Gets filename part of file_uri, or 'untitled'.
virtual bool get_read_only () const
virtual void set_read_only (bool bVal)
virtual void set_view (ViewBase *pView)
 If you don't want to use a View, then don't use set_view().
virtual ViewBaseget_view ()
virtual void set_file_extension (const Glib::ustring &strVal)
virtual Glib::ustring get_file_extension () const
type_signal_modifiedsignal_modified ()
 This signal is emitted when the document has been modified.
type_signal_forgetsignal_forget ()
 This signal is emitted when the view should forget the document.

Static Public Member Functions

Glib::ustring util_file_uri_get_name (const Glib::ustring &file_uri, const Glib::ustring &file_extension)

Protected Member Functions

virtual bool load_after ()
 overrideable.
virtual bool save_before ()
 overrideable.
virtual bool read_from_disk ()
virtual bool write_to_disk ()

Protected Attributes

Glib::ustring m_strContents
Glib::ustring m_file_uri
Glib::ustring m_file_extension
ViewBasem_pView
type_signal_modified signal_modified_
type_signal_forget signal_forget_
bool m_bModified
bool m_bIsNew
bool m_bReadOnly

Detailed Description

The Document is like the 'Model' in the Model-View-Controller framework.

Each App should have a Document. Each View gets and sets data in its document.


Member Typedef Documentation

typedef sigc::signal<void> Bakery::Document::type_signal_forget
 

typedef sigc::signal<void, bool> Bakery::Document::type_signal_modified
 

For instance, void on_document_modified(bool modified);.


Constructor & Destructor Documentation

Bakery::Document::Document  ) 
 

virtual Bakery::Document::~Document  )  [virtual]
 


Member Function Documentation

virtual Glib::ustring Bakery::Document::get_contents  )  const [virtual]
 

virtual Glib::ustring Bakery::Document::get_file_extension  )  const [virtual]
 

virtual Glib::ustring Bakery::Document::get_file_uri  )  const [virtual]
 

virtual Glib::ustring Bakery::Document::get_file_uri_with_extension const Glib::ustring uri  )  [virtual]
 

virtual bool Bakery::Document::get_is_new  )  const [virtual]
 

Whether this just a default document.

virtual bool Bakery::Document::get_modified  )  const [virtual]
 

virtual Glib::ustring Bakery::Document::get_name  )  const [virtual]
 

Gets filename part of file_uri, or 'untitled'.

virtual bool Bakery::Document::get_read_only  )  const [virtual]
 

virtual ViewBase* Bakery::Document::get_view  )  [virtual]
 

virtual bool Bakery::Document::load  )  [virtual]
 

virtual bool Bakery::Document::load_after  )  [protected, virtual]
 

overrideable.

Does anything which should be done after the data has been loaded from disk, but before updating the View.

Reimplemented in Bakery::Document_XML.

virtual bool Bakery::Document::read_from_disk  )  [protected, virtual]
 

virtual bool Bakery::Document::save  )  [virtual]
 

virtual bool Bakery::Document::save_before  )  [protected, virtual]
 

overrideable.

Does anything which should be done before the view has saved its data, before writing to disk..

Reimplemented in Bakery::Document_XML.

virtual void Bakery::Document::set_contents const Glib::ustring strVal  )  [virtual]
 

virtual void Bakery::Document::set_file_extension const Glib::ustring strVal  )  [virtual]
 

virtual void Bakery::Document::set_file_uri const Glib::ustring file_uri,
bool  bEnforceFileExtension = false
[virtual]
 

void Bakery::Document::set_is_new bool  bVal  ) 
 

Called by App_WithDoc::init_create_document().

virtual void Bakery::Document::set_modified bool  bVal = true  )  [virtual]
 

virtual void Bakery::Document::set_read_only bool  bVal  )  [virtual]
 

virtual void Bakery::Document::set_view ViewBase pView  )  [virtual]
 

If you don't want to use a View, then don't use set_view().

type_signal_forget& Bakery::Document::signal_forget  ) 
 

This signal is emitted when the view should forget the document.

This is used internally, and you should not need to use it yourself.

type_signal_modified& Bakery::Document::signal_modified  ) 
 

This signal is emitted when the document has been modified.

It allows the view to update itself to show the new information.

Glib::ustring Bakery::Document::util_file_uri_get_name const Glib::ustring file_uri,
const Glib::ustring file_extension
[static]
 

virtual bool Bakery::Document::write_to_disk  )  [protected, virtual]
 


Member Data Documentation

bool Bakery::Document::m_bIsNew [protected]
 

bool Bakery::Document::m_bModified [protected]
 

bool Bakery::Document::m_bReadOnly [protected]
 

Glib::ustring Bakery::Document::m_file_extension [protected]
 

Glib::ustring Bakery::Document::m_file_uri [protected]
 

ViewBase* Bakery::Document::m_pView [protected]
 

Glib::ustring Bakery::Document::m_strContents [protected]
 

type_signal_forget Bakery::Document::signal_forget_ [protected]
 

type_signal_modified Bakery::Document::signal_modified_ [protected]
 


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