Go to the documentation of this file.
4 #include <QCoreApplication>
5 #include <QDomDocument>
6 #include <QInputMethodEvent>
43 (QEvent::Type) QEvent::registerEventType();
51 void run(
void)
override
65 m_fullScreen(fullscreen),
73 QString(
"SCREEN_TYPE CREATED %1").arg(name));
77 MythUIType *parent,
const QString &name,
bool fullscreen) :
79 m_fullScreen(fullscreen)
85 QString(
"SCREEN_TYPE CREATED %1").arg(name));
92 QString(
"SCREEN_TYPE DESTROYED %1").arg(objectName()));
246 region = region.united(QRegion(
m_area));
323 QString msg(tr(
"Loading..."));
324 if (!message.isEmpty())
408 bool handled =
false;
412 for (
int i = 0; i < actions.size() && !handled; i++)
414 const QString&
action = actions[i];
427 else if (
action ==
"ESCAPE")
431 else if (
action ==
"MENU")
435 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)
static constexpr const char * MYTH_APPNAME_MYTHFRONTEND
virtual bool inputMethodEvent(QInputMethodEvent *event)
Input Method event handler.
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
static constexpr const char * ACTION_SCREENSHOT
MythUIType * m_currentFocusWidget
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
bool Create(void) override
virtual bool Create(void)
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.
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.
static constexpr const char * ACTION_TVPOWERON
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...
static constexpr const char * ACTION_TVPOWEROFF
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
bool inputMethodEvent(QInputMethodEvent *event) override
Input Method event handler.
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 IsExitingToMain() const
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
friend class MythScreenType
static const Type kEventType
void CloseBusyPopup(void)
void start(QRunnable *runnable, const QString &debugName, int priority=0)
void SetFullscreen(bool full)
QString GetHelpText(void) const