37
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef CPNETWORKPLUGINFORM_H
|
|
19 |
#define CPNETWORKPLUGINFORM_H
|
|
20 |
|
|
21 |
#include <hbdataform.h>
|
|
22 |
#include <QStringList>
|
|
23 |
#include <QSharedPointer>
|
|
24 |
#include <psetnetworkwrapper.h>
|
|
25 |
#include <hbmessagebox.h>
|
|
26 |
|
|
27 |
class HbDataFormModelItem;
|
|
28 |
class CpSettingsWrapper;
|
|
29 |
class PSetWrapper;
|
|
30 |
class HbListWidget;
|
|
31 |
class PSetNetworkWrapper;
|
|
32 |
class CpSettingFormItemData;
|
|
33 |
class CpPhoneNotes;
|
|
34 |
class CellularDataSettings;
|
|
35 |
|
|
36 |
class CpNetworkPluginForm : public HbDataForm
|
|
37 |
{
|
|
38 |
Q_OBJECT
|
|
39 |
|
|
40 |
public:
|
|
41 |
|
|
42 |
explicit CpNetworkPluginForm(QGraphicsItem *parent = 0);
|
|
43 |
|
|
44 |
virtual ~CpNetworkPluginForm();
|
|
45 |
|
|
46 |
void searchAvailableNetworks();
|
|
47 |
|
|
48 |
signals:
|
|
49 |
|
|
50 |
void showGlobalProgressNote(int ¬eId, const QString& text);
|
|
51 |
void showGlobalNote(
|
|
52 |
int ¬eId, const QString& text, HbMessageBox::MessageBoxType msgBoxType);
|
|
53 |
void cancelNote(int noteId);
|
|
54 |
|
|
55 |
public slots:
|
|
56 |
|
|
57 |
void cellularDataUseHomeStateChanged(int index);
|
|
58 |
void cellularDataUseRoamStateChanged(int index);
|
|
59 |
void networkModeStateChanged(int index);
|
|
60 |
void operatorSelectionStateChanged(bool index);
|
|
61 |
void networkAccessModeGot(int mode);
|
|
62 |
void availableNetworksGot(
|
|
63 |
QList<PSetNetworkWrapper::NetworkInfo*> &m_networkInfoList);
|
|
64 |
void networkReqestFailed(
|
|
65 |
PSetNetworkWrapper::ErrorCode error,
|
|
66 |
PSetNetworkWrapper::RequestType type);
|
|
67 |
void userCancel();
|
|
68 |
void handleSearchingNetworks(PSetNetworkWrapper::RequestType &type);
|
|
69 |
void handleRequestingSelectedNetwork(bool ongoing);
|
|
70 |
void handleNetworkChanged(
|
|
71 |
PSetNetworkWrapper::NetworkInfo& currentInfo,
|
|
72 |
PSetNetworkWrapper::RegistrationStatus& status);
|
|
73 |
void finishedManualSelectiondialog(HbAction* action);
|
|
74 |
|
|
75 |
private:
|
|
76 |
HbDataFormModelItem *createNetworkModeItem();
|
|
77 |
HbDataFormModelItem *createOperatorSelectionItem();
|
|
78 |
HbDataFormModelItem *createHomeDataUsageItem();
|
|
79 |
HbDataFormModelItem *createRoamDataUsageItem();
|
|
80 |
|
|
81 |
void automaticOperatorSelection();
|
|
82 |
void manualOperatorSelection();
|
|
83 |
|
|
84 |
void dualModeSelection();
|
|
85 |
void umtsSelection();
|
|
86 |
void gsmSelection();
|
|
87 |
|
|
88 |
HbDialog* createDialog(const QString& heading) const;
|
|
89 |
void addItemToListWidget(
|
|
90 |
HbListWidget* w, const QString& item, const int& data) const;
|
|
91 |
|
|
92 |
void showManualSelectiondialog();
|
|
93 |
void restoreUiSelection();
|
|
94 |
QString networkName(PSetNetworkWrapper::NetworkInfo &info);
|
|
95 |
|
|
96 |
void connectToNetworkWrapper(PSetNetworkWrapper &wrapper);
|
|
97 |
|
|
98 |
void connectToPhoneNotes(CpPhoneNotes ¬es);
|
|
99 |
|
|
100 |
bool isPhoneOnLine();
|
|
101 |
|
|
102 |
private:
|
|
103 |
|
|
104 |
QStringList mNetworkModeOptions;
|
|
105 |
QStringList mOperatorSelectionOptions;
|
|
106 |
QStringList mCellularUseHomeOptions;
|
|
107 |
QStringList mCellularUseRoamOptions;
|
|
108 |
int m_activeNoteId;
|
|
109 |
int m_activeProgressNoteId;
|
|
110 |
// Own
|
|
111 |
PSetWrapper *m_pSetWrapper;
|
|
112 |
CpSettingsWrapper *m_cpSettingsWrapper;
|
|
113 |
QSharedPointer<CellularDataSettings> mCellularSettings;
|
|
114 |
HbDialog *m_dialog;
|
|
115 |
|
|
116 |
// Not own
|
|
117 |
PSetNetworkWrapper *m_psetNetworkWrapper;
|
|
118 |
CpSettingFormItemData *m_NetworkModeOptionsItemData;
|
|
119 |
CpSettingFormItemData *m_NetworkOperatorSelectionItemData;
|
|
120 |
CpSettingFormItemData *mCellularUseHomeSelectionItemData;
|
|
121 |
CpSettingFormItemData *mCellularUseRoamSelectionItemData;
|
|
122 |
QList<PSetNetworkWrapper::NetworkInfo*> *m_networkInfoList;
|
|
123 |
};
|
|
124 |
|
|
125 |
#endif // CPNETWORKPLUGINFORM_H
|