KVIrc  4.9.2
DeveloperAPIs
Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | Friends | List of all members
KviStatusBar Class Reference

Status Bar class. More...

#include <KviStatusBar.h>

+ Inheritance diagram for KviStatusBar:

Public Member Functions

KviStatusBarAppletappletAt (const QPoint &pnt, bool bBestMatch=false)
 Returns the applet at the given point. More...
 
bool appletExists (KviStatusBarApplet *pApplet)
 Returns true if the applet exists, false otherwise. More...
 
KviMainWindowframe ()
 Returns the frame pointer. More...
 
int insertPermanentWidgetAtTheEnd (QWidget *widget, int stretch=0)
 Inserts an applet at the end of the statusbar as a permanent widget and returns its index. More...
 
 KviStatusBar (KviMainWindow *pFrame)
 Constructs the statusbar object. More...
 
void queueMessage (KviStatusBarMessage *pMsg)
 Queue a statusbar message in the stack. More...
 
void registerAppletDescriptor (KviStatusBarAppletDescriptor *d)
 Registers the applet descriptor. More...
 
 ~KviStatusBar ()
 Destroys the statusbar object. More...
 

Protected Slots

void appletsPopupAboutToShow ()
 Shows the per-applet popup menu. More...
 
void appletsPopupActivated (QAction *pAction)
 Called when the user activates the per-applet popup. More...
 
void contextMenuRequested (const QPoint &pos)
 Called when the user requests a context menu. More...
 
void contextPopupAboutToShow ()
 Shows the applet common popup menu. More...
 
void messageTimerFired ()
 Called when the timer timeouts. More...
 
void removeClickedApplet ()
 Called when the user removes an applet from the statusbar. More...
 
void setPermanentMessage ()
 Sets the permanent message to be shown. More...
 

Protected Member Functions

KviStatusBarAppletcreateApplet (const QString &szInternalName)
 Create an applet. More...
 
void dragEnterEvent (QDragEnterEvent *event)
 
void dragMoveEvent (QDragMoveEvent *de)
 
void dropEvent (QDropEvent *de)
 
virtual bool event (QEvent *e)
 
void load ()
 Saves the statusbar stack. More...
 
virtual void mouseDoubleClickEvent (QMouseEvent *e)
 
virtual void mousePressEvent (QMouseEvent *e)
 
void recalcMinimumHeight ()
 Recalculates the minimum height of the status bar. More...
 
void registerApplet (KviStatusBarApplet *pApplet)
 Registers the given applet in the statusbar. More...
 
void save ()
 Saves the statusbar stack. More...
 
void showFirstMessageInQueue ()
 Shows the first message in the queue stack. More...
 
void showLayoutHelp ()
 Shows the common help for every applet. More...
 
void tipRequest (QHelpEvent *e)
 Shows the right tooltip. More...
 
void unregisterApplet (KviStatusBarApplet *pApplet)
 Unegisters the given applet in the statusbar. More...
 

Protected Attributes

bool m_bStopLayoutOnAddRemove
 
int m_iLastMinimumHeight
 
KviPointerHashTable< QString,
KviStatusBarAppletDescriptor > * 
m_pAppletDescriptors
 
KviPointerList
< KviStatusBarApplet > * 
m_pAppletList
 
QMenu * m_pAppletsPopup
 
KviTalHBoxm_pBox
 
KviStatusBarAppletm_pClickedApplet
 
QMenu * m_pContextPopup
 
KviMainWindowm_pFrame
 
QLabel * m_pMessageLabel
 
KviPointerList
< KviStatusBarMessage > * 
m_pMessageQueue
 
QTimer * m_pMessageTimer
 
KviDynamicToolTipm_pToolTip
 

Friends

class KviMainWindow
 
class KviStatusBarApplet
 

Detailed Description

Status Bar class.

Constructor & Destructor Documentation

KviStatusBar::KviStatusBar ( KviMainWindow pFrame)
KviStatusBar::~KviStatusBar ( )

Member Function Documentation

KviStatusBarApplet * KviStatusBar::appletAt ( const QPoint &  pnt,
bool  bBestMatch = false 
)

Returns the applet at the given point.

If bBestMatch is specified and no applets are found, the last applet will be returned

Parameters
pntThe source point
bBestMatchWhether to return the best match
Returns
KviStatusBarApplet *
Warning
pnt is global!

References KviPointerList< T >::first(), KviPointerList< T >::last(), m_pAppletList, and KviPointerList< T >::next().

Referenced by contextMenuRequested(), and tipRequest().

bool KviStatusBar::appletExists ( KviStatusBarApplet pApplet)

Returns true if the applet exists, false otherwise.

Parameters
pAppletThe pointer to the applet to check existence
Returns
bool

References KviPointerList< T >::findRef(), and m_pAppletList.

Referenced by contextPopupAboutToShow(), dragMoveEvent(), and removeClickedApplet().

void KviStatusBar::appletsPopupAboutToShow ( )
protectedslot
void KviStatusBar::appletsPopupActivated ( QAction *  pAction)
protectedslot
void KviStatusBar::contextMenuRequested ( const QPoint &  pos)
protectedslot

Called when the user requests a context menu.

Parameters
posThe position of the mouse
Returns
void

References appletAt(), connect(), contextPopupAboutToShow(), m_pClickedApplet, and m_pContextPopup.

Referenced by KviStatusBar().

void KviStatusBar::contextPopupAboutToShow ( )
protectedslot
KviStatusBarApplet * KviStatusBar::createApplet ( const QString &  szInternalName)
protected

Create an applet.

It searches for the given name and if found in the applet descriptor stack, it will passes creates the applet

Parameters
szInternalNameThe internal name of the applet
Returns
KviStatusBarApplet *

References KviStatusBarAppletDescriptor::create(), d, KviPointerHashTable< Key, T >::find(), and m_pAppletDescriptors.

Referenced by load().

void KviStatusBar::dragEnterEvent ( QDragEnterEvent *  event)
protected
void KviStatusBar::dragMoveEvent ( QDragMoveEvent *  de)
protected
void KviStatusBar::dropEvent ( QDropEvent *  de)
protected

References m_pClickedApplet.

bool KviStatusBar::event ( QEvent *  e)
protectedvirtual

References tipRequest().

KviMainWindow* KviStatusBar::frame ( )
inline
int KviStatusBar::insertPermanentWidgetAtTheEnd ( QWidget *  widget,
int  stretch = 0 
)

Inserts an applet at the end of the statusbar as a permanent widget and returns its index.

Parameters
widgetThe widget to insert
stretchStretch factor used to compute widget size when the statusbar gets resized. Defaults to 0.
Returns
int

References KviPointerList< T >::count(), and m_pAppletList.

Referenced by CreateStatusBarAwayIndicator(), CreateStatusBarClock(), CreateStatusBarConnectionTimer(), CreateStatusBarLagIndicator(), CreateStatusBarSeparator(), CreateStatusBarUpdateIndicator(), CreateTorrentClientApplet(), and KVSO_CLASS_FUNCTION().

void KviStatusBar::load ( )
protected
void KviStatusBar::messageTimerFired ( )
protectedslot

Called when the timer timeouts.

Remove the first item from the stack and sets the second one as permanent

Returns
void

References KviPointerList< T >::isEmpty(), m_pMessageQueue, m_pMessageTimer, KviPointerList< T >::removeFirst(), setPermanentMessage(), and showFirstMessageInQueue().

Referenced by showFirstMessageInQueue().

void KviStatusBar::mouseDoubleClickEvent ( QMouseEvent *  e)
protectedvirtual
void KviStatusBar::mousePressEvent ( QMouseEvent *  e)
protectedvirtual
void KviStatusBar::queueMessage ( KviStatusBarMessage pMsg)

Queue a statusbar message in the stack.

Parameters
pMsgThe pointer to the message to queue
Returns
void
Warning
It takes the ownership of pMsg

References KviPointerList< T >::append(), KviPointerList< T >::count(), KviPointerList< T >::first(), m_pMessageQueue, m_pMessageTimer, KviPointerList< T >::prepend(), KviStatusBarMessage::priority(), and showFirstMessageInQueue().

Referenced by showLayoutHelp().

void KviStatusBar::recalcMinimumHeight ( )
protected

Recalculates the minimum height of the status bar.

Returns
void

References l, KviPointerList< T >::last(), m_iLastMinimumHeight, m_pAppletList, m_pMessageLabel, KviPointerList< T >::prev(), RICHTEXTLABELTRICK, and VMARGIN.

void KviStatusBar::registerApplet ( KviStatusBarApplet pApplet)
protected

Registers the given applet in the statusbar.

Parameters
pAppletThe pointer to the applet
Returns
void

References KviPointerList< T >::inSort(), and m_pAppletList.

Referenced by KviStatusBarApplet::KviStatusBarApplet().

void KviStatusBar::registerAppletDescriptor ( KviStatusBarAppletDescriptor d)
void KviStatusBar::removeClickedApplet ( )
protectedslot

Called when the user removes an applet from the statusbar.

Returns
void

References appletExists(), and m_pClickedApplet.

Referenced by contextPopupAboutToShow().

void KviStatusBar::save ( )
protected
void KviStatusBar::setPermanentMessage ( )
protectedslot
void KviStatusBar::showFirstMessageInQueue ( )
protected
void KviStatusBar::showLayoutHelp ( )
protected

Shows the common help for every applet.

Returns
void

References __tr2qs, and queueMessage().

Referenced by appletsPopupActivated().

void KviStatusBar::tipRequest ( QHelpEvent *  e)
protected

Shows the right tooltip.

If an applet is found at the position of the triggered event, the right tooltip will be show, otherwise a common one will be show

Parameters
eThe event triggered
Returns
void

References __tr2qs, KviMainWindow::activeContext(), appletAt(), c, KviIrcContext::Connected, KviStatusBarApplet::descriptor(), m_pFrame, KviIrcContext::state(), KviStatusBarApplet::tipText(), and KviStatusBarAppletDescriptor::visibleName().

Referenced by event().

void KviStatusBar::unregisterApplet ( KviStatusBarApplet pApplet)
protected

Unegisters the given applet in the statusbar.

Parameters
pAppletThe pointer to the applet
Returns
void

References m_pAppletList, and KviPointerList< T >::removeRef().

Referenced by KviStatusBarApplet::~KviStatusBarApplet().

Friends And Related Function Documentation

friend class KviMainWindow
friend
friend class KviStatusBarApplet
friend

Member Data Documentation

bool KviStatusBar::m_bStopLayoutOnAddRemove
protected
int KviStatusBar::m_iLastMinimumHeight
protected
KviPointerHashTable<QString, KviStatusBarAppletDescriptor>* KviStatusBar::m_pAppletDescriptors
protected
KviPointerList<KviStatusBarApplet>* KviStatusBar::m_pAppletList
protected
QMenu* KviStatusBar::m_pAppletsPopup
protected
KviTalHBox* KviStatusBar::m_pBox
protected
KviStatusBarApplet* KviStatusBar::m_pClickedApplet
protected
QMenu* KviStatusBar::m_pContextPopup
protected
KviMainWindow* KviStatusBar::m_pFrame
protected
QLabel* KviStatusBar::m_pMessageLabel
protected
KviPointerList<KviStatusBarMessage>* KviStatusBar::m_pMessageQueue
protected
QTimer* KviStatusBar::m_pMessageTimer
protected
KviDynamicToolTip* KviStatusBar::m_pToolTip
protected

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