00001 #ifndef MYTHUI_STATETYPE_H_
00002 #define MYTHUI_STATETYPE_H_
00003
00004 #include <qstring.h>
00005 #include <qdatetime.h>
00006 #include <qvaluevector.h>
00007
00008 #include "mythuitype.h"
00009 #include "mythimage.h"
00010
00011
00012
00013 class MythUIStateType : public MythUIType
00014 {
00015 public:
00016 enum StateType { None = 0, Off, Half, Full };
00017
00018 MythUIStateType(MythUIType *parent, const char *name);
00019 ~MythUIStateType();
00020
00021 void SetShowEmpty(bool showempty) { m_ShowEmpty = showempty; }
00022
00023 bool AddImage(const QString &name, MythImage *image);
00024 bool AddImage(StateType type, MythImage *image);
00025
00026 bool AddObject(const QString &name, MythUIType *object);
00027 bool AddObject(StateType type, MythUIType *object);
00028
00029 bool DisplayState(const QString &name);
00030 bool DisplayState(StateType type);
00031
00032 void ClearImages();
00033
00034 protected:
00035 void ClearMaps();
00036
00037 virtual bool ParseElement(QDomElement &element);
00038 virtual void CopyFrom(MythUIType *base);
00039 virtual void CreateCopy(MythUIType *parent);
00040 virtual void Finalize(void);
00041
00042 QMap<QString, MythUIType *> m_ObjectsByName;
00043 QMap<int, MythUIType *> m_ObjectsByState;
00044
00045 MythUIType *m_CurrentState;
00046
00047 bool m_ShowEmpty;
00048 };
00049
00050 #endif