KVIrc  4.9.2
DeveloperAPIs
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

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

Protected Slots

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

Protected Member Functions

virtual void fillCaptionBuffers ()
 Fills in the caption buffers. More...
 
virtual void getBaseLogFileName (QString &szBuffer)
 Gets the base of the log file name. More...
 
QString getInfoLabelText ()
 Gets the info of the text in the upper part of the query. More...
 
virtual void getWindowListTipText (QString &szBuffer)
 Gets the window list and info label tooltip text. More...
 
virtual void loadProperties (KviConfigurationFile *pCfg)
 Loads the properties from file. More...
 
virtual QPixmap * myIconPtr ()
 Returns the icon associated to the query. More...
 
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. More...
 
virtual void resizeEvent (QResizeEvent *)
 
virtual void saveProperties (KviConfigurationFile *pCfg)
 Saves the properties to file. More...
 
virtual void triggerCreationEvents ()
 Trigger the OnQueryWindowCreated event. More...
 
- Protected Member Functions inherited from KviWindow
virtual void childEvent (QChildEvent *pEvent)
 
void childInserted (QWidget *pObject)
 
void childRemoved (QWidget *pObject)
 
virtual void childrenTreeChanged (QWidget *pAdded)
 
virtual void closeEvent (QCloseEvent *pEvent)
 
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)
 
void fillSingleColorCaptionBuffers (const QString &szName)
 
virtual void focusInEvent (QFocusEvent *)
 
virtual bool focusNextPrevChild (bool bNext)
 
virtual void inputMethodEvent (QInputMethodEvent *e)
 
virtual void lostUserFocus ()
 
virtual void moveEvent (QMoveEvent *pEvent)
 
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

Holds the flags of a query.

Enumerator
Dead 

Constructor & Destructor Documentation

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

Member Function Documentation

void KviQueryWindow::applyOptions ( )
virtual
bool KviQueryWindow::avatarChanged ( const QString &  szNick)
inline

Called when the target changes the avatar.

Parameters
szNickThe nickname of the user
Returns
bool
QFrame* KviQueryWindow::buttonContainer ( )
inlinevirtual

Returns the button container.

Returns
QFrame *

Reimplemented from KviWindow.

Referenced by KviQueryWindow().

void KviQueryWindow::fillCaptionBuffers ( )
protectedvirtual
void KviQueryWindow::getBaseLogFileName ( QString &  szBuffer)
protectedvirtual

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(), KviConsoleWindow::context(), KviWindow::context(), KviConsoleWindow::currentNetworkName(), KviIrcContext::id(), and KviWindow::windowName().

QString KviQueryWindow::getInfoLabelText ( )
protected
void KviQueryWindow::getWindowListTipText ( QString &  szBuffer)
protectedvirtual
bool KviQueryWindow::isDeadQuery ( )
inline

Returns true if the query is dead.

Returns
bool

Referenced by myIconPtr().

QByteArray KviQueryWindow::loadLogFile ( const QString &  szFileName,
bool  bGzip 
)

Loads a log file.

It opens a logfile, gzipped or not, and returns the content in a buffer

Parameters
szFileNameThe filename of the log file
bGzipWhether the log file is gzipped
Returns
QByteArray

Referenced by pasteLastLog().

void KviQueryWindow::loadProperties ( KviConfigurationFile pCfg)
protectedvirtual

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

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

QPixmap * KviQueryWindow::myIconPtr ( )
protectedvirtual

Returns the icon associated to the query.

Returns
QPixmap *

Reimplemented from KviWindow.

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

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

Referenced by KviIrcServerParser::parseLiteralNick().

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::parseLiteralJoin(), KviIrcServerParser::parseLiteralKick(), KviIrcServerParser::parseLiteralNick(), KviIrcServerParser::parseLiteralPart(), and setTarget().

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(), and updateLabelText().

Referenced by userAction().

void KviQueryWindow::ownAction ( const QString &  szBuffer)
virtual
void KviQueryWindow::ownMessage ( const QString &  szBuffer,
bool  bUserFeedback = true 
)
virtual
void KviQueryWindow::pasteLastLog ( )

Pastes the most recent channel log into the buffer.

It searches for the most recent channel log of the channel we have just joined, and pastes into the buffer the last N lines, where N is get from the options

Returns
void

References __tr2qs, KviWindow::console(), KviConsoleWindow::currentNetworkName(), g_pApp, KviApplication::getLocalKvircDirectory(), i, KVI_OPTION_UINT, KVI_OUT_QUERYPRIVMSG, KviOption_uintDaysIntervalToPasteOnQueryJoin, KviOption_uintLinesToPasteOnQueryJoin, loadLogFile(), KviApplication::Log, KviWindow::output(), and target().

Referenced by KviIrcServerParser::parseLiteralNotice(), and KviIrcServerParser::parseLiteralPrivmsg().

void KviQueryWindow::resizeEvent ( QResizeEvent *  )
protectedvirtual
void KviQueryWindow::saveProperties ( KviConfigurationFile pCfg)
protectedvirtual

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

int KviQueryWindow::selectedCount ( )
inline

Returns the number of selected users in the userlist.

Returns
int
void KviQueryWindow::setAliveQuery ( )
void KviQueryWindow::setDeadQuery ( )
KviUserListEntry * KviQueryWindow::setTarget ( const QString &  szNick,
const QString &  szUser,
const QString &  szHost 
)
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().

QSize KviQueryWindow::sizeHint ( ) const
virtual

Returns the size of the query object.

Returns
QSize

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

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

virtual const QString& KviQueryWindow::target ( )
inlinevirtual

Returns the name of the query target.

Returns
const QString &

Reimplemented from KviWindow.

References KviWindow::windowName().

Referenced by pasteLastLog(), and setAliveQuery().

void KviQueryWindow::textViewRightClicked ( )
protectedslot

Triggers the OnQueryPopupRequest event.

Returns
void

References KviEvent_OnQueryPopupRequest, and KVS_TRIGGER_EVENT_0.

Referenced by KviQueryWindow().

void KviQueryWindow::toggleListView ( )
protectedslot

Toggles the userlist view.

Returns
void

References m_pUserListView, and showListView().

Referenced by KviQueryWindow().

void KviQueryWindow::triggerCreationEvents ( )
protectedvirtual

Trigger the OnQueryWindowCreated event.

Returns
void

Reimplemented from KviWindow.

References KviEvent_OnQueryWindowCreated, and KVS_TRIGGER_EVENT_0.

void KviQueryWindow::updateLabelText ( )
void KviQueryWindow::userAction ( KviIrcMask user,
unsigned int  uActionType 
)
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().

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(), updateLabelText(), KviUserListView::userAction(), and KviUserListView::userActionVerifyMask().

KviUserListView* KviQueryWindow::userListView ( )
inline

Returns the userlist of the query (the remote peer)

Returns
KviUserListView *

Referenced by KviApplication::notifierMessage().

Member Data Documentation

int KviQueryWindow::m_iFlags
protected
QFrame* KviQueryWindow::m_pButtonGrid
protected

Referenced by KviQueryWindow().

KviThemedLabel* KviQueryWindow::m_pLabel
protected
KviWindowToolPageButton* KviQueryWindow::m_pListViewButton
protected

Referenced by KviQueryWindow(), and showListView().

KviUserListView* KviQueryWindow::m_pUserListView
protected
QList<int> KviQueryWindow::m_SplitterSizesList
protected

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