gcp::Text Class Reference

#include <text.h>

Inheritance diagram for gcp::Text:

gcp::TextObject gcu::Object

List of all members.

Public Member Functions

xmlNodePtr Save (xmlDocPtr xml) const
xmlNodePtr SaveSelection (xmlDocPtr xml) const
bool Load (xmlNodePtr)
void Add (GtkWidget *w) const
void Update (GtkWidget *w) const
void SetSelected (GtkWidget *w, int state)
bool OnChanged (bool save)
void Transform2D (gcu::Matrix2D &m, double x, double y)
void GetSize (double &x, double &y)
double GetYAlign ()
bool SetProperty (unsigned property, char const *value)


Detailed Description

The text objects in GChemPaint, excluding atomic symbols. Using this class to represent chemical objects looses the chemical significance.

Definition at line 41 of file text.h.


Member Function Documentation

xmlNodePtr gcp::Text::Save ( xmlDocPtr  xml  )  const [virtual]

Parameters:
xml the xmlDoc used to save the document.
Used to save the Object to the xmlDoc. Each serializable Object should implement this virtual method.
Returns:
the xmlNode containing the serialized object. The name of the node should be the name of the corresponding type used as first parameter to the Object::AddType method. The default method just saves the id and children.

Reimplemented from gcu::Object.

xmlNodePtr gcp::Text::SaveSelection ( xmlDocPtr  xml  )  const

Parameters:
xml the xmlDoc used for clipboard operations.
Saves the currently selected text. This method is used by the framework when editing the textual object.
Returns:
the xmlNode containing the serialized selection.

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

Parameters:
node the xml node representing the text.
Loads the position and Id.

Reimplemented from gcp::TextObject.

void gcp::Text::Add ( GtkWidget *  w  )  const [virtual]

Parameters:
w the GtkWidget inside which the Object will be displayed.
Used to add a representation of the Object in the widget. This method might be overrided for displayable Object classes unless the application uses another mechanism.

Reimplemented from gcu::Object.

void gcp::Text::Update ( GtkWidget *  w  )  const [virtual]

Parameters:
w the GtkWidget inside which the Object is displayed.
Used to update the representation of the Object in the widget. This method might be overrided for displayable Object classes unless the application uses another mechanism.

Reimplemented from gcu::Object.

void gcp::Text::SetSelected ( GtkWidget *  w,
int  state 
) [virtual]

Parameters:
w the GtkWidget inside which the Object is displayed.
state the selection state of the Object.
Used to set the selection state of the Object inside the widget. The values of state are application dependant and have no default value.

Reimplemented from gcu::Object.

bool gcp::Text::OnChanged ( bool  save  )  [virtual]

Parameters:
save whether the text should be saved for undo/redo operations.
Called after any change in the text.

Implements gcp::TextObject.

void gcp::Text::Transform2D ( gcu::Matrix2D m,
double  x,
double  y 
) [virtual]

Parameters:
m the Matrix2D of the transformation.
x the x component of the center of the transformation.
y the y component of the center of the transformation.
Used to move and/or transform an object. This virtual method must be overrided by Object derived classes for which it makes sense. The base Object class has no coordinates and the default method calls the corresponding method for every child.

Reimplemented from gcu::Object.

void gcp::Text::GetSize ( double &  x,
double &  y 
) [inline]

Parameters:
x the variable to be set to the width value.
y the variable to be set to the height value.
Retrieves the size of the text in canvas coordinates.

Reimplemented from gcp::TextObject.

Definition at line 73 of file text.h.

References gcp::TextObject::m_height, and gcp::TextObject::m_length.

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

Returns:
the y coordinate at half height of a carbon atom symbol if any was present at default size so that all texts and chemicalk symbols will have the same base line when aligned.

Reimplemented from gcu::Object.

bool gcp::Text::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 for the fragment. This method supports GCU_PROP_POS2D, GCU_PROP_TEXT_MARKUP, GCU_PROP_TEXT_TEXT, GCU_PROP_TEXT_ALIGNMENT and GCU_PROP_TEXT_JUSTIFICATION.
Returns:
true if the property could be set, or if the property is not relevant, false otherwise.

Reimplemented from gcu::Object.


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

Generated on Sun Sep 28 22:21:06 2008 for The Gnome Chemistry Utils by  doxygen 1.5.6