|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2010 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 ** No Commercial Usage |
|
11 ** This file contains pre-release code and may not be distributed. |
|
12 ** You may use this file in accordance with the terms and conditions |
|
13 ** contained in the Technology Preview License Agreement accompanying |
|
14 ** this package. |
|
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 ** If you have questions regarding the use of this file, please contact |
|
29 ** Nokia at qt-info@nokia.com. |
|
30 ** |
|
31 ** |
|
32 ** |
|
33 ** |
|
34 ** |
|
35 ** |
|
36 ** |
|
37 ** |
|
38 ** $QT_END_LICENSE$ |
|
39 ** |
|
40 ****************************************************************************/ |
|
41 |
|
42 #ifndef QNETWORKCONFIGURATIONMANAGER_H |
|
43 #define QNETWORKCONFIGURATIONMANAGER_H |
|
44 |
|
45 #ifdef QT_MOBILITY_BEARER |
|
46 # include "qmobilityglobal.h" |
|
47 #endif |
|
48 |
|
49 #include <QtCore/qobject.h> |
|
50 #include <QtNetwork/qnetworkconfiguration.h> |
|
51 |
|
52 #ifndef QT_NO_BEARERMANAGEMENT |
|
53 |
|
54 QT_BEGIN_HEADER |
|
55 |
|
56 #ifndef QT_MOBILITY_BEARER |
|
57 QT_BEGIN_NAMESPACE |
|
58 #define QNetworkConfigurationManagerExport Q_NETWORK_EXPORT |
|
59 QT_MODULE(Network) |
|
60 #else |
|
61 QTM_BEGIN_NAMESPACE |
|
62 #define QNetworkConfigurationManagerExport Q_BEARER_EXPORT |
|
63 #endif |
|
64 |
|
65 class QNetworkConfigurationManagerPrivate; |
|
66 class QNetworkConfigurationManagerExport QNetworkConfigurationManager : public QObject |
|
67 { |
|
68 Q_OBJECT |
|
69 |
|
70 public: |
|
71 |
|
72 enum Capability { |
|
73 CanStartAndStopInterfaces = 0x00000001, |
|
74 DirectConnectionRouting = 0x00000002, |
|
75 SystemSessionSupport = 0x00000004, |
|
76 ApplicationLevelRoaming = 0x00000008, |
|
77 ForcedRoaming = 0x00000010, |
|
78 DataStatistics = 0x00000020, |
|
79 NetworkSessionRequired = 0x00000040 |
|
80 }; |
|
81 |
|
82 Q_DECLARE_FLAGS(Capabilities, Capability) |
|
83 |
|
84 QNetworkConfigurationManager( QObject* parent = 0 ); |
|
85 virtual ~QNetworkConfigurationManager(); |
|
86 |
|
87 |
|
88 QNetworkConfigurationManager::Capabilities capabilities() const; |
|
89 |
|
90 QNetworkConfiguration defaultConfiguration() const; |
|
91 QList<QNetworkConfiguration> allConfigurations(QNetworkConfiguration::StateFlags flags = 0) const; |
|
92 QNetworkConfiguration configurationFromIdentifier(const QString& identifier) const; |
|
93 void updateConfigurations(); |
|
94 |
|
95 bool isOnline() const; |
|
96 |
|
97 Q_SIGNALS: |
|
98 void configurationAdded(const QNetworkConfiguration& config); |
|
99 void configurationRemoved(const QNetworkConfiguration& config); |
|
100 void configurationChanged(const QNetworkConfiguration& config); |
|
101 void onlineStateChanged(bool isOnline); |
|
102 void updateCompleted(); |
|
103 |
|
104 }; |
|
105 |
|
106 Q_DECLARE_OPERATORS_FOR_FLAGS(QNetworkConfigurationManager::Capabilities) |
|
107 |
|
108 #ifndef QT_MOBILITY_BEARER |
|
109 QT_END_NAMESPACE |
|
110 #else |
|
111 QTM_END_NAMESPACE |
|
112 #endif |
|
113 |
|
114 QT_END_HEADER |
|
115 |
|
116 #endif // QT_NO_BEARERMANAGEMENT |
|
117 |
|
118 #endif //QNETWORKCONFIGURATIONMANAGER_H |
|
119 |