libglom-1.30  1.30.0
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
GlomBakery::Document_XML Class Reference
Inheritance diagram for GlomBakery::Document_XML:
Inheritance graph
[legend]
Collaboration diagram for GlomBakery::Document_XML:
Collaboration graph
[legend]

Public Member Functions

 Document_XML ()
 
virtual ~Document_XML ()
 
virtual bool load_after (int& failure_code) override
 Allow app to update icons/title bar. More...
 
virtual bool save_before () override
 overrideable. More...
 
void set_dtd_name (const std::string& strVal)
 
std::string get_dtd_name () const
 
void set_dtd_root_node_name (const Glib::ustring& strVal, const Glib::ustring& xmlns=Glib::ustring())
 Set the root node name and (optionally) the xmlns ID to be written when writing the document. More...
 
Glib::ustring get_dtd_root_node_name () const
 
Glib::ustring get_xml () const
 
- Public Member Functions inherited from GlomBakery::Document
 Document ()
 
virtual ~Document ()
 
bool save ()
 
bool load (int& failure_code)
 
bool load_from_data (const guchar* data, std::size_t length, int& failure_code)
 
bool get_modified () const
 
virtual void set_modified (bool bVal=true)
 
bool get_is_new () const
 Whether this just a default document. More...
 
void set_is_new (bool bVal)
 Called by AppWindow_WithDoc::init_create_document(). More...
 
Glib::ustring get_contents () const
 
Glib::ustring get_file_uri_with_extension (const Glib::ustring& uri)
 
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'. More...
 
bool get_read_only () const
 
void set_read_only (bool bVal)
 
void set_view (ViewBase* pView)
 If you don't want to use a View, then don't use set_view(). More...
 
ViewBaseget_view ()
 
void set_file_extension (const Glib::ustring& strVal)
 
Glib::ustring get_file_extension () const
 
type_signal_modifiedsignal_modified ()
 This signal is emitted when the document has been modified. More...
 
type_signal_forgetsignal_forget ()
 This signal is emitted when the view should forget the document. More...
 

Protected Types

typedef GlomBakery::Document type_base
 

Protected Member Functions

const xmlpp::Element* get_node_document () const
 
xmlpp::Element* get_node_document ()
 
void Util_DOM_Write (Glib::ustring& refstrXML) const
 
void add_indenting_white_space_to_node (xmlpp::Node* node=0, const Glib::ustring& start_indent=Glib::ustring())
 Put each node on its own line and add white space for indenting, even if there are child text nodes. More...
 
- Protected Member Functions inherited from GlomBakery::Document
bool read_from_disk (int& failure_code)
 
bool write_to_disk ()
 

Protected Attributes

xmlpp::DomParser m_DOM_Parser
 
xmlpp::Document* m_pDOM_Document
 
std::string m_strDTD_Name
 
Glib::ustring m_strRootNodeName
 
Glib::ustring m_root_xmlns
 
bool m_write_formatted
 
- Protected Attributes inherited from GlomBakery::Document
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
 

Additional Inherited Members

- Public Types inherited from GlomBakery::Document
enum  LoadFailureCodes {
  LoadFailureCodes::NONE = 0,
  LoadFailureCodes::NOT_FOUND = 1,
  LoadFailureCodes::LAST = 20
}
 
typedef sigc::signal< void, bool > type_signal_modified
 For instance, void on_document_modified(bool modified);. More...
 
typedef sigc::signal< void > type_signal_forget
 
- Static Public Member Functions inherited from GlomBakery::Document
static Glib::ustring util_file_uri_get_name (const Glib::ustring& file_uri, const Glib::ustring& file_extension)
 

Member Typedef Documentation

Constructor & Destructor Documentation

GlomBakery::Document_XML::Document_XML ( )
virtual GlomBakery::Document_XML::~Document_XML ( )
virtual

Member Function Documentation

void GlomBakery::Document_XML::add_indenting_white_space_to_node ( xmlpp::Node *  node = 0,
const Glib::ustring start_indent = Glib::ustring() 
)
protected

Put each node on its own line and add white space for indenting, even if there are child text nodes.

set_write_formatted() does not cause nodes to be indented if there are child text nodes, because it assumes that the white space is then significant.

std::string GlomBakery::Document_XML::get_dtd_name ( ) const
Glib::ustring GlomBakery::Document_XML::get_dtd_root_node_name ( ) const
const xmlpp::Element* GlomBakery::Document_XML::get_node_document ( ) const
protected
xmlpp::Element* GlomBakery::Document_XML::get_node_document ( )
protected
Glib::ustring GlomBakery::Document_XML::get_xml ( ) const
virtual bool GlomBakery::Document_XML::load_after ( int &  failure_code)
overridevirtual

Allow app to update icons/title bar.

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

Parameters
failure_codeUsed to return a custom error code that is understood by your application. This must be greater than zero.

Reimplemented from GlomBakery::Document.

virtual bool GlomBakery::Document_XML::save_before ( )
overridevirtual

overrideable.

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

Reimplemented from GlomBakery::Document.

void GlomBakery::Document_XML::set_dtd_name ( const std::string strVal)
void GlomBakery::Document_XML::set_dtd_root_node_name ( const Glib::ustring strVal,
const Glib::ustring xmlns = Glib::ustring() 
)

Set the root node name and (optionally) the xmlns ID to be written when writing the document.

The root node name is also used when reading documents.

void GlomBakery::Document_XML::Util_DOM_Write ( Glib::ustring refstrXML) const
protected

Member Data Documentation

xmlpp::DomParser GlomBakery::Document_XML::m_DOM_Parser
protected
xmlpp::Document* GlomBakery::Document_XML::m_pDOM_Document
protected
Glib::ustring GlomBakery::Document_XML::m_root_xmlns
protected
std::string GlomBakery::Document_XML::m_strDTD_Name
protected
Glib::ustring GlomBakery::Document_XML::m_strRootNodeName
protected
bool GlomBakery::Document_XML::m_write_formatted
protected

The documentation for this class was generated from the following file: