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_MYTHNOTIFICATIONCENTER_H
10#define MYTHTV_MYTHNOTIFICATIONCENTER_H
11
12#include <QList>
13#include <QDateTime>
14#include <QMutex>
15
16#include "mythuiexp.h"
17
18#include "mythnotification.h"
19
20// .h
21
22class MythScreenType;
23class NCPrivate;
24
26{
27public:
29
30 static const Type kEventType;
31
32 // No implicit copying.
35protected:
38};
39
41{
42public:
45
51 bool Queue(const MythNotification &notification);
52
56 static MythNotificationCenter *GetInstance(void);
57
67 int Register(void *from);
74 void UnRegister(void *from, int id, bool closeimemdiately = false);
75
76 /*
77 * OSD drawing utilities
78 */
79
84 static QDateTime ScreenExpiryTime(const MythScreenType *screen);
89 static bool ScreenCreated(const MythScreenType *screen);
95 void GetNotificationScreens(QList<MythScreenType*> &screens);
100 static void UpdateScreen(MythScreenType *screen);
104 int DisplayedNotifications(void) const;
108 int QueuedNotifications(void) const;
113 bool RemoveFirst(void);
119 void ProcessQueue(void);
120
121private:
122 NCPrivate *d {nullptr}; // NOLINT(readability-identifier-naming)
123};
124
128MUI_PUBLIC void ShowNotificationError(const QString &msg,
129 const QString &from = QString(),
130 const QString &detail = QString(),
131 VNMask visibility = MythNotification::kAll,
133
134MUI_PUBLIC void ShowNotification(const QString &msg,
135 const QString &from = QString(),
136 const QString &detail = QString(),
137 VNMask visibility = MythNotification::kAll,
139
141 const QString &msg,
142 const QString &origin = QString(),
143 const QString &detail = QString(),
144 const QString &image = QString(),
145 const QString &extra = QString(),
146 const QString &progress_text = QString(),
147 float progress = -1.0F,
148 std::chrono::seconds duration = -1s,
149 bool fullscreen = false,
150 VNMask visibility = MythNotification::kAll,
152 const QString &style = QString());
153
154MUI_PUBLIC void ShowNotification(MythNotification::Type type,
155 const QString &msg,
156 const QString &origin = QString(),
157 const QString &detail = QString(),
158 const QString &image = QString(),
159 const QString &extra = QString(),
160 const QString &progress_text = QString(),
161 float progress = -1.0F,
162 std::chrono::seconds duration = -1s,
163 bool fullscreen = false,
164 VNMask visibility = MythNotification::kAll,
166 const QString &style = QString());
167
168#endif /* defined(MYTHTV_MYTHNOTIFICATIONCENTER_H) */
This class is used as a container for messages.
Definition: mythevent.h:17
MythNotificationCenterEvent & operator=(const MythNotificationCenterEvent &other)=default
MythNotificationCenterEvent(MythNotificationCenterEvent &&)=delete
MythNotificationCenterEvent & operator=(MythNotificationCenterEvent &&)=delete
MythNotificationCenterEvent(const MythNotificationCenterEvent &other)=default
Screen in which all other widgets are contained and rendered.
static const iso6937table * d
bool progress
unsigned int VNMask
MUI_PUBLIC void ShowNotificationError(const QString &msg, const QString &from=QString(), const QString &detail=QString(), VNMask visibility=MythNotification::kAll, MythNotification::Priority priority=MythNotification::kDefault)
convenience utility to display error message as notification
MUI_PUBLIC void ShowNotification(const QString &msg, const QString &from=QString(), const QString &detail=QString(), VNMask visibility=MythNotification::kAll, MythNotification::Priority priority=MythNotification::kDefault)
#define MUI_PUBLIC
Definition: mythuiexp.h:9
def error(message)
Definition: smolt.py:409