MythTV  master
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
MythNotificationCenter Class Reference

#include <mythnotificationcenter.h>

Collaboration diagram for MythNotificationCenter:
Collaboration graph
[legend]

Public Member Functions

 MythNotificationCenter (void)
 
virtual ~MythNotificationCenter ()
 
bool Queue (const MythNotification &notification)
 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 MythNotificationCenterGetInstance (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

NCPrivated {nullptr}
 

Detailed Description

Definition at line 40 of file mythnotificationcenter.h.

Constructor & Destructor Documentation

◆ MythNotificationCenter()

MythNotificationCenter::MythNotificationCenter ( void  )

Definition at line 1323 of file mythnotificationcenter.cpp.

◆ ~MythNotificationCenter()

MythNotificationCenter::~MythNotificationCenter ( )
virtual

Definition at line 1335 of file mythnotificationcenter.cpp.

Member Function Documentation

◆ Queue()

bool MythNotificationCenter::Queue ( const MythNotification notification)

◆ GetInstance()

MythNotificationCenter * MythNotificationCenter::GetInstance ( void  )
static

◆ Register()

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()

void MythNotificationCenter::UnRegister ( void *  from,
int  id,
bool  closeimemdiately = false 
)

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().

◆ ScreenExpiryTime()

QDateTime MythNotificationCenter::ScreenExpiryTime ( const MythScreenType screen)
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().

◆ ScreenCreated()

bool MythNotificationCenter::ScreenCreated ( const MythScreenType screen)
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().

◆ GetNotificationScreens()

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().

◆ UpdateScreen()

void MythNotificationCenter::UpdateScreen ( MythScreenType screen)
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().

◆ DisplayedNotifications()

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().

◆ QueuedNotifications()

int MythNotificationCenter::QueuedNotifications ( void  ) const

Returns number of notifications currently queued.

Definition at line 1416 of file mythnotificationcenter.cpp.

◆ RemoveFirst()

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().

◆ ProcessQueue()

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().

Member Data Documentation

◆ d

NCPrivate* MythNotificationCenter::d {nullptr}
private

The documentation for this class was generated from the following files: