kivio
kivio_text_style.h
00001 #ifndef KIVIO_TEXT_STYLE_H 00002 #define KIVIO_TEXT_STYLE_H 00003 00004 #ifdef HAVE_CONFIG_H 00005 #include <config.h> 00006 #endif 00007 00008 #include <qfont.h> 00009 00010 class QDomDocument; 00011 class QPainter; 00012 00013 00014 class KivioTextStyle 00015 { 00016 protected: 00017 QString m_text; // The text inside this shape 00018 QColor m_color; // The text color 00019 QFont m_font; // The text font 00020 bool m_isHtml; // Is the text HTML formatted? 00021 int m_hTextAlign, m_vTextAlign; // Horizontal and vertical text alignment flags 00022 00023 public: 00024 KivioTextStyle(); 00025 virtual ~KivioTextStyle(); 00026 00027 QDomElement saveXML( QDomDocument & ); 00028 bool loadXML( const QDomElement & ); 00029 00030 void copyInto( KivioTextStyle * ); 00031 00032 00033 00034 00035 inline QString text() { return m_text; } 00036 inline void setText( QString s ) { m_text=s; } 00037 00038 inline QColor color() { return m_color; } 00039 inline void setColor( QColor c ) { m_color=c; } 00040 00041 inline QFont font() { return m_font; } 00042 inline void setFont( QFont f ) { m_font=f; } 00043 00044 inline bool isHtml() { return m_isHtml; } 00045 inline void setIsHtml( bool b ) { m_isHtml=b; } 00046 00047 inline int hTextAlign() { return m_hTextAlign; } 00048 inline void setHTextAlign(int i) { m_hTextAlign=i; } 00049 00050 inline int vTextAlign() { return m_vTextAlign; } 00051 inline void setVTextAlign(int i) { m_vTextAlign=i; } 00052 00053 }; 00054 00055 #endif 00056