![]() |
KVIrc
4.9.2
DeveloperAPIs
|
Status Bar class. More...
#include <KviStatusBar.h>
Inheritance diagram for KviStatusBar:Public Member Functions | |
| KviStatusBarApplet * | appletAt (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... | |
| KviMainWindow * | frame () |
| 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 | |
| KviStatusBarApplet * | createApplet (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 |
| KviTalHBox * | m_pBox |
| KviStatusBarApplet * | m_pClickedApplet |
| QMenu * | m_pContextPopup |
| KviMainWindow * | m_pFrame |
| QLabel * | m_pMessageLabel |
| KviPointerList < KviStatusBarMessage > * | m_pMessageQueue |
| QTimer * | m_pMessageTimer |
| KviDynamicToolTip * | m_pToolTip |
Friends | |
| class | KviMainWindow |
| class | KviStatusBarApplet |
Status Bar class.
| KviStatusBar::KviStatusBar | ( | KviMainWindow * | pFrame | ) |
Constructs the statusbar object.
| pFrame | The parent frame class |
References connect(), contextMenuRequested(), m_bStopLayoutOnAddRemove, m_iLastMinimumHeight, m_pAppletDescriptors, m_pAppletList, m_pAppletsPopup, m_pClickedApplet, m_pContextPopup, m_pFrame, m_pMessageLabel, m_pMessageQueue, m_pMessageTimer, KviStatusBarClock::selfRegister(), KviStatusBarConnectionTimer::selfRegister(), KviStatusBarSeparator::selfRegister(), KviStatusBarAwayIndicator::selfRegister(), KviStatusBarLagIndicator::selfRegister(), KviStatusBarUpdateIndicator::selfRegister(), KviPointerHashTable< Key, T >::setAutoDelete(), KviPointerList< T >::setAutoDelete(), and setPermanentMessage().
| KviStatusBar::~KviStatusBar | ( | ) |
Destroys the statusbar object.
References m_bStopLayoutOnAddRemove, m_pAppletDescriptors, m_pAppletList, m_pMessageLabel, m_pMessageQueue, m_pMessageTimer, and save().
| 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
| pnt | The source point |
| bBestMatch | Whether to return the best match |
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.
| pApplet | The pointer to the applet to check existence |
References KviPointerList< T >::findRef(), and m_pAppletList.
Referenced by contextPopupAboutToShow(), dragMoveEvent(), and removeClickedApplet().
|
protectedslot |
Shows the per-applet popup menu.
References KviPointerHashTableIterator< Key, T >::current(), d, g_pModuleManager, KviModuleManager::loadModulesByCaps(), m_pAppletDescriptors, and m_pAppletsPopup.
Referenced by contextPopupAboutToShow().
|
protectedslot |
Called when the user activates the per-applet popup.
| iId | The id of the applet |
References KviPointerHashTableIterator< Key, T >::current(), d, KviPointerList< T >::findRef(), KviPointerList< T >::inSort(), m_bStopLayoutOnAddRemove, m_pAppletDescriptors, m_pAppletList, m_pClickedApplet, KviPointerList< T >::removeRef(), and showLayoutHelp().
Referenced by contextPopupAboutToShow().
|
protectedslot |
Called when the user requests a context menu.
| pos | The position of the mouse |
References appletAt(), connect(), contextPopupAboutToShow(), m_pClickedApplet, and m_pContextPopup.
Referenced by KviStatusBar().
|
protectedslot |
Shows the applet common popup menu.
References __tr2qs, appletExists(), appletsPopupAboutToShow(), appletsPopupActivated(), connect(), KviStatusBarApplet::descriptor(), KviStatusBarApplet::fillContextPopup(), m_pAppletsPopup, m_pClickedApplet, m_pContextPopup, Normal, p, removeClickedApplet(), and KviStatusBarAppletDescriptor::visibleName().
Referenced by contextMenuRequested().
|
protected |
Create an applet.
It searches for the given name and if found in the applet descriptor stack, it will passes creates the applet
| szInternalName | The internal name of the applet |
References KviStatusBarAppletDescriptor::create(), d, KviPointerHashTable< Key, T >::find(), and m_pAppletDescriptors.
Referenced by load().
|
protected |
|
protected |
|
protected |
References m_pClickedApplet.
|
protectedvirtual |
References tipRequest().
|
inline |
Returns the frame pointer.
Referenced by KviStatusBarAwayIndicator::KviStatusBarAwayIndicator(), KviStatusBarLagIndicator::KviStatusBarLagIndicator(), KviStatusBarAwayIndicator::mouseDoubleClickEvent(), KviStatusBarLagIndicator::mouseDoubleClickEvent(), KviStatusBarAwayIndicator::tipText(), KviStatusBarLagIndicator::tipText(), KviStatusBarAwayIndicator::updateDisplay(), and KviStatusBarLagIndicator::updateDisplay().
| 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.
| widget | The widget to insert |
| stretch | Stretch factor used to compute widget size when the statusbar gets resized. Defaults to 0. |
References KviPointerList< T >::count(), and m_pAppletList.
Referenced by CreateStatusBarAwayIndicator(), CreateStatusBarClock(), CreateStatusBarConnectionTimer(), CreateStatusBarLagIndicator(), CreateStatusBarSeparator(), CreateStatusBarUpdateIndicator(), CreateTorrentClientApplet(), and KVSO_CLASS_FUNCTION().
|
protected |
Saves the statusbar stack.
References createApplet(), KviCString::Format, g_pApp, g_pModuleManager, KviModuleManager::getModule(), KviApplication::getReadOnlyConfigPath(), i, KviStatusBarApplet::loadState(), KviCString::ptr(), KviConfigurationFile::Read, KviConfigurationFile::readEntry(), KviConfigurationFile::readIntEntry(), and KviConfigurationFile::setGroup().
Referenced by KviMainWindow::KviMainWindow(), and KviMainWindow::toggleStatusBar().
|
protectedslot |
Called when the timer timeouts.
Remove the first item from the stack and sets the second one as permanent
References KviPointerList< T >::isEmpty(), m_pMessageQueue, m_pMessageTimer, KviPointerList< T >::removeFirst(), setPermanentMessage(), and showFirstMessageInQueue().
Referenced by showFirstMessageInQueue().
|
protectedvirtual |
References __tr2qs, KviMainWindow::activeContext(), c, KviIrcContext::Connected, KviIrcContext::connection(), KviIrcConnection::currentNetworkName(), KviIrcConnection::currentServerName(), KviIrcConnectionUserInfo::hostName(), KviIrcConnectionUserInfo::isAway(), KviIrcConnectionUserInfo::localHostIp(), m_pFrame, KviIrcConnectionUserInfo::nickName(), KviIrcContext::state(), KviIrcConnection::userInfo(), KviIrcConnectionUserInfo::userMode(), and KviIrcConnectionUserInfo::userName().
|
protectedvirtual |
References KviStatusBarApplet::index(), m_pAppletList, m_pClickedApplet, and KviPointerList< T >::sort().
| void KviStatusBar::queueMessage | ( | KviStatusBarMessage * | pMsg | ) |
Queue a statusbar message in the stack.
| pMsg | The pointer to the message to queue |
References KviPointerList< T >::append(), KviPointerList< T >::count(), KviPointerList< T >::first(), m_pMessageQueue, m_pMessageTimer, KviPointerList< T >::prepend(), KviStatusBarMessage::priority(), and showFirstMessageInQueue().
Referenced by showLayoutHelp().
|
protected |
Recalculates the minimum height of the status bar.
References l, KviPointerList< T >::last(), m_iLastMinimumHeight, m_pAppletList, m_pMessageLabel, KviPointerList< T >::prev(), RICHTEXTLABELTRICK, and VMARGIN.
|
protected |
Registers the given applet in the statusbar.
| pApplet | The pointer to the applet |
References KviPointerList< T >::inSort(), and m_pAppletList.
Referenced by KviStatusBarApplet::KviStatusBarApplet().
| void KviStatusBar::registerAppletDescriptor | ( | KviStatusBarAppletDescriptor * | d | ) |
Registers the applet descriptor.
| d | The applet description to register |
References d, KviStatusBarAppletDescriptor::internalName(), m_pAppletDescriptors, and KviPointerHashTable< Key, T >::replace().
Referenced by StatusBarApplet::selfRegister(), KviStatusBarClock::selfRegister(), KviStatusBarConnectionTimer::selfRegister(), KviStatusBarSeparator::selfRegister(), KviStatusBarAwayIndicator::selfRegister(), KviStatusBarLagIndicator::selfRegister(), and KviStatusBarUpdateIndicator::selfRegister().
|
protectedslot |
Called when the user removes an applet from the statusbar.
References appletExists(), and m_pClickedApplet.
Referenced by contextPopupAboutToShow().
|
protected |
Saves the statusbar stack.
References KviApplication::Config, KviPointerList< T >::count(), KviPointerList< T >::first(), KviCString::Format, g_pApp, KviApplication::getLocalKvircDirectory(), i, m_pAppletList, KviPointerList< T >::next(), KviCString::ptr(), KviConfigurationFile::setGroup(), KviPointerList< T >::sort(), KviConfigurationFile::Write, and KviConfigurationFile::writeEntry().
Referenced by ~KviStatusBar().
|
protectedslot |
Sets the permanent message to be shown.
The message varies upon the connection status
References __tr2qs, KviMainWindow::activeContext(), c, KviIrcContext::Connected, KviIrcContext::Connecting, KviIrcContext::connection(), KviIrcConnection::currentNickName(), KviIrcConnection::currentServerName(), KviIrcContext::LoggingIn, m_pFrame, m_pMessageLabel, m_pMessageTimer, KviIrcContext::state(), KviIrcConnection::userInfo(), and KviIrcConnectionUserInfo::userMode().
Referenced by KviStatusBar(), and messageTimerFired().
|
protected |
Shows the first message in the queue stack.
References connect(), KviPointerList< T >::first(), m_pMessageLabel, m_pMessageQueue, m_pMessageTimer, messageTimerFired(), KviStatusBarMessage::text(), and KviStatusBarMessage::timeout().
Referenced by messageTimerFired(), and queueMessage().
|
protected |
Shows the common help for every applet.
References __tr2qs, and queueMessage().
Referenced by appletsPopupActivated().
|
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
| e | The event triggered |
References __tr2qs, KviMainWindow::activeContext(), appletAt(), c, KviIrcContext::Connected, KviStatusBarApplet::descriptor(), m_pFrame, KviIrcContext::state(), KviStatusBarApplet::tipText(), and KviStatusBarAppletDescriptor::visibleName().
Referenced by event().
|
protected |
Unegisters the given applet in the statusbar.
| pApplet | The pointer to the applet |
References m_pAppletList, and KviPointerList< T >::removeRef().
Referenced by KviStatusBarApplet::~KviStatusBarApplet().
|
friend |
|
friend |
|
protected |
Referenced by appletsPopupActivated(), KviStatusBar(), and ~KviStatusBar().
|
protected |
Referenced by KviStatusBar(), and recalcMinimumHeight().
|
protected |
|
protected |
|
protected |
Referenced by appletsPopupAboutToShow(), contextPopupAboutToShow(), and KviStatusBar().
|
protected |
|
protected |
|
protected |
Referenced by contextMenuRequested(), contextPopupAboutToShow(), and KviStatusBar().
|
protected |
Referenced by KviStatusBar(), mouseDoubleClickEvent(), setPermanentMessage(), and tipRequest().
|
protected |
Referenced by KviStatusBar(), recalcMinimumHeight(), setPermanentMessage(), showFirstMessageInQueue(), and ~KviStatusBar().
|
protected |
Referenced by KviStatusBar(), messageTimerFired(), queueMessage(), showFirstMessageInQueue(), and ~KviStatusBar().
|
protected |
Referenced by KviStatusBar(), messageTimerFired(), queueMessage(), setPermanentMessage(), showFirstMessageInQueue(), and ~KviStatusBar().
|
protected |
1.8.7