• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

Solid

  • sources
  • kde-4.12
  • kdelibs
  • solid
  • solid
internetgateway.cpp
Go to the documentation of this file.
1 /*
2  Copyright 2010 Paulo Romulo Alves Barros <paulo.romulo@kdemail.net>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) version 3, or any
8  later version accepted by the membership of KDE e.V. (or its
9  successor approved by the membership of KDE e.V.), which shall
10  act as a proxy defined in Section 6 of version 3 of the license.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public
18  License along with this library. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #include "internetgateway.h"
22 #include "internetgateway_p.h"
23 
24 #include "soliddefs_p.h"
25 
26 #include <solid/ifaces/internetgateway.h>
27 
28 namespace Solid
29 {
30 
31 InternetGateway::InternetGateway(QObject* backendObject) :
32  DeviceInterface(*new InternetGatewayPrivate(), backendObject)
33 {
34  connect(backendObject,
35  SIGNAL(portMappingAdded(QString,qint16,NetworkProtocol,qint16,QString)),
36  this,
37  SIGNAL(portMappingAdded(QString,qint16,NetworkProtocol,qint16,QString)));
38 
39  connect(backendObject,
40  SIGNAL(portMappingDeleted(QString,qint16,NetworkProtocol)),
41  this,
42  SIGNAL(portMappingDeleted(QString,qint16,NetworkProtocol)));
43 
44  connect(backendObject,
45  SIGNAL(enabledForInternet(bool)),
46  this,
47  SIGNAL(enabledForInternet(bool)));
48 }
49 
50 InternetGateway::InternetGateway(InternetGatewayPrivate& dd, QObject* backendObject)
51  : DeviceInterface(dd, backendObject)
52 {
53  connect(backendObject,
54  SIGNAL(portMappingAdded(QString,qint16,NetworkProtocol,qint16,QString)),
55  this,
56  SIGNAL(portMappingAdded(QString,qint16,NetworkProtocol,qint16,QString)));
57 
58  connect(backendObject,
59  SIGNAL(portMappingDeleted(QString,qint16,NetworkProtocol)),
60  this,
61  SIGNAL(portMappingDeleted(QString,qint16,NetworkProtocol)));
62 
63  connect(backendObject,
64  SIGNAL(enabledForInternet(bool)),
65  this,
66  SIGNAL(enabledForInternet(bool)));
67 }
68 
69 InternetGateway::~InternetGateway()
70 {
71 }
72 
73 void InternetGateway::requestCurrentConnections() const
74 {
75  Q_D(const InternetGateway);
76 
77  SOLID_CALL(Ifaces::InternetGateway*, d->backendObject(), requestCurrentConnections());
78 }
79 
80 QStringList InternetGateway::currentConnections() const
81 {
82  Q_D(const InternetGateway);
83 
84  return_SOLID_CALL(Ifaces::InternetGateway*, d->backendObject(), QStringList(), currentConnections());
85 }
86 
87 void InternetGateway::addPortMapping(const QString& remoteHost, qint16 externalPort, const NetworkProtocol& mappingProtocol,
88  qint16 internalPort, const QString& internalClient)
89 {
90  Q_D(const InternetGateway);
91 
92  SOLID_CALL(Ifaces::InternetGateway*, d->backendObject(),
93  addPortMapping(remoteHost, externalPort, mappingProtocol, internalPort, internalClient));
94 }
95 
96 void InternetGateway::deletePortMapping(const QString& remoteHost, qint16 externalPort, const NetworkProtocol& mappingProtocol)
97 {
98  Q_D(const InternetGateway);
99 
100  SOLID_CALL(Ifaces::InternetGateway*, d->backendObject(),
101  deletePortMapping(remoteHost, externalPort, mappingProtocol));
102 }
103 
104 InternetGateway::InternetStatus InternetGateway::isEnabledForInternet() const
105 {
106  Q_D(const InternetGateway);
107 
108  return_SOLID_CALL(Ifaces::InternetGateway*, d->backendObject(), InternetGateway::UnknownStatus, isEnabledForInternet());
109 }
110 
111 void InternetGateway::setEnabledForInternet(bool enabled)
112 {
113  Q_D(const InternetGateway);
114 
115  SOLID_CALL(Ifaces::InternetGateway*, d->backendObject(), setEnabledForInternet(enabled));
116 }
117 
118 }
Solid::InternetGateway::setEnabledForInternet
void setEnabledForInternet(bool enabled)
Definition: internetgateway.cpp:111
Solid::InternetGateway::UnknownStatus
Definition: internetgateway.h:47
Solid::InternetGateway::isEnabledForInternet
InternetStatus isEnabledForInternet() const
Definition: internetgateway.cpp:104
Solid::InternetGateway::portMappingDeleted
void portMappingDeleted(const QString &remoteHost, qint16 externalPort, const NetworkProtocol &mappingProtocol)
Solid::InternetGateway::addPortMapping
void addPortMapping(const QString &remoteHost, qint16 externalPort, const NetworkProtocol &mappingProtocol, qint16 internalPort, const QString &internalClient)
Definition: internetgateway.cpp:87
QObject
Solid::InternetGateway::NetworkProtocol
NetworkProtocol
Definition: internetgateway.h:49
Solid::DeviceInterface
Base class of all the device interfaces.
Definition: deviceinterface.h:42
Solid::InternetGateway::deletePortMapping
void deletePortMapping(const QString &remoteHost, qint16 externalPort, const NetworkProtocol &mappingProtocol)
Definition: internetgateway.cpp:96
Solid::InternetGatewayPrivate
Definition: internetgateway_p.h:28
Solid::InternetGateway::enabledForInternet
void enabledForInternet(bool enabled)
soliddefs_p.h
internetgateway_p.h
Solid::InternetGateway::requestCurrentConnections
void requestCurrentConnections() const
Definition: internetgateway.cpp:73
Solid::InternetGateway::~InternetGateway
virtual ~InternetGateway()
Definition: internetgateway.cpp:69
return_SOLID_CALL
#define return_SOLID_CALL(Type, Object, Default, Method)
Definition: soliddefs_p.h:26
Solid::InternetGateway
Definition: internetgateway.h:37
Solid::InternetGateway::portMappingAdded
void portMappingAdded(const QString &remoteHost, qint16 externalPort, const NetworkProtocol &mappingProtocol, qint16 internalPort, const QString &internalClient)
Solid::InternetGateway::InternetStatus
InternetStatus
Definition: internetgateway.h:47
SOLID_CALL
#define SOLID_CALL(Type, Object, Method)
Definition: soliddefs_p.h:39
Solid::InternetGateway::currentConnections
QStringList currentConnections() const
Definition: internetgateway.cpp:80
internetgateway.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:47 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Solid

Skip menu "Solid"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal