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