* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
-#ifndef NETWORK_H_
-#define NETWORK_H_
+#ifndef NETWORK_H
+#define NETWORK_H
#include <QString>
#include <QStringList>
bool supports(const QString ¶m) const { return _supports.contains(param); }
QString support(const QString ¶m) const;
- IrcUser *newIrcUser(const QString &hostmask);
+ IrcUser *newIrcUser(const QString &hostmask, const QVariantMap &initData = QVariantMap());
inline IrcUser *newIrcUser(const QByteArray &hostmask) { return newIrcUser(decodeServerString(hostmask)); }
IrcUser *ircUser(QString nickname) const;
inline IrcUser *ircUser(const QByteArray &nickname) const { return ircUser(decodeServerString(nickname)); }
inline QList<IrcUser *> ircUsers() const { return _ircUsers.values(); }
inline quint32 ircUserCount() const { return _ircUsers.count(); }
- IrcChannel *newIrcChannel(const QString &channelname);
+ IrcChannel *newIrcChannel(const QString &channelname, const QVariantMap &initData = QVariantMap());
inline IrcChannel *newIrcChannel(const QByteArray &channelname) { return newIrcChannel(decodeServerString(channelname)); }
IrcChannel *ircChannel(QString channelname) const;
inline IrcChannel *ircChannel(const QByteArray &channelname) const { return ircChannel(decodeServerString(channelname)); }
static void setDefaultCodecForEncoding(const QByteArray &name);
static void setDefaultCodecForDecoding(const QByteArray &name);
+ bool autoAwayActive() const { return _autoAwayActive; }
+ void setAutoAwayActive(bool active) { _autoAwayActive = active; }
+
public slots:
void setNetworkName(const QString &networkName);
void setCurrentServer(const QString ¤tServer);
inline void addIrcUser(const QString &hostmask) { newIrcUser(hostmask); }
inline void addIrcChannel(const QString &channel) { newIrcChannel(channel); }
- void removeIrcUser(const QString &nick);
- void removeIrcChannel(const QString &channel);
//init geters
QVariantMap initSupports() const;
void emitConnectionError(const QString &);
private slots:
- void ircUserDestroyed();
- void channelDestroyed();
void removeIrcUser(IrcUser *ircuser);
void removeIrcChannel(IrcChannel *ircChannel);
void removeChansAndUsers();
- void ircUserInitDone();
- void ircChannelInitDone();
signals:
void aboutToBeDestroyed();
void ircChannelAdded(const QString &channelname);
void ircChannelAdded(IrcChannel *);
- void ircUserRemoved(const QString &nick);
- void ircChannelRemoved(const QString &channel);
-
- // needed for client sync progress
- void ircUserRemoved(QObject *);
- void ircChannelRemoved(QObject *);
-
- void ircUserInitDone(IrcUser *);
- void ircChannelInitDone(IrcChannel *);
-
void connectRequested(NetworkId id = 0) const;
void disconnectRequested(NetworkId id = 0) const;
void setNetworkInfoRequested(const NetworkInfo &) const;
+protected:
+ inline virtual IrcChannel *ircChannelFactory(const QString &channelname) { return new IrcChannel(channelname, this); }
+
private:
QPointer<SignalProxy> _proxy;
static QTextCodec *_defaultCodecForServer;
static QTextCodec *_defaultCodecForEncoding;
static QTextCodec *_defaultCodecForDecoding;
+
+ bool _autoAwayActive; // when this is active handle305 and handle306 don't trigger any output
+
+ friend class IrcUser;
+ friend class IrcChannel;
};
//! Stores all editable information about a network (as opposed to runtime state).