1 /***************************************************************************
2 * Copyright (C) 2005-2010 by the Quassel Project *
3 * devel@quassel-irc.org *
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. *
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. *
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 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
21 #ifndef NETWORKEVENT_H
22 #define NETWORKEVENT_H
24 #include <QStringList>
25 #include <QVariantList>
30 class NetworkEvent : public Event {
33 explicit NetworkEvent(EventManager::EventType type, Network *network)
38 inline NetworkId networkId() const { return network()? network()->networkId() : NetworkId(); }
39 inline Network *network() const { return _network; }
45 class NetworkConnectionEvent : public NetworkEvent {
48 explicit NetworkConnectionEvent(EventManager::EventType type, Network *network, Network::ConnectionState state)
49 : NetworkEvent(type, network),
53 inline Network::ConnectionState connectionState() const { return _state; }
54 inline void setConnectionState(Network::ConnectionState state) { _state = state; }
57 Network::ConnectionState _state;
60 class NetworkDataEvent : public NetworkEvent {
63 explicit NetworkDataEvent(EventManager::EventType type, Network *network, const QByteArray &data)
64 : NetworkEvent(type, network),
68 inline QByteArray data() const { return _data; }
69 inline void setData(const QByteArray &data) { _data = data; }