25 #ifndef GCHEMPAINT_DOCUMENT_H 26 #define GCHEMPAINT_DOCUMENT_H 38 #include <libxml/tree.h> 105 GtkWidget* GetWidget ();
120 virtual bool Load (xmlNodePtr node);
124 const gchar* GetTitle ()
const;
130 void SetTitle (
const gchar* title);
136 void SetLabel (
const gchar* label);
140 const gchar* GetLabel ()
const;
147 void SetFileName (std::string
const &filename,
const gchar *mime_type);
159 void DoPrint (GtkPrintOperation *print, GtkPrintContext *context,
int page)
const;
165 void AddObject (Object* pObject);
171 void AddAtom (
Atom* pAtom);
177 void AddFragment (
Fragment* pFragment);
184 void AddBond (
Bond* pBond);
190 void ParseXMLTree (xmlDocPtr xml);
195 void LoadObjects (xmlNodePtr node);
201 xmlDocPtr BuildXMLTree ()
const;
211 void Remove (Object*
object);
217 void Remove (
const char* Id);
221 void OnProperties ();
255 void SetAuthor (
const gchar* author);
261 void SetMail (
const gchar* mail);
267 void SetComment (
const gchar* comment);
273 void FinishOperation ();
277 void AbortOperation ();
281 void PopOperation ();
288 void PushOperation (
Operation* operation,
bool undo =
true);
310 void PasteData (xmlNodePtr node);
314 bool CanUndo () {
return m_UndoList.size() > 0;}
320 void SetEditable (
bool editable) {m_bWriteable = editable; m_bUndoRedo =
true;}
338 void ExportImage (std::string
const &filename,
const char* type,
int resolution = -1);
344 void SetReadOnly (
bool ro);
355 virtual double GetYAlign ();
363 GtkWindow *GetGtkWindow ();
370 void SetTheme (
Theme *theme);
385 void SetDirty (
bool isDirty =
true);
390 void OnThemeNamesChanged ();
396 double GetMedianBondLength ();
406 bool SetProperty (
unsigned property,
char const *value);
416 std::string GetProperty (
unsigned property)
const;
431 void SaveResidue (
Residue const *r, xmlNodePtr node);
441 gcu::Residue const *GetResidue (
char const *symbol,
bool *ambiguous = NULL);
461 void RemoveAtom (
Atom* pAtom);
462 void RemoveBond (
Bond* pBond);
463 void RemoveFragment (
Fragment* pFragment);
471 gchar *m_comment, *m_author, *m_mail;
472 bool m_bIsLoading, m_bUndoRedo, m_bReadOnly;
473 std::string m_FileType;
475 GDate CreationDate, RevisionDate;
476 std::list<Operation*> m_UndoList, m_RedoList;
480 unsigned long m_OpID;
481 unsigned m_LastStackSize;
482 std::set<Residue const *> m_SavedResidues;
483 std::map<std::string, gcu::SymbolResidue> m_Residues;
484 std::set <std::string> m_NewObjects;
670 #endif // GCHEMPAINT_DOCUMENT_H
GChemPaint specific C++ classes.
gcu::SignalId OnChangedSignal
#define GCU_RO_PROP(type, member)
gcu::SignalId OnDeleteSignal
void SetEditable(bool editable)
gcu::SignalId OnThemeChangedSignal
const gchar * GetFileName() const
a GChemPaint specific Residue class.
Operation * GetCurrentOperation()
const GDate * GetRevisionDate()
const gchar * GetAuthor()
void SetLoading(bool loading)
const gchar * GetComment()
const GDate * GetCreationDate()
gcp::Application * GetApplication()
#define GCU_PROP(type, member)
std::set< std::string > & GetNewObjects()
GChemPaint application base class.