00001 #ifndef MYTHSCREEN_TYPE_H_
00002 #define MYTHSCREEN_TYPE_H_
00003
00004 #include "mythuitype.h"
00005 #include "mythuitext.h"
00006 #include "mythuiutils.h"
00007
00008 #include <QHash>
00009
00010 class MythScreenStack;
00011 class MythUIBusyDialog;
00012
00019 class MUI_PUBLIC ScreenLoadCompletionEvent : public QEvent
00020 {
00021 public:
00022 ScreenLoadCompletionEvent(const QString &id) :
00023 QEvent(kEventType), m_id(id) { }
00024
00025 QString GetId() { return m_id; }
00026
00027 static Type kEventType;
00028
00029 private:
00030 QString m_id;
00031 };
00032
00039 class MUI_PUBLIC MythScreenType : public MythUIType
00040 {
00041 Q_OBJECT
00042
00043 public:
00044 MythScreenType(MythScreenStack *parent, const QString &name,
00045 bool fullscreen = true);
00046 virtual ~MythScreenType();
00047
00048 virtual bool Create(void);
00049 virtual bool keyPressEvent(QKeyEvent *);
00050 virtual bool gestureEvent(MythGestureEvent *);
00051 virtual void ShowMenu(void);
00052
00053 void doInit(void);
00054 void LoadInForeground(void);
00055 bool IsInitialized(void) const;
00056
00057
00058 bool IsFullscreen(void) const;
00059 void SetFullscreen(bool full);
00060
00061 MythUIType *GetFocusWidget(void) const;
00062 bool SetFocusWidget(MythUIType *widget = NULL);
00063 virtual bool NextPrevWidgetFocus(bool up_or_down);
00064 void BuildFocusList(void);
00065
00066 MythScreenStack *GetScreenStack() const;
00067
00068 virtual void aboutToHide(void);
00069 virtual void aboutToShow(void);
00070
00071 bool IsDeleting(void) const;
00072 void SetDeleting(bool deleting);
00073
00074 bool IsLoading(void) { return m_IsLoading; }
00075 bool IsLoaded(void) { return m_IsLoaded; }
00076
00077 void SetTextFromMap(InfoMap &infoMap);
00078 void ResetMap(InfoMap &infoMap);
00079
00080 virtual MythPainter *GetPainter(void);
00081
00082 public slots:
00083 virtual void Close();
00084
00085 signals:
00086 void Exiting();
00087
00088 protected:
00089
00090 MythScreenType(MythUIType *parent, const QString &name,
00091 bool fullscreen = true);
00092
00093 virtual void CopyFrom(MythUIType *base);
00094 virtual void CreateCopy(MythUIType *parent);
00095 virtual bool ParseElement(
00096 const QString &filename, QDomElement &element, bool showWarnings);
00097
00098 virtual void Load(void);
00099 virtual void Init(void);
00100
00101 void LoadInBackground(QString message = "");
00102 void ReloadInBackground(void);
00103
00104 void OpenBusyPopup(QString message = "");
00105 void CloseBusyPopup(void);
00106 void SetBusyPopupMessage(const QString &message);
00107 void ResetBusyPopup(void);
00108
00109 bool m_FullScreen;
00110 bool m_IsDeleting;
00111 bool m_IsLoading;
00112 bool m_IsLoaded;
00113 bool m_IsInitialized;
00114
00115 MythUIType *m_CurrentFocusWidget;
00116
00117
00118
00119 QMap<int, MythUIType *> m_FocusWidgetList;
00120
00121 MythScreenStack *m_ScreenStack;
00122 MythUIBusyDialog *m_BusyPopup;
00123
00124 QRegion m_SavedMask;
00125
00126 friend class XMLParseBase;
00127 };
00128
00129 #endif