• Main Page
  • Modules
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

C:/Users/David/Documents/QtProjects/visualsc/scdatamodel/textblockattributes.h

Go to the documentation of this file.
00001 #ifndef STATEIDTEXTBLOCKATTRIBUTES_H
00002 #define STATEIDTEXTBLOCKATTRIBUTES_H
00003 
00004 
00005 #include <QList>
00006 #include <QPointF>
00007 #include <QString>
00008 #include <QColor>
00009 #include "iattribute.h"
00010 
00011 #include "scdatamodel_global.h"
00012 #include <QMetaType>
00013 
00014 
00015 
00016 
00021 class SCDATAMODELSHARED_EXPORT  TextAttribute :  public IAttribute
00022 {
00023 public:
00024     TextAttribute(QObject * parent, QString key, QString initValue);
00025     TextAttribute(const TextAttribute& textAttribute);
00026     TextAttribute();
00027 
00028     ~TextAttribute();
00029 
00030     TextAttribute& operator=( const TextAttribute& textAttribute);
00031 
00032     virtual QString asString();
00033 
00034     virtual void    setValue(const QString value)  ;
00035 
00036 private:
00037 
00038     QString _text;
00039 };
00040 
00041 
00042 class SCDATAMODELSHARED_EXPORT  FontFamilyAttribute :  public IAttribute
00043 {
00044 public:
00045     FontFamilyAttribute(QObject * parent, QString key, QString initValue);
00046     FontFamilyAttribute(const FontFamilyAttribute& fontFamilyAttribute);
00047     FontFamilyAttribute();
00048 
00049     ~FontFamilyAttribute();
00050 
00051     FontFamilyAttribute& operator=( const FontFamilyAttribute& fontFamilyAttribute);
00052 
00053     virtual QString asString();
00054 
00055     virtual void    setValue(const QString value)  ;
00056 
00057 private:
00058 
00059     QString _family;
00060 };
00061 
00062 
00063 
00064 class SCDATAMODELSHARED_EXPORT  FontSizeAttribute :  public IAttribute
00065 {
00066 public:
00067     FontSizeAttribute(QObject * parent, QString key, int initValue);
00068     FontSizeAttribute(QObject * parent, QString key, QString initValue);
00069     FontSizeAttribute(const FontSizeAttribute & fontSizeAttribute );
00070     FontSizeAttribute();
00071 
00072     ~FontSizeAttribute();
00073     FontSizeAttribute& operator=(const  FontSizeAttribute& fontSizeAttribute);
00074 
00075     virtual QString asString();
00076     virtual int asInt();
00077     virtual void    setValue(const QString size)  ;
00078     void            setValue(const int v);
00079 
00080 private:
00081 
00082     int _size;
00083 };
00084 
00085 
00086 class SCDATAMODELSHARED_EXPORT  FontColorAttribute :  public IAttribute
00087 {
00088 public:
00089     FontColorAttribute(QObject * parent, QString key, QColor initValue);
00090     FontColorAttribute(const FontColorAttribute& fontColorAttribute );
00091     FontColorAttribute();
00092 
00093     ~FontColorAttribute();
00094     FontColorAttribute& operator=( const FontColorAttribute& fontColorAttribute);
00095 
00096     virtual QString asString();
00097     QColor asQColor();
00098 
00099     /* html font color attribute
00100     color_name  Specifies the text color with a color name (like "red")
00101     hex_number  Specifies the text color with a hex code (like "#ff0000")
00102     rgb_number  Specifies the text color with an rgb code (like "rgb(255,0,0)")
00103     */
00104 
00105     virtual void    setValue(const QString color)  ;
00106     void            setValue(const QColor color);
00107 
00108 private:
00109 
00110     QColor _color;
00111 };
00112 
00113 class SCDATAMODELSHARED_EXPORT  FontBoldAttribute :  public IAttribute
00114 {
00115 public:
00116     FontBoldAttribute(QObject * parent, QString key, bool initValue);
00117     FontBoldAttribute(QObject * parent, QString key, QString initValue);
00118     FontBoldAttribute(const FontBoldAttribute & fontBoldAttribute );
00119     FontBoldAttribute();
00120 
00121     ~FontBoldAttribute();
00122     FontBoldAttribute& operator=(const FontBoldAttribute& fontBoldAttribute);
00123 
00124     virtual QString asString();
00125     bool asBool();
00126 
00127     virtual void    setValue(const QString bold)  ;
00128             void    setValue(const bool bold)  ;
00129 
00130 private:
00131 
00132     bool _bold;
00133 };
00134 
00135 
00136 class SCDATAMODELSHARED_EXPORT  FontUnderlineAttribute :  public IAttribute
00137 {
00138 public:
00139     FontUnderlineAttribute(QObject * parent, QString key, bool initValue);
00140     FontUnderlineAttribute(QObject * parent, QString key, QString initValue);
00141     FontUnderlineAttribute(const FontUnderlineAttribute & fontUnderlineAttribute );
00142     FontUnderlineAttribute();
00143     ~FontUnderlineAttribute();
00144     FontUnderlineAttribute& operator=( const FontUnderlineAttribute& fontUnderlineAttribute);
00145 
00146     virtual QString asString();
00147             bool asBool();
00148 
00149 
00150     virtual void    setValue(const QString underline)  ;
00151             void    setValue(const bool underline)  ;
00152 
00153 private:
00154 
00155     bool _underline;
00156 };
00157 
00158 
00159 
00169 class  SCDATAMODELSHARED_EXPORT TextBlockAttributes: public IAttributeContainer
00170 {
00171 public:
00172 
00173     TextBlockAttributes(QObject * parent, QString key);
00174     TextBlockAttributes( const TextBlockAttributes& ta);
00175     TextBlockAttributes();
00176     ~TextBlockAttributes();
00177 
00178     TextBlockAttributes& operator=( TextBlockAttributes& sa );
00179 
00180 
00181     virtual void setAttributes(const IAttributeContainer& sourceAttrList);
00182 
00183 
00184 
00185 private: // methods
00186 
00187     void initCommon();
00188 };
00189 
00190 
00191 Q_DECLARE_METATYPE(FontFamilyAttribute);
00192 Q_DECLARE_METATYPE(FontSizeAttribute);
00193 Q_DECLARE_METATYPE(FontColorAttribute);
00194 Q_DECLARE_METATYPE(FontBoldAttribute);
00195 Q_DECLARE_METATYPE(FontUnderlineAttribute);
00196 Q_DECLARE_METATYPE(TextBlockAttributes);
00197 
00198 #endif // STATEIDTEXTBLOCKATTRIBUTES_H

Generated on Mon Sep 26 2011 06:59:25 for visualsc by  doxygen 1.7.1