gcp/text.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef GCHEMPAINT_TEXT_H
00026 #define GCHEMPAINT_TEXT_H
00027
00028 #include <gccv/item-client.h>
00029 #include <gcu/macros.h>
00030 #include <gcu/object.h>
00031 #include <libxml/tree.h>
00032 #include <gtk/gtk.h>
00033 #include "text-object.h"
00034
00036 namespace gcp {
00037
00042 class Text: public TextObject, public gccv::ItemClient
00043 {
00044 public:
00048 Text ();
00055 Text (double x, double y);
00059 virtual ~Text ();
00060
00067 void GetCoords (double *x, double *y);
00074 void SetCoords (double x, double y);
00079 xmlNodePtr Save (xmlDocPtr xml) const;
00087 xmlNodePtr SaveSelection (xmlDocPtr xml) const;
00093 bool Load (xmlNodePtr node);
00100 bool LoadSelection (xmlNodePtr node, unsigned pos);
00111 bool LoadNode (xmlNodePtr node, unsigned &pos, int level = 0, int cur_size = 0);
00115 void AddItem ();
00119 void UpdateItem ();
00127 void SetSelected (int state);
00133 bool OnChanged (bool save);
00143 void Transform2D (gcu::Matrix2D& m, double x, double y);
00151 bool OnEvent (GdkEvent *event);
00158 void GetSize (double& x, double& y) {x = m_length; y = m_height;}
00164 double GetYAlign ();
00171 void SetText (char const *text) {m_buf = text;}
00181 bool SetProperty (unsigned property, char const *value);
00182
00194 GCU_PROP (PangoAlignment, Align)
00206 GCU_PROP (bool, Justified)
00220 GCU_PROP (GtkAnchorType, Anchor)
00221 };
00222
00223 }
00224
00225 #endif //GCHEMPAINT_TEXT_H