KVIrc  4.9.2
DeveloperAPIs
KviQueryWindow.h
Go to the documentation of this file.
1 #ifndef _KVI_QUERY_H_
2 #define _KVI_QUERY_H_
3 //=============================================================================
4 //
5 // File : KviQueryWindow.h
6 // Creation date : Mon Aug 7 2000 14:19:00 by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 2000-2010 Szymon Stefanek (pragma at kvirc dot net)
10 //
11 // This program is FREE software. You can redistribute it and/or
12 // modify it under the terms of the GNU General Public License
13 // as published by the Free Software Foundation; either version 2
14 // of the License, or (at your option) any later version.
15 //
16 // This program is distributed in the HOPE that it will be USEFUL,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 // See the GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, write to the Free Software Foundation,
23 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 //=============================================================================
26 
33 #include "kvi_settings.h"
34 #include "KviWindow.h"
35 #include "KviCString.h"
36 #include "KviIrcUserDataBase.h"
37 #include "KviUserListView.h"
38 #include "KviThemedLabel.h"
39 #include "KviPointerHashTable.h"
40 
41 class KviConsoleWindow;
44 
50 {
51  Q_OBJECT
52 public:
57  enum Flag
58  {
59  Dead = 1
60  };
61 
68  KviQueryWindow(KviConsoleWindow * lpConsole, const QString & szNick);
69 
73  ~KviQueryWindow();
74 
75 protected:
78  int m_iFlags;
80  QFrame * m_pButtonGrid;
81  QList<int> m_SplitterSizesList;
82 
83 public:
88  KviUserListView * userListView() { return m_pUserListView; };
89 
94  void setDeadQuery();
95 
100  void setAliveQuery();
101 
106  bool isDeadQuery() { return m_iFlags & Dead; };
107 
112  virtual QSize sizeHint() const;
113 
118  virtual const QString & target() { return windowName(); };
119 
127  KviUserListEntry * setTarget(const QString & szNick, const QString & szUser, const QString & szHost);
128 
133  QFrame * buttonContainer() { return (QFrame *)m_pButtonGrid; };
134 
139  virtual void applyOptions();
140 
147  void userAction(KviIrcMask * user, unsigned int uActionType);
148 
155  void userAction(const QString & szNick, unsigned int uActionType);
156 
165  void userAction(const QString & szNick, const QString & szUser, const QString & szHost, unsigned int uActionType);
166 
173  bool nickChange(const QString & szOldNick, const QString & szNewNick);
174 
181  void ownMessage(const QString & szBuffer, bool bUserFeedback = true);
182 
188  void ownAction(const QString & szBuffer);
189 
194  int selectedCount() { return m_pUserListView->selectedCount(); };
195 
201  bool avatarChanged(const QString & szNick) { return m_pUserListView->avatarChanged(szNick); };
202 
212  void notifyCommonChannels(const QString & szNick, const QString & szUser, const QString & szHost, int iChans, const QString & szChans);
213 
220  void showListView(bool bShow, bool bIgnoreSizeChange = false);
221 
227  void mergeQuery(KviQueryWindow * pQuery);
228 
233  void updateLabelText();
234 
243  void pasteLastLog();
244 
253  QByteArray loadLogFile(const QString & szFileName, bool bGzip);
254 
255 protected:
266  void notifyTargetChange(const QString & szOldNick, const QString & szOldUser, const QString & szOldHost, const QString & szNick, const QString & szUser, const QString & szHost);
267 
272  QString getInfoLabelText();
273 
278  virtual void getWindowListTipText(QString & szBuffer);
279 
284  virtual QPixmap * myIconPtr();
285 
290  virtual void fillCaptionBuffers();
291 
297  virtual void loadProperties(KviConfigurationFile * pCfg);
298 
304  virtual void saveProperties(KviConfigurationFile * pCfg);
305 
311  virtual void getBaseLogFileName(QString & szBuffer);
312 
317  virtual void triggerCreationEvents();
318 
319  virtual void resizeEvent(QResizeEvent *);
320 protected slots:
325  void textViewRightClicked();
326 
331  void toggleListView();
332 
338  void slotDndEvents(const QString & szFile);
339 };
340 
341 #endif //_KVI_CHANNEL_H_
QList< int > m_SplitterSizesList
Definition: KviQueryWindow.h:81
Definition: KviConsoleWindow.h:75
virtual void saveProperties(KviConfigurationFile *pCfg)
Definition: KviWindow.cpp:562
#define KVIRC_API
Definition: kvi_settings.h:128
KviUserListView * userListView()
Returns the userlist of the query (the remote peer)
Definition: KviQueryWindow.h:88
User list view management.
virtual void loadProperties(KviConfigurationFile *pCfg)
Definition: KviWindow.cpp:588
Definition: KviConfigurationFile.h:48
KviWindowToolPageButton * m_pListViewButton
Definition: KviQueryWindow.h:77
const QString & windowName()
Returns the name of this window.
Definition: KviWindow.h:228
Irc user mask handling.
Definition: KviIrcMask.h:45
The class which manages a query.
Definition: KviQueryWindow.h:49
Pointer Hash Table.
virtual QPixmap * myIconPtr()
Definition: KviWindow.cpp:619
QString szHost
Definition: libkvisetup.cpp:45
virtual void applyOptions()
Definition: KviWindow.cpp:1129
virtual void ownMessage(const QString &, bool=true)
Definition: KviWindow.h:380
User DB handling.
virtual void fillCaptionBuffers()
Definition: KviWindow.cpp:624
Definition: KviWindowToolWidget.h:47
virtual void triggerCreationEvents()
Definition: KviWindow.h:437
KviThemedLabel * m_pLabel
Definition: KviQueryWindow.h:79
virtual void getWindowListTipText(QString &szBuffer)
Definition: KviWindow.h:348
virtual void ownAction(const QString &)
Definition: KviWindow.h:381
bool isDeadQuery()
Returns true if the query is dead.
Definition: KviQueryWindow.h:106
Base class for all windows in KVIrc.
Definition: KviWindow.h:74
Flag
Holds the flags of a query.
Definition: KviQueryWindow.h:57
Definition: KviThemedLabel.h:33
Contains the KviWindow class.
virtual void getBaseLogFileName(QString &szBuffer)
Definition: KviWindow.cpp:557
KviUserListView * m_pUserListView
Definition: KviQueryWindow.h:76
char szBuffer[4096]
Definition: winamp.cpp:77
QFrame * m_pButtonGrid
Definition: KviQueryWindow.h:80
This file contains compile time settings.
int selectedCount()
Returns the number of selected users in the userlist.
Definition: KviQueryWindow.h:194
QFrame * buttonContainer()
Returns the button container.
Definition: KviQueryWindow.h:133
User list view management class.
Definition: KviUserListView.h:226
int m_iFlags
Definition: KviQueryWindow.h:78
virtual const QString & target()
Returns the name of the query target.
Definition: KviQueryWindow.h:118
bool avatarChanged(const QString &szNick)
Called when the target changes the avatar.
Definition: KviQueryWindow.h:201
Userlist entry management class.
Definition: KviUserListView.h:134