00001 #ifndef MYTHUI_EDITBAR_H_
00002 #define MYTHUI_EDITBAR_H_
00003
00004 #include "mythuitype.h"
00005 #include "mythuiimage.h"
00006 #include "mythuishape.h"
00007
00015 class MUI_PUBLIC MythUIEditBar : public MythUIType
00016 {
00017 public:
00018 MythUIEditBar(MythUIType *parent, const QString &name);
00019 ~MythUIEditBar();
00020
00021 void SetTotal(double total);
00022 void SetPosition(double position);
00023 void AddRegion(double start, double end);
00024 void SetTotal(long long total);
00025 void SetPosition(long long position);
00026 void AddRegion(long long start, long long end);
00027 void ClearRegions(void);
00028 void Display(void);
00029 void ReleaseImages(void);
00030
00031 protected:
00032 virtual void CopyFrom(MythUIType *base);
00033 virtual void CreateCopy(MythUIType *parent);
00034 virtual void Finalize(void);
00035
00036 private:
00037
00038 void AddBar(MythUIShape *shape, MythUIImage *image, const QRect &area);
00039 void AddMark(MythUIShape *shape, MythUIImage *image, int start, bool left);
00040 MythUIType* GetNew(MythUIShape *shape, MythUIImage *image);
00041 void CalcInverseRegions(void);
00042 void ClearImages(void);
00043
00044 float m_position;
00045 double m_total;
00046 QList<QPair<float,float> > m_regions;
00047 QList<QPair<float,float> > m_invregions;
00048 QList<MythUIType*> m_images;
00049 };
00050
00051 #endif