class IrcUser;
class IrcChannel;
+// defined below!
+struct NetworkInfo;
+
// TODO: ConnectionInfo to propagate and sync the current state of NetworkConnection, encodings etcpp
class Network : public SyncableObject {
public:
Network(const NetworkId &networkid, QObject *parent = 0);
- //virtual ~Network();
+ // ~Network();
NetworkId networkId() const;
QStringList channels() const;
QList<QVariantMap> serverList() const;
+ NetworkInfo networkInfo() const;
+ void setNetworkInfo(const NetworkInfo &);
+
QString prefixes();
QString prefixModes();
IrcChannel *newIrcChannel(const QString &channelname);
IrcChannel *newIrcChannel(const QByteArray &channelname);
- IrcChannel *ircChannel(QString channelname);
- IrcChannel *ircChannel(const QByteArray &channelname);
+ IrcChannel *ircChannel(QString channelname) const;
+ IrcChannel *ircChannel(const QByteArray &channelname) const;
QList<IrcChannel *> ircChannels() const;
quint32 ircChannelCount() const;
void ircUserNickChanged(QString newnick);
void requestConnect();
+ void requestDisconnect();
private slots:
void ircUserDestroyed();
void ircChannelInitDone(IrcChannel *);
void connectRequested(NetworkId = 0);
+ void disconnectRequested(NetworkId = 0);
private:
NetworkId _networkId;
QHash<QString, QString> _supports; // stores results from RPL_ISUPPORT
QList<QVariantMap> _serverList;
+ QStringList _perform;
//QVariantMap networkSettings;
- //QVariantMap identity;
-
+
QPointer<SignalProxy> _proxy;
void determinePrefixes();
};
+//! Stores all editable information about a network (as opposed to runtime state).
+struct NetworkInfo {
+ NetworkId networkId;
+ IdentityId identity;
+ QString networkName;
+ QByteArray codecForEncoding;
+ QByteArray codecForDecoding;
+ QList<QVariantMap> serverList;
+
+ bool operator==(const NetworkInfo &other) const;
+ bool operator!=(const NetworkInfo &other) const;
+};
+
+
#endif