MythTV  0.28pre
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Groups Pages
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...
 
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...
 
bool ScreenCreated (const MythScreenType *screen)
 Return true if Create() has been called on screen. More...
 
void GetNotificationScreens (QList< MythScreenType * > &screens)
 Return the list of notification screens being currently displayed. More...
 
void UpdateScreen (MythScreenType *screen)
 Will call ::doInit() if the screen is a MythNotificationScreen and Create() has been called for it already. 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...
 

Private Attributes

NCPrivated
 

Detailed Description

Definition at line 33 of file mythnotificationcenter.h.

Constructor & Destructor Documentation

MythNotificationCenter::MythNotificationCenter ( void  )

Definition at line 1337 of file mythnotificationcenter.cpp.

MythNotificationCenter::~MythNotificationCenter ( )
virtual

Definition at line 1349 of file mythnotificationcenter.cpp.

Member Function Documentation

bool MythNotificationCenter::Queue ( const MythNotification notification)
MythNotificationCenter * MythNotificationCenter::GetInstance ( void  )
static

returns the MythNotificationCenter singleton

Definition at line 1332 of file mythnotificationcenter.cpp.

Referenced by 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 1382 of file mythnotificationcenter.cpp.

Referenced by VideoDialog::createFetchDialog(), MythContextPrivate::event(), MythAirplayServer::HandleResponse(), and MythRAOPConnection::MythRAOPConnection().

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

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

QDateTime MythNotificationCenter::ScreenExpiryTime ( const MythScreenType screen)

Return when the given screen is going to expire will return an invalid QDateTime if screen isn't a MythNotificationScreen.

Definition at line 1392 of file mythnotificationcenter.cpp.

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

bool MythNotificationCenter::ScreenCreated ( const MythScreenType screen)

Return true if Create() has been called on screen.

will always return true should screen not be a MythNotificationScreen

Definition at line 1402 of file mythnotificationcenter.cpp.

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

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

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

void MythNotificationCenter::UpdateScreen ( MythScreenType screen)

Will call ::doInit() if the screen is a MythNotificationScreen and Create() has been called for it already.

Definition at line 1417 of file mythnotificationcenter.cpp.

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

int MythNotificationCenter::DisplayedNotifications ( void  ) const

Returns number of notifications currently displayed.

Definition at line 1431 of file mythnotificationcenter.cpp.

int MythNotificationCenter::QueuedNotifications ( void  ) const

Returns number of notifications currently queued.

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

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

Referenced by MythMainWindow::customEvent().

Member Data Documentation

NCPrivate* MythNotificationCenter::d
private

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