# gcu::Document Class Reference

`#include <gcu/document.h>`

Inheritance diagram for gcu::Document:

List of all members.

## Public Member Functions

| Document (Application *App=NULL)
virtual | ~Document ()
string & | GetTranslatedId (const char *id)
void | EraseTranslationId (const char *Id)
void | EmptyTranslationTable ()
void | SetTitle (string &title)
void | SetTitle (char const *title)
string & | GetTitle ()
Application * | GetApp (void)
void | SetDirty (bool val)
bool | GetDirty (void)
bool & | GetRefDirty (void)
bool | GetEmpty (void)

## Protected Attributes

string | m_Title
Application * | m_App
bool | m_Empty

## Detailed Description

This class is the base document class.

Definition at line 45 of file document.h.

## Constructor & Destructor Documentation

gcu::Document::Document | ( | Application * | App = `NULL` | ) |

Parameters:

  | App,: | the Appllcation which owns the new document.

The default constructor. Creates an empty document.

virtual gcu::Document::~Document | ( |  | ) | `[virtual]`

The destructor of Document.

## Member Function Documentation

string& gcu::Document::GetTranslatedId | ( | const char * | id | ) | `[inline]`

Parameters:

  | id,: | the original id to tranlate

When pasting, objects added to the document might have the same Id as objects already existing. In such cases, the document maintains a table to update links using Ids as identifiers. GetTranslatedId returns the translated id corresponding to the parameter id.

Definition at line 70 of file document.h.

void gcu::Document::EraseTranslationId | ( | const char * | Id | ) | `[inline]`

Parameters:

  | Id,: | the entry to remove

When pasting, objects added to the document might have the same Id as objects already existing. In such cases, the document maintains a table to update links using Ids as identifiers. The EraseTranslationTable method removes thenentry correspondig to id.

Definition at line 78 of file document.h.

void gcu::Document::EmptyTranslationTable | ( |  | ) | `[inline]`

When pasting, objects added to the document might have the same Id as objects already existing. In such cases, the document maintains a table to update links using Ids as identifiers. The EmptyTranslationTable method should be called after pasting to reinitialize the table to avoid errors on the next paste event.

Definition at line 85 of file document.h.

void gcu::Document::SetTitle | ( | string & | title | ) | `[inline]`

Parameters:

  | title | the new document title.

Definition at line 90 of file document.h.

References m_Title.

void gcu::Document::SetTitle | ( | char const * | title | ) | `[inline]`

Parameters:

  | title | the new document title.

Definition at line 94 of file document.h.

References m_Title.

string& gcu::Document::GetTitle | ( |  | ) | `[inline]`

Returns:
  the current document title.

Reimplemented in gcu::Chem3dDoc.

Definition at line 98 of file document.h.

References m_Title.

gcu::Document::GetApp | ( | void |  | ) | `[inline]`

Returns:
  a pointer to the Appication instance owning the ocument or NULL for an orphan document.

Definition at line 129 of file document.h.

gcu::Document::SetDirty | ( | bool | dirty | ) | `[inline]`

Parameters:

  | dirty | should be true if the document has changed, false otherwise.

Definition at line 141 of file document.h.

gcu::Document::GetDirty | ( | void |  | ) | `[inline]`

Returns:
  true if the document has changed since it was opened or last saved, false otherwise.

Definition at line 141 of file document.h.

gcu::Document::GetRefDirty | ( | void |  | ) | `[inline]`

Returns:
  the current state of the document as a reference: true if the document has changed since it was opened or last saved, false otherwise.

Definition at line 141 of file document.h.

gcu::Document::GetEmpty | ( | void |  | ) | `[inline]`

Returns:
  true if the document does not contain anything, false otherwise.

Definition at line 148 of file document.h.

## Member Data Documentation

string gcu::Document::m_Title`[protected]`

The document title.

Definition at line 120 of file document.h.

Referenced by GetTitle(), and SetTitle().

gcu::Document::m_App`[protected]`

The Application instance owning the document.

Definition at line 129 of file document.h.

gcu::Document::m_Empty`[protected]`

Tells if the document is empty or not.

Definition at line 148 of file document.h.

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

- document.h