Sync default port with Use encrypted connection
[quassel.git] / src / common / network.h
1 /***************************************************************************
2  *   Copyright (C) 2005-2016 by the Quassel Project                        *
3  *   devel@quassel-irc.org                                                 *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) version 3.                                           *
9  *                                                                         *
10  *   This program is distributed in the hope that it will be useful,       *
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13  *   GNU General Public License for more details.                          *
14  *                                                                         *
15  *   You should have received a copy of the GNU General Public License     *
16  *   along with this program; if not, write to the                         *
17  *   Free Software Foundation, Inc.,                                       *
18  *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
19  ***************************************************************************/
20
21 #ifndef NETWORK_H
22 #define NETWORK_H
23
24 #include <QString>
25 #include <QStringList>
26 #include <QList>
27 #include <QNetworkProxy>
28 #include <QHash>
29 #include <QVariantMap>
30 #include <QPointer>
31 #include <QMutex>
32 #include <QByteArray>
33
34 #include "types.h"
35 #include "util.h"
36 #include "syncableobject.h"
37
38 #include "signalproxy.h"
39 #include "ircuser.h"
40 #include "ircchannel.h"
41
42 // defined below!
43 struct NetworkInfo;
44
45 // TODO: ConnectionInfo to propagate and sync the current state of NetworkConnection, encodings etcpp
46
47 class Network : public SyncableObject
48 {
49     SYNCABLE_OBJECT
50     Q_OBJECT
51     Q_ENUMS(ConnectionState)
52
53     Q_PROPERTY(QString networkName READ networkName WRITE setNetworkName)
54     Q_PROPERTY(QString currentServer READ currentServer WRITE setCurrentServer)
55     Q_PROPERTY(QString myNick READ myNick WRITE setMyNick)
56     Q_PROPERTY(int latency READ latency WRITE setLatency)
57     Q_PROPERTY(QByteArray codecForServer READ codecForServer WRITE setCodecForServer)
58     Q_PROPERTY(QByteArray codecForEncoding READ codecForEncoding WRITE setCodecForEncoding)
59     Q_PROPERTY(QByteArray codecForDecoding READ codecForDecoding WRITE setCodecForDecoding)
60     Q_PROPERTY(IdentityId identityId READ identity WRITE setIdentity)
61     Q_PROPERTY(bool isConnected READ isConnected WRITE setConnected)
62     //Q_PROPERTY(Network::ConnectionState connectionState READ connectionState WRITE setConnectionState)
63     Q_PROPERTY(int connectionState READ connectionState WRITE setConnectionState)
64     Q_PROPERTY(bool useRandomServer READ useRandomServer WRITE setUseRandomServer)
65     Q_PROPERTY(QStringList perform READ perform WRITE setPerform)
66     Q_PROPERTY(bool useAutoIdentify READ useAutoIdentify WRITE setUseAutoIdentify)
67     Q_PROPERTY(QString autoIdentifyService READ autoIdentifyService WRITE setAutoIdentifyService)
68     Q_PROPERTY(QString autoIdentifyPassword READ autoIdentifyPassword WRITE setAutoIdentifyPassword)
69     Q_PROPERTY(bool useSasl READ useSasl WRITE setUseSasl)
70     Q_PROPERTY(QString saslAccount READ saslAccount WRITE setSaslAccount)
71     Q_PROPERTY(QString saslPassword READ saslPassword WRITE setSaslPassword)
72     Q_PROPERTY(bool useAutoReconnect READ useAutoReconnect WRITE setUseAutoReconnect)
73     Q_PROPERTY(quint32 autoReconnectInterval READ autoReconnectInterval WRITE setAutoReconnectInterval)
74     Q_PROPERTY(quint16 autoReconnectRetries READ autoReconnectRetries WRITE setAutoReconnectRetries)
75     Q_PROPERTY(bool unlimitedReconnectRetries READ unlimitedReconnectRetries WRITE setUnlimitedReconnectRetries)
76     Q_PROPERTY(bool rejoinChannels READ rejoinChannels WRITE setRejoinChannels)
77
78 public :
79         enum ConnectionState {
80         Disconnected,
81         Connecting,
82         Initializing,
83         Initialized,
84         Reconnecting,
85         Disconnecting
86     };
87
88     // see:
89     //  http://www.irc.org/tech_docs/005.html
90     //  http://www.irc.org/tech_docs/draft-brocklesby-irc-isupport-03.txt
91     enum ChannelModeType {
92         NOT_A_CHANMODE = 0x00,
93         A_CHANMODE = 0x01,
94         B_CHANMODE = 0x02,
95         C_CHANMODE = 0x04,
96         D_CHANMODE = 0x08
97     };
98
99     // Default port assignments according to what many IRC networks have settled on.
100     // Technically not a standard, but it's fairly widespread.
101     // See https://freenode.net/news/port-6697-irc-via-tlsssl
102     enum PortDefaults {
103         PORT_PLAINTEXT = 6667, /// Default port for unencrypted connections
104         PORT_SSL = 6697        /// Default port for encrypted connections
105     };
106
107     struct Server {
108         QString host;
109         uint port;
110         QString password;
111         bool useSsl;
112         bool sslVerify;     /// If true, validate SSL certificates
113         int sslVersion;
114
115         bool useProxy;
116         int proxyType;
117         QString proxyHost;
118         uint proxyPort;
119         QString proxyUser;
120         QString proxyPass;
121
122         // sslVerify only applies when useSsl is true.  sslVerify should be enabled by default,
123         // so enabling useSsl offers a more secure default.
124         Server() : port(6667), useSsl(false), sslVerify(true), sslVersion(0), useProxy(false),
125             proxyType(QNetworkProxy::Socks5Proxy), proxyHost("localhost"), proxyPort(8080) {}
126
127         Server(const QString &host, uint port, const QString &password, bool useSsl,
128                bool sslVerify)
129             : host(host), port(port), password(password), useSsl(useSsl), sslVerify(sslVerify),
130               sslVersion(0), useProxy(false), proxyType(QNetworkProxy::Socks5Proxy),
131               proxyHost("localhost"), proxyPort(8080) {}
132
133         bool operator==(const Server &other) const;
134         bool operator!=(const Server &other) const;
135     };
136     typedef QList<Server> ServerList;
137
138     Network(const NetworkId &networkid, QObject *parent = 0);
139     ~Network();
140
141     inline NetworkId networkId() const { return _networkId; }
142
143     inline SignalProxy *proxy() const { return _proxy; }
144     inline void setProxy(SignalProxy *proxy) { _proxy = proxy; }
145
146     inline bool isMyNick(const QString &nick) const { return (myNick().toLower() == nick.toLower()); }
147     inline bool isMe(IrcUser *ircuser) const { return (ircuser->nick().toLower() == myNick().toLower()); }
148
149     bool isChannelName(const QString &channelname) const;
150
151     /**
152      * Checks if the target counts as a STATUSMSG
153      *
154      * Status messages are prefixed with one or more characters from the server-provided STATUSMSG
155      * if available, otherwise "@" and "+" are assumed.  Generally, status messages sent to a
156      * channel are only visible to those with the same or higher permissions, e.g. voiced.
157      *
158      * @param[in] target Name of destination, e.g. a channel or query
159      * @returns True if a STATUSMSG, otherwise false
160      */
161     bool isStatusMsg(const QString &target) const;
162
163     inline bool isConnected() const { return _connected; }
164     //Network::ConnectionState connectionState() const;
165     inline int connectionState() const { return _connectionState; }
166
167     QString prefixToMode(const QString &prefix) const;
168     inline QString prefixToMode(const QCharRef &prefix) const { return prefixToMode(QString(prefix)); }
169     QString modeToPrefix(const QString &mode) const;
170     inline QString modeToPrefix(const QCharRef &mode) const { return modeToPrefix(QString(mode)); }
171
172     ChannelModeType channelModeType(const QString &mode);
173     inline ChannelModeType channelModeType(const QCharRef &mode) { return channelModeType(QString(mode)); }
174
175     inline const QString &networkName() const { return _networkName; }
176     inline const QString &currentServer() const { return _currentServer; }
177     inline const QString &myNick() const { return _myNick; }
178     inline int latency() const { return _latency; }
179     inline IrcUser *me() const { return ircUser(myNick()); }
180     inline IdentityId identity() const { return _identity; }
181     QStringList nicks() const;
182     inline QStringList channels() const { return _ircChannels.keys(); }
183     /**
184      * Gets the list of available capabilities.
185      *
186      * @returns QStringList of available capabilities
187      */
188     inline const QStringList caps() const { return QStringList(_caps.keys()); }
189     /**
190      * Gets the list of enabled (acknowledged) capabilities.
191      *
192      * @returns QStringList of enabled (acknowledged) capabilities
193      */
194     inline const QStringList capsEnabled() const { return _capsEnabled; }
195     inline const ServerList &serverList() const { return _serverList; }
196     inline bool useRandomServer() const { return _useRandomServer; }
197     inline const QStringList &perform() const { return _perform; }
198     inline bool useAutoIdentify() const { return _useAutoIdentify; }
199     inline const QString &autoIdentifyService() const { return _autoIdentifyService; }
200     inline const QString &autoIdentifyPassword() const { return _autoIdentifyPassword; }
201     inline bool useSasl() const { return _useSasl; }
202     inline const QString &saslAccount() const { return _saslAccount; }
203     inline const QString &saslPassword() const { return _saslPassword; }
204     inline bool useAutoReconnect() const { return _useAutoReconnect; }
205     inline quint32 autoReconnectInterval() const { return _autoReconnectInterval; }
206     inline quint16 autoReconnectRetries() const { return _autoReconnectRetries; }
207     inline bool unlimitedReconnectRetries() const { return _unlimitedReconnectRetries; }
208     inline bool rejoinChannels() const { return _rejoinChannels; }
209
210     NetworkInfo networkInfo() const;
211     void setNetworkInfo(const NetworkInfo &);
212
213     QString prefixes() const;
214     QString prefixModes() const;
215     void determinePrefixes() const;
216
217     bool supports(const QString &param) const { return _supports.contains(param); }
218     QString support(const QString &param) const;
219
220     /**
221      * Checks if a given capability is acknowledged and active.
222      *
223      * @param[in] capability Name of capability
224      * @returns True if acknowledged (active), otherwise false
225      */
226     inline bool capEnabled(const QString &capability) const { return _capsEnabled.contains(capability.toLower()); }
227     // IRCv3 specs all use lowercase capability names
228
229     /**
230      * Gets the value of an available capability, e.g. for SASL, "EXTERNAL,PLAIN".
231      *
232      * @param[in] capability Name of capability
233      * @returns Value of capability if one was specified, otherwise empty string
234      */
235     QString capValue(const QString &capability) const { return _caps.value(capability.toLower()); }
236     // IRCv3 specs all use lowercase capability names
237     // QHash returns the default constructed value if not found, in this case, empty string
238     // See:  https://doc.qt.io/qt-4.8/qhash.html#value
239
240     IrcUser *newIrcUser(const QString &hostmask, const QVariantMap &initData = QVariantMap());
241     inline IrcUser *newIrcUser(const QByteArray &hostmask) { return newIrcUser(decodeServerString(hostmask)); }
242     IrcUser *ircUser(QString nickname) const;
243     inline IrcUser *ircUser(const QByteArray &nickname) const { return ircUser(decodeServerString(nickname)); }
244     inline QList<IrcUser *> ircUsers() const { return _ircUsers.values(); }
245     inline quint32 ircUserCount() const { return _ircUsers.count(); }
246
247     IrcChannel *newIrcChannel(const QString &channelname, const QVariantMap &initData = QVariantMap());
248     inline IrcChannel *newIrcChannel(const QByteArray &channelname) { return newIrcChannel(decodeServerString(channelname)); }
249     IrcChannel *ircChannel(QString channelname) const;
250     inline IrcChannel *ircChannel(const QByteArray &channelname) const { return ircChannel(decodeServerString(channelname)); }
251     inline QList<IrcChannel *> ircChannels() const { return _ircChannels.values(); }
252     inline quint32 ircChannelCount() const { return _ircChannels.count(); }
253
254     QByteArray codecForServer() const;
255     QByteArray codecForEncoding() const;
256     QByteArray codecForDecoding() const;
257     void setCodecForServer(QTextCodec *codec);
258     void setCodecForEncoding(QTextCodec *codec);
259     void setCodecForDecoding(QTextCodec *codec);
260
261     QString decodeString(const QByteArray &text) const;
262     QByteArray encodeString(const QString &string) const;
263     QString decodeServerString(const QByteArray &text) const;
264     QByteArray encodeServerString(const QString &string) const;
265
266     static QByteArray defaultCodecForServer();
267     static QByteArray defaultCodecForEncoding();
268     static QByteArray defaultCodecForDecoding();
269     static void setDefaultCodecForServer(const QByteArray &name);
270     static void setDefaultCodecForEncoding(const QByteArray &name);
271     static void setDefaultCodecForDecoding(const QByteArray &name);
272
273     inline bool autoAwayActive() const { return _autoAwayActive; }
274     inline void setAutoAwayActive(bool active) { _autoAwayActive = active; }
275
276 public slots:
277     void setNetworkName(const QString &networkName);
278     void setCurrentServer(const QString &currentServer);
279     void setConnected(bool isConnected);
280     void setConnectionState(int state);
281     virtual void setMyNick(const QString &mynick);
282     void setLatency(int latency);
283     void setIdentity(IdentityId);
284
285     void setServerList(const QVariantList &serverList);
286     void setUseRandomServer(bool);
287     void setPerform(const QStringList &);
288     void setUseAutoIdentify(bool);
289     void setAutoIdentifyService(const QString &);
290     void setAutoIdentifyPassword(const QString &);
291     void setUseSasl(bool);
292     void setSaslAccount(const QString &);
293     void setSaslPassword(const QString &);
294     virtual void setUseAutoReconnect(bool);
295     virtual void setAutoReconnectInterval(quint32);
296     virtual void setAutoReconnectRetries(quint16);
297     void setUnlimitedReconnectRetries(bool);
298     void setRejoinChannels(bool);
299
300     void setCodecForServer(const QByteArray &codecName);
301     void setCodecForEncoding(const QByteArray &codecName);
302     void setCodecForDecoding(const QByteArray &codecName);
303
304     void addSupport(const QString &param, const QString &value = QString());
305     void removeSupport(const QString &param);
306
307     // IRCv3 capability negotiation (can be connected to signals)
308
309     /**
310      * Add an available capability, optionally providing a value.
311      *
312      * This may happen during first connect, or at any time later if a new capability becomes
313      * available (e.g. SASL service starting).
314      *
315      * @param[in] capability Name of the capability
316      * @param[in] value
317      * @parblock
318      * Optional value of the capability, e.g. sasl=plain.
319      * @endparblock
320      */
321     void addCap(const QString &capability, const QString &value = QString());
322
323     /**
324      * Marks a capability as acknowledged (enabled by the IRC server).
325      *
326      * @param[in] capability Name of the capability
327      */
328     void acknowledgeCap(const QString &capability);
329
330     /**
331      * Removes a capability from the list of available capabilities.
332      *
333      * This may happen during first connect, or at any time later if an existing capability becomes
334      * unavailable (e.g. SASL service stopping).  This also removes the capability from the list
335      * of acknowledged capabilities.
336      *
337      * @param[in] capability Name of the capability
338      */
339     void removeCap(const QString &capability);
340
341     /**
342      * Clears all capabilities from the list of available capabilities.
343      *
344      * This also removes the capability from the list of acknowledged capabilities.
345      */
346     void clearCaps();
347
348     inline void addIrcUser(const QString &hostmask) { newIrcUser(hostmask); }
349     inline void addIrcChannel(const QString &channel) { newIrcChannel(channel); }
350
351     //init geters
352     QVariantMap initSupports() const;
353     /**
354      * Get the initial list of available capabilities.
355      *
356      * @return QVariantMap of <QString, QString> indicating available capabilities and values
357      */
358     QVariantMap initCaps() const;
359     /**
360      * Get the initial list of enabled (acknowledged) capabilities.
361      *
362      * @return QVariantList of QString indicating enabled (acknowledged) capabilities and values
363      */
364     QVariantList initCapsEnabled() const { return toVariantList(capsEnabled()); }
365     inline QVariantList initServerList() const { return toVariantList(serverList()); }
366     virtual QVariantMap initIrcUsersAndChannels() const;
367
368     //init seters
369     void initSetSupports(const QVariantMap &supports);
370     /**
371      * Initialize the list of available capabilities.
372      *
373      * @param[in] caps QVariantMap of <QString, QString> indicating available capabilities and values
374      */
375     void initSetCaps(const QVariantMap &caps);
376     /**
377      * Initialize the list of enabled (acknowledged) capabilities.
378      *
379      * @param[in] caps QVariantList of QString indicating enabled (acknowledged) capabilities and values
380      */
381     inline void initSetCapsEnabled(const QVariantList &capsEnabled) { _capsEnabled = fromVariantList<QString>(capsEnabled); }
382     inline void initSetServerList(const QVariantList &serverList) { _serverList = fromVariantList<Server>(serverList); }
383     virtual void initSetIrcUsersAndChannels(const QVariantMap &usersAndChannels);
384
385     /**
386      * Update IrcUser hostmask and username from mask, creating an IrcUser if one does not exist.
387      *
388      * @param[in] mask   Full nick!user@hostmask string
389      * @return IrcUser of the matching nick if exists, otherwise a new IrcUser
390      */
391     IrcUser *updateNickFromMask(const QString &mask);
392
393     // these slots are to keep the hashlists of all users and the
394     // channel lists up to date
395     void ircUserNickChanged(QString newnick);
396
397     virtual inline void requestConnect() const { REQUEST(NO_ARG) }
398     virtual inline void requestDisconnect() const { REQUEST(NO_ARG) }
399     virtual inline void requestSetNetworkInfo(const NetworkInfo &info) { REQUEST(ARG(info)) }
400
401     void emitConnectionError(const QString &);
402
403 protected slots:
404     virtual void removeIrcUser(IrcUser *ircuser);
405     virtual void removeIrcChannel(IrcChannel *ircChannel);
406     virtual void removeChansAndUsers();
407
408 signals:
409     void aboutToBeDestroyed();
410     void networkNameSet(const QString &networkName);
411     void currentServerSet(const QString &currentServer);
412     void connectedSet(bool isConnected);
413     void connectionStateSet(Network::ConnectionState);
414 //   void connectionStateSet(int);
415     void connectionError(const QString &errorMsg);
416     void myNickSet(const QString &mynick);
417 //   void latencySet(int latency);
418     void identitySet(IdentityId);
419
420     void configChanged();
421
422     //   void serverListSet(QVariantList serverList);
423 //   void useRandomServerSet(bool);
424 //   void performSet(const QStringList &);
425 //   void useAutoIdentifySet(bool);
426 //   void autoIdentifyServiceSet(const QString &);
427 //   void autoIdentifyPasswordSet(const QString &);
428 //   void useAutoReconnectSet(bool);
429 //   void autoReconnectIntervalSet(quint32);
430 //   void autoReconnectRetriesSet(quint16);
431 //   void unlimitedReconnectRetriesSet(bool);
432 //   void rejoinChannelsSet(bool);
433
434 //   void codecForServerSet(const QByteArray &codecName);
435 //   void codecForEncodingSet(const QByteArray &codecName);
436 //   void codecForDecodingSet(const QByteArray &codecName);
437
438 //   void supportAdded(const QString &param, const QString &value);
439 //   void supportRemoved(const QString &param);
440
441     // IRCv3 capability negotiation (can drive other slots)
442     /**
443      * Indicates a capability is now available, with optional value in Network::capValue().
444      *
445      * @see Network::addCap()
446      *
447      * @param[in] capability Name of the capability
448      */
449     void capAdded (const QString &capability);
450
451     /**
452      * Indicates a capability was acknowledged (enabled by the IRC server).
453      *
454      * @see Network::acknowledgeCap()
455      *
456      * @param[in] capability Name of the capability
457      */
458     void capAcknowledged(const QString &capability);
459
460     /**
461      * Indicates a capability was removed from the list of available capabilities.
462      *
463      * @see Network::removeCap()
464      *
465      * @param[in] capability Name of the capability
466      */
467     void capRemoved(const QString &capability);
468
469 //   void ircUserAdded(const QString &hostmask);
470     void ircUserAdded(IrcUser *);
471 //   void ircChannelAdded(const QString &channelname);
472     void ircChannelAdded(IrcChannel *);
473
474 //   void connectRequested() const;
475 //   void disconnectRequested() const;
476 //   void setNetworkInfoRequested(const NetworkInfo &) const;
477
478 protected:
479     inline virtual IrcChannel *ircChannelFactory(const QString &channelname) { return new IrcChannel(channelname, this); }
480     inline virtual IrcUser *ircUserFactory(const QString &hostmask) { return new IrcUser(hostmask, this); }
481
482 private:
483     QPointer<SignalProxy> _proxy;
484
485     NetworkId _networkId;
486     IdentityId _identity;
487
488     QString _myNick;
489     int _latency;
490     QString _networkName;
491     QString _currentServer;
492     bool _connected;
493     ConnectionState _connectionState;
494
495     mutable QString _prefixes;
496     mutable QString _prefixModes;
497
498     QHash<QString, IrcUser *> _ircUsers; // stores all known nicks for the server
499     QHash<QString, IrcChannel *> _ircChannels; // stores all known channels
500     QHash<QString, QString> _supports; // stores results from RPL_ISUPPORT
501
502     QHash<QString, QString> _caps;  /// Capabilities supported by the IRC server
503     // By synchronizing the supported capabilities, the client could suggest certain behaviors, e.g.
504     // in the Network settings dialog, recommending SASL instead of using NickServ, or warning if
505     // SASL EXTERNAL isn't available.
506     QStringList _capsEnabled;       /// Enabled capabilities that received 'CAP ACK'
507     // _capsEnabled uses the same values from the <name>=<value> pairs stored in _caps
508
509     ServerList _serverList;
510     bool _useRandomServer;
511     QStringList _perform;
512
513     bool _useAutoIdentify;
514     QString _autoIdentifyService;
515     QString _autoIdentifyPassword;
516
517     bool _useSasl;
518     QString _saslAccount;
519     QString _saslPassword;
520
521     bool _useAutoReconnect;
522     quint32 _autoReconnectInterval;
523     quint16 _autoReconnectRetries;
524     bool _unlimitedReconnectRetries;
525     bool _rejoinChannels;
526
527     QTextCodec *_codecForServer;
528     QTextCodec *_codecForEncoding;
529     QTextCodec *_codecForDecoding;
530
531     static QTextCodec *_defaultCodecForServer;
532     static QTextCodec *_defaultCodecForEncoding;
533     static QTextCodec *_defaultCodecForDecoding;
534
535     bool _autoAwayActive; // when this is active handle305 and handle306 don't trigger any output
536
537     friend class IrcUser;
538     friend class IrcChannel;
539 };
540
541
542 //! Stores all editable information about a network (as opposed to runtime state).
543 struct NetworkInfo {
544     // set some default values, note that this does not initialize e.g. name and id
545     NetworkInfo();
546
547     NetworkId networkId;
548     QString networkName;
549     IdentityId identity;
550
551     bool useCustomEncodings; // not used!
552     QByteArray codecForServer;
553     QByteArray codecForEncoding;
554     QByteArray codecForDecoding;
555
556     Network::ServerList serverList;
557     bool useRandomServer;
558
559     QStringList perform;
560
561     bool useAutoIdentify;
562     QString autoIdentifyService;
563     QString autoIdentifyPassword;
564
565     bool useSasl;
566     QString saslAccount;
567     QString saslPassword;
568
569     bool useAutoReconnect;
570     quint32 autoReconnectInterval;
571     quint16 autoReconnectRetries;
572     bool unlimitedReconnectRetries;
573     bool rejoinChannels;
574
575     bool operator==(const NetworkInfo &other) const;
576     bool operator!=(const NetworkInfo &other) const;
577 };
578
579 QDataStream &operator<<(QDataStream &out, const NetworkInfo &info);
580 QDataStream &operator>>(QDataStream &in, NetworkInfo &info);
581 QDebug operator<<(QDebug dbg, const NetworkInfo &i);
582 Q_DECLARE_METATYPE(NetworkInfo)
583
584 QDataStream &operator<<(QDataStream &out, const Network::Server &server);
585 QDataStream &operator>>(QDataStream &in, Network::Server &server);
586 QDebug operator<<(QDebug dbg, const Network::Server &server);
587 Q_DECLARE_METATYPE(Network::Server)
588
589 #endif