Go to the documentation of this file.
4 #include <QCoreApplication>
5 #include <QDomDocument>
41 (QEvent::Type) QEvent::registerEventType();
49 void run(
void)
override
73 QString(
"SCREEN_TYPE CREATED %1").
arg(name));
77 MythUIType *parent,
const QString &name,
bool fullscreen) :
86 QString(
"SCREEN_TYPE CREATED %1").
arg(name));
93 QString(
"SCREEN_TYPE DESTROYED %1").
arg(objectName()));
162 bool reachedCurrent =
false;
175 if ((looped || reachedCurrent) &&
180 reachedCurrent =
true;
200 if ((looped || reachedCurrent) &&
205 reachedCurrent =
true;
264 region = region.united(QRegion(
m_area));
341 QString msg(tr(
"Loading..."));
342 if (!message.isEmpty())
420 bool handled =
false;
424 for (
int i = 0; i < actions.size() && !handled; i++)
426 QString
action = actions[i];
439 else if (
action ==
"ESCAPE")
441 else if (
action ==
"MENU")
443 else if (
action.startsWith(
"SYSEVENT"))
458 bool handled =
false;
463 case Qt::RightButton:
491 const QString &
filename, QDomElement &element,
bool showWarnings)
493 if (element.tagName() ==
"area")
500 rectN.
moveLeft((screenArea.width() - rectN.width()) / 2);
503 rectN.
moveTop((screenArea.height() - rectN.height()) / 2);
508 m_area.height() >= screenArea.height());
526 LOG(VB_GENERAL, LOG_ERR,
"ERROR, bad parsing");
548 LOG(VB_GENERAL, LOG_ERR,
"CreateCopy called on screentype - bad.");
virtual bool keyPressEvent(QKeyEvent *event)
Key event handler.
void LoadInBackground(const QString &message="")
QPoint GetPosition() const
void SetBusyPopupMessage(const QString &message)
void AddFocusableChildrenToList(FocusInfoType &focusList)
virtual bool NextPrevWidgetFocus(bool up_or_down)
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
void ConnectDependants(bool recurse=false)
Gesture GetGesture() const
MythUIType * GetChildAt(QPoint p, bool recursive=true, bool focusable=true) const
Return the first MythUIType at the given coordinates.
Qt::MouseButton GetButton() const
MythUIType * m_currentFocusWidget
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
bool Create(void) override
MythScreenType(MythScreenStack *parent, const QString &name, bool fullscreen=true)
virtual bool Create(void)
arg(title).arg(filename).arg(doDelete))
void HandleTVAction(const QString &Action)
virtual void SetArea(const MythRect &rect)
void OpenBusyPopup(const QString &message="")
bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings) override
Parse the xml definition of this widget setting the state of the object accordingly.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Screen in which all other widgets are contained and rendered.
#define MYTH_APPNAME_MYTHFRONTEND
#define ACTION_SCREENSHOT
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
void CopyFrom(MythUIType *base) override
Copy this widgets state from another.
virtual void Load(void)
Load data which will ultimately be displayed on-screen or used to determine what appears on-screen (S...
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
MythScreenType & m_parent
MythUIType * GetFocusWidget(void) const
void moveLeft(const QString &sX)
void ResetBusyPopup(void)
void ActivateAnimations(MythUIAnimation::Trigger trigger)
void ReloadInBackground(void)
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
#define ACTION_TVPOWEROFF
void SendSystemEvent(const QString &msg)
bool IsEnabled(void) const
bool SetFocusWidget(MythUIType *widget=nullptr)
MythPainter * GetPainter(void) override
void BuildFocusList(void)
void moveTop(const QString &sY)
MythUIBusyDialog * m_busyPopup
virtual void CopyFrom(MythUIType *base)
Copy this widgets state from another.
QWidget * GetPaintWindow()
static MythPainter * GetPainter(void)
static MythRect parseRect(const QString &text, bool normalize=true)
virtual void Init(void)
Used after calling Load() to assign data to widgets and other UI initilisation which is prohibited in...
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
FocusInfoType m_focusWidgetList
void LoadInForeground(void)
MythScreenStack * GetScreenStack() const
A C++ ripoff of the stroke library for MythTV.
ScreenLoadTask(MythScreenType &parent)
The base class on which all widgets and screens are based.
~MythScreenType() override
All purpose text widget, displays a text string.
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
void CreateCopy(MythUIType *parent) override
Copy the state of this widget to the one given, it must be of the same type.
friend class ScreenLoadTask
virtual bool gestureEvent(MythGestureEvent *event)
Mouse click/movement handler, receives mouse gesture events from the QCoreApplication event loop.
bool IsDeleting(void) const
SemaphoreLocker(QSemaphore *lock)
virtual void SetText(const QString &text)
volatile bool m_isLoading
void SetMessage(const QString &message)
virtual void PopScreen(MythScreenType *screen=nullptr, bool allowFade=true, bool deleteScreen=true)
virtual void ShowMenu(void)
MythMainWindow * GetMythMainWindow(void)
bool gestureEvent(MythGestureEvent *event) override
Mouse click/movement handler, receives mouse gesture events from the QCoreApplication event loop.
MythScreenStack * GetStack(const QString &Stackname)
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
virtual void aboutToHide(void)
MythScreenStack * m_screenStack
A custom event that represents a mouse gesture.
void SetDeleting(bool deleting)
MythPainter * GetMythPainter(void)
virtual void aboutToShow(void)
virtual bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings)
Parse the xml definition of this widget setting the state of the object accordingly.
static bool ScreenShot(int Width=0, int Height=0, QString Filename="")
static MThreadPool * globalInstance(void)
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
bool IsInitialized(void) const
Has Init() been called on this screen?
bool IsFullscreen(void) const
bool IsVisible(bool recurse=false) const
void CloseBusyPopup(void)
void start(QRunnable *runnable, const QString &debugName, int priority=0)
void SetFullscreen(bool full)
QString GetHelpText(void) const