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