Solid
internetgateway.h
Go to the documentation of this file.
00001 /* 00002 Copyright 2010 Paulo Romulo Alves Barros <paulo.romulo@kdemail.net> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Lesser General Public 00006 License as published by the Free Software Foundation; either 00007 version 2.1 of the License, or (at your option) version 3, or any 00008 later version accepted by the membership of KDE e.V. (or its 00009 successor approved by the membership of KDE e.V.), which shall 00010 act as a proxy defined in Section 6 of version 3 of the license. 00011 00012 This library is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public 00018 License along with this library. If not, see <http://www.gnu.org/licenses/>. 00019 */ 00020 00021 #ifndef SOLID_INTERNETGATEWAY_H 00022 #define SOLID_INTERNETGATEWAY_H 00023 00024 #include <QtCore/QStringList> 00025 00026 #include <solid/deviceinterface.h> 00027 00028 #include <solid/solid_export.h> 00029 #include <solid/solidnamespace.h> 00030 00031 namespace Solid 00032 { 00033 class InternetGatewayPrivate; 00034 00035 class Device; 00036 00037 class SOLID_EXPORT InternetGateway : public Solid::DeviceInterface 00038 { 00039 Q_OBJECT 00040 Q_DECLARE_PRIVATE(InternetGateway) 00041 friend class Device; 00042 00043 private: 00044 explicit InternetGateway(QObject* backendObject); 00045 00046 public: 00047 enum InternetStatus { InternetEnabled = 0, InternetDisabled = 1, UnknownStatus = 2 }; 00048 00049 enum NetworkProtocol { TCP = 0, UDP = 1 }; 00050 00051 virtual ~InternetGateway(); 00052 00053 static Type deviceInterfaceType() { return DeviceInterface::InternetGateway; } 00054 00055 void requestCurrentConnections() const; 00056 00057 QStringList currentConnections() const; 00058 00059 void addPortMapping(const QString& remoteHost, qint16 externalPort, const NetworkProtocol& mappingProtocol, 00060 qint16 internalPort, const QString& internalClient); 00061 00062 void deletePortMapping(const QString& remoteHost, qint16 externalPort, const NetworkProtocol& mappingProtocol); 00063 00064 InternetStatus isEnabledForInternet() const; 00065 00066 void setEnabledForInternet(bool enabled); 00067 00068 Q_SIGNALS: 00069 void portMappingAdded(const QString& remoteHost, qint16 externalPort, const NetworkProtocol& mappingProtocol, 00070 qint16 internalPort, const QString& internalClient); 00071 00072 void portMappingDeleted(const QString& remoteHost, qint16 externalPort, const NetworkProtocol& mappingProtocol); 00073 00074 void enabledForInternet(bool enabled); 00075 00076 void currentConnectionsDataIsReady(QStringList currentConnections); 00077 00078 protected: 00079 InternetGateway(InternetGatewayPrivate& dd, QObject* backendObject); 00080 }; 00081 00082 } 00083 #endif // SOLID_INTERNETGATEWAY_H
KDE 4.6 API Reference