~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to libs/solid/control/networkgsminterface.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
Copyright 2008 Will Stephenson <wstephenson@kde.org>
 
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 <KLocale>
 
22
 
 
23
#include "networkgsminterface.h"
 
24
#include "networkgsminterface_p.h"
 
25
 
 
26
#include "frontendobject_p.h"
 
27
#include "soliddefs_p.h"
 
28
#include "ifaces/networkgsminterface.h"
 
29
#include "ifaces/modemgsmnetworkinterface.h"
 
30
 
 
31
Solid::Control::GsmNetworkInterface::GsmNetworkInterface(QObject *backendObject)
 
32
    : SerialNetworkInterface(*new GsmNetworkInterfacePrivate(this), backendObject)
 
33
{
 
34
    Q_D(GsmNetworkInterface);
 
35
    d->setBackendObject(backendObject);
 
36
    makeConnections( backendObject );
 
37
}
 
38
 
 
39
Solid::Control::GsmNetworkInterface::GsmNetworkInterface(const GsmNetworkInterface &networkinterface)
 
40
    : SerialNetworkInterface(*new GsmNetworkInterfacePrivate(this), networkinterface)
 
41
{
 
42
    Q_D(GsmNetworkInterface);
 
43
    d->setBackendObject(networkinterface.d_ptr->backendObject());
 
44
    makeConnections( networkinterface.d_ptr->backendObject() );
 
45
}
 
46
 
 
47
Solid::Control::GsmNetworkInterface::GsmNetworkInterface(GsmNetworkInterfacePrivate &dd, QObject *backendObject)
 
48
    : SerialNetworkInterface(dd, backendObject)
 
49
{
 
50
    makeConnections( backendObject );
 
51
}
 
52
 
 
53
Solid::Control::GsmNetworkInterface::GsmNetworkInterface(GsmNetworkInterfacePrivate &dd, const GsmNetworkInterface &networkinterface)
 
54
    : SerialNetworkInterface(dd, networkinterface.d_ptr->backendObject())
 
55
{
 
56
    makeConnections( networkinterface.d_ptr->backendObject() );
 
57
}
 
58
 
 
59
Solid::Control::GsmNetworkInterface::~GsmNetworkInterface()
 
60
{
 
61
}
 
62
 
 
63
Solid::Control::NetworkInterface::Type Solid::Control::GsmNetworkInterface::type() const
 
64
{
 
65
    return Gsm;
 
66
}
 
67
 
 
68
Solid::Control::ModemGsmNetworkInterface * Solid::Control::GsmNetworkInterface::getModemNetworkIface()
 
69
{
 
70
    Q_D(const GsmNetworkInterface);
 
71
    Ifaces::GsmNetworkInterface *t = qobject_cast<Ifaces::GsmNetworkInterface *>(d->backendObject());
 
72
    if (t != 0)
 
73
    {
 
74
        return t->getModemNetworkIface();
 
75
    }
 
76
    return 0;
 
77
}
 
78
 
 
79
Solid::Control::ModemGsmCardInterface * Solid::Control::GsmNetworkInterface::getModemCardIface()
 
80
{
 
81
    Q_D(const GsmNetworkInterface);
 
82
    Ifaces::GsmNetworkInterface *t = qobject_cast<Ifaces::GsmNetworkInterface *>(d->backendObject());
 
83
    if (t != 0)
 
84
    {
 
85
        return t->getModemCardIface();
 
86
    }
 
87
    return 0;
 
88
}
 
89
 
 
90
void Solid::Control::GsmNetworkInterface::setModemNetworkIface(Solid::Control::ModemGsmNetworkInterface * iface)
 
91
{
 
92
    Q_D(const GsmNetworkInterface);
 
93
    Ifaces::GsmNetworkInterface *t = qobject_cast<Ifaces::GsmNetworkInterface *>(d->backendObject());
 
94
    if (t != 0)
 
95
    {
 
96
        t->setModemNetworkIface(iface);
 
97
    }
 
98
}
 
99
 
 
100
void Solid::Control::GsmNetworkInterface::makeConnections(QObject * source)
 
101
{
 
102
}
 
103
 
 
104
void Solid::Control::GsmNetworkInterfacePrivate::setBackendObject(QObject *object)
 
105
{
 
106
    SerialNetworkInterfacePrivate::setBackendObject(object);
 
107
}
 
108
 
 
109
void Solid::Control::GsmNetworkInterface::_k_destroyed(QObject *object)
 
110
{
 
111
    Q_UNUSED(object);
 
112
}
 
113
// vim: sw=4 sts=4 et tw=100