Quassel IRC  Pre-Release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
SystemTray Class Reference

#include </tmp/quassel/src/qtui/systemtray.h>

Inheritance diagram for SystemTray:
Collaboration diagram for SystemTray:

Public Slots

virtual void setState (State)
virtual void setVisible (bool visible=true)
virtual void setToolTip (const QString &title, const QString &subtitle)
virtual void showMessage (const QString &title, const QString &message, MessageIcon icon=Information, int msTimeout=10000, uint notificationId=0)
virtual void closeMessage (uint notificationId)

Signals

void activated (SystemTray::ActivationReason)
void iconChanged (const QIcon &icon)
void animationEnabledChanged (bool)
void toolTipChanged (const QString &title, const QString &subtitle)
void messageClicked (uint notificationId)
void messageClosed (uint notificationId)

Protected Slots

virtual void activate (SystemTray::ActivationReason=Trigger)

Protected Member Functions

virtual void setMode (Mode mode)
bool shouldBeVisible () const
virtual QIcon stateIcon () const
QIcon stateIcon (State state) const
QString toolTipTitle () const
QString toolTipSubTitle () const
QMenu * trayMenu () const
bool animationEnabled () const

Private Types

enum  Mode { Invalid, Legacy, StatusNotifier }
enum  MessageIcon { NoIcon, Information, Warning, Critical }
enum  ActivationReason {
  Unknown, Context, DoubleClick, Trigger,
  MiddleClick
}

Private Slots

void minimizeRestore ()
void trayMenuAboutToShow ()
void enableAnimationChanged (const QVariant &)

Private Member Functions

 Q_ENUMS (State Mode MessageIcon ActivationReason) public
 SystemTray (QWidget *parent)
virtual ~SystemTray ()
virtual void init ()
Mode mode () const
State state () const
bool isAlerted () const
virtual bool isSystemTrayAvailable () const
void setAlert (bool alerted)
virtual bool isVisible () const
QWidget * associatedWidget () const

Private Attributes

Mode _mode
State _state
bool _shouldBeVisible
QString _toolTipTitle
QString _toolTipSubTitle
QIcon _passiveIcon
QIcon _activeIcon
QIcon _needsAttentionIcon
bool _animationEnabled
QMenu * _trayMenu
QWidget * _associatedWidget
Action_minimizeRestoreAction

Detailed Description

Definition at line 29 of file systemtray.h.

Member Enumeration Documentation

enum Mode
private
Enumerator:
Invalid 
Legacy 
StatusNotifier 

Definition at line 41 of file systemtray.h.

enum MessageIcon
private
Enumerator:
NoIcon 
Information 
Warning 
Critical 

Definition at line 48 of file systemtray.h.

enum ActivationReason
private
Enumerator:
Unknown 
Context 
DoubleClick 
Trigger 
MiddleClick 

Definition at line 56 of file systemtray.h.

Constructor & Destructor Documentation

SystemTray ( QWidget *  parent)
explicitprivate

Definition at line 37 of file systemtray.cpp.

~SystemTray ( )
privatevirtual

Definition at line 52 of file systemtray.cpp.

References _trayMenu.

Member Function Documentation

Q_ENUMS ( State Mode MessageIcon  ActivationReason)
inlineprivate

Definition at line 32 of file systemtray.h.

SystemTray::State state ( ) const
inlineprivate
bool isAlerted ( ) const
inlineprivate

Definition at line 131 of file systemtray.h.

References state().

bool isSystemTrayAvailable ( ) const
inlineprivatevirtual
virtual bool isVisible ( ) const
inlineprivatevirtual

Reimplemented in LegacySystemTray.

Definition at line 74 of file systemtray.h.

QWidget * associatedWidget ( ) const
private

Definition at line 58 of file systemtray.cpp.

References _associatedWidget.

Referenced by init(), and LegacySystemTray::LegacySystemTray().

void setState ( State  state)
virtualslot

Definition at line 144 of file systemtray.cpp.

References _state, and state().

Referenced by setAlert(), MainWin::setConnectedState(), and MainWin::setDisconnectedState().

void setVisible ( bool  visible = true)
virtualslot

Definition at line 161 of file systemtray.cpp.

References _shouldBeVisible.

Referenced by QtUi::minimizeRestore(), and QtUi::useSystemTrayChanged().

void setToolTip ( const QString &  title,
const QString &  subtitle 
)
virtualslot
void showMessage ( const QString &  title,
const QString &  message,
MessageIcon  icon = Information,
int  msTimeout = 10000,
uint  notificationId = 0 
)
virtualslot

Definition at line 175 of file systemtray.cpp.

Referenced by SystrayNotificationBackend::notify().

virtual void closeMessage ( uint  notificationId)
inlinevirtualslot

Definition at line 83 of file systemtray.h.

Referenced by SystrayNotificationBackend::close().

void activated ( SystemTray::ActivationReason  )
signal
void iconChanged ( const QIcon &  icon)
signal
void animationEnabledChanged ( bool  )
signal

Referenced by enableAnimationChanged().

void toolTipChanged ( const QString &  title,
const QString &  subtitle 
)
signal
void messageClicked ( uint  notificationId)
signal
void messageClosed ( uint  notificationId)
signal
void activate ( SystemTray::ActivationReason  reason = Trigger)
protectedvirtualslot

Definition at line 185 of file systemtray.cpp.

References activated().

Referenced by LegacySystemTray::on_activated().

void setMode ( Mode  mode)
protectedvirtual

Reimplemented in LegacySystemTray.

Definition at line 106 of file systemtray.cpp.

References _mode, _trayMenu, and Legacy.

bool shouldBeVisible ( ) const
inlineprotected

Definition at line 134 of file systemtray.h.

References _shouldBeVisible.

Referenced by LegacySystemTray::setMode(), and LegacySystemTray::setVisible().

QIcon stateIcon ( ) const
protectedvirtual

Reimplemented in LegacySystemTray.

Definition at line 124 of file systemtray.cpp.

References state().

QIcon stateIcon ( State  state) const
protected

Definition at line 130 of file systemtray.cpp.

References _activeIcon, _needsAttentionIcon, and _passiveIcon.

QString toolTipTitle ( ) const
inlineprotected

Definition at line 136 of file systemtray.h.

References _toolTipTitle.

Referenced by LegacySystemTray::syncLegacyIcon().

QString toolTipSubTitle ( ) const
inlineprotected

Definition at line 137 of file systemtray.h.

References _toolTipSubTitle.

Referenced by LegacySystemTray::syncLegacyIcon().

QMenu * trayMenu ( ) const
inlineprotected

Definition at line 135 of file systemtray.h.

References _trayMenu.

Referenced by LegacySystemTray::init().

bool animationEnabled ( ) const
inlineprotected

Definition at line 138 of file systemtray.h.

References _animationEnabled.

Referenced by LegacySystemTray::setState().

void minimizeRestore ( )
privateslot

Definition at line 191 of file systemtray.cpp.

References GraphicalUi::toggleMainWidget().

Referenced by init().

void trayMenuAboutToShow ( )
privateslot

Definition at line 97 of file systemtray.cpp.

References _minimizeRestoreAction, and GraphicalUi::isMainWidgetVisible().

Referenced by init().

void enableAnimationChanged ( const QVariant &  v)
privateslot

Definition at line 197 of file systemtray.cpp.

References _animationEnabled, and animationEnabledChanged().

Referenced by init().

Member Data Documentation

Mode _mode
private

Definition at line 114 of file systemtray.h.

Referenced by mode(), and setMode().

State _state
private

Definition at line 115 of file systemtray.h.

Referenced by setState(), and state().

bool _shouldBeVisible
private

Definition at line 116 of file systemtray.h.

Referenced by setVisible(), and shouldBeVisible().

QString _toolTipTitle
private

Definition at line 118 of file systemtray.h.

Referenced by setToolTip(), and toolTipTitle().

QString _toolTipSubTitle
private

Definition at line 118 of file systemtray.h.

Referenced by setToolTip(), and toolTipSubTitle().

QIcon _passiveIcon
private

Definition at line 119 of file systemtray.h.

Referenced by stateIcon().

QIcon _activeIcon
private

Definition at line 119 of file systemtray.h.

Referenced by init(), and stateIcon().

QIcon _needsAttentionIcon
private

Definition at line 119 of file systemtray.h.

Referenced by stateIcon().

bool _animationEnabled
private

Definition at line 120 of file systemtray.h.

Referenced by animationEnabled(), and enableAnimationChanged().

QMenu* _trayMenu
private

Definition at line 122 of file systemtray.h.

Referenced by init(), setMode(), trayMenu(), and ~SystemTray().

QWidget* _associatedWidget
private

Definition at line 123 of file systemtray.h.

Referenced by associatedWidget().

Action* _minimizeRestoreAction
private

Definition at line 124 of file systemtray.h.

Referenced by init(), and trayMenuAboutToShow().


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