The Gnome Chemistry Utils  0.14.0
Public Member Functions | List of all members
gcp::Document Class Reference

#include <gcp/document.h>

Inheritance diagram for gcp::Document:
gcu::Document gcugtk::Printable gcu::Object gcu::DialogOwner gcu::DialogOwner

Public Member Functions

 Document (Application *App, bool StandAlone, Window *window=NULL)
virtual ~Document ()
void Clear ()
GtkWidget * GetWidget ()
ViewGetView ()
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 ()
OperationGetNewOperation (OperationType type)
OperationGetCurrentOperation ()
void PasteData (xmlNodePtr node)
bool CanUndo ()
void SetEditable (bool editable)
bool GetEditable ()
gcp::ApplicationGetApplication ()
void ExportImage (std::string const &filename, const char *type, int resolution=-1)
void SetReadOnly (bool ro)
bool GetReadOnly ()
virtual double GetYAlign ()
gcu::WindowGetWindow ()
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::ResidueCreateResidue (char const *name, char const *symbol, gcu::Molecule *molecule)
std::set< std::string > & GetNewObjects ()
ThemeGetTheme (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
void SetBracketsFontFamily (std::string val)
std::string GetBracketsFontFamily (void) const
std::string & GetRefBracketsFontFamily (void)
void SetBracketsFontSize (int val)
int GetBracketsFontSize (void) const
int & GetRefBracketsFontSize (void)
void SetUseAtomColors (bool val)
bool GetUseAtomColors (void) const
bool & GetRefUseAtomColors (void)
- Public Member Functions inherited from gcu::Document
 Document (Application *App=NULL)
std::string & GetTranslatedId (const char *id)
void EraseTranslationId (const char *Id)
void EmptyTranslationTable ()
virtual void SetTitle (std::string &title)
virtual void SetTitle (char const *title)
std::string & GetTitle ()
void NotifyDirty (Object *pObject)
bool SetTarget (char const *id, Object **target, Object *parent, Object *owner=NULL, Action action=ActionException) throw (std::runtime_error)
virtual bool Loaded () throw (LoaderError)
std::string Name ()
void ObjectLoaded (Object *obj)
ApplicationGetApp (void)
bool GetEmpty (void)
void SetScale (double val)
double GetScale (void) const
double & GetRefScale (void)
- Public Member Functions inherited from gcu::Object
 Object (TypeId Id=OtherType)
virtual ~Object ()
TypeId GetType () const
void SetId (gchar const *Id)
char const * GetId () const
virtual void AddChild (Object *object)
ObjectGetMolecule () const
ObjectGetReaction () const
ObjectGetGroup () const
DocumentGetDocument () const
ApplicationGetApplication () const
ObjectGetParentOfType (TypeId Id) const
ObjectGetChild (const gchar *Id) const
ObjectGetFirstChild (std::map< std::string, Object * >::iterator &i)
ObjectGetNextChild (std::map< std::string, Object * >::iterator &i)
ObjectGetDescendant (const char *Id) const
ObjectGetParent () const
void SetParent (Object *Parent)
virtual xmlNodePtr Save (xmlDocPtr xml) const
virtual bool GetCoords (double *x, double *y, double *z=NULL) const
virtual void Move (double x, double y, double z=0.)
virtual void Transform2D (Matrix2D &m, double x, double y)
bool SaveChildren (xmlDocPtr xml, xmlNodePtr node) const
void SaveId (xmlNodePtr node) const
xmlNodePtr GetNodeByProp (xmlNodePtr node, char const *Property, char const *Id)
xmlNodePtr GetNextNodeByProp (xmlNodePtr node, char const *Property, char const *Id)
xmlNodePtr GetNodeByName (xmlNodePtr node, char const *Name)
xmlNodePtr GetNextNodeByName (xmlNodePtr node, char const *Name)
bool HasChildren () const
unsigned GetChildrenNumber () const
virtual ObjectGetAtomAt (double x, double y, double z=0.)
virtual bool Build (std::set< Object * > const &Children) throw (std::invalid_argument)
virtual bool BuildContextualMenu (UIManager *uim, Object *object, double x, double y)
void EmitSignal (SignalId Signal)
void Lock (bool state=true)
bool IsLocked ()
ObjectGetFirstLink (std::set< Object * >::iterator &i)
ObjectGetNextLink (std::set< Object * >::iterator &i)
void Link (Object *object)
void Unlink (Object *object)
virtual void OnUnlink (Object *object)
void GetPossibleAncestorTypes (std::set< TypeId > &types) const
virtual void OnLoaded ()
std::string Identity ()
virtual char const * HasPropertiesDialog () const
virtual bool CanSelect () const
virtual void NotifyEmpty ()
void ShowPropertiesDialog ()
bool GetDirty (void) const
- Public Member Functions inherited from gcu::DialogOwner
 DialogOwner ()
virtual ~DialogOwner ()
DialogGetDialog (std::string name) const
void ClearDialogs ()
- Public Member Functions inherited from gcugtk::Printable
 Printable ()
virtual ~Printable ()
virtual bool SupportsHeaders ()
virtual bool SupportMultiplePages ()
virtual int GetPagesNumber ()
void Print (bool preview)
void SetPageSetup (GtkPageSetup *PageSetup)
GtkPrintSettings * GetPrintSettings (void) const
void SetUnit (GtkUnit val)
GtkUnit GetUnit (void) const
GtkUnit & GetRefUnit (void)
void SetHeaderHeight (double val)
double GetHeaderHeight (void) const
double & GetRefHeaderHeight (void)
void SetFooterHeight (double val)
double GetFooterHeight (void) const
double & GetRefFooterHeight (void)
void SetHorizCentered (bool val)
bool GetHorizCentered (void) const
bool & GetRefHorizCentered (void)
void SetVertCentered (bool val)
bool GetVertCentered (void) const
bool & GetRefVertCentered (void)
void SetScaleType (PrintScaleType val)
PrintScaleType GetScaleType (void) const
PrintScaleTypeGetRefScaleType (void)
void SetScale (double val)
double GetScale (void) const
double & GetRefScale (void)
void SetHorizFit (bool val)
bool GetHorizFit (void) const
bool & GetRefHorizFit (void)
void SetVertFit (bool val)
bool GetVertFit (void) const
bool & GetRefVertFit (void)
void SetHPages (int val)
int GetHPages (void) const
int & GetRefHPages (void)
void SetVPages (int val)
int GetVPages (void) const
int & GetRefVPages (void)
void SetHasBackground (bool val)
bool GetHasBackground (void) const
bool & GetRefHasBackground (void)
void SetPrintBackground (bool val)
bool GetPrintBackground (void) const
bool & GetRefPrintBackground (void)

Additional Inherited Members

- Static Public Member Functions inherited from gcu::Object
static TypeId AddType (std::string TypeName, Object *(*CreateFunc)(), TypeId id=OtherType)
static void AddAlias (TypeId id, std::string TypeName)
static ObjectCreateObject (const std::string &TypeName, Object *parent=NULL)
static TypeId GetTypeId (const std::string &Name)
static std::string GetTypeName (TypeId Id)
static void AddMenuCallback (TypeId Id, BuildMenuCb cb)
static void AddRule (TypeId type1, RuleId rule, TypeId type2)
static void AddRule (const std::string &type1, RuleId rule, const std::string &type2)
static const std::set< TypeId > & GetRules (TypeId type, RuleId rule)
static const std::set< TypeId > & GetRules (const std::string &type, RuleId rule)
static void SetCreationLabel (TypeId Id, std::string Label)
static const std::string & GetCreationLabel (TypeId Id)
static const std::string & GetCreationLabel (const std::string &TypeName)
static SignalId CreateNewSignalId ()
- Protected Member Functions inherited from gcu::Object
virtual DialogBuildPropertiesDialog ()
- Protected Attributes inherited from gcu::Document
std::string m_Title
std::set< Object * > m_DirtyObjects
Applicationm_App
bool m_Empty

Detailed Description

The document class for GChemPaint.

Definition at line 78 of file gcp/document.h.

Constructor & Destructor Documentation

gcp::Document::Document ( Application App,
bool  StandAlone,
Window window = NULL 
)
Parameters
Appthe application.
StandAlonewhether the document is opened in its own window or embedded in something else.
windowthe document window if it has already been created or NULL.

Constructs a new empty document using default theme.

virtual gcp::Document::~Document ( )
virtual

The destructor.

Reimplemented from gcu::Document.

Member Function Documentation

void gcp::Document::AbortOperation ( )

Aborts and deletyes the current operation.

void gcp::Document::AddAtom ( Atom pAtom)
Parameters
pAtoma new atom.

Adds a new atom to the document.

void gcp::Document::AddBond ( Bond pBond)
Parameters
pBonda new bond.

Adds a new bond to the document and checks the connectivity of the new covalent structure.

void gcp::Document::AddFragment ( Fragment pFragment)
Parameters
pFragmenta new atoms group.

Adds a new fragment to the document.

void gcp::Document::AddObject ( Object *  pObject)
Parameters
pObjecta new object.

Adds a new object to the document.

xmlDocPtr gcp::Document::BuildXMLTree ( ) const

Builds the XML tree representing the document. The returned value must be freed using xmlFree.

Returns
the new XML document.
bool gcp::Document::CanUndo ( )
inline
Returns
true if the undo stack is not empty.

Definition at line 314 of file gcp/document.h.

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
Parameters
namethe name of the new residue.
symbolthe symbol of the new residue.
moleculea molecule with a pseudo atom which describes the structure of the residue.
Returns
the new Residue on success or NULL.

Reimplemented from gcu::Document.

void gcp::Document::DoPrint ( GtkPrintOperation *  print,
GtkPrintContext *  context,
int  page 
) const
virtual
Parameters
printa GtkPrintOperation.
contexta GtkPrintContext.
pagethe page to print.

Prints the document.

Implements gcugtk::Printable.

void gcp::Document::ExportImage ( std::string const &  filename,
const char *  type,
int  resolution = -1 
)
Parameters
filenamethe image filename.
typea string representing the image type like "png", "svg", or "eps".
resolutionthe resolution to use in the image for bitmaps or −1.

Exports the current document as an image. The image is limited to the real bounds of the document. For bitmaps, the size is evaluated using the perceived screen resolution. If the default resolution (−1) is used, the resoution will be the screen resolution.

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
Returns
whether the document may use the clipboard or not.

Definition at line 618 of file gcp/document.h.

gcp::Application* gcp::Document::GetApplication ( void  )
inline
Returns
the application owning the document.

Definition at line 328 of file gcp/document.h.

gcp::Document::GetArrowLength ( void  ) const
inline
Returns
the current default arrow length.

Definition at line 530 of file gcp/document.h.

const gchar* gcp::Document::GetAuthor ( )
inline
Returns
the author's name.

Definition at line 241 of file gcp/document.h.

gcp::Document::GetBondAngle ( void  ) const
inline
Returns
the current default angle between two consecutive bonds in a chain.

Definition at line 518 of file gcp/document.h.

gcp::Document::GetBondLength ( void  ) const
inline
Returns
the current default bond length.

Definition at line 503 of file gcp/document.h.

gcp::Document::GetBracketsFontFamily ( void  ) const
inline
Returns
the current brackets font family.

Definition at line 639 of file gcp/document.h.

gcp::Document::GetBracketsFontSize ( void  ) const
inline
Returns
the current brackets font size.

Definition at line 651 of file gcp/document.h.

const gchar* gcp::Document::GetComment ( )
inline
Returns
the comment associated with the document.

Definition at line 249 of file gcp/document.h.

const GDate* gcp::Document::GetCreationDate ( )
inline
Returns
the date at which the document was first created.

Definition at line 233 of file gcp/document.h.

Operation* gcp::Document::GetCurrentOperation ( )
inline
Returns
the current undo/redo operation.

Definition at line 303 of file gcp/document.h.

bool gcp::Document::GetEditable ( )
inline
Returns
true if the document can be edited.

Definition at line 324 of file gcp/document.h.

const gchar* gcp::Document::GetFileName ( ) const
inline
Returns
the current file name, actually the URI.

Definition at line 151 of file gcp/document.h.

GtkWindow* gcp::Document::GetGtkWindow ( )
virtual
Returns
GtkWindow displaying the document if any.

Reimplemented from gcu::Document.

const gchar* gcp::Document::GetLabel ( ) const
Returns
the window title.
const gchar* gcp::Document::GetMail ( )
inline
Returns
the author's e-mail address.

Definition at line 245 of file gcp/document.h.

double gcp::Document::GetMedianBondLength ( )
Returns
the median value of bond lengths. This is used when importing data from a document with a different theme or from an other program to scale the data so that the bond lengths fit the themed bond length.
std::set<std::string>& gcp::Document::GetNewObjects ( )
inline
Returns
the set of objects created during the current operation (such as pasting data). This is used to properly update links such as which bonds correspond to which atoms as the pasted objects might have the same id than already existing objects.

Reimplemented from gcu::Document.

Definition at line 458 of file gcp/document.h.

Operation* gcp::Document::GetNewOperation ( OperationType  type)
Parameters
typethe type of the new undo/redo operation.
Returns
the new operation.
gcp::Document::GetPangoAttrList ( void  ) const
inline
Returns
a PangoAttrList with all the attributes used for atomic symbols display.

Definition at line 606 of file gcp/document.h.

std::string gcp::Document::GetProperty ( unsigned  property) const
virtual
Parameters
propertythe property id as defined in objprops.h

Used when saving to get properties from document.. Supported properties for documents are: GCU_PROP_DOC_FILENAME, GCU_PROP_DOC_MIMETYPE, GCU_PROP_DOC_TITLE, GCU_PROP_DOC_COMMENT, GCU_PROP_DOC_CREATOR, GCU_PROP_DOC_CREATION_TIME, GCU_PROP_DOC_MODIFICATION_TIME, and GCU_PROP_THEME_BOND_LENGTH.

Reimplemented from gcu::Object.

bool gcp::Document::GetReadOnly ( )
inline
Returns
true if the file is read-only or false if it is writeable.

Definition at line 348 of file gcp/document.h.

gcp::Document::GetRefAllowClipboard ( void  )
inline
Returns
whether the document may use the clipboard or not as a reference.

Definition at line 618 of file gcp/document.h.

gcp::Document::GetRefArrowLength ( void  )
inline
Returns
the current default arrow length as a reference.

Definition at line 530 of file gcp/document.h.

gcp::Document::GetRefBondAngle ( void  )
inline
Returns
the current default angle between two consecutive bonds in a chain as a reference.

Definition at line 518 of file gcp/document.h.

gcp::Document::GetRefBondLength ( void  )
inline
Returns
the current default bond length as a reference.

Definition at line 503 of file gcp/document.h.

gcp::Document::GetRefBracketsFontFamily ( void  )
inline
Returns
the current brackets font family as a reference.

Definition at line 639 of file gcp/document.h.

gcp::Document::GetRefBracketsFontSize ( void  )
inline
Returns
the current brackets font size as a reference.

Definition at line 651 of file gcp/document.h.

gcp::Document::GetRefTextFontFamily ( void  )
inline
Returns
the current text font family as a reference.

Definition at line 542 of file gcp/document.h.

gcp::Document::GetRefTextFontSize ( void  )
inline
Returns
the current text font size as a reference.

Definition at line 602 of file gcp/document.h.

gcp::Document::GetRefTextFontStretch ( void  )
inline
Returns
the current text font stretch as a reference.

Definition at line 590 of file gcp/document.h.

gcp::Document::GetRefTextFontStyle ( void  )
inline
Returns
the current text font style as a reference.

Definition at line 554 of file gcp/document.h.

gcp::Document::GetRefTextFontVariant ( void  )
inline
Returns
the current text font variant as a reference.

Definition at line 578 of file gcp/document.h.

gcp::Document::GetRefTextFontWeight ( void  )
inline
Returns
the current text font weight as a reference.

Definition at line 566 of file gcp/document.h.

gcp::Document::GetRefUseAtomColors ( void  )
inline
Returns
whether to use symbolic colors for the atomic symbols as a reference.

Definition at line 665 of file gcp/document.h.

gcu::Residue const* gcp::Document::GetResidue ( char const *  symbol,
bool *  ambiguous = NULL 
)
virtual
Parameters
symbolthe symbol for which a Residue* is searched.
ambiguouswhere to store the boolean telling if the symbol is ambiguous or NULL.

Documents might own not global residues with the samesymbol or name but a different meaning from the standard residue.

Returns
the Residue* found or NULL.

Reimplemented from gcu::Document.

const GDate* gcp::Document::GetRevisionDate ( )
inline
Returns
the last date at which the document was modified.

Definition at line 237 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.

Returns
the GChemPaint API version which last saved the file.

Definition at line 627 of file gcp/document.h.

gcp::Document::GetTextFontFamily ( void  ) const
inline
Returns
the current text font family.

Definition at line 542 of file gcp/document.h.

gcp::Document::GetTextFontSize ( void  ) const
inline
Returns
the current text font size.

Definition at line 602 of file gcp/document.h.

gcp::Document::GetTextFontStretch ( void  ) const
inline
Returns
the current text font stretch.

Definition at line 590 of file gcp/document.h.

gcp::Document::GetTextFontStyle ( void  ) const
inline
Returns
the current text font style.

Definition at line 554 of file gcp/document.h.

gcp::Document::GetTextFontVariant ( void  ) const
inline
Returns
the current text font variant.

Definition at line 578 of file gcp/document.h.

gcp::Document::GetTextFontWeight ( void  ) const
inline
Returns
the current text font weight.

Definition at line 566 of file gcp/document.h.

gcp::Document::GetTheme ( void  ) const
inline
Returns
the theme used by the document.

Definition at line 491 of file gcp/document.h.

const gchar* gcp::Document::GetTitle ( ) const
Returns
the document title.
gcp::Document::GetUseAtomColors ( void  ) const
inline
Returns
whether to use symbolic colors for the atomic symbols.

Definition at line 665 of file gcp/document.h.

View* gcp::Document::GetView ( void  )
inline
Returns
the gcp::View associated with the document.

Definition at line 109 of file gcp/document.h.

GtkWidget* gcp::Document::GetWidget ( )
Returns
the canvas widget where the document is displayed.
gcu::Window* gcp::Document::GetWindow ( )
virtual
Returns
the gcp::Window displaying the document if any.

Reimplemented from gcu::Document.

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.

Returns
y coordinate used for alignment.

Reimplemented from gcu::Object.

virtual bool gcp::Document::Load ( xmlNodePtr  node)
virtual
Parameters
nodethe XML root node for the document.

Loads the document from the XML tree representing it.

Returns
true on success, false otherwise.

Reimplemented from gcu::Object.

void gcp::Document::LoadObjects ( xmlNodePtr  node)
Parameters
nodethe 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
Parameters
Signala SignalId
Childthe child which emitted the signal or NULL

Called when a signal has been emitted by a child. Only OnThemeChangedSignal is relevant for documents.

Returns
false since documents have no parent.

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)
Parameters
xmlthe XML document representing the GChemPaint document being loaded.

Parses the XML tree and creates all objects it represents.

void gcp::Document::PasteData ( xmlNodePtr  node)
Parameters
nodethe XML node representing objects to add to the document.

Adds previously serialized objects from the clipboard to the document. Links can be set only to or from pasted objects.

void gcp::Document::PopOperation ( )

Removes an operation from the udo stack and deletes it.

void gcp::Document::PushOperation ( Operation operation,
bool  undo = true 
)
Parameters
operationthe operation to add.
undowhether to put he operation on the undo or the redo stack.

Adds the current operation to the appropriate task.

void gcp::Document::Remove ( Object *  object)
Parameters
objectthe object to remove.

Removes a child object from the document, and deletes it.

void gcp::Document::Remove ( const char *  Id)
Parameters
Idthe Id of the object to be removed.

Removes a child object from the document, and deletes it.

void gcp::Document::Save ( ) const
virtual

Saves the current file.

Reimplemented from gcu::Document.

void gcp::Document::SaveResidue ( Residue const *  r,
xmlNodePtr  node 
)
Parameters
rthe residue to be saved.
nodethe XML node to which add the saved residue if needed.

GChemPaint saves the meaning of a residue the first time it is encountered, and maintains a list of saved residues to avoid duplicates.

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
Parameters
valwhether the document may use the clipboard or no.

Sets the rights for the document clipbard access.

Definition at line 618 of file gcp/document.h.

gcp::Document::SetArrowLength ( double  val)
inline
Parameters
valthe new default arrow length.

Sets the new default arrow length for the document.

Definition at line 530 of file gcp/document.h.

void gcp::Document::SetAuthor ( const gchar *  author)
Parameters
authorthe new author name.

Setes the document author name.

gcp::Document::SetBondAngle ( double  val)
inline
Parameters
valthe new default bond angle between two consecutive bonds in a chain.

Sets the new default bond angle between two consecutive bonds in a chain for the document.

Definition at line 518 of file gcp/document.h.

gcp::Document::SetBondLength ( double  val)
inline
Parameters
valthe new default bond length.

Sets the new default bond length for the document.

Definition at line 503 of file gcp/document.h.

gcp::Document::SetBracketsFontFamily ( std::string  val)
inline
Parameters
valthe new brackets font family.

Sets the new current brackets font family for the document.

Definition at line 639 of file gcp/document.h.

gcp::Document::SetBracketsFontSize ( int  val)
inline
Parameters
valthe new brackets font size.

Sets the new current text font size for the document.

Definition at line 651 of file gcp/document.h.

void gcp::Document::SetComment ( const gchar *  comment)
Parameters
commentthe new comment.

Sets the comment associated with the document any.

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
Parameters
editablewhether the document might be edited or not

This method is used to lock a document and inhibit any change in it.

Definition at line 320 of file gcp/document.h.

void gcp::Document::SetFileName ( std::string const &  filename,
const gchar *  mime_type 
)
Parameters
filenamethe new file name (URI).
mime_typethe new mime type.

Sets the new file name and its associated mime type.

void gcp::Document::SetLabel ( const gchar *  label)
Parameters
labelthe new window title.

Sets the label to use as window title.

void gcp::Document::SetLoading ( bool  loading)
inline
Parameters
loadingwhether the document is loading data or not.

Used to inhibit undo/redo operation creation when loading.

Definition at line 423 of file gcp/document.h.

void gcp::Document::SetMail ( const gchar *  mail)
Parameters
mailthe new e-mail address.

Sets the document author e-mail address.

bool gcp::Document::SetProperty ( unsigned  property,
char const *  value 
)
virtual
Parameters
propertythe property id as defined in objprops.h
valuethe property value as a string

Used when loading to set properties. Supported properties for documents are: GCU_PROP_DOC_FILENAME, GCU_PROP_DOC_MIMETYPE, GCU_PROP_DOC_TITLE, GCU_PROP_DOC_COMMENT, GCU_PROP_DOC_CREATOR, GCU_PROP_DOC_CREATION_TIME, GCU_PROP_DOC_MODIFICATION_TIME, and GCU_PROP_THEME_BOND_LENGTH.

Reimplemented from gcu::Object.

void gcp::Document::SetReadOnly ( bool  ro)
Parameters
rowhether the file is read-only or not.

If ro is true, the File/Save menu item and corresponding button will be disabled.

gcp::Document::SetTextFontFamily ( gchar *  val)
inline
Parameters
valthe new text font family.

Sets the new current text font family for the document.

Definition at line 542 of file gcp/document.h.

gcp::Document::SetTextFontSize ( gint  val)
inline
Parameters
valthe new text font size.

Sets the new current text font size for the document.

Definition at line 602 of file gcp/document.h.

gcp::Document::SetTextFontStretch ( PangoStretch  val)
inline
Parameters
valthe new text font stretch.

Sets the new current text font stretch for the document.

Definition at line 590 of file gcp/document.h.

gcp::Document::SetTextFontStyle ( PangoStyle  val)
inline
Parameters
valthe new text font style.

Sets the new current text font style for the document.

Definition at line 554 of file gcp/document.h.

gcp::Document::SetTextFontVariant ( PangoVariant  val)
inline
Parameters
valthe new text font variant.

Sets the new current text font variant for the document.

Definition at line 578 of file gcp/document.h.

gcp::Document::SetTextFontWeight ( PangoWeight  val)
inline
Parameters
valthe new text font weight.

Sets the new current text font weight for the document.

Definition at line 566 of file gcp/document.h.

void gcp::Document::SetTheme ( Theme theme)
Parameters
themethe new theme for the document.

Sets the theme to be used by the document. This will not change lengths of existing bonds or size of existing text.

void gcp::Document::SetTitle ( const gchar *  title)
Parameters
titlethe new title.

The document title.

gcp::Document::SetUseAtomColors ( bool  val)
inline
Parameters
valwhether to use symbolic colors for the atomic symbols.

When set, atomic symbols will be displayed using the symbolic colors for the element (when the color is not white, i.e. hydrogen symbol will always be black).

Definition at line 665 of file gcp/document.h.

void gcp::Document::Update ( )

Updates the view for all objects which have been marked as dirty.


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