gcp::Document Class Reference

#include <gcp/document.h>

Inheritance diagram for gcp::Document:

gcu::Document gcu::Printable gcu::Object gcu::DialogOwner gcu::DialogOwner

List of all members.

Public Member Functions

 Document (Application *App, bool StandAlone, Window *window=NULL)
virtual ~Document ()
void Clear ()
GtkWidget * GetWidget ()
View * GetView ()
void BuildBondList (std::list< Bond * > &BondList, gcu::Object const *obj) const
void BuildAtomTable (std::map< std::string, unsigned > &AtomTable, gcu::Object const *obj, unsigned &index) const
void Save () const
virtual bool Load (xmlNodePtr)
void DoPrint (GtkPrintOperation *print, GtkPrintContext *context) const
virtual double GetYAlign ()
GtkWindow * GetGtkWindow ()
bool OnSignal (gcu::SignalId Signal, gcu::Object *Child)
void SetDirty (bool isDirty=true)
bool SetProperty (unsigned property, char const *value)
gcu::Residue const * GetResidue (char const *symbol, bool *ambiguous=NULL)
gcu::ResidueCreateResidue (char const *name, char const *symbol, gcu::Molecule *molecule)
Theme * GetTheme (void)
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)
void SetAllowClipboard (bool val)
bool GetAllowClipboard (void) const
bool & GetRefAllowClipboard (void)


Detailed Description

The document class for GChemPaint.

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


Constructor & Destructor Documentation

gcp::Document::Document ( Application App,
bool  StandAlone,
Window window = NULL 
)

Parameters:
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.
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::Clear (  ) 

Empties a document and reinitialize it.

GtkWidget* gcp::Document::GetWidget (  ) 

Returns:
the canvas widget where the document is displayed.

View* gcp::Document::GetView ( void   )  [inline]

Returns:
the gcp::View associated with the document.

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

void gcp::Document::BuildBondList ( std::list< Bond * > &  BondList,
gcu::Object const *  obj 
) const

Parameters:
@param 

void gcp::Document::BuildAtomTable ( std::map< std::string, unsigned > &  AtomTable,
gcu::Object const *  obj,
unsigned &  index 
) const

Parameters:
 

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

Saves the document. Need to be overloaded by derived class if meaningful. Default implementation doesn't do anything.

Reimplemented from gcu::Document.

virtual bool gcp::Document::Load ( xmlNodePtr  node  )  [virtual]

Parameters:
node a pointer to the xmlNode containing the serialized object.
Used to load an Object in memory. The Object must already exist.

Example:

        std::string str = (const char*)node->name;
        Object* pObject = Object::CreateObject(str, this);
        if (pObject) {
                if (!pObject->Load(node)) delete Object; 
        } else
                cerr << "Warning: unknown object: " << str << endl;

Returns:
true on succes, false otherwise.

Reimplemented from gcu::Object.

void gcp::Document::DoPrint ( GtkPrintOperation *  print,
GtkPrintContext *  context 
) const [virtual]

Parameters:
print a GtkPrintOperation*.
context a GtkPrintContext*.
This is the method doing the real printing. It mustbe overloaded by derived classes and take parameters defined in gcu::Printable into account. Default implementation does not do anything.

Implements gcu::Printable.

virtual double gcp::Document::GetYAlign (  )  [virtual]

Used to retrieve the y coordinate for alignment. The default implementation returns 0.0 and every derived class for which alignment has a meaning should implement this method.

Returns:
y coordinate used for objects alignment.

Reimplemented from gcu::Object.

GtkWindow* gcp::Document::GetGtkWindow (  )  [virtual]

Derived classes need to overload this pure virtual method.

Returns:
the top level GtkWindow containing the document.

Implements gcu::Printable.

bool gcp::Document::OnSignal ( gcu::SignalId  Signal,
gcu::Object Child 
) [virtual]

Parameters:
Signal the appropriate SignalId
Child the child which emitted the signal or NULL
This function is called by the framework when a signal has been emitted for the object. It should not be called by a program; call Object::EmitSignal instead.

Returns:
true if the signal should be propagated to the parent, false otherwise.

Reimplemented from gcu::Object.

void gcp::Document::SetDirty ( bool  dirty = true  ) 

Parameters:
dirty should be true if the object needs some update, false otherwise. For a document, it means that the document has been changed.

Reimplemented from gcu::Object.

bool gcp::Document::SetProperty ( unsigned  property,
char const *  value 
) [virtual]

Parameters:
property the property id as defined in objprops.h
value the property value as a string
Used when loading to set properties to various objects. If the method returns false, the property should be set again later. This might happen if an atom does not exists when one of its bonds is loaded. All classes supporting the mechanism must overload this method.
Returns:
true if the property could be set, or if the property is not relevant, false otherwise.

Reimplemented from gcu::Object.

gcu::Residue const* gcp::Document::GetResidue ( char const *  symbol,
bool *  ambiguous = NULL 
) [virtual]

Parameters:
symbol the symbol for which a Residue* is searched.
ambiguous where 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.

gcu::Residue* gcp::Document::CreateResidue ( char const *  name,
char const *  symbol,
gcu::Molecule molecule 
) [virtual]

Parameters:
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.
Returns:
the new Residue on success or NULL.

Reimplemented from gcu::Document.

gcp::Document::GetTheme ( void   )  [inline]

Returns:
the theme used by the document.

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

gcp::Document::SetBondLength ( double  val  )  [inline]

Parameters:
val the new default bond length.
Sets the new default bond length for the document.

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

gcp::Document::GetBondLength ( void   )  const [inline]

Returns:
the current default bond length.

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

gcp::Document::GetRefBondLength ( void   )  [inline]

Returns:
the current default bond length as a reference.

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

gcp::Document::SetBondAngle ( double  val  )  [inline]

Parameters:
val the 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 259 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 259 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 259 of file gcp/document.h.

gcp::Document::SetArrowLength ( double  val  )  [inline]

Parameters:
val the new default arrow length.
Sets the new default arrow length for the document.

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

gcp::Document::GetArrowLength ( void   )  const [inline]

Returns:
the current default arrow length.

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

gcp::Document::GetRefArrowLength ( void   )  [inline]

Returns:
the current default arrow length as a reference.

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

gcp::Document::SetTextFontFamily ( gchar *  val  )  [inline]

Parameters:
val the new text font family.
Sets the new current text font family for the document.

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

gcp::Document::GetTextFontFamily ( void   )  const [inline]

Returns:
the current text font family.

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

gcp::Document::GetRefTextFontFamily ( void   )  [inline]

Returns:
the current text font family as a reference.

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

gcp::Document::SetTextFontStyle ( PangoStyle  val  )  [inline]

Parameters:
val the new text font style.
Sets the new current text font style for the document.

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

gcp::Document::GetTextFontStyle ( void   )  const [inline]

Returns:
the current text font style.

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

gcp::Document::GetRefTextFontStyle ( void   )  [inline]

Returns:
the current text font style as a reference.

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

gcp::Document::SetTextFontWeight ( PangoWeight  val  )  [inline]

Parameters:
val the new text font weight.
Sets the new current text font weight for the document.

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

gcp::Document::GetTextFontWeight ( void   )  const [inline]

Returns:
the current text font weight.

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

gcp::Document::GetRefTextFontWeight ( void   )  [inline]

Returns:
the current text font weight as a reference.

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

gcp::Document::SetTextFontVariant ( PangoVariant  val  )  [inline]

Parameters:
val the new text font variant.
Sets the new current text font variant for the document.

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

gcp::Document::GetTextFontVariant ( void   )  const [inline]

Returns:
the current text font variant.

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

gcp::Document::GetRefTextFontVariant ( void   )  [inline]

Returns:
the current text font variant as a reference.

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

gcp::Document::SetTextFontStretch ( PangoStretch  val  )  [inline]

Parameters:
val the new text font stretch.
Sets the new current text font stretch for the document.

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

gcp::Document::GetTextFontStretch ( void   )  const [inline]

Returns:
the current text font stretch.

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

gcp::Document::GetRefTextFontStretch ( void   )  [inline]

Returns:
the current text font stretch as a reference.

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

gcp::Document::SetTextFontSize ( gint  val  )  [inline]

Parameters:
val the new text font size.
Sets the new current text font size for the document.

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

gcp::Document::GetTextFontSize ( void   )  const [inline]

Returns:
the current text font size.

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

gcp::Document::GetRefTextFontSize ( void   )  [inline]

Returns:
the current text font size as a reference.

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

gcp::Document::GetPangoAttrList ( void   )  [inline]

Returns:
a PangoAttrList with all the attributes used for atomic symbols display.

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

gcp::Document::SetAllowClipboard ( bool  val  )  [inline]

Parameters:
val whether the document may use the clipboard or no.
Sets the rights for the document clipbard access.

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

gcp::Document::GetAllowClipboard ( void   )  const [inline]

Returns:
whether the document may use the clipboard or not.

Definition at line 359 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 359 of file gcp/document.h.


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

Generated on Sat Aug 23 23:10:07 2008 for The Gnome Chemistry Utils by  doxygen 1.5.6