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