#include <gcp/document.h>
Public Member Functions | |
Document (Application *App, bool StandAlone, Window *window=NULL) | |
virtual | ~Document () |
void | Clear () |
GtkWidget * | GetWidget () |
View * | GetView () |
bool | ImportOB (OpenBabel::OBMol &Mol) |
void | ExportOB () const |
void | Save () const |
virtual bool | Load (xmlNodePtr node) |
const gchar * | GetTitle () const |
void | SetTitle (const gchar *title) |
void | SetLabel (const gchar *label) |
const gchar * | GetLabel () const |
void | SetFileName (std::string const &filename, const gchar *mime_type) |
const gchar * | GetFileName () const |
void | DoPrint (GtkPrintOperation *print, GtkPrintContext *context, int page) const |
void | AddObject (Object *pObject) |
void | AddAtom (Atom *pAtom) |
void | AddFragment (Fragment *pFragment) |
void | AddBond (Bond *pBond) |
void | ParseXMLTree (xmlDocPtr xml) |
void | LoadObjects (xmlNodePtr node) |
xmlDocPtr | BuildXMLTree () const |
void | Update () |
void | Remove (Object *object) |
void | Remove (const char *Id) |
void | OnProperties () |
void | OnUndo () |
void | OnRedo () |
const GDate * | GetCreationDate () |
const GDate * | GetRevisionDate () |
const gchar * | GetAuthor () |
const gchar * | GetMail () |
const gchar * | GetComment () |
void | SetAuthor (const gchar *author) |
void | SetMail (const gchar *mail) |
void | SetComment (const gchar *comment) |
void | FinishOperation () |
void | AbortOperation () |
void | PopOperation () |
void | PushOperation (Operation *operation, bool undo=true) |
void | SetActive () |
Operation * | GetNewOperation (OperationType type) |
Operation * | GetCurrentOperation () |
void | AddData (xmlNodePtr node) |
bool | CanUndo () |
void | SetEditable (bool editable) |
bool | GetEditable () |
gcp::Application * | GetApplication () |
void | ExportImage (std::string const &filename, const char *type, int resolution=-1) |
void | SetReadOnly (bool ro) |
bool | GetReadOnly () |
virtual double | GetYAlign () |
Window * | GetWindow () |
GtkWindow * | GetGtkWindow () |
void | SetTheme (Theme *theme) |
bool | OnSignal (gcu::SignalId Signal, gcu::Object *Child) |
void | SetDirty (bool isDirty=true) |
void | OnThemeNamesChanged () |
double | GetMedianBondLength () |
bool | SetProperty (unsigned property, char const *value) |
std::string | GetProperty (unsigned property) const |
void | SetLoading (bool loading) |
void | SaveResidue (Residue const *r, xmlNodePtr node) |
gcu::Residue const * | GetResidue (char const *symbol, bool *ambiguous=NULL) |
gcu::Residue * | CreateResidue (char const *name, char const *symbol, gcu::Molecule *molecule) |
Theme * | GetTheme (void) const |
void | SetBondLength (double val) |
double | GetBondLength (void) const |
double & | GetRefBondLength (void) |
void | SetBondAngle (double val) |
double | GetBondAngle (void) const |
double & | GetRefBondAngle (void) |
void | SetArrowLength (double val) |
double | GetArrowLength (void) const |
double & | GetRefArrowLength (void) |
void | SetTextFontFamily (gchar *val) |
gchar * | GetTextFontFamily (void) const |
gchar *& | GetRefTextFontFamily (void) |
void | SetTextFontStyle (PangoStyle val) |
PangoStyle | GetTextFontStyle (void) const |
PangoStyle & | GetRefTextFontStyle (void) |
void | SetTextFontWeight (PangoWeight val) |
PangoWeight | GetTextFontWeight (void) const |
PangoWeight & | GetRefTextFontWeight (void) |
void | SetTextFontVariant (PangoVariant val) |
PangoVariant | GetTextFontVariant (void) const |
PangoVariant & | GetRefTextFontVariant (void) |
void | SetTextFontStretch (PangoStretch val) |
PangoStretch | GetTextFontStretch (void) const |
PangoStretch & | GetRefTextFontStretch (void) |
void | SetTextFontSize (gint val) |
gint | GetTextFontSize (void) const |
gint & | GetRefTextFontSize (void) |
PangoAttrList * | GetPangoAttrList (void) const |
void | SetAllowClipboard (bool val) |
bool | GetAllowClipboard (void) const |
bool & | GetRefAllowClipboard (void) |
unsigned | GetSoftwareVersion (void) const |
Definition at line 77 of file gcp/document.h.
gcp::Document::Document | ( | Application * | App, | |
bool | StandAlone, | |||
Window * | window = NULL | |||
) |
App | the application. | |
StandAlone | whether the document is opened in its own window or embedded in something else. | |
window | the document window if it has already been created or NULL. |
virtual gcp::Document::~Document | ( | ) | [virtual] |
The destructor.
Reimplemented from gcu::Document.
void gcp::Document::AbortOperation | ( | ) |
Aborts and deletyes the current operation.
void gcp::Document::AddAtom | ( | Atom * | pAtom | ) |
pAtom | a new atom. |
void gcp::Document::AddBond | ( | Bond * | pBond | ) |
pBond | a new bond. |
void gcp::Document::AddData | ( | xmlNodePtr | node | ) |
node | the XML node representing objects to add to the document. |
void gcp::Document::AddFragment | ( | Fragment * | pFragment | ) |
pFragment | a new atoms group. |
void gcp::Document::AddObject | ( | Object * | pObject | ) |
pObject | a new object. |
xmlDocPtr gcp::Document::BuildXMLTree | ( | ) | const |
Builds the XML tree representing the document. The returned value must be freed using xmlFree.
bool gcp::Document::CanUndo | ( | ) | [inline] |
void gcp::Document::Clear | ( | ) | [virtual] |
Empties a document and reinitialize it.
Reimplemented from gcu::Object.
gcu::Residue* gcp::Document::CreateResidue | ( | char const * | name, | |
char const * | symbol, | |||
gcu::Molecule * | molecule | |||
) | [virtual] |
name | the name of the new residue. | |
symbol | the symbol of the new residue. | |
molecule | a molecule with a pseudo atom which describes the structure of the residue. |
Reimplemented from gcu::Document.
void gcp::Document::DoPrint | ( | GtkPrintOperation * | print, | |
GtkPrintContext * | context, | |||
int | page | |||
) | const [virtual] |
a GtkPrintOperation. | ||
context | a GtkPrintContext. | |
page | the page to print. |
Implements gcu::Printable.
void gcp::Document::ExportImage | ( | std::string const & | filename, | |
const char * | type, | |||
int | resolution = -1 | |||
) |
filename | the image filename. | |
type | a string representing the image type like "png", "svg", or "eps". | |
resolution | the resolution to use in the image for bitmaps or −1. |
void gcp::Document::ExportOB | ( | ) | const |
Exports the current file using OpenBabel. Only molecules will be exported.
void gcp::Document::FinishOperation | ( | ) |
Ends the current operation and pushes it on top of the undo stack. This method must be called after all changes have been done in the document and the changes described in the operation.
gcp::Document::GetAllowClipboard | ( | void | ) | const [inline] |
Definition at line 620 of file gcp/document.h.
gcp::Application* gcp::Document::GetApplication | ( | ) | [inline] |
gcp::Document::GetArrowLength | ( | void | ) | const [inline] |
const gchar* gcp::Document::GetAuthor | ( | ) | [inline] |
gcp::Document::GetBondAngle | ( | void | ) | const [inline] |
Definition at line 520 of file gcp/document.h.
gcp::Document::GetBondLength | ( | void | ) | const [inline] |
const gchar* gcp::Document::GetComment | ( | ) | [inline] |
const GDate* gcp::Document::GetCreationDate | ( | ) | [inline] |
Definition at line 242 of file gcp/document.h.
Operation* gcp::Document::GetCurrentOperation | ( | ) | [inline] |
bool gcp::Document::GetEditable | ( | ) | [inline] |
const gchar* gcp::Document::GetFileName | ( | ) | const [inline] |
GtkWindow* gcp::Document::GetGtkWindow | ( | ) | [virtual] |
const gchar* gcp::Document::GetLabel | ( | ) | const |
const gchar* gcp::Document::GetMail | ( | ) | [inline] |
double gcp::Document::GetMedianBondLength | ( | ) |
Operation* gcp::Document::GetNewOperation | ( | OperationType | type | ) |
type | the type of the new undo/redo operation. |
gcp::Document::GetPangoAttrList | ( | void | ) | const [inline] |
Definition at line 608 of file gcp/document.h.
std::string gcp::Document::GetProperty | ( | unsigned | property | ) | const [virtual] |
property | the property id as defined in objprops.h |
Reimplemented from gcu::Object.
bool gcp::Document::GetReadOnly | ( | ) | [inline] |
Definition at line 356 of file gcp/document.h.
gcp::Document::GetRefAllowClipboard | ( | void | ) | [inline] |
Definition at line 620 of file gcp/document.h.
gcp::Document::GetRefArrowLength | ( | void | ) | [inline] |
Definition at line 532 of file gcp/document.h.
gcp::Document::GetRefBondAngle | ( | void | ) | [inline] |
Definition at line 520 of file gcp/document.h.
gcp::Document::GetRefBondLength | ( | void | ) | [inline] |
Definition at line 505 of file gcp/document.h.
gcp::Document::GetRefTextFontFamily | ( | void | ) | [inline] |
gcp::Document::GetRefTextFontSize | ( | void | ) | [inline] |
gcp::Document::GetRefTextFontStretch | ( | void | ) | [inline] |
Definition at line 592 of file gcp/document.h.
gcp::Document::GetRefTextFontStyle | ( | void | ) | [inline] |
gcp::Document::GetRefTextFontVariant | ( | void | ) | [inline] |
Definition at line 580 of file gcp/document.h.
gcp::Document::GetRefTextFontWeight | ( | void | ) | [inline] |
gcu::Residue const* gcp::Document::GetResidue | ( | char const * | symbol, | |
bool * | ambiguous = NULL | |||
) | [virtual] |
symbol | the symbol for which a Residue* is searched. | |
ambiguous | where to store the boolean telling if the symbol is ambiguous or NULL. |
Reimplemented from gcu::Document.
const GDate* gcp::Document::GetRevisionDate | ( | ) | [inline] |
Definition at line 246 of file gcp/document.h.
gcp::Document::GetSoftwareVersion | ( | void | ) | const [inline] |
Retrieves the GChemPaint API number corresponding to the program which saved the file last time. Might be 0 if the file has never been saved, or if the file was not saved using GChemPaint. The version is an unsigned decimal number of the type MMMmmmµµµ, where MMM is the major version, mmm the minor version and µµµ the micro version. This is used to detect files with old syntax on loading.
Definition at line 629 of file gcp/document.h.
gcp::Document::GetTextFontFamily | ( | void | ) | const [inline] |
gcp::Document::GetTextFontSize | ( | void | ) | const [inline] |
gcp::Document::GetTextFontStretch | ( | void | ) | const [inline] |
gcp::Document::GetTextFontStyle | ( | void | ) | const [inline] |
gcp::Document::GetTextFontVariant | ( | void | ) | const [inline] |
gcp::Document::GetTextFontWeight | ( | void | ) | const [inline] |
gcp::Document::GetTheme | ( | void | ) | const [inline] |
const gchar* gcp::Document::GetTitle | ( | ) | const |
View* gcp::Document::GetView | ( | void | ) | [inline] |
GtkWidget* gcp::Document::GetWidget | ( | ) |
Window* gcp::Document::GetWindow | ( | void | ) | [inline] |
Definition at line 367 of file gcp/document.h.
virtual double gcp::Document::GetYAlign | ( | ) | [virtual] |
Used to retrieve the y coordinate for alignment. If the documetn contains just one objecst as a molecule or a reaction, it will reurn it's alignment value, otherwise 0 is returned.
Reimplemented from gcu::Object.
bool gcp::Document::ImportOB | ( | OpenBabel::OBMol & | Mol | ) |
Mol | an OpenBabel molecule to import. |
virtual bool gcp::Document::Load | ( | xmlNodePtr | node | ) | [virtual] |
node | the XML root node for the document. |
Reimplemented from gcu::Object.
void gcp::Document::LoadObjects | ( | xmlNodePtr | node | ) |
node | the XML node representing objects to add to the document. |
void gcp::Document::OnProperties | ( | ) |
Called by the framework when the user fires the File/Properties command.
void gcp::Document::OnRedo | ( | ) |
Called by the framework when the user fires the Edit/Redo command.
bool gcp::Document::OnSignal | ( | gcu::SignalId | Signal, | |
gcu::Object * | Child | |||
) | [virtual] |
Signal | a SignalId | |
Child | the child which emitted the signal or NULL |
Reimplemented from gcu::Object.
void gcp::Document::OnThemeNamesChanged | ( | ) |
Called by the framework when the theme names have changed, i.e. a new theme has ben added, or a theme has been removed or renamed.
void gcp::Document::OnUndo | ( | ) |
Called by the framework when the user fires the Edit/Undo command.
void gcp::Document::ParseXMLTree | ( | xmlDocPtr | xml | ) |
xml | the XML document representing the GChemPaint document being loaded. |
void gcp::Document::PopOperation | ( | ) |
Removes an operation from the udo stack and deletes it.
void gcp::Document::PushOperation | ( | Operation * | operation, | |
bool | undo = true | |||
) |
operation | the operation to add. | |
undo | whether to put he operation on the undo or the redo stack. |
void gcp::Document::Remove | ( | const char * | Id | ) |
Id | the Id of the object to be removed. |
void gcp::Document::Remove | ( | Object * | object | ) |
object | the object to remove. |
void gcp::Document::Save | ( | ) | const [virtual] |
Saves the current file.
Reimplemented from gcu::Document.
void gcp::Document::SaveResidue | ( | Residue const * | r, | |
xmlNodePtr | node | |||
) |
r | the residue to be saved. | |
node | the XML node to which add the saved residue if needed. |
void gcp::Document::SetActive | ( | ) |
Called by the framework when the document becomes the active one. Updates the menus according to the document state.
gcp::Document::SetAllowClipboard | ( | bool | val | ) | [inline] |
val | whether the document may use the clipboard or no. |
Definition at line 620 of file gcp/document.h.
gcp::Document::SetArrowLength | ( | double | val | ) | [inline] |
val | the new default arrow length. |
Definition at line 532 of file gcp/document.h.
void gcp::Document::SetAuthor | ( | const gchar * | author | ) |
author | the new author name. |
gcp::Document::SetBondAngle | ( | double | val | ) | [inline] |
val | the new default bond angle between two consecutive bonds in a chain. |
Definition at line 520 of file gcp/document.h.
gcp::Document::SetBondLength | ( | double | val | ) | [inline] |
val | the new default bond length. |
Definition at line 505 of file gcp/document.h.
void gcp::Document::SetComment | ( | const gchar * | comment | ) |
comment | the new comment. |
void gcp::Document::SetDirty | ( | bool | isDirty = true |
) |
Mark the document as dirty. On any attempt to close a dirty document, a dialog box is opened to ask the user if he wants to save the modified document or drop the changes.
Reimplemented from gcu::Object.
void gcp::Document::SetEditable | ( | bool | editable | ) | [inline] |
editable | whether the document might be edited or not |
Definition at line 328 of file gcp/document.h.
void gcp::Document::SetFileName | ( | std::string const & | filename, | |
const gchar * | mime_type | |||
) |
filename | the new file name (URI). | |
mime_type | the new mime type. |
void gcp::Document::SetLabel | ( | const gchar * | label | ) |
label | the new window title. |
void gcp::Document::SetLoading | ( | bool | loading | ) | [inline] |
loading | whether the document is loading data or not. |
Definition at line 431 of file gcp/document.h.
void gcp::Document::SetMail | ( | const gchar * | ) |
the new e-mail address. |
bool gcp::Document::SetProperty | ( | unsigned | property, | |
char const * | value | |||
) | [virtual] |
property | the property id as defined in objprops.h | |
value | the property value as a string |
Reimplemented from gcu::Object.
void gcp::Document::SetReadOnly | ( | bool | ro | ) |
ro | whether the file is read-only or not. |
gcp::Document::SetTextFontFamily | ( | gchar * | val | ) | [inline] |
val | the new text font family. |
Definition at line 544 of file gcp/document.h.
gcp::Document::SetTextFontSize | ( | gint | val | ) | [inline] |
val | the new text font size. |
Definition at line 604 of file gcp/document.h.
gcp::Document::SetTextFontStretch | ( | PangoStretch | val | ) | [inline] |
val | the new text font stretch. |
Definition at line 592 of file gcp/document.h.
gcp::Document::SetTextFontStyle | ( | PangoStyle | val | ) | [inline] |
val | the new text font style. |
Definition at line 556 of file gcp/document.h.
gcp::Document::SetTextFontVariant | ( | PangoVariant | val | ) | [inline] |
val | the new text font variant. |
Definition at line 580 of file gcp/document.h.
gcp::Document::SetTextFontWeight | ( | PangoWeight | val | ) | [inline] |
val | the new text font weight. |
Definition at line 568 of file gcp/document.h.
void gcp::Document::SetTheme | ( | Theme * | theme | ) |
theme | the new theme for the document. |
void gcp::Document::SetTitle | ( | const gchar * | title | ) |
title | the new title. |
void gcp::Document::Update | ( | ) |
Updates the view for all objects which have been marked as dirty.