00001 #ifndef MYTHUI_TEXT_H_
00002 #define MYTHUI_TEXT_H_
00003
00004 #include "mythuitype.h"
00005
00006 #include <qimage.h>
00007
00008
00009 #include "mythuitype.h"
00010
00011 class MythFontProperties;
00012
00013 class MythUIText : public MythUIType
00014 {
00015 public:
00016 MythUIText(MythUIType *parent, const char *name);
00017 MythUIText(const QString &text, const MythFontProperties &font,
00018 QRect displayRect, QRect altDisplayRect,
00019 MythUIType *parent, const char *name);
00020 ~MythUIText();
00021
00022 void SetText(const QString &text);
00023 QString GetText(void);
00024 QString GetDefaultText(void);
00025
00026 void SetFontProperties(const MythFontProperties &fontProps);
00027
00028 void UseAlternateArea(bool useAlt);
00029
00030 void SetJustification(int just);
00031 int GetJustification(void);
00032 void SetCutDown(bool cut);
00033
00034 void SetArea(const QRect &rect);
00035
00036 virtual void Pulse(void);
00037
00038 void CycleColor(QColor startColor, QColor endColor, int numSteps);
00039 void StopCycling();
00040
00041 protected:
00042 virtual void DrawSelf(MythPainter *p, int xoffset, int yoffset,
00043 int alphaMod, QRect clipRect);
00044
00045 virtual bool ParseElement(QDomElement &element);
00046 virtual void CopyFrom(MythUIType *base);
00047 virtual void CreateCopy(MythUIType *parent);
00048 virtual void Finalize(void);
00049
00050 int m_Justification;
00051 QRect m_OrigDisplayRect;
00052 QRect m_AltDisplayRect;
00053
00054 QString m_Message;
00055 QString m_CutMessage;
00056 QString m_DefaultMessage;
00057
00058 bool m_Cutdown;
00059
00060 MythFontProperties* m_Font;
00061
00062 bool m_colorCycling;
00063 QColor m_startColor, m_endColor;
00064 int m_numSteps, m_curStep;
00065 float curR, curG, curB;
00066 float incR, incG, incB;
00067 };
00068
00069 #endif