MythTV  master
mythmainwindowprivate.h
Go to the documentation of this file.
1 #ifndef MYTHMAINWINDOWPRIVATE_H
2 #define MYTHMAINWINDOWPRIVATE_H
3 
4 // MythTV
5 #include "mythconfig.h"
6 #include "mythmainwindow.h"
7 #include "mythgesture.h"
8 
9 class MythScreenStack;
10 class MythSignalingTimer;
11 class MythThemeBase;
12 class MythUDPListener;
13 class MythMediaDevice;
14 
16 {
17  public:
18  void AddMapping(int key, const QString& action)
19  {
20  m_actionMap[key].append(action);
21  }
22 
23  bool GetMapping(int key, QStringList &actions)
24  {
25  if (m_actionMap.count(key) > 0)
26  {
27  actions += m_actionMap[key];
28  return true;
29  }
30  return false;
31  }
32 
33  QMap<int, QStringList> m_actionMap;
34 };
35 
36 // Adding member initializers caused compilation to fail with an error
37 // that it cannot convert a brace-enclosed initializer list to JumpData.
38 // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init)
39 struct JumpData
40 {
41  void (*m_callback)(void);
42  QString m_destination;
43  QString m_description;
45  QString m_localAction;
46 };
47 
48 using MythMediaCallback = QPair<QString, MediaPlayCallback>;
49 
51 {
52  friend class MythMainWindow;
53 
54  protected:
55  MythMainWindowPrivate() = default;
56 
57  static int TranslateKeyNum(QKeyEvent *Event);
58 
59  float m_wmult { 1.0F };
60  float m_hmult { 1.0F };
61  QRect m_screenRect;
63  bool m_doesFillScreen { false };
64  bool m_exitingtomain { false };
65  bool m_popwindows { false };
67  bool m_useDB { true };
68 
69  QHash<QString, KeyContext *> m_keyContexts;
70  QMap<int, JumpData*> m_jumpMap;
71  QMap<QString, JumpData> m_destinationMap;
72  QMap<QString, MythMediaCallback> m_mediaPluginMap;
73  QHash<QString, QHash<QString, QString> > m_actionText;
74 
75  void (*m_exitMenuCallback)(void) { nullptr };
76  void (*m_exitMenuMediaDeviceCallback)(MythMediaDevice* mediadevice) { nullptr };
78 
79  int m_escapekey { 0 };
82  QVector<MythScreenStack *> m_stackList;
85  QTimer *m_gestureTimer { nullptr };
86  QTimer *m_hideMouseTimer { nullptr };
89  bool m_drawEnabled { true };
90  MythThemeBase *m_themeBase { nullptr };
93  QTimer *m_idleTimer { nullptr };
94  int m_idleTime { 0 };
95  bool m_standby { false };
96  bool m_enteringStandby { false };
97  bool m_disableIdle { false };
98  bool m_allowInput { true };
99  bool m_pendingUpdate { false };
100  // window aspect
101  bool m_firstinit { true };
102  // Support for long press
104  ulong m_longPressTime { 0 };
105 };
106 #endif
MythMainWindowPrivate::m_mediaDeviceForCallback
MythMediaDevice * m_mediaDeviceForCallback
Definition: mythmainwindowprivate.h:77
MythMainWindowPrivate::m_pendingUpdate
bool m_pendingUpdate
Definition: mythmainwindowprivate.h:99
MythMainWindowPrivate::m_udpListener
MythUDPListener * m_udpListener
Definition: mythmainwindowprivate.h:91
MythMainWindowPrivate::m_longPressKeyCode
int m_longPressKeyCode
Definition: mythmainwindowprivate.h:103
MythMainWindowPrivate::m_wmult
float m_wmult
Definition: mythmainwindowprivate.h:59
MythMainWindowPrivate::m_idleTime
int m_idleTime
Definition: mythmainwindowprivate.h:94
MythMainWindowPrivate::m_gestureTimer
QTimer * m_gestureTimer
Definition: mythmainwindowprivate.h:85
MythMainWindowPrivate::m_useDB
bool m_useDB
To allow or prevent database access.
Definition: mythmainwindowprivate.h:67
MythMainWindowPrivate::m_disableIdle
bool m_disableIdle
Definition: mythmainwindowprivate.h:97
MythMainWindowPrivate::m_stackList
QVector< MythScreenStack * > m_stackList
Definition: mythmainwindowprivate.h:82
MythScreenStack
Definition: mythscreenstack.h:16
MythMainWindowPrivate::m_popwindows
bool m_popwindows
Definition: mythmainwindowprivate.h:65
MythMainWindowPrivate::m_exitingtomain
bool m_exitingtomain
Definition: mythmainwindowprivate.h:64
MythMainWindowPrivate::m_exitMenuMediaDeviceCallback
void(* m_exitMenuMediaDeviceCallback)(MythMediaDevice *mediadevice)
Definition: mythmainwindowprivate.h:76
MythMainWindowPrivate::m_screenRect
QRect m_screenRect
Definition: mythmainwindowprivate.h:61
MythMainWindowPrivate::m_mediaPluginMap
QMap< QString, MythMediaCallback > m_mediaPluginMap
Definition: mythmainwindowprivate.h:72
MythMainWindowPrivate::m_actionText
QHash< QString, QHash< QString, QString > > m_actionText
Definition: mythmainwindowprivate.h:73
MythMainWindowPrivate::m_hmult
float m_hmult
Definition: mythmainwindowprivate.h:60
MythMainWindowPrivate::m_hideMouseTimer
QTimer * m_hideMouseTimer
Definition: mythmainwindowprivate.h:86
JumpData::m_localAction
QString m_localAction
Definition: mythmainwindowprivate.h:45
MythMainWindowPrivate::TranslateKeyNum
static int TranslateKeyNum(QKeyEvent *Event)
Definition: mythmainwindowprivate.cpp:8
MythGesture
Contains the points in a stroke, and translates them into gestures.
Definition: mythgesture.h:147
MythThemeBase
Definition: myththemebase.h:9
MythMainWindowPrivate::m_exitMenuCallback
void(* m_exitMenuCallback)(void)
Definition: mythmainwindowprivate.h:75
KeyContext::GetMapping
bool GetMapping(int key, QStringList &actions)
Definition: mythmainwindowprivate.h:23
MythMainWindowPrivate
Definition: mythmainwindowprivate.h:51
MythMainWindowPrivate::m_longPressTime
ulong m_longPressTime
Definition: mythmainwindowprivate.h:104
MythMainWindowPrivate::m_themeBase
MythThemeBase * m_themeBase
Definition: mythmainwindowprivate.h:90
MythMainWindowPrivate::m_destinationMap
QMap< QString, JumpData > m_destinationMap
Definition: mythmainwindowprivate.h:71
Event
Event details.
Definition: zmdefines.h:27
MythMainWindowPrivate::m_drawDisabledDepth
uint m_drawDisabledDepth
Definition: mythmainwindowprivate.h:88
MythMainWindowPrivate::m_keyContexts
QHash< QString, KeyContext * > m_keyContexts
Definition: mythmainwindowprivate.h:69
MythMainWindowPrivate::m_idleTimer
QTimer * m_idleTimer
Definition: mythmainwindowprivate.h:93
MythMainWindowPrivate::m_drawDisableLock
QMutex m_drawDisableLock
Definition: mythmainwindowprivate.h:87
JumpData::m_destination
QString m_destination
Definition: mythmainwindowprivate.h:42
MythMainWindowPrivate::m_escapekey
int m_escapekey
Definition: mythmainwindowprivate.h:79
MythUDPListener
Definition: mythudplistener.h:13
JumpData
Definition: mythmainwindowprivate.h:40
MythMainWindowPrivate::m_drawInterval
int m_drawInterval
Definition: mythmainwindowprivate.h:80
uint
unsigned int uint
Definition: compat.h:140
MythMainWindowPrivate::m_drawEnabled
bool m_drawEnabled
Definition: mythmainwindowprivate.h:89
mythgesture.h
A C++ ripoff of the stroke library for MythTV.
MythMainWindowPrivate::m_enteringStandby
bool m_enteringStandby
Definition: mythmainwindowprivate.h:96
MythMainWindowPrivate::MythMainWindowPrivate
MythMainWindowPrivate()=default
JumpData::m_description
QString m_description
Definition: mythmainwindowprivate.h:43
JumpData::m_exittomain
bool m_exittomain
Definition: mythmainwindowprivate.h:44
MythMediaCallback
QPair< QString, MediaPlayCallback > MythMediaCallback
Definition: mythmainwindowprivate.h:48
MythMainWindowPrivate::m_allowInput
bool m_allowInput
Definition: mythmainwindowprivate.h:98
MythMainWindow::drawRefresh
@ drawRefresh
Definition: mythmainwindow.h:40
build_compdb.action
action
Definition: build_compdb.py:9
MythMainWindowPrivate::m_jumpMap
QMap< int, JumpData * > m_jumpMap
Definition: mythmainwindowprivate.h:70
MythMainWindowPrivate::m_gesture
MythGesture m_gesture
Definition: mythmainwindowprivate.h:84
MythMainWindowPrivate::m_firstinit
bool m_firstinit
Definition: mythmainwindowprivate.h:101
KeyContext
Definition: mythmainwindowprivate.h:16
MythMediaDevice
Definition: mythmedia.h:49
KeyContext::m_actionMap
QMap< int, QStringList > m_actionMap
Definition: mythmainwindowprivate.h:33
MythMainWindowPrivate::m_drawTimer
MythSignalingTimer * m_drawTimer
Definition: mythmainwindowprivate.h:81
JumpData::m_callback
void(* m_callback)(void)
Definition: mythmainwindowprivate.h:41
MythNotificationCenter
Definition: mythnotificationcenter.h:34
MythMainWindowPrivate::m_mainStack
MythScreenStack * m_mainStack
Definition: mythmainwindowprivate.h:83
mythmainwindow.h
MythMainWindowPrivate::m_standby
bool m_standby
Definition: mythmainwindowprivate.h:95
MythMainWindowPrivate::m_doesFillScreen
bool m_doesFillScreen
Definition: mythmainwindowprivate.h:63
MythSignalingTimer
Definition: mythsignalingtimer.h:21
KeyContext::AddMapping
void AddMapping(int key, const QString &action)
Definition: mythmainwindowprivate.h:18
MythMainWindowPrivate::m_nc
MythNotificationCenter * m_nc
Definition: mythmainwindowprivate.h:92
MythMainWindow
Definition: mythmainwindow.h:33
MythMainWindowPrivate::m_uiScreenRect
QRect m_uiScreenRect
Definition: mythmainwindowprivate.h:62