4 #include <QCoreApplication> 5 #include <QDomDocument> 40 (QEvent::Type) QEvent::registerEventType();
48 void run(
void)
override 78 QString(
"SCREEN_TYPE CREATED %1").arg(
name));
99 QString(
"SCREEN_TYPE CREATED %1").arg(
name));
106 QString(
"SCREEN_TYPE DESTROYED %1").arg(objectName()));
176 bool reachedCurrent =
false;
190 if ((looped || reachedCurrent) &&
195 reachedCurrent =
true;
218 if ((looped || reachedCurrent) &&
223 reachedCurrent =
true;
285 region = region.united(QRegion(
m_Area));
362 QString msg(tr(
"Loading..."));
363 if (!message.isEmpty())
441 bool handled =
false;
445 for (
int i = 0; i < actions.size() && !handled; i++)
447 QString
action = actions[i];
460 else if (
action ==
"ESCAPE")
462 else if (
action ==
"MENU")
464 else if (
action.startsWith(
"SYSEVENT"))
481 bool handled =
false;
514 const QString &filename, QDomElement &element,
bool showWarnings)
516 if (element.tagName() ==
"area")
523 rectN.
moveLeft((screenArea.width() - rectN.width()) / 2);
526 rectN.
moveTop((screenArea.height() - rectN.height()) / 2);
530 if (
m_Area.width() < screenArea.width() ||
531 m_Area.height() < screenArea.height())
556 LOG(VB_GENERAL, LOG_ERR,
"ERROR, bad parsing");
578 LOG(VB_GENERAL, LOG_ERR,
"CreateCopy called on screentype - bad.");
SemaphoreLocker(QSemaphore *lock)
virtual void aboutToShow(void)
void SetMessage(const QString &message)
MythScreenStack * GetScreenStack() const
QString GetHelpText(void) const
virtual void ShowMenu(void)
void start(QRunnable *runnable, QString debugName, int priority=0)
virtual bool keyPressEvent(QKeyEvent *event)
Key event handler.
volatile bool m_IsLoading
bool TranslateKeyPress(const QString &context, QKeyEvent *e, QStringList &actions, bool allowJumps=true)
Get a list of actions for a keypress in the given context.
#define ACTION_SCREENSHOT
All purpose text widget, displays a text string.
virtual bool gestureEvent(MythGestureEvent *event)
Mouse click/movement handler, receives mouse gesture events from the QCoreApplication event loop.
bool IsVisible(bool recurse=false) const
virtual bool Create(void)
bool IsFullscreen(void) const
ScreenLoadTask(MythScreenType &parent)
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
virtual void SetText(const QString &text)
MythPainter * GetMythPainter(void)
MythUIBusyDialog * m_BusyPopup
MythUIType * m_CurrentFocusWidget
MythScreenStack * GetStack(const QString &stackname)
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
bool ScreenShot(int w=0, int h=0, QString filename="")
Gesture gesture(void) const
Get the gesture type.
void ConnectDependants(bool recurse=false)
MythScreenType(MythScreenStack *parent, const QString &name, bool fullscreen=true)
void HandleTVPower(bool poweron)
The base class on which all widgets and screens are based.
void CopyFrom(MythUIType *base) override
Copy this widgets state from another.
void BuildFocusList(void)
bool IsInitialized(void) const
Has Init() been called on this screen?
void AddFocusableChildrenToList(QMap< int, MythUIType * > &focusList)
void LoadInForeground(void)
bool gestureEvent(MythGestureEvent *) override
Mouse click/movement handler, receives mouse gesture events from the QCoreApplication event loop.
MythPainter * GetPainter(void)
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
void SetDeleting(bool deleting)
bool Create(void) override
void SetFullscreen(bool full)
MythScreenType & m_parent
A C++ ripoff of the stroke library for MythTV.
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
virtual bool NextPrevWidgetFocus(bool up_or_down)
QWidget * GetPaintWindow()
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
QMap< int, MythUIType * > m_FocusWidgetList
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
void ReloadInBackground(void)
void moveLeft(const QString &sX)
MythUIType * GetChildAt(const QPoint &p, bool recursive=true, bool focusable=true) const
Return the first MythUIType at the given coordinates.
virtual ~MythScreenType()
void SetBusyPopupMessage(const QString &message)
A custom event that represents a mouse gesture.
#define ACTION_TVPOWEROFF
friend class ScreenLoadTask
MythUIType * GetFocusWidget(void) const
MythMainWindow * GetMythMainWindow(void)
static MThreadPool * globalInstance(void)
virtual void SetArea(const MythRect &rect)
bool keyPressEvent(QKeyEvent *) override
Key event handler.
#define LOG(_MASK_, _LEVEL_, _STRING_)
virtual void aboutToHide(void)
Button GetButton(void) const
void CloseBusyPopup(void)
#define MYTH_APPNAME_MYTHFRONTEND
virtual void PopScreen(MythScreenType *screen=nullptr, bool allowFade=true, bool deleteScreen=true)
MythScreenStack * m_ScreenStack
MythPainter * GetPainter(void) override
virtual void CopyFrom(MythUIType *base)
Copy this widgets state from another.
bool IsEnabled(void) const
bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings) override
Parse the xml definition of this widget setting the state of the object accordingly.
virtual void Init(void)
Used after calling Load() to assign data to widgets and other UI initilisation which is prohibited in...
void CreateCopy(MythUIType *parent) override
Copy the state of this widget to the one given, it must be of the same type.
static MythRect parseRect(const QString &text, bool normalize=true)
virtual void Load(void)
Load data which will ultimately be displayed on-screen or used to determine what appears on-screen (S...
bool SetFocusWidget(MythUIType *widget=nullptr)
void OpenBusyPopup(QString message="")
Screen in which all other widgets are contained and rendered.
void moveTop(const QString &sX)
void ActivateAnimations(MythUIAnimation::Trigger trigger)
bool IsDeleting(void) const
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
void SendSystemEvent(const QString &msg)
virtual bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings)
Parse the xml definition of this widget setting the state of the object accordingly.
QPoint GetPosition() const
void ResetBusyPopup(void)
void LoadInBackground(QString message="")