KVIrc 5.2.0
Developer APIs
Public Types | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
KviQueryWindow Class Reference

The class which manages a query. More...

#include <KviQueryWindow.h>

+ Inheritance diagram for KviQueryWindow:

Public Types

enum  Flag { Dead = 1 }
 Holds the flags of a query. More...
 
- Public Types inherited from KviWindow
enum  ActivityTemperature {
  Ice = 0 , VeryCold = 1 , Cold = 2 , Undefined = 3 ,
  Hot = 4 , VeryHot = 5 , Fire = 6
}
 Holds the activity meter in temperature scale. More...
 
enum  ActivityValue {
  None = 0 , VeryLow = 1 , Low = 2 , Medium = 3 ,
  High = 4 , VeryHigh = 5
}
 Holds the activity meter in value scale. More...
 
enum  AttentionLevel { VisibleAndActive = 0 , MainWindowIsVisible = 1 }
 attention levels usable in hasAttention() More...
 
enum  Type {
  Console = 0 , Channel = 1 , Query = 2 , DeadChannel = 3 ,
  DeadQuery = 4 , Editor = 5 , Help = 6 , Terminal = 7 ,
  SocketSpy = 8 , Links = 9 , List = 10 , DccChat = 11 ,
  DccTransfer = 12 , DccCanvas = 13 , DccVoice = 14 , DccVideo = 15 ,
  UserWindow = 16 , Tool = 17 , IOGraph = 18 , DirBrowser = 19 ,
  ScriptEditor = 20 , ScriptObject = 21 , LogView = 22 , Offer = 23 ,
  Debug = 24 , Unknown = 25 , TypeCount = 26
}
 Holds the types of a window; these are used by the KVIrc core and distributed modules. More...
 

Public Member Functions

void applyOptions () override
 Applies the options.
 
bool avatarChanged (const QString &szNick)
 Called when the target changes the avatar.
 
QFrame * buttonContainer () override
 Returns the button container.
 
bool isDeadQuery ()
 Returns true if the query is dead.
 
 KviQueryWindow (KviConsoleWindow *lpConsole, const QString &szNick)
 Constructs the query object.
 
void mergeQuery (KviQueryWindow *pQuery)
 Merges a query into the one we're using.
 
bool nickChange (const QString &szOldNick, const QString &szNewNick)
 Called when the target changes the nick.
 
void notifyCommonChannels (const QString &szNick, const QString &szUser, const QString &szHost, int iChans, const QString &szChans)
 Notify us if we have common channels with the target.
 
void ownAction (const QString &szBuffer) override
 Called when we perform an action.
 
void ownMessage (const QString &szBuffer, bool bUserFeedback=true) override
 Called when we send a message to the query target.
 
int selectedCount ()
 Returns the number of selected users in the userlist.
 
void setAliveQuery ()
 Sets the status of the query as alive.
 
void setDeadQuery ()
 Sets the status of the query as dead.
 
KviUserListEntrysetTarget (const QString &szNick, const QString &szUser, const QString &szHost)
 Sets the target of the query.
 
void showListView (bool bShow, bool bIgnoreSizeChange=false)
 Shows the userlist view.
 
QSize sizeHint () const override
 Returns the size of the query object.
 
const QString & target () override
 Returns the name of the query target.
 
void updateLabelText ()
 Updates the text of the tooltip.
 
void userAction (const QString &szNick, const QString &szUser, const QString &szHost, unsigned int uActionType)
 Called when a user performs an action.
 
void userAction (const QString &szNick, unsigned int uActionType)
 Called when a user performs an action.
 
void userAction (KviIrcMask *user, unsigned int uActionType)
 Called when a user performs an action.
 
KviUserListViewuserListView ()
 Returns the userlist of the query (the remote peer)
 
 ~KviQueryWindow ()
 Destroys the query object.
 
- Public Member Functions inherited from KviWindow
virtual bool activityMeter (unsigned int *puActivityValue, unsigned int *puActivityTemperature)
 
KviIrcConnectionconnection ()
 Returns the current IRC connection (if any)
 
KviConsoleWindowconsole () const
 Returns the console that this window belongs to.
 
KviIrcContextcontext ()
 
void contextPopup ()
 
QString decodeText (const char *pcText)
 
virtual QTextCodec * defaultTextCodec ()
 
void delayedAutoRaise ()
 
void delayedClose ()
 
void demandAttention ()
 Notify the window manager that this window demands attention.
 
QByteArray encodeText (const QString &szText)
 
void forceTextCodec (QTextCodec *pCodec)
 
virtual void getConfigGroupName (QString &szBuffer)
 
void getDefaultLogFileName (QString &szBuffer)
 
void getDefaultLogFileName (QString &szBuffer, QDate date, bool bGzip, unsigned int uDatetimeFormat)
 
bool hasAttention (AttentionLevel eLevel=VisibleAndActive)
 Returns whether this window is the active one.
 
virtual bool highlightMe (unsigned int uValue)
 
virtual bool highlightMeter (unsigned int *puValue)
 
QString id () const
 Returns the global ID of this window.
 
KviInputinput () const
 
void internalOutput (KviIrcView *pView, int iMsgType, const kvi_wchar_t *pwText, int iFlags=0, const QDateTime &datetime=QDateTime())
 
bool isChannel () const
 
bool isConsole () const
 
bool isDocked () const
 
bool isQuery () const
 
 KviWindow (Type eType, const QString &szName, KviConsoleWindow *pConsole=nullptr)
 Constructs the window object.
 
virtual KviIrcViewlastClickedView () const
 Returns the KviIrcView that was last clicked in this window.
 
const QString & lastLineOfText ()
 
const QString & lastMessageText ()
 
void listWindowTypes ()
 
virtual const QString & localNick ()
 
QTextEncoder * makeEncoder ()
 
unsigned long int numericId () const
 Returns the global ID of this window.
 
virtual void output (int iMsgType, const char *pcFormat,...)
 
virtual void output (int iMsgType, const kvi_wchar_t *pwFormat,...)
 
void output (int iMsgType, const QDateTime &datetime, const char *pcFormat,...)
 
void output (int iMsgType, const QDateTime &datetime, const kvi_wchar_t *pwFormat,...)
 
void output (int iMsgType, const QDateTime &datetime, QString szFmt,...)
 
virtual void output (int iMsgType, QString szFmt,...)
 
virtual void outputNoFmt (int iMsgType, const char *pcText, int iFlags=0, const QDateTime &datetime=QDateTime())
 
virtual void outputNoFmt (int iMsgType, const kvi_wchar_t *pwText, int iFlags=0, const QDateTime &datetime=QDateTime())
 
virtual void outputNoFmt (int iMsgType, const QString &szText, int iFlags=0, const QDateTime &datetime=QDateTime())
 
virtual KviWindowoutputProxy ()
 
void pasteLastLog ()
 Pastes the most recent channel log into the buffer.
 
virtual const QString & plainTextCaption ()
 
void setFixedCaption (const QString &szCaption)
 
void setProgress (int iProgress)
 Sets the progress for the WindowList item.
 
bool setTextEncoding (const QString &szTextEncoding)
 
void setWindowName (const QString &szName)
 Sets the name of the window.
 
void setWindowTitle (QString &szTitle)
 
KviTalSplittersplitter () const
 Returns the splitter of this window.
 
QTextCodec * textCodec ()
 
const QString & textEncoding () const
 
virtual void toggleButtonContainer ()
 
Type type () const
 Returns the type of the window.
 
virtual const char * typeString ()
 Returns a descriptive name of the window type.
 
void unhighlight ()
 
void updateBackgrounds (QObject *pObj=nullptr)
 
virtual void updateCaption ()
 
virtual void updateIcon ()
 
KviIrcViewview () const
 Returns the KviIrcView of this window.
 
KviWindowListItemwindowListItem () const
 Returns the windowList item.
 
const QString & windowName () const
 Returns the name of this window.
 
 ~KviWindow ()
 Destroys the window object.
 

Protected Slots

void slotDndEvents (const QString &szFile)
 Triggers the OnQueryFileDropped event.
 
void textViewRightClicked ()
 Triggers the OnQueryPopupRequest event.
 
void toggleListView ()
 Toggles the userlist view.
 
- Protected Slots inherited from KviWindow
void childDestroyed ()
 
void cryptControllerFinished ()
 
void cryptSessionInfoDestroyed ()
 
void systemTextEncodingPopupActivated (QAction *pAction)
 
void textEncodingButtonClicked ()
 
void toggleCryptController ()
 

Protected Member Functions

void fillCaptionBuffers () override
 Fills in the caption buffers.
 
void getBaseLogFileName (QString &szBuffer) override
 Gets the base of the log file name.
 
QString getInfoLabelText ()
 Gets the info of the text in the upper part of the query.
 
void getWindowListTipText (QString &szBuffer) override
 Gets the window list and info label tooltip text.
 
void loadProperties (KviConfigurationFile *pCfg) override
 Loads the properties from file.
 
QPixmap * myIconPtr () override
 Returns the icon associated to the query.
 
void notifyTargetChange (const QString &szOldNick, const QString &szOldUser, const QString &szOldHost, const QString &szNick, const QString &szUser, const QString &szHost)
 Called to notify us that the target of the query is changed.
 
void resizeEvent (QResizeEvent *) override
 
void saveProperties (KviConfigurationFile *pCfg) override
 Saves the properties to file.
 
void triggerCreationEvents () override
 Trigger the OnQueryWindowCreated event.
 
- Protected Member Functions inherited from KviWindow
void childEvent (QChildEvent *pEvent) override
 
void childInserted (QWidget *pObject)
 
void childRemoved (QWidget *pObject)
 
virtual void childrenTreeChanged (QWidget *pAdded)
 
void closeEvent (QCloseEvent *pEvent) override
 
void createCryptControllerButton (QWidget *pPar)
 
void createSystemTextEncodingPopup ()
 
void createTextEncodingButton (QWidget *pPar)
 
QToolButton * createToolButton (QWidget *pPar, const char *pcName, KviIconManager::SmallIcon eIcon, const QString &szToolTip, bool bOn)
 
virtual void createWindowListItem ()
 
virtual void destroyWindowListItem ()
 
bool eventFilter (QObject *pObject, QEvent *pEvent) override
 
void fillSingleColorCaptionBuffers (const QString &szName)
 
void focusInEvent (QFocusEvent *) override
 
bool focusNextPrevChild (bool bNext) override
 
void inputMethodEvent (QInputMethodEvent *e) override
 
virtual void lostUserFocus ()
 
void moveEvent (QMoveEvent *pEvent) override
 
virtual void preprocessMessage (QString &szMessage)
 
void setType (Type eType)
 
virtual void triggerDestructionEvents ()
 
virtual void youAreDocked ()
 
virtual void youAreUndocked ()
 

Protected Attributes

int m_iFlags
 
QFrame * m_pButtonGrid
 
KviThemedLabelm_pLabel
 
KviWindowToolPageButtonm_pListViewButton
 
KviUserListViewm_pUserListView
 
QList< int > m_SplitterSizesList
 
- Protected Attributes inherited from KviWindow
bool m_bIsDocked
 
bool m_bProcessingInputEvent
 
Type m_eType
 
KviTalHBoxm_pButtonBox
 
KviConsoleWindowm_pConsole
 
QWidget * m_pFocusHandler
 
QToolButton * m_pHideToolsButton
 
KviInputm_pInput
 
KviIrcViewm_pIrcView
 
QWidget * m_pLastFocusedChild
 
KviTalSplitterm_pSplitter
 
QTextCodec * m_pTextCodec
 
QToolButton * m_pTextEncodingButton
 
KviWindowListItemm_pWindowListItem
 
QString m_szName
 
QString m_szPlainTextCaption
 
QString m_szTextEncoding
 
unsigned long int m_uId
 

Additional Inherited Members

- Public Slots inherited from KviWindow
void autoRaise ()
 
void dock ()
 
void reloadImages ()
 
void savePropertiesAsDefault ()
 
void undock ()
 
- Signals inherited from KviWindow
void windowNameChanged ()
 
- Static Protected Attributes inherited from KviWindow
static const char * m_typeTable [TypeCount]
 
- Properties inherited from KviWindow
int KviProperty_ChildFocusOwner
 

Detailed Description

The class which manages a query.

Member Enumeration Documentation

◆ Flag

Holds the flags of a query.

Enumerator
Dead 

Constructor & Destructor Documentation

◆ KviQueryWindow()

KviQueryWindow::KviQueryWindow ( KviConsoleWindow lpConsole,
const QString &  szNick 
)

◆ ~KviQueryWindow()

KviQueryWindow::~KviQueryWindow ( )

Member Function Documentation

◆ applyOptions()

void KviQueryWindow::applyOptions ( )
overridevirtual

◆ avatarChanged()

bool KviQueryWindow::avatarChanged ( const QString &  szNick)
inline

Called when the target changes the avatar.

Parameters
szNickThe nickname of the user
Returns
bool

References KviUserListView::avatarChanged().

◆ buttonContainer()

QFrame * KviQueryWindow::buttonContainer ( )
inlineoverridevirtual

Returns the button container.

Returns
QFrame *

Reimplemented from KviWindow.

Referenced by KviQueryWindow().

◆ fillCaptionBuffers()

void KviQueryWindow::fillCaptionBuffers ( )
overrideprotectedvirtual

◆ getBaseLogFileName()

void KviQueryWindow::getBaseLogFileName ( QString &  szBuffer)
overrideprotectedvirtual

Gets the base of the log file name.

Parameters
szBufferThe buffer where to save the info
Returns
void

Reimplemented from KviWindow.

References KviWindow::connection(), KviWindow::console(), KviWindow::context(), KviConsoleWindow::currentNetworkName(), szBuffer, and KviWindow::windowName().

◆ getInfoLabelText()

QString KviQueryWindow::getInfoLabelText ( )
protected

◆ getWindowListTipText()

void KviQueryWindow::getWindowListTipText ( QString &  szBuffer)
overrideprotectedvirtual

◆ isDeadQuery()

bool KviQueryWindow::isDeadQuery ( )
inline

Returns true if the query is dead.

Returns
bool

Referenced by myIconPtr().

◆ loadProperties()

void KviQueryWindow::loadProperties ( KviConfigurationFile pCfg)
overrideprotectedvirtual

Loads the properties from file.

Parameters
pCfgThe configuration file
Returns
void

Reimplemented from KviWindow.

References KviWindow::loadProperties(), KviWindow::m_pSplitter, m_SplitterSizesList, KviConfigurationFile::readBoolEntry(), KviConfigurationFile::readIntListEntry(), and showListView().

◆ mergeQuery()

void KviQueryWindow::mergeQuery ( KviQueryWindow pQuery)

Merges a query into the one we're using.

Parameters
pQueryThe source query
Returns
void

References KviIrcView::appendMessagesFrom(), KviWindow::m_pIrcView, and updateLabelText().

Referenced by KviIrcServerParser::parseLiteralNick().

◆ myIconPtr()

QPixmap * KviQueryWindow::myIconPtr ( )
overrideprotectedvirtual

Returns the icon associated to the query.

Returns
QPixmap *

Reimplemented from KviWindow.

References KviIconManager::DeadQuery, g_pIconManager, KviIconManager::getSmallIcon(), isDeadQuery(), and KviIconManager::Query.

◆ nickChange()

bool KviQueryWindow::nickChange ( const QString &  szOldNick,
const QString &  szNewNick 
)

Called when the target changes the nick.

Parameters
szOldNickThe old nickname of the user
szNewNickThe new nickname of the user
Returns
bool

References m_pUserListView, KviUserListView::nickChange(), KviWindow::setWindowName(), KviWindow::updateCaption(), and updateLabelText().

◆ notifyCommonChannels()

void KviQueryWindow::notifyCommonChannels ( const QString &  szNick,
const QString &  szUser,
const QString &  szHost,
int  iChans,
const QString &  szChans 
)

Notify us if we have common channels with the target.

Parameters
szNickThe nickname of the user
szUserThe username of the user
szHostThe hostname of the user
iChansThe number of common channels
szChansThe common channels
Returns
void

References __tr2qs, KVI_OUT_QUERYTRACE, KviWindow::output(), szHost, and updateLabelText().

Referenced by KviIrcServerParser::parseLiteralNick(), and setTarget().

◆ notifyTargetChange()

void KviQueryWindow::notifyTargetChange ( const QString &  szOldNick,
const QString &  szOldUser,
const QString &  szOldHost,
const QString &  szNick,
const QString &  szUser,
const QString &  szHost 
)
protected

Called to notify us that the target of the query is changed.

Parameters
szOldNickThe old nickname of the target
szOldUserThe old username of the target
szOldHostThe old hostname of the target
szNickThe new nickname of the target
szUserThe new username of the target
szHostThe new hostname of the target
Returns
void

References __tr2qs, KVI_OUT_QUERYTRACE, KviWindow::output(), szHost, and updateLabelText().

Referenced by userAction(), and userAction().

◆ ownAction()

void KviQueryWindow::ownAction ( const QString &  szBuffer)
overridevirtual

◆ ownMessage()

void KviQueryWindow::ownMessage ( const QString &  szBuffer,
bool  bUserFeedback = true 
)
overridevirtual

◆ resizeEvent()

void KviQueryWindow::resizeEvent ( QResizeEvent *  )
overrideprotected

◆ saveProperties()

void KviQueryWindow::saveProperties ( KviConfigurationFile pCfg)
overrideprotectedvirtual

Saves the properties to file.

Parameters
pCfgThe configuration file
Returns
void

Reimplemented from KviWindow.

References KviWindow::m_pSplitter, m_pUserListView, m_SplitterSizesList, KviWindow::saveProperties(), and KviConfigurationFile::writeEntry().

◆ selectedCount()

int KviQueryWindow::selectedCount ( )
inline

Returns the number of selected users in the userlist.

Returns
int

References KviUserListView::selectedCount().

◆ setAliveQuery()

void KviQueryWindow::setAliveQuery ( )

◆ setDeadQuery()

void KviQueryWindow::setDeadQuery ( )

◆ setTarget()

KviUserListEntry * KviQueryWindow::setTarget ( const QString &  szNick,
const QString &  szUser,
const QString &  szHost 
)

◆ showListView()

void KviQueryWindow::showListView ( bool  bShow,
bool  bIgnoreSizeChange = false 
)

Shows the userlist view.

Parameters
bShowWhether to show or hide the view
bIgnoreSizeChangeWhether to ignore the size change
Returns
void

References m_pListViewButton, KviWindow::m_pSplitter, m_pUserListView, and m_SplitterSizesList.

Referenced by loadProperties(), and toggleListView().

◆ sizeHint()

QSize KviQueryWindow::sizeHint ( ) const
override

Returns the size of the query object.

Returns
QSize

References KviInput::heightHint(), KviWindow::m_pInput, KviWindow::m_pIrcView, KviWindow::m_pSplitter, and KviIrcView::sizeHint().

◆ slotDndEvents

void KviQueryWindow::slotDndEvents ( const QString &  szFile)
protectedslot

Triggers the OnQueryFileDropped event.

Parameters
szFileThe file dropped in the query
Returns
void

References KviEvent_OnQueryFileDropped, and KVS_TRIGGER_EVENT_1.

Referenced by KviQueryWindow().

◆ target()

const QString & KviQueryWindow::target ( )
inlineoverridevirtual

Returns the name of the query target.

Returns
const QString &

Reimplemented from KviWindow.

References KviWindow::windowName().

Referenced by setAliveQuery().

◆ textViewRightClicked

void KviQueryWindow::textViewRightClicked ( )
protectedslot

Triggers the OnQueryPopupRequest event.

Returns
void

References KviEvent_OnQueryPopupRequest, and KVS_TRIGGER_EVENT_0.

Referenced by KviQueryWindow().

◆ toggleListView

void KviQueryWindow::toggleListView ( )
protectedslot

Toggles the userlist view.

Returns
void

References m_pUserListView, and showListView().

Referenced by KviQueryWindow().

◆ triggerCreationEvents()

void KviQueryWindow::triggerCreationEvents ( )
overrideprotectedvirtual

Trigger the OnQueryWindowCreated event.

Returns
void

Reimplemented from KviWindow.

References KviEvent_OnQueryWindowCreated, and KVS_TRIGGER_EVENT_0.

◆ updateLabelText()

void KviQueryWindow::updateLabelText ( )

◆ userAction() [1/3]

void KviQueryWindow::userAction ( const QString &  szNick,
const QString &  szUser,
const QString &  szHost,
unsigned int  uActionType 
)

Called when a user performs an action.

Parameters
szNickThe nickname of the user
szUserThe username of the user
szHostThe hostname of the user
uActionTypeThe type of the action
Returns
void

References kvi_getUserActionTemperature(), KVI_OPTION_BOOL, KviOption_boolEnableQueryTracing, m_pUserListView, notifyTargetChange(), szHost, updateLabelText(), KviUserListView::userAction(), and KviUserListView::userActionVerifyMask().

◆ userAction() [2/3]

void KviQueryWindow::userAction ( const QString &  szNick,
unsigned int  uActionType 
)

Called when a user performs an action.

Parameters
szNickThe nickname of the user
uActionTypeThe type of the action
Returns
void

References kvi_getUserActionTemperature(), m_pUserListView, updateLabelText(), and KviUserListView::userAction().

◆ userAction() [3/3]

void KviQueryWindow::userAction ( KviIrcMask user,
unsigned int  uActionType 
)

◆ userListView()

KviUserListView * KviQueryWindow::userListView ( )
inline

Returns the userlist of the query (the remote peer)

Returns
KviUserListView *

Referenced by KviApplication::notifierMessage().

Member Data Documentation

◆ m_iFlags

int KviQueryWindow::m_iFlags
protected

◆ m_pButtonGrid

QFrame* KviQueryWindow::m_pButtonGrid
protected

Referenced by KviQueryWindow().

◆ m_pLabel

KviThemedLabel* KviQueryWindow::m_pLabel
protected

◆ m_pListViewButton

KviWindowToolPageButton* KviQueryWindow::m_pListViewButton
protected

Referenced by KviQueryWindow(), and showListView().

◆ m_pUserListView

KviUserListView* KviQueryWindow::m_pUserListView
protected

◆ m_SplitterSizesList

QList<int> KviQueryWindow::m_SplitterSizesList
protected

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