KVIrc  4.9.2
DeveloperAPIs
KviNotifyList.h
Go to the documentation of this file.
1 #ifndef _KVI_NOTIFYLIST_H_
2 #define _KVI_NOTIFYLIST_H_
3 
4 //=============================================================================
5 //
6 // File : KviNotifyList.h
7 // Creation date : Fri Oct 27 2000 23:39:09 CEST by Szymon Stefanek
8 //
9 // This file is part of the KVIrc IRC client distribution
10 // Copyright (C) 2000-2010 Szymon Stefanek (pragma at kvirc dot net)
11 //
12 // This program is FREE software. You can redistribute it and/or
13 // modify it under the terms of the GNU General Public License
14 // as published by the Free Software Foundation; either version 2
15 // of the License, or (at your option) any later version.
16 //
17 // This program is distributed in the HOPE that it will be USEFUL,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 // See the GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program. If not, write to the Free Software Foundation,
24 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 //
26 //=============================================================================
27 
28 #include "kvi_settings.h"
29 #include "KviQString.h"
30 #include "KviPointerList.h"
31 #include "KviPointerHashTable.h"
32 
33 #include <QObject>
34 #include <QTimer>
35 
36 class KviConsoleWindow;
37 class KviIrcMessage;
38 class KviIrcMask;
39 class KviIrcConnection;
40 
41 class KVIRC_API KviNotifyListManager : public QObject
42 {
43  friend class KviConsoleWindow;
44  friend class KviConnectionInfo;
45  friend class KviIrcServerParser;
46  friend class KviIrcConnection;
47  Q_OBJECT
48 protected:
51 
52 protected:
55 
56 protected:
57  virtual void start();
58  virtual void stop();
59  virtual bool handleUserhost(KviIrcMessage * msg);
60  virtual bool handleIsOn(KviIrcMessage * msg);
61  virtual bool handleWatchReply(KviIrcMessage * msg);
62  void notifyOnLine(const QString & nick, const QString & user = QString(), const QString & host = QString(), const QString & szReason = QString(), bool bJoin = true);
63  void notifyOffLine(const QString & nick, const QString & user = QString(), const QString & host = QString(), const QString & szReason = QString());
64 
65 public:
67 };
68 
70 {
71  friend class KviConsoleWindow;
72  friend class KviIrcServerParser;
73  friend class KviIrcConnection;
74  Q_OBJECT
75 protected:
78 
79 private:
80  KviPointerHashTable<QString, QString> * m_pRegUserDict; // dict notifystring->reguser name
81  KviPointerList<QString> * m_pNotifyList; // list of notifystring (total)
82  KviPointerList<QString> * m_pIsOnList; // list of notifystring (one session)
83  QString m_szIsOnString; // m_pIsOnList in form of a string
92  bool m_bRunning;
93 
94 protected:
95  virtual void start();
96  virtual void stop();
97  virtual bool handleUserhost(KviIrcMessage * msg);
98  virtual bool handleIsOn(KviIrcMessage * msg);
99 
100 private:
101  void delayedNotifySession();
102  void delayedIsOnSession();
103  void delayedUserhostSession();
104 private slots:
105  void newNotifySession();
106  void newIsOnSession();
107  void newUserhostSession();
108 
109  void buildRegUserDict();
110  void buildIsOnList();
111  void buildUserhostList();
112  void buildNotifyList();
113  void sendIsOn();
114  void sendUserhost();
115  bool doMatchUser(const QString & notifyString, const KviIrcMask & mask);
116 };
117 
119 {
120  friend class KviConsoleWindow;
121  friend class KviIrcServerParser;
122  friend class KviIrcConnection;
123  Q_OBJECT
124 protected:
127 
128 protected:
133 
134 protected:
135  virtual void start();
136  virtual void stop();
137  virtual bool handleIsOn(KviIrcMessage * msg);
138 
139 protected:
140  virtual void timerEvent(QTimerEvent * e);
141 
142 private:
143  void buildNickList();
144  void sendIsOn();
145 };
146 
148 {
149  friend class KviConsoleWindow;
150  friend class KviIrcServerParser;
151  friend class KviIrcConnection;
152  Q_OBJECT
153 public:
156 
157 protected:
158  KviPointerHashTable<QString, QString> * m_pRegUserDict; // dict notifystring->reguser name
159 protected:
160  void buildRegUserDict();
161  virtual void start();
162  virtual void stop();
163  virtual bool handleWatchReply(KviIrcMessage * msg);
164  bool doMatchUser(KviIrcMessage * msg, const QString & notifyString, const KviIrcMask & mask);
165 };
166 
167 #endif //_KVI_NOTIFYLIST_H_
void start()
This starts an asynchronous connection attempt.
Definition: KviIrcConnection.cpp:286
virtual void start()
Definition: KviNotifyList.cpp:127
QTimer * m_pDelayedNotifyTimer
Definition: KviNotifyList.h:90
Definition: KviConsoleWindow.h:75
bool m_bExpectingIsOn
Definition: KviNotifyList.h:87
#define KVIRC_API
Definition: kvi_settings.h:128
virtual void stop()
Definition: KviNotifyList.cpp:131
Definition: KviIrcMessage.h:50
Definition: KviNotifyList.h:69
An abstraction of a connection to an IRC server.
Definition: KviIrcConnection.h:95
virtual bool handleWatchReply(KviIrcMessage *msg)
Definition: KviNotifyList.cpp:145
KviPointerHashTable< QString, QString > * m_pRegUserDict
Definition: KviNotifyList.h:158
KviConsoleWindow * m_pConsole
Definition: KviIrcConnection.h:142
KviPointerList< QString > * m_pNotifyList
Definition: KviNotifyList.h:81
Definition: KviNotifyList.h:41
QString m_szUserhostString
Definition: KviNotifyList.h:86
#define e
Definition: detector.cpp:69
Irc user mask handling.
Definition: KviIrcMask.h:45
Definition: KviNotifyList.h:118
KviPointerHashTable< QString, QString > * m_pRegUserDict
Definition: KviNotifyList.h:80
Pointer Hash Table.
bool m_bExpectingUserhost
Definition: KviNotifyList.h:88
virtual bool handleUserhost(KviIrcMessage *msg)
Definition: KviNotifyList.cpp:135
virtual bool handleIsOn(KviIrcMessage *msg)
Definition: KviNotifyList.cpp:140
KviConsoleWindow * m_pConsole
Definition: KviNotifyList.h:53
int m_iNextNickToCheck
Definition: KviNotifyList.h:131
KviPointerList< QString > * m_pOnlineList
Definition: KviNotifyList.h:84
KviPointerList< QString > * m_pNickList
Definition: KviNotifyList.h:129
QTimer * m_pDelayedUserhostTimer
Definition: KviNotifyList.h:91
C++ Template based double linked pointer list class.
QString m_szLastIsOnMsg
Definition: KviNotifyList.h:130
KviIrcConnection * m_pConnection
Definition: KviNotifyList.h:54
KviPointerList< QString > * m_pIsOnList
Definition: KviNotifyList.h:82
Definition: KviIrcServerParser.h:115
bool m_bRunning
Definition: KviNotifyList.h:92
QString m_szIsOnString
Definition: KviNotifyList.h:83
Definition: KviNotifyList.h:147
This file contains compile time settings.
QTimer * m_pDelayedIsOnTimer
Definition: KviNotifyList.h:89
Helper functions for the QString class.
KviConsoleWindow * console()
Definition: KviNotifyList.h:66
int m_iRestartTimer
Definition: KviNotifyList.h:132
KviPointerList< QString > * m_pUserhostList
Definition: KviNotifyList.h:85