source: trunk/src/network/bearer/qnetworkconfiguration.h

Last change on this file was 846, checked in by Dmitry A. Kuminov, 15 years ago

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

File size: 4.5 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4** All rights reserved.
5** Contact: Nokia Corporation (qt-info@nokia.com)
6**
7** This file is part of the QtNetwork module of the Qt Toolkit.
8**
9** $QT_BEGIN_LICENSE:LGPL$
10** Commercial Usage
11** Licensees holding valid Qt Commercial licenses may use this file in
12** accordance with the Qt Commercial License Agreement provided with the
13** Software or, alternatively, in accordance with the terms contained in
14** a written agreement between you and Nokia.
15**
16** GNU Lesser General Public License Usage
17** Alternatively, this file may be used under the terms of the GNU Lesser
18** General Public License version 2.1 as published by the Free Software
19** Foundation and appearing in the file LICENSE.LGPL included in the
20** packaging of this file. Please review the following information to
21** ensure the GNU Lesser General Public License version 2.1 requirements
22** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23**
24** In addition, as a special exception, Nokia gives you certain additional
25** rights. These rights are described in the Nokia Qt LGPL Exception
26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27**
28** GNU General Public License Usage
29** Alternatively, this file may be used under the terms of the GNU
30** General Public License version 3.0 as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL included in the
32** packaging of this file. Please review the following information to
33** ensure the GNU General Public License version 3.0 requirements will be
34** met: http://www.gnu.org/copyleft/gpl.html.
35**
36** If you have questions regarding the use of this file, please contact
37** Nokia at qt-info@nokia.com.
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#ifndef QNETWORKCONFIGURATION_H
43#define QNETWORKCONFIGURATION_H
44
45#ifndef QT_MOBILITY_BEARER
46# include <QtCore/qglobal.h>
47#else
48# include "qmobilityglobal.h"
49#endif
50
51#include <QtCore/qshareddata.h>
52#include <QtCore/qstring.h>
53#include <QtCore/qlist.h>
54
55#if defined(Q_OS_WIN) && defined(interface)
56#undef interface
57#endif
58
59QT_BEGIN_HEADER
60
61#ifndef QT_MOBILITY_BEARER
62QT_BEGIN_NAMESPACE
63QT_MODULE(Network)
64#define QNetworkConfigurationExport Q_NETWORK_EXPORT
65#else
66QTM_BEGIN_NAMESPACE
67#define QNetworkConfigurationExport Q_BEARER_EXPORT
68#endif
69
70class QNetworkConfigurationPrivate;
71class QNetworkConfigurationExport QNetworkConfiguration
72{
73public:
74 QNetworkConfiguration();
75 QNetworkConfiguration(const QNetworkConfiguration& other);
76 QNetworkConfiguration &operator=(const QNetworkConfiguration& other);
77 ~QNetworkConfiguration();
78
79 bool operator==(const QNetworkConfiguration& cp) const;
80 inline bool operator!=(const QNetworkConfiguration& cp) const
81 { return !operator==(cp); }
82
83 enum Type {
84 InternetAccessPoint = 0,
85 ServiceNetwork,
86 UserChoice,
87 Invalid
88 };
89
90 enum Purpose {
91 UnknownPurpose = 0,
92 PublicPurpose,
93 PrivatePurpose,
94 ServiceSpecificPurpose
95 };
96
97 enum StateFlag {
98 Undefined = 0x0000001,
99 Defined = 0x0000002,
100 Discovered = 0x0000006,
101 Active = 0x000000e
102 };
103
104 Q_DECLARE_FLAGS(StateFlags, StateFlag)
105
106#ifndef QT_MOBILITY_BEARER
107 enum BearerType {
108 BearerUnknown,
109 BearerEthernet,
110 BearerWLAN,
111 Bearer2G,
112 BearerCDMA2000,
113 BearerWCDMA,
114 BearerHSPA,
115 BearerBluetooth,
116 BearerWiMAX
117 };
118#endif
119
120 StateFlags state() const;
121 Type type() const;
122 Purpose purpose() const;
123
124#ifndef QT_MOBILITY_BEARER
125#ifdef QT_DEPRECATED
126 // Required to maintain source compatibility with Qt Mobility.
127 QT_DEPRECATED inline QString bearerName() const { return bearerTypeName(); }
128#endif
129 BearerType bearerType() const;
130 QString bearerTypeName() const;
131#else
132 QString bearerName() const;
133#endif
134
135 QString identifier() const;
136 bool isRoamingAvailable() const;
137 QList<QNetworkConfiguration> children() const;
138
139 QString name() const;
140 bool isValid() const;
141
142private:
143 friend class QNetworkConfigurationPrivate;
144 friend class QNetworkConfigurationManager;
145 friend class QNetworkConfigurationManagerPrivate;
146 friend class QNetworkSessionPrivate;
147 QExplicitlySharedDataPointer<QNetworkConfigurationPrivate> d;
148};
149
150#ifndef QT_MOBILITY_BEARER
151QT_END_NAMESPACE
152#else
153QTM_END_NAMESPACE
154#endif
155
156QT_END_HEADER
157
158#endif //QNETWORKCONFIGURATION_H
Note: See TracBrowser for help on using the repository browser.