The Gnome Chemistry Utils
0.14.0
|
#include <gcp/text-object.h>
Public Member Functions | |
TextObject (gcu::TypeId Type) | |
TextObject (double x, double y, gcu::TypeId Type) | |
virtual | ~TextObject () |
void | GetSize (double &x, double &y) |
xmlNodePtr | SaveSelected () |
void | LoadSelected (xmlNodePtr node) |
virtual bool | OnChanged (bool save)=0 |
bool | SaveNode (xmlDocPtr xml, xmlNodePtr node) const |
bool | Load (xmlNodePtr node) |
void | Move (double x, double y, double z=0) |
bool | IsLocked () |
void | GetSelectionBounds (unsigned &start, unsigned &end) |
std::string | GetBuffer () |
virtual std::string | GetProperty (unsigned property) const |
void | SelectionChanged (unsigned start, unsigned end) |
void | TextChanged (unsigned pos) |
gccv::TextTagList | GetTagList (void) |
void | SetEditor (TextEditor *val) |
TextEditor * | GetEditor (void) const |
TextEditor *& | GetRefEditor (void) |
gccv::Text * | GetTextItem (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) |
Object * | GetMolecule () const |
Object * | GetReaction () const |
Object * | GetGroup () const |
Document * | GetDocument () const |
Application * | GetApplication () const |
Object * | GetParentOfType (TypeId Id) const |
Object * | GetChild (const gchar *Id) const |
Object * | GetFirstChild (std::map< std::string, Object * >::iterator &i) |
Object * | GetNextChild (std::map< std::string, Object * >::iterator &i) |
Object * | GetDescendant (const char *Id) const |
Object * | GetParent () const |
void | SetParent (Object *Parent) |
virtual xmlNodePtr | Save (xmlDocPtr xml) const |
virtual bool | GetCoords (double *x, double *y, double *z=NULL) const |
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 Object * | GetAtomAt (double x, double y, double z=0.) |
virtual bool | Build (std::set< Object * > const &Children) throw (std::invalid_argument) |
virtual double | GetYAlign () |
virtual bool | BuildContextualMenu (UIManager *uim, Object *object, double x, double y) |
void | EmitSignal (SignalId Signal) |
virtual bool | OnSignal (SignalId Signal, Object *Child) |
void | Lock (bool state=true) |
Object * | GetFirstLink (std::set< Object * >::iterator &i) |
Object * | GetNextLink (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 bool | SetProperty (unsigned property, char const *value) |
virtual void | OnLoaded () |
void | SetDirty (bool dirty=true) |
virtual void | Clear () |
virtual std::string | Name () |
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 gccv::TextClient | |
TextClient () | |
virtual | ~TextClient () |
virtual void | InterlineChanged (G_GNUC_UNUSED double interline) |
virtual void | JustificationChanged (G_GNUC_UNUSED GtkJustification justification) |
Public Member Functions inherited from gccv::ItemClient | |
ItemClient () | |
virtual | ~ItemClient () |
virtual void | AddItem () |
virtual void | UpdateItem () |
virtual void | SetSelected (int state) |
Item * | GetItem (void) |
Protected Attributes | |
double | m_x |
double | m_y |
double | m_length |
double | m_height |
int | m_ascent |
int | m_InsertOffset |
std::string | m_buf |
bool | m_bLoading |
unsigned | m_StartSel |
unsigned | m_EndSel |
bool | m_RealSave |
gccv::TextTagList | m_TagList |
gccv::Text * | m_TextItem |
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 Object * | CreateObject (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 Dialog * | BuildPropertiesDialog () |
The base class for texts. This class is virtual with one pure virtual method (gcp::TextObject::OnSave).
Definition at line 50 of file text-object.h.
gcp::TextObject::TextObject | ( | gcu::TypeId | Type | ) |
Type | the TypeId of the derived class. |
The default constructor.
gcp::TextObject::TextObject | ( | double | x, |
double | y, | ||
gcu::TypeId | Type | ||
) |
Type | the TypeId of the derived class. |
x | the horizontal poisition. |
y | the vertical poisition. |
Constructs and sets the position of the text object.
|
virtual |
The destructor.
|
inline |
Definition at line 135 of file text-object.h.
References m_buf.
|
inline |
Definition at line 219 of file text-object.h.
|
virtual |
property | the property id as defined in gcu/objprops.h |
Used when saving to get properties from a text object. Only on eproperty is supported: GCU_PROP_TEXT_TEXT
Reimplemented from gcu::Object.
|
inline |
Definition at line 219 of file text-object.h.
|
inline |
start | where to store the start of the selection. |
end | where to store the end of the selection. |
The values set as bounds are in bytes.
Definition at line 131 of file text-object.h.
References m_EndSel, and m_StartSel.
|
inline |
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 in gcp::Text.
Definition at line 78 of file text-object.h.
|
inline |
Definition at line 206 of file text-object.h.
|
inline |
Definition at line 227 of file text-object.h.
|
inline |
This is used because updates are not needed while loading util the whole text has been loaded.
Reimplemented from gcu::Object.
Definition at line 124 of file text-object.h.
References m_bLoading.
|
virtual |
node | the xml node representing the text. |
Loads the position and Id.
Reimplemented from gcu::Object.
Reimplemented in gcp::Fragment, and gcp::Text.
void gcp::TextObject::LoadSelected | ( | xmlNodePtr | node | ) |
node | the xml node representing the text to import. |
Replaces the contents of the text object by what is represented by the node.
|
virtual |
x | the horizontal translation. |
y | the vertical translation. |
z | the depth translation. |
The z variable is not useful.
Reimplemented from gcu::Object.
Reimplemented in gcp::Fragment.
|
pure virtual |
save | whether the text should be saved for undo/redo operations. |
Must be called after any change in the text. This method is pure virtual and must be overloaded in derived classes.
Implemented in gcp::Fragment, and gcp::Text.
bool gcp::TextObject::SaveNode | ( | xmlDocPtr | xml, |
xmlNodePtr | node | ||
) | const |
xml | the xml document. |
node | the node representing the text. |
Saves the position and Id. Called by derived classes when saving if meaningful.
xmlNodePtr gcp::TextObject::SaveSelected | ( | ) |
Saves the selection.
|
virtual |
start | new selection start index. |
end | new selection end index. |
Notifies the client that the selection position has changed.
Implements gccv::TextClient.
|
inline |
val | the text editor associated with the object during edition. |
Associates val with the object during edition.
Definition at line 219 of file text-object.h.
|
virtual |
pos | the new cursor position. |
Notifies the client that the text has been changed.
Implements gccv::TextClient.
|
protected |
The ascent of the text.
Definition at line 172 of file text-object.h.
|
protected |
treu on loading, false otherwise.
Definition at line 184 of file text-object.h.
Referenced by IsLocked().
|
protected |
The text owned byt the object.
Definition at line 180 of file text-object.h.
Referenced by GetBuffer(), and gcp::Text::SetText().
|
protected |
The index in bytes of the end of the selection.
Definition at line 192 of file text-object.h.
Referenced by GetSelectionBounds().
|
protected |
The height of the object in canvas units.
Definition at line 168 of file text-object.h.
Referenced by GetSize(), and gcp::Text::GetSize().
|
protected |
The current insertionposition.
Definition at line 176 of file text-object.h.
|
protected |
The width of the object in canvas units.
Definition at line 164 of file text-object.h.
Referenced by GetSize(), and gcp::Text::GetSize().
|
protected |
Tells whether the Save method is called for the whole text or just the selection.
Definition at line 197 of file text-object.h.
|
protected |
The index in bytes of the start of the selection.
Definition at line 188 of file text-object.h.
Referenced by GetSelectionBounds().
|
protected |
The tags list associated with the object.
Definition at line 206 of file text-object.h.
|
protected |
The canvas text item used to display the object.
Definition at line 227 of file text-object.h.
|
protected |
The horizontal of the object in canvas units.
Definition at line 156 of file text-object.h.
|
protected |
The vertical of the object in canvas units.
Definition at line 160 of file text-object.h.