MythTV
master
|
#include <mythnotificationcenter.h>
Public Member Functions | |
MythNotificationCenter (void) | |
virtual | ~MythNotificationCenter () |
bool | Queue (const MythNotification ¬ification) |
Queue a notification Queue() is thread-safe and can be called from anywhere. More... | |
int | Register (void *from) |
An application can register in which case it will be assigned a reusable screen, which can be modified or updated Register takes a pointer of the client registering. More... | |
void | UnRegister (void *from, int id, bool closeimemdiately=false) |
Unregister the client. More... | |
void | GetNotificationScreens (QList< MythScreenType * > &screens) |
Return the list of notification screens being currently displayed. More... | |
int | DisplayedNotifications (void) const |
Returns number of notifications currently displayed. More... | |
int | QueuedNotifications (void) const |
Returns number of notifications currently queued. More... | |
bool | RemoveFirst (void) |
Will remove the oldest notification from the stack return true if a screen was removed; or false if nothing was done. More... | |
void | ProcessQueue (void) |
ProcessQueue will be called by the GUI event handler and will process all queued MythNotifications and delete screens marked to be deleted ProcessQueue must be called from GUI thread. More... | |
Static Public Member Functions | |
static MythNotificationCenter * | GetInstance (void) |
returns the MythNotificationCenter singleton More... | |
static QDateTime | ScreenExpiryTime (const MythScreenType *screen) |
Return when the given screen is going to expire will return an invalid QDateTime if screen isn't a MythNotificationScreen. More... | |
static bool | ScreenCreated (const MythScreenType *screen) |
Return true if ::Create() has been called on screen. More... | |
static void | UpdateScreen (MythScreenType *screen) |
Will call ::doInit() if the screen is a MythNotificationScreen and ::Create() has been called for it already. More... | |
Private Attributes | |
NCPrivate * | d {nullptr} |
Definition at line 40 of file mythnotificationcenter.h.
MythNotificationCenter::MythNotificationCenter | ( | void | ) |
Definition at line 1323 of file mythnotificationcenter.cpp.
|
virtual |
Definition at line 1335 of file mythnotificationcenter.cpp.
bool MythNotificationCenter::Queue | ( | const MythNotification & | notification | ) |
Queue a notification Queue() is thread-safe and can be called from anywhere.
Typical use would be GetNotificationCenter()->Queue(notification)
Definition at line 1349 of file mythnotificationcenter.cpp.
Referenced by VideoDialog::createFetchDialog(), EditMetadataDialog::customEvent(), GameUI::customEvent(), MythMainWindow::customEvent(), VideoDialog::customEvent(), TV::customEvent(), MusicPlayer::customEvent(), MetadataOptions::customEvent(), MythRAOPDevice::deleteClient(), MythAirplayServer::deleteConnection(), VideoDialog::dismissFetchDialog(), MythAirplayServer::HandleResponse(), MythContextPrivate::HideConnectionFailurePopup(), MythMainWindow::Init(), MythRAOPDevice::newRaopConnection(), EditMetadataDialog::OnArtworkSearchDone(), MetadataOptions::OnArtworkSearchDone(), MusicPlayer::play(), NetworkControl::processNotification(), MythRAOPConnection::SendNotification(), MusicPlayer::sendNotification(), MythContextPrivate::ShowConnectionFailurePopup(), and ShowNotification().
|
static |
returns the MythNotificationCenter singleton
Definition at line 1318 of file mythnotificationcenter.cpp.
Referenced by MythMainWindow::customEvent(), TV::customEvent(), MythMainWindow::ExitToMainMenu(), and ShowNotification().
int MythNotificationCenter::Register | ( | void * | from | ) |
An application can register in which case it will be assigned a reusable screen, which can be modified or updated Register takes a pointer of the client registering.
This is used to make sure a registered Id can only be used by the client who registered for it. Returns a unique Id that can be provided with a MythNotification Return -1 is case of error
Definition at line 1368 of file mythnotificationcenter.cpp.
Referenced by VideoDialog::createFetchDialog(), MythContextPrivate::event(), MythAirplayServer::HandleResponse(), and MythRAOPConnection::MythRAOPConnection().
Unregister the client.
If the notification had set a duration, the screen will be left to laps, unless forcedisconnect is set; in which case the screen will be closed immediately.
Definition at line 1373 of file mythnotificationcenter.cpp.
Referenced by VideoDialog::dismissFetchDialog(), MythAirplayServer::StopSession(), AirplayConnection::UnRegister(), MusicPlayer::~MusicPlayer(), and MythContextPrivate::~MythContextPrivate().
|
static |
Return when the given screen is going to expire will return an invalid QDateTime if screen isn't a MythNotificationScreen.
Definition at line 1378 of file mythnotificationcenter.cpp.
Referenced by OSD::Draw().
|
static |
Return true if ::Create() has been called on screen.
will always return true should screen not be a MythNotificationScreen
Definition at line 1386 of file mythnotificationcenter.cpp.
Referenced by OSD::Draw().
void MythNotificationCenter::GetNotificationScreens | ( | QList< MythScreenType * > & | screens | ) |
Return the list of notification screens being currently displayed.
The list contains pointer of existing screen's copies, with ::Create() not called yet.
Definition at line 1394 of file mythnotificationcenter.cpp.
Referenced by OSD::Draw().
|
static |
Will call ::doInit() if the screen is a MythNotificationScreen and ::Create() has been called for it already.
Definition at line 1399 of file mythnotificationcenter.cpp.
Referenced by OSD::Draw().
int MythNotificationCenter::DisplayedNotifications | ( | void | ) | const |
Returns number of notifications currently displayed.
Definition at line 1411 of file mythnotificationcenter.cpp.
Referenced by MythMainWindow::ExitToMainMenu(), and OSD::IsOSDVisible().
int MythNotificationCenter::QueuedNotifications | ( | void | ) | const |
Returns number of notifications currently queued.
Definition at line 1416 of file mythnotificationcenter.cpp.
bool MythNotificationCenter::RemoveFirst | ( | void | ) |
Will remove the oldest notification from the stack return true if a screen was removed; or false if nothing was done.
Definition at line 1421 of file mythnotificationcenter.cpp.
Referenced by OSD::HideAll().
void MythNotificationCenter::ProcessQueue | ( | void | ) |
ProcessQueue will be called by the GUI event handler and will process all queued MythNotifications and delete screens marked to be deleted ProcessQueue must be called from GUI thread.
Definition at line 1354 of file mythnotificationcenter.cpp.
Referenced by MythMainWindow::customEvent().
|
private |
Definition at line 122 of file mythnotificationcenter.h.
Referenced by DisplayedNotifications(), GetNotificationScreens(), ProcessQueue(), Queue(), QueuedNotifications(), Register(), RemoveFirst(), UnRegister(), and ~MythNotificationCenter().