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 33 of file mythnotificationcenter.h.

Constructor & Destructor Documentation

◆ MythNotificationCenter()

MythNotificationCenter::MythNotificationCenter ( void  )

Definition at line 1338 of file mythnotificationcenter.cpp.

◆ ~MythNotificationCenter()

MythNotificationCenter::~MythNotificationCenter ( )
virtual

Definition at line 1350 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 1383 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 1388 of file mythnotificationcenter.cpp.

Referenced by VideoDialog::dismissFetchDialog(), MythAirplayServer::StopSession(), AirplayConnection::UnRegister(), MusicPlayer::~MusicPlayer(), MythContextPrivate::~MythContextPrivate(), and MythRAOPConnection::~MythRAOPConnection().

◆ 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 1393 of file mythnotificationcenter.cpp.

Referenced by OSD::Draw(), and OSD::DrawDirect().

◆ 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 1403 of file mythnotificationcenter.cpp.

Referenced by OSD::Draw(), and OSD::DrawDirect().

◆ 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 1413 of file mythnotificationcenter.cpp.

Referenced by OSD::Draw(), and OSD::DrawDirect().

◆ 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 1418 of file mythnotificationcenter.cpp.

Referenced by OSD::Draw(), and OSD::DrawDirect().

◆ DisplayedNotifications()

int MythNotificationCenter::DisplayedNotifications ( void  ) const

Returns number of notifications currently displayed.

Definition at line 1432 of file mythnotificationcenter.cpp.

Referenced by MythMainWindow::ExitToMainMenu().

◆ QueuedNotifications()

int MythNotificationCenter::QueuedNotifications ( void  ) const

Returns number of notifications currently queued.

Definition at line 1437 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 1442 of file mythnotificationcenter.cpp.

◆ 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 1369 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: