00001 #ifndef MYTHSCREEN_STACK_H_
00002 #define MYTHSCREEN_STACK_H_
00003
00004 #include <QVector>
00005 #include <QObject>
00006
00007 #include "mythuiexp.h"
00008
00009 class QString;
00010
00011 class MythScreenType;
00012 class MythMainWindow;
00013 class MythPainter;
00014
00015 class MUI_PUBLIC MythScreenStack : public QObject
00016 {
00017 Q_OBJECT
00018
00019 public:
00020 MythScreenStack(MythMainWindow *parent, const QString &name,
00021 bool main = false);
00022 virtual ~MythScreenStack();
00023
00024 void AddScreen(MythScreenType *screen, bool allowFade = true);
00025 void PopScreen(bool allowFade = true, bool deleteScreen = true);
00026 void PopScreen(MythScreenType *screen, bool allowFade = true,
00027 bool deleteScreen = true);
00028
00029 MythScreenType *GetTopScreen(void) const;
00030
00031 void GetDrawOrder(QVector<MythScreenType *> &screens);
00032 void GetScreenList(QVector<MythScreenType *> &screens);
00033 void ScheduleInitIfNeeded(void);
00034 void AllowReInit(void) { m_DoInit = true; }
00035 int TotalScreens() const;
00036
00037 void DisableEffects(void) { m_DoTransitions = false; }
00038 void EnableEffects(void);
00039
00040 QString GetLocation(bool fullPath) const;
00041
00042 MythPainter *GetPainter(void);
00043
00044 signals:
00045 void topScreenChanged(MythScreenType *screen);
00046
00047 private slots:
00048 void doInit(void);
00049
00050 protected:
00051 void RecalculateDrawOrder(void);
00052 void DoNewFadeTransition();
00053 void CheckNewFadeTransition();
00054 void CheckDeletes(bool force = false);
00055
00056 QVector<MythScreenType *> m_Children;
00057 QVector<MythScreenType *> m_DrawOrder;
00058
00059 MythScreenType *m_topScreen;
00060
00061 bool m_DoTransitions;
00062 bool m_DoInit;
00063 bool m_InitTimerStarted;
00064 bool m_InNewTransition;
00065 MythScreenType *m_newTop;
00066
00067 QVector<MythScreenType *> m_ToDelete;
00068 };
00069
00070 #endif
00071