MythTV  master
mythnotificationcenter.h
Go to the documentation of this file.
1 //
2 // mythnotificationcenter.h
3 // MythTV
4 //
5 // Created by Jean-Yves Avenard on 25/06/13.
6 // Copyright (c) 2013 Bubblestuff Pty Ltd. All rights reserved.
7 //
8 
9 #ifndef __MythTV__mythnotifications__
10 #define __MythTV__mythnotifications__
11 
12 #include <QList>
13 #include <QDateTime>
14 #include <QMutex>
15 
16 #include "mythuiexp.h"
17 
18 #include "mythnotification.h"
19 
20 // .h
21 
22 class MythScreenType;
23 class NCPrivate;
24 
26 {
27 public:
29 
30  static Type kEventType;
31 };
32 
34 {
35 public:
37  virtual ~MythNotificationCenter();
38 
44  bool Queue(const MythNotification &notification);
45 
49  static MythNotificationCenter *GetInstance(void);
50 
60  int Register(void *from);
67  void UnRegister(void *from, int id, bool closeimemdiately = false);
68 
69  /*
70  * OSD drawing utilities
71  */
72 
77  QDateTime ScreenExpiryTime(const MythScreenType *screen);
82  bool ScreenCreated(const MythScreenType *screen);
88  void GetNotificationScreens(QList<MythScreenType*> &screens);
93  void UpdateScreen(MythScreenType *screen);
97  int DisplayedNotifications(void) const;
101  int QueuedNotifications(void) const;
106  bool RemoveFirst(void);
112  void ProcessQueue(void);
113 
114 private:
115  NCPrivate *d {nullptr};
116 };
117 
121 MUI_PUBLIC void ShowNotificationError(const QString &msg,
122  const QString &from = QString(),
123  const QString &detail = QString(),
124  const VNMask visibility = MythNotification::kAll,
126 
127 MUI_PUBLIC void ShowNotification(const QString &msg,
128  const QString &from = QString(),
129  const QString &detail = QString(),
130  const VNMask visibility = MythNotification::kAll,
132 
134  const QString &msg,
135  const QString &origin = QString(),
136  const QString &detail = QString(),
137  const QString &image = QString(),
138  const QString &extra = QString(),
139  const QString &progress_text = QString(),
140  float progress = -1.0F,
141  int duration = -1,
142  bool fullscreen = false,
143  const VNMask visibility = MythNotification::kAll,
145  const QString &style = QString());
146 
147 MUI_PUBLIC void ShowNotification(MythNotification::Type type,
148  const QString &msg,
149  const QString &origin = QString(),
150  const QString &detail = QString(),
151  const QString &image = QString(),
152  const QString &extra = QString(),
153  const QString &progress_text = QString(),
154  float progress = -1.0F,
155  int duration = -1,
156  bool fullscreen = false,
157  const VNMask visibility = MythNotification::kAll,
159  const QString &style = QString());
160 
161 #endif /* defined(__MythTV__mythnotifications__) */
static void error(const char *str,...)
Definition: vbi.c:42
MUI_PUBLIC void ShowNotification(const QString &msg, const QString &from=QString(), const QString &detail=QString(), const VNMask visibility=MythNotification::kAll, const MythNotification::Priority priority=MythNotification::kDefault)
unsigned int VNMask
Priority
Priority enum A notification can be given a priority.
MUI_PUBLIC void ShowNotificationError(const QString &msg, const QString &from=QString(), const QString &detail=QString(), const VNMask visibility=MythNotification::kAll, const MythNotification::Priority priority=MythNotification::kDefault)
convenience utility to display error message as notification
This class is used as a container for messages.
Definition: mythevent.h:16
static const uint16_t * d
#define MUI_PUBLIC
Definition: mythuiexp.h:9
Screen in which all other widgets are contained and rendered.