25 #ifndef GCHEMPAINT_DOCUMENT_H 26 #define GCHEMPAINT_DOCUMENT_H 38 #include <libxml/tree.h> 105 GtkWidget* GetWidget ();
110 View const*GetView ()
const {
return m_pView;}
121 virtual bool Load (xmlNodePtr node);
125 const gchar* GetTitle ()
const;
131 void SetTitle (
const gchar* title);
137 void SetLabel (
const gchar* label);
141 const gchar* GetLabel ()
const;
148 void SetFileName (std::string
const &filename,
const gchar *mime_type);
160 void DoPrint (GtkPrintOperation *print, GtkPrintContext *context,
int page)
const;
166 void AddObject (Object* pObject);
172 void AddAtom (
Atom* pAtom);
178 void AddFragment (
Fragment* pFragment);
185 void AddBond (
Bond* pBond);
191 void ParseXMLTree (xmlDocPtr xml);
196 void LoadObjects (xmlNodePtr node);
202 xmlDocPtr BuildXMLTree ()
const;
212 void Remove (Object*
object);
218 void Remove (
const char* Id);
222 void OnProperties ();
256 void SetAuthor (
const gchar* author);
262 void SetMail (
const gchar* mail);
268 void SetComment (
const gchar* comment);
274 void FinishOperation ();
278 void AbortOperation ();
282 void PopOperation ();
289 void PushOperation (
Operation* operation,
bool undo =
true);
311 void PasteData (xmlNodePtr node);
315 bool CanUndo () {
return m_UndoList.size() > 0;}
321 void SetEditable (
bool editable) {m_bWriteable = editable; m_bUndoRedo =
true;}
339 void ExportImage (std::string
const &filename,
const char* type,
int resolution = -1);
345 void SetReadOnly (
bool ro);
356 virtual double GetYAlign ();
364 GtkWindow *GetGtkWindow ();
371 void SetTheme (
Theme *theme);
386 void SetDirty (
bool isDirty =
true);
391 void OnThemeNamesChanged ();
397 double GetMedianBondLength ();
407 bool SetProperty (
unsigned property,
char const *value);
417 std::string GetProperty (
unsigned property)
const;
432 void SaveResidue (
Residue const *r, xmlNodePtr node);
442 gcu::Residue const *GetResidue (
char const *symbol,
bool *ambiguous = NULL);
462 void RemoveAtom (
Atom* pAtom);
463 void RemoveBond (
Bond* pBond);
464 void RemoveFragment (
Fragment* pFragment);
472 gchar *m_comment, *m_author, *m_mail;
473 bool m_bIsLoading, m_bUndoRedo, m_bReadOnly;
474 std::string m_FileType;
476 GDate CreationDate, RevisionDate;
477 std::list<Operation*> m_UndoList, m_RedoList;
481 unsigned long m_OpID;
482 unsigned m_LastStackSize;
483 std::set<Residue const *> m_SavedResidues;
484 std::map<std::string, gcu::SymbolResidue> m_Residues;
485 std::set <std::string> m_NewObjects;
671 #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.