Go to the documentation of this file.
4 #include <QCoreApplication>
5 #include <QDomDocument>
6 #include <QInputMethodEvent>
42 (QEvent::Type) QEvent::registerEventType();
50 void run(
void)
override
64 m_fullScreen(fullscreen),
72 QString(
"SCREEN_TYPE CREATED %1").arg(name));
76 MythUIType *parent,
const QString &name,
bool fullscreen) :
78 m_fullScreen(fullscreen)
84 QString(
"SCREEN_TYPE CREATED %1").arg(name));
91 QString(
"SCREEN_TYPE DESTROYED %1").arg(objectName()));
245 region = region.united(QRegion(
m_area));
322 QString msg(tr(
"Loading..."));
323 if (!message.isEmpty())
407 bool handled =
false;
411 for (
int i = 0; i < actions.size() && !handled; i++)
413 const QString&
action = actions[i];
426 else if (
action ==
"ESCAPE")
430 else if (
action ==
"MENU")
434 else if (
action.startsWith(
"SYSEVENT"))
457 bool handled =
false;
462 case Qt::RightButton:
490 const QString &
filename, QDomElement &element,
bool showWarnings)
492 if (element.tagName() ==
"area")
499 rectN.
moveLeft((screenArea.width() - rectN.width()) / 2);
502 rectN.
moveTop((screenArea.height() - rectN.height()) / 2);
507 m_area.height() >= screenArea.height());
525 LOG(VB_GENERAL, LOG_ERR,
"ERROR, bad parsing");
547 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 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
static constexpr const char * MYTH_APPNAME_MYTHFRONTEND
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