|
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 PsUiNotes; |
|
34 class CellularDataSettings; |
|
35 |
|
36 class CpNetworkPluginForm : public HbDataForm |
|
37 { |
|
38 Q_OBJECT |
|
39 |
|
40 public: |
|
41 explicit CpNetworkPluginForm(QGraphicsItem *parent = 0); |
|
42 virtual ~CpNetworkPluginForm(); |
|
43 |
|
44 void searchAvailableNetworks(); |
|
45 |
|
46 signals: |
|
47 void showGlobalProgressNote(int ¬eId, const QString& text); |
|
48 void showGlobalNote( |
|
49 int ¬eId, const QString& text, HbMessageBox::MessageBoxType msgBoxType); |
|
50 void cancelNote(int noteId); |
|
51 |
|
52 public slots: |
|
53 void cellularDataUseHomeStateChanged(int index); |
|
54 void cellularDataUseRoamStateChanged(int index); |
|
55 void networkModeStateChanged(int index); |
|
56 void operatorSelectionStateChanged(); |
|
57 void networkAccessModeGot(int mode); |
|
58 void availableNetworksGot( |
|
59 QList<PSetNetworkWrapper::NetworkInfo*> &m_networkInfoList); |
|
60 void networkReqestFailed( |
|
61 PSetNetworkWrapper::ErrorCode error, |
|
62 PSetNetworkWrapper::RequestType type); |
|
63 void userCancel(); |
|
64 void handleSearchingNetworks(PSetNetworkWrapper::RequestType &type); |
|
65 void handleRequestingSelectedNetwork(bool ongoing); |
|
66 void handleNetworkChanged( |
|
67 PSetNetworkWrapper::NetworkInfo& currentInfo, |
|
68 PSetNetworkWrapper::RegistrationStatus& status); |
|
69 void finishedManualSelectiondialog(HbAction* action); |
|
70 void chageVisbilityOfManualNetworkSelection(bool visible); |
|
71 |
|
72 protected: |
|
73 HbDataFormModelItem *createNetworkModeItem(); |
|
74 HbDataFormModelItem *createOperatorSelectionItem(); |
|
75 HbDataFormModelItem *createHomeDataUsageItem(); |
|
76 HbDataFormModelItem *createRoamDataUsageItem(); |
|
77 |
|
78 void automaticOperatorSelection(); |
|
79 void manualOperatorSelection(); |
|
80 |
|
81 void dualModeSelection(); |
|
82 void umtsSelection(); |
|
83 void gsmSelection(); |
|
84 |
|
85 HbDialog* createDialog(const QString& heading) const; |
|
86 void addItemToListWidget(HbListWidget* w, const QString& item, |
|
87 const int& data, const HbIcon& primaryIcon) const; |
|
88 |
|
89 void showManualSelectiondialog(); |
|
90 void restoreOperatorSelectionUi(); |
|
91 QString networkName(PSetNetworkWrapper::NetworkInfo &info); |
|
92 |
|
93 void connectToNetworkWrapper(PSetNetworkWrapper &wrapper); |
|
94 void connectToPhoneNotes(PsUiNotes ¬es); |
|
95 |
|
96 QString primaryIconForNetwork(const PSetNetworkWrapper::NetworkInfo &info); |
|
97 |
|
98 private: |
|
99 |
|
100 QStringList mNetworkModeOptions; |
|
101 QStringList mOperatorSelectionOptions; |
|
102 QStringList mCellularUseHomeOptions; |
|
103 QStringList mCellularUseRoamOptions; |
|
104 int m_activeNoteId; |
|
105 int m_activeProgressNoteId; |
|
106 // Own |
|
107 PSetWrapper *m_pSetWrapper; |
|
108 CpSettingsWrapper *m_cpSettingsWrapper; |
|
109 QSharedPointer<CellularDataSettings> mCellularSettings; |
|
110 HbDialog *m_dialog; |
|
111 |
|
112 // Not own |
|
113 PSetNetworkWrapper *m_psetNetworkWrapper; |
|
114 CpSettingFormItemData *m_NetworkModeOptionsItemData; |
|
115 CpSettingFormItemData *m_NetworkOperatorSelectionItemData; |
|
116 CpSettingFormItemData *mCellularUseHomeSelectionItemData; |
|
117 CpSettingFormItemData *mCellularUseRoamSelectionItemData; |
|
118 QList<PSetNetworkWrapper::NetworkInfo*> *m_networkInfoList; |
|
119 }; |
|
120 |
|
121 #endif // CPNETWORKPLUGINFORM_H |