KVIrc 5.2.4
Developer APIs
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.
 
bool appletExists (KviStatusBarApplet *pApplet)
 Returns true if the applet exists, false otherwise.
 
KviMainWindowframe ()
 Returns the frame pointer.
 
int insertPermanentWidgetAtTheEnd (QWidget *widget, int stretch=0)
 Inserts an applet at the end of the statusbar as a permanent widget and returns its index.
 
 KviStatusBar (KviMainWindow *pFrame)
 Constructs the statusbar object.
 
void queueMessage (KviStatusBarMessage *pMsg)
 Queue a statusbar message in the stack.
 
void registerAppletDescriptor (KviStatusBarAppletDescriptor *d)
 Registers the applet descriptor.
 
 ~KviStatusBar ()
 Destroys the statusbar object.
 

Protected Slots

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

Protected Member Functions

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

Protected Attributes

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

Friends

class KviMainWindow
 
class KviStatusBarApplet
 

Detailed Description

Status Bar class.

Constructor & Destructor Documentation

◆ KviStatusBar()

KviStatusBar::KviStatusBar ( KviMainWindow pFrame)

◆ ~KviStatusBar()

KviStatusBar::~KviStatusBar ( )

Member Function Documentation

◆ appletAt()

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().

◆ appletExists()

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().

◆ appletsPopupAboutToShow

void KviStatusBar::appletsPopupAboutToShow ( )
protectedslot

◆ appletsPopupActivated

void KviStatusBar::appletsPopupActivated ( QAction *  pAction)
protectedslot

◆ contextMenuRequested

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().

◆ contextPopupAboutToShow

void KviStatusBar::contextPopupAboutToShow ( )
protectedslot

◆ createApplet()

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().

◆ dragEnterEvent()

void KviStatusBar::dragEnterEvent ( QDragEnterEvent *  event)
overrideprotected

◆ dragMoveEvent()

void KviStatusBar::dragMoveEvent ( QDragMoveEvent *  de)
overrideprotected

◆ dropEvent()

void KviStatusBar::dropEvent ( QDropEvent *  de)
overrideprotected

References m_pClickedApplet.

◆ event()

bool KviStatusBar::event ( QEvent *  e)
overrideprotected

References e, and tipRequest().

◆ frame()

KviMainWindow * KviStatusBar::frame ( )
inline

◆ insertPermanentWidgetAtTheEnd()

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().

◆ load()

void KviStatusBar::load ( )
protected

◆ messageTimerFired

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().

◆ mouseDoubleClickEvent()

void KviStatusBar::mouseDoubleClickEvent ( QMouseEvent *  e)
overrideprotected

◆ mousePressEvent()

void KviStatusBar::mousePressEvent ( QMouseEvent *  e)
overrideprotected

◆ queueMessage()

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().

◆ recalcMinimumHeight()

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.

◆ registerApplet()

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().

◆ registerAppletDescriptor()

void KviStatusBar::registerAppletDescriptor ( KviStatusBarAppletDescriptor d)

Registers the applet descriptor.

Parameters
dThe applet description to register
Returns
void

References d, m_pAppletDescriptors, and KviPointerHashTable< Key, T >::replace().

◆ removeClickedApplet

void KviStatusBar::removeClickedApplet ( )
protectedslot

Called when the user removes an applet from the statusbar.

Returns
void

References appletExists(), and m_pClickedApplet.

Referenced by contextPopupAboutToShow().

◆ save()

void KviStatusBar::save ( )
protected

◆ setPermanentMessage

void KviStatusBar::setPermanentMessage ( )
protectedslot

◆ showFirstMessageInQueue()

void KviStatusBar::showFirstMessageInQueue ( )
protected

◆ showLayoutHelp()

void KviStatusBar::showLayoutHelp ( )
protected

Shows the common help for every applet.

Returns
void

References __tr2qs, and queueMessage().

Referenced by appletsPopupActivated().

◆ tipRequest()

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(), KviIrcContext::Connected, KviStatusBarApplet::descriptor(), e, m_pFrame, KviIrcContext::state(), KviStatusBarApplet::tipText(), and KviStatusBarAppletDescriptor::visibleName().

Referenced by event().

◆ unregisterApplet()

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 Symbol Documentation

◆ KviMainWindow

friend class KviMainWindow
friend

◆ KviStatusBarApplet

friend class KviStatusBarApplet
friend

Member Data Documentation

◆ m_bStopLayoutOnAddRemove

bool KviStatusBar::m_bStopLayoutOnAddRemove
protected

◆ m_iLastMinimumHeight

int KviStatusBar::m_iLastMinimumHeight
protected

◆ m_pAppletDescriptors

KviPointerHashTable<QString, KviStatusBarAppletDescriptor>* KviStatusBar::m_pAppletDescriptors
protected

◆ m_pAppletList

KviPointerList<KviStatusBarApplet>* KviStatusBar::m_pAppletList
protected

◆ m_pAppletsPopup

QMenu* KviStatusBar::m_pAppletsPopup
protected

◆ m_pClickedApplet

KviStatusBarApplet* KviStatusBar::m_pClickedApplet
protected

◆ m_pContextPopup

QMenu* KviStatusBar::m_pContextPopup
protected

◆ m_pFrame

KviMainWindow* KviStatusBar::m_pFrame
protected

◆ m_pMessageLabel

QLabel* KviStatusBar::m_pMessageLabel
protected

◆ m_pMessageQueue

KviPointerList<KviStatusBarMessage>* KviStatusBar::m_pMessageQueue
protected

◆ m_pMessageTimer

QTimer* KviStatusBar::m_pMessageTimer
protected

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