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

Solid

  • 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
28namespace Solid
29{
30
31InternetGateway::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
50InternetGateway::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
69InternetGateway::~InternetGateway()
70{
71}
72
73void InternetGateway::requestCurrentConnections() const
74{
75 Q_D(const InternetGateway);
76
77 SOLID_CALL(Ifaces::InternetGateway*, d->backendObject(), requestCurrentConnections());
78}
79
80QStringList InternetGateway::currentConnections() const
81{
82 Q_D(const InternetGateway);
83
84 return_SOLID_CALL(Ifaces::InternetGateway*, d->backendObject(), QStringList(), currentConnections());
85}
86
87void 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
96void 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
104InternetGateway::InternetStatus InternetGateway::isEnabledForInternet() const
105{
106 Q_D(const InternetGateway);
107
108 return_SOLID_CALL(Ifaces::InternetGateway*, d->backendObject(), InternetGateway::UnknownStatus, isEnabledForInternet());
109}
110
111void InternetGateway::setEnabledForInternet(bool enabled)
112{
113 Q_D(const InternetGateway);
114
115 SOLID_CALL(Ifaces::InternetGateway*, d->backendObject(), setEnabledForInternet(enabled));
116}
117
118}
QObject
Solid::DeviceInterface
Base class of all the device interfaces.
Definition: deviceinterface.h:43
Solid::DeviceInterface::InternetGateway
@ InternetGateway
Definition: deviceinterface.h:73
Solid::InternetGatewayPrivate
Definition: internetgateway_p.h:29
Solid::InternetGateway
Definition: internetgateway.h:38
Solid::InternetGateway::requestCurrentConnections
void requestCurrentConnections() const
Definition: internetgateway.cpp:73
Solid::InternetGateway::portMappingDeleted
void portMappingDeleted(const QString &remoteHost, qint16 externalPort, const NetworkProtocol &mappingProtocol)
Solid::InternetGateway::currentConnections
QStringList currentConnections() const
Definition: internetgateway.cpp:80
Solid::InternetGateway::isEnabledForInternet
InternetStatus isEnabledForInternet() const
Definition: internetgateway.cpp:104
Solid::InternetGateway::NetworkProtocol
NetworkProtocol
Definition: internetgateway.h:49
Solid::InternetGateway::enabledForInternet
void enabledForInternet(bool enabled)
Solid::InternetGateway::setEnabledForInternet
void setEnabledForInternet(bool enabled)
Definition: internetgateway.cpp:111
Solid::InternetGateway::InternetStatus
InternetStatus
Definition: internetgateway.h:47
Solid::InternetGateway::UnknownStatus
@ UnknownStatus
Definition: internetgateway.h:47
Solid::InternetGateway::portMappingAdded
void portMappingAdded(const QString &remoteHost, qint16 externalPort, const NetworkProtocol &mappingProtocol, qint16 internalPort, const QString &internalClient)
Solid::InternetGateway::deletePortMapping
void deletePortMapping(const QString &remoteHost, qint16 externalPort, const NetworkProtocol &mappingProtocol)
Definition: internetgateway.cpp:96
Solid::InternetGateway::addPortMapping
void addPortMapping(const QString &remoteHost, qint16 externalPort, const NetworkProtocol &mappingProtocol, qint16 internalPort, const QString &internalClient)
Definition: internetgateway.cpp:87
Solid::InternetGateway::~InternetGateway
virtual ~InternetGateway()
Definition: internetgateway.cpp:69
internetgateway.h
internetgateway_p.h
Solid
Definition: acadapter.h:29
soliddefs_p.h
return_SOLID_CALL
#define return_SOLID_CALL(Type, Object, Default, Method)
Definition: soliddefs_p.h:26
SOLID_CALL
#define SOLID_CALL(Type, Object, Method)
Definition: soliddefs_p.h:39
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
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