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

#include <mythnotificationcenter_private.h>

Inheritance diagram for NCPrivate:
Inheritance graph
[legend]
Collaboration diagram for NCPrivate:
Collaboration graph
[legend]

Public Slots

void ScreenDeleted (void)
 Remove screen from screens list. More...
 

Public Member Functions

 NCPrivate (void)
 
 ~NCPrivate () override
 
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...
 
void ScreenStackDeleted (void)
 

Static Public Member Functions

static MythNotificationCenterGetInstance (void)
 returns the MythNotificationCenter singleton More...
 

Private Member Functions

MythNotificationScreenCreateScreen (MythNotification *notification, int id=-1)
 CreateScreen will create a MythNotificationScreen instance. More...
 
void DeleteAllRegistrations (void)
 
void DeleteAllScreens (void)
 
void DeleteUnregistered (void)
 
int InsertScreen (MythNotificationScreen *screen)
 Insert screen into list of screens. More...
 
int RemoveScreen (MythNotificationScreen *screen)
 Remove screen from list of screens. More...
 
void RefreshScreenPosition (int from=0)
 Re-position screens on display. More...
 

Private Attributes

MythNotificationScreenStackm_originalScreenStack {nullptr}
 
MythNotificationScreenStackm_screenStack {nullptr}
 
QList< MythNotification * > m_notifications
 
QList< MythNotificationScreen * > m_screens
 
QList< MythNotificationScreen * > m_deletedScreens
 
QMap< int, MythNotificationScreen * > m_registrations
 
QList< int > m_suspended
 
QMap< int, boolm_unregistered
 
QMap< int, void * > m_clients
 
QMutex m_lock
 
int m_currentId {0}
 
QMap< MythNotificationScreen *, MythNotificationScreen * > m_converted
 

Detailed Description

Definition at line 33 of file mythnotificationcenter_private.h.

Constructor & Destructor Documentation

◆ NCPrivate()

NCPrivate::NCPrivate ( void  )

Definition at line 749 of file mythnotificationcenter.cpp.

◆ ~NCPrivate()

NCPrivate::~NCPrivate ( )
override

Definition at line 757 of file mythnotificationcenter.cpp.

Member Function Documentation

◆ ScreenDeleted

void NCPrivate::ScreenDeleted ( void  )
slot

Remove screen from screens list.

Qt slot called upon MythScreenType::Exiting().

Definition at line 788 of file mythnotificationcenter.cpp.

Referenced by CreateScreen().

◆ Queue()

bool NCPrivate::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 863 of file mythnotificationcenter.cpp.

Referenced by MythNotificationCenter::Queue().

◆ GetInstance()

static MythNotificationCenter* NCPrivate::GetInstance ( void  )
static

returns the MythNotificationCenter singleton

◆ Register()

int NCPrivate::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 1011 of file mythnotificationcenter.cpp.

Referenced by MythNotificationCenter::Register().

◆ UnRegister()

void NCPrivate::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 1025 of file mythnotificationcenter.cpp.

Referenced by MythNotificationCenter::UnRegister().

◆ ScreenExpiryTime()

QDateTime NCPrivate::ScreenExpiryTime ( const MythScreenType screen)

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

◆ ScreenCreated()

bool NCPrivate::ScreenCreated ( const MythScreenType screen)

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

will always return true should screen not be a MythNotificationScreen

◆ GetNotificationScreens()

void NCPrivate::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 1220 of file mythnotificationcenter.cpp.

Referenced by MythNotificationCenter::GetNotificationScreens().

◆ UpdateScreen()

void NCPrivate::UpdateScreen ( MythScreenType screen)

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

◆ DisplayedNotifications()

int NCPrivate::DisplayedNotifications ( void  ) const

Returns number of notifications currently displayed.

Definition at line 1274 of file mythnotificationcenter.cpp.

Referenced by MythNotificationCenter::DisplayedNotifications().

◆ QueuedNotifications()

int NCPrivate::QueuedNotifications ( void  ) const

Returns number of notifications currently queued.

Definition at line 1279 of file mythnotificationcenter.cpp.

Referenced by MythNotificationCenter::QueuedNotifications().

◆ RemoveFirst()

bool NCPrivate::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 1284 of file mythnotificationcenter.cpp.

Referenced by MythNotificationCenter::RemoveFirst().

◆ ProcessQueue()

void NCPrivate::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 907 of file mythnotificationcenter.cpp.

Referenced by MythNotificationCenter::ProcessQueue().

◆ ScreenStackDeleted()

void NCPrivate::ScreenStackDeleted ( void  )

◆ CreateScreen()

MythNotificationScreen * NCPrivate::CreateScreen ( MythNotification n,
int  id = -1 
)
private

CreateScreen will create a MythNotificationScreen instance.

This screen will not be displayed until it is used.

Definition at line 987 of file mythnotificationcenter.cpp.

Referenced by ProcessQueue().

◆ DeleteAllRegistrations()

void NCPrivate::DeleteAllRegistrations ( void  )
private

Definition at line 1056 of file mythnotificationcenter.cpp.

Referenced by ~NCPrivate().

◆ DeleteAllScreens()

void NCPrivate::DeleteAllScreens ( void  )
private

Definition at line 1068 of file mythnotificationcenter.cpp.

Referenced by DeleteUnregistered(), ProcessQueue(), and ~NCPrivate().

◆ DeleteUnregistered()

void NCPrivate::DeleteUnregistered ( void  )
private

Definition at line 1100 of file mythnotificationcenter.cpp.

Referenced by ProcessQueue(), and ~NCPrivate().

◆ InsertScreen()

int NCPrivate::InsertScreen ( MythNotificationScreen screen)
private

Insert screen into list of screens.

Returns index in screens list.

Definition at line 1144 of file mythnotificationcenter.cpp.

Referenced by ProcessQueue().

◆ RemoveScreen()

int NCPrivate::RemoveScreen ( MythNotificationScreen screen)
private

Remove screen from list of screens.

Returns index in screens list.

Definition at line 1173 of file mythnotificationcenter.cpp.

◆ RefreshScreenPosition()

void NCPrivate::RefreshScreenPosition ( int  from = 0)
private

Re-position screens on display.

Definition at line 1195 of file mythnotificationcenter.cpp.

Referenced by ProcessQueue(), and ScreenDeleted().

Member Data Documentation

◆ m_originalScreenStack

MythNotificationScreenStack* NCPrivate::m_originalScreenStack {nullptr}
private

Definition at line 132 of file mythnotificationcenter_private.h.

Referenced by DeleteAllScreens(), NCPrivate(), and ~NCPrivate().

◆ m_screenStack

MythNotificationScreenStack* NCPrivate::m_screenStack {nullptr}
private

◆ m_notifications

QList<MythNotification*> NCPrivate::m_notifications
private

◆ m_screens

QList<MythNotificationScreen*> NCPrivate::m_screens
private

◆ m_deletedScreens

QList<MythNotificationScreen*> NCPrivate::m_deletedScreens
private

◆ m_registrations

QMap<int, MythNotificationScreen*> NCPrivate::m_registrations
private

◆ m_suspended

QList<int> NCPrivate::m_suspended
private

Definition at line 138 of file mythnotificationcenter_private.h.

Referenced by DeleteUnregistered(), Queue(), and ScreenDeleted().

◆ m_unregistered

QMap<int,bool> NCPrivate::m_unregistered
private

Definition at line 139 of file mythnotificationcenter_private.h.

Referenced by DeleteUnregistered(), ScreenDeleted(), and UnRegister().

◆ m_clients

QMap<int, void*> NCPrivate::m_clients
private

Definition at line 140 of file mythnotificationcenter_private.h.

Referenced by Queue(), Register(), and UnRegister().

◆ m_lock

QMutex NCPrivate::m_lock
private

◆ m_currentId

int NCPrivate::m_currentId {0}
private

Definition at line 142 of file mythnotificationcenter_private.h.

Referenced by Register().

◆ m_converted

QMap<MythNotificationScreen*, MythNotificationScreen*> NCPrivate::m_converted
private

Definition at line 143 of file mythnotificationcenter_private.h.

Referenced by GetNotificationScreens(), and ScreenDeleted().


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