Go to the documentation of this file. 1 #ifndef MYTHUI_TYPES_H_
2 #define MYTHUI_TYPES_H_
25 class QInputMethodEvent;
54 { enum : std::uint8_t {MemberFunction =
false, MemberConstFunction =
false}; };
55 template<
class Obj,
typename Ret,
typename... Args>
struct FunctionPointerTest<Ret (Obj::*) (Args...)>
57 template<
class Obj,
typename Ret,
typename... Args>
struct FunctionPointerTest<Ret (Obj::*) (Args...) const>
90 MythUIType(QObject *parent,
const QString &name);
92 virtual void Reset(
void);
95 MythUIType *GetChild(
const QString &name)
const;
96 MythUIType *GetChildAt(QPoint
p,
bool recursive=
true,
97 bool focusable=
true)
const;
98 QList<MythUIType *> *GetAllChildren(
void);
99 QList<MythUIType *> GetAllDescendants(
void);
101 void DeleteChild(
const QString &name);
103 void DeleteAllChildren(
void);
106 bool NeedsRedraw(
void)
const;
107 void ResetNeedsRedraw(
void);
108 void SetRedraw(
void);
113 bool CanTakeFocus(
void)
const;
114 void SetCanTakeFocus(
bool set =
true);
115 void SetFocusOrder(
int order);
118 void SetEnabled(
bool enable);
120 bool MoveToTop(
void);
127 virtual void Pulse(
void);
129 void Draw(
MythPainter *
p,
int xoffset,
int yoffset,
int alphaMod = 255,
130 QRect clipRect = QRect());
134 void SetPosition(
int x,
int y);
135 void SetPosition(QPoint point);
136 virtual void SetPosition(
const MythPoint &point);
137 virtual MythPoint GetPosition(
void)
const;
138 virtual void SetSize(QSize size);
139 virtual void SetMinSize(
const MythPoint &size);
140 virtual QSize GetMinSize(
void)
const;
141 virtual void SetArea(
const MythRect &rect);
142 virtual void AdjustMinArea(
int delta_x,
int delta_y,
143 int delta_w,
int delta_h);
144 virtual void VanishSibling(
void);
147 virtual void SetMinArea(
const MythRect & rect);
148 virtual MythRect GetArea(
void)
const;
149 virtual MythRect GetFullArea(
void)
const;
150 virtual void RecalculateArea(
bool recurse =
true);
151 void ExpandArea(QRect rect);
153 virtual QRegion GetDirtyArea(
void)
const;
155 bool IsVisible(
bool recurse =
false)
const;
156 virtual void SetVisible(
bool visible);
158 void MoveTo(QPoint destXY, QPoint speedXY);
160 void AdjustAlpha(
int mode,
int alphachange,
int minalpha = 0,
162 void SetAlpha(
int newalpha);
163 int GetAlpha(
void)
const;
167 virtual bool keyPressEvent(QKeyEvent *event);
168 virtual bool inputMethodEvent(QInputMethodEvent *event);
179 { m_xmlLocation = QString(
"%1:%2").arg(
filename).arg(where); }
185 bool IsDeferredLoading(
bool recurse =
false)
const;
187 virtual void LoadNow(
void);
189 bool ContainsPoint(QPoint point)
const;
195 void SetZoom(
float zoom);
196 void SetHorizontalZoom(
float zoom);
197 void SetVerticalZoom(
float zoom);
198 void SetAngle(
float angle);
199 void SetDependIsDefault(
bool isDefault);
200 void SetReverseDependence(
MythUIType *dependee,
bool reverse);
201 void SetDependsMap(QMap<QString, QString> dependsMap);
206 void customEvent(QEvent *event)
override;
215 void UpdateDependState(
bool isDefault);
216 void UpdateDependState(
MythUIType *dependee,
bool isDefault);
219 void RequestUpdate();
220 void RequestRegionUpdate(
const QRect &);
223 void VisibilityChanged(
bool Visible);
228 void FinishedMoving();
229 void FinishedFading();
230 void DependChanged(
bool isDefault);
233 virtual void DrawSelf(
MythPainter *
p,
int xoffset,
int yoffset,
234 int alphaMod, QRect clipRect);
237 void HandleAlphaPulse();
238 void HandleMovementPulse();
240 int CalcAlpha(
int alphamod)
const;
242 static int NormX(
int width);
243 static int NormY(
int height);
247 virtual bool ParseElement(
248 const QString &
filename, QDomElement &element,
bool showWarnings);
251 virtual void Finalize(
void);
261 bool m_visible {
true};
262 bool m_hasFocus {
false};
263 bool m_canHaveFocus {
false};
264 bool m_enabled {
true};
265 bool m_enableInitiator {
false};
266 bool m_initiator {
false};
267 bool m_vanish {
false};
268 bool m_vanished {
false};
269 bool m_isDependDefault {
false};
272 int m_focusOrder {0};
278 QRegion m_dirtyRegion {0,0,0,0};
279 bool m_needsRedraw {
false};
283 int m_alphaChangeMode {0};
284 int m_alphaChange {0};
286 int m_alphaMax {255};
288 bool m_moving {
false};
289 QPoint m_xyDestination {0,0};
290 QPoint m_xySpeed {0,0};
303 bool m_deferload {
false};
305 QColor m_borderColor {Qt::black};
void SetXMLLocation(const QString &filename, int where)
Image widget, displays a single image or multiple images in sequence.
QList< MythUIAnimation * > m_animations
A text entry and edit widget.
Screen in which all other widgets are contained and rendered.
QString GetXMLName(void) const
std::function< void(void)> MythUICallbackNMF
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
Q_DECLARE_METATYPE(StandardSetting *)
void(QObject::*)(void) MythUICallbackMF
static void ConnectDependants(MythUIType *parent, QMap< QString, QString > &dependsMap)
QMap< QString, QString > GetDependsMap() const
QString GetXMLLocation(void) const
bool IsEnabled(void) const
void SetHelpText(const QString &text)
void SetPainter(MythPainter *painter)
QList< MythUIType * > m_childrenList
A checkbox widget supporting three check states - on,off,half and two conditions - selected and unsel...
The base class on which all widgets and screens are based.
QList< int > m_dependOperator
All purpose text widget, displays a text string.
QMap< QString, QString > m_dependsMap
void SetXMLName(const QString &name)
QMultiMap< int, MythUIType * > FocusInfoType
void SetDeferLoad(bool defer)
QList< QPair< MythUIType *, bool > > m_dependsValue
QMap< MythUIType *, bool > m_reverseDepend
A widget for offering a range of numerical values where only the the bounding values and interval are...
A custom event that represents a mouse gesture.
void(QObject::*)(void) const MythUICallbackMFc
QList< MythUIAnimation * > * GetAnimations(void)
QString GetHelpText(void) const
Wrapper around QPoint allowing us to handle percentage and other relative values for positioning in m...