|
1 /* |
|
2 * Copyright (c) 2005-2006 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: Network selection dialog controller |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_AINWSDLGCONTROLLER_H |
|
20 #define C_AINWSDLGCONTROLLER_H |
|
21 |
|
22 #include <e32base.h> |
|
23 #include <AknSoftNotifier.h> |
|
24 #include <NWHandlingEngine.h> |
|
25 |
|
26 class CNWSession; |
|
27 |
|
28 /** |
|
29 * Network Selection Dialog controller. |
|
30 */ |
|
31 NONSHARABLE_CLASS( CAiNwSDlgController ) : |
|
32 public CBase, |
|
33 public MNWMessageObserver |
|
34 { |
|
35 public: |
|
36 |
|
37 // Constructors and destructors |
|
38 |
|
39 /** |
|
40 * Creates a new instance of the class. |
|
41 * |
|
42 * @return A new instance of the class. |
|
43 * @exception Any of the system-wide error codes if instance creation |
|
44 * fails due to an unrecoverable error. |
|
45 */ |
|
46 static CAiNwSDlgController* NewL(); |
|
47 |
|
48 ~CAiNwSDlgController(); |
|
49 |
|
50 // from MNWMessageObserver |
|
51 |
|
52 void HandleNetworkMessage( const TNWMessages aMessage ); |
|
53 void HandleNetworkError( const TNWOperation aOperation, TInt aErrorCode ); |
|
54 |
|
55 private: |
|
56 |
|
57 // Constructors |
|
58 |
|
59 CAiNwSDlgController(); |
|
60 |
|
61 void ConstructL(); |
|
62 |
|
63 private: |
|
64 |
|
65 // New functions |
|
66 |
|
67 /** |
|
68 * Take action according to current state change. |
|
69 */ |
|
70 void HandleStateChange(); |
|
71 |
|
72 /** |
|
73 * |
|
74 */ |
|
75 void HandleNetworkFound(); |
|
76 |
|
77 /** |
|
78 * |
|
79 */ |
|
80 void HandleNetworkLost(); |
|
81 |
|
82 /** |
|
83 * Opens the network selection dialog. |
|
84 */ |
|
85 void LaunchDialog(); |
|
86 |
|
87 /** |
|
88 * Cancels the network selection dialog. |
|
89 */ |
|
90 void CancelDialog(); |
|
91 |
|
92 /** |
|
93 * Tests if offline mode is engaged. |
|
94 * |
|
95 * @return ETrue if offline mode is currently active |
|
96 */ |
|
97 TBool IsOffLineMode() const; |
|
98 |
|
99 /** |
|
100 * Tests if Bluetooth SAP is in connected mode. |
|
101 * |
|
102 * @return ETrue if Bluetooth SAP is active. |
|
103 */ |
|
104 TBool IsBluetoothSAPConnected() const; |
|
105 |
|
106 static TInt DelayCallBack(TAny* aParam); |
|
107 |
|
108 private: |
|
109 |
|
110 // Data |
|
111 |
|
112 /** |
|
113 * Notifier service |
|
114 * Own |
|
115 */ |
|
116 CAknSoftNotifier* iSoftNotifier; |
|
117 |
|
118 /** |
|
119 * Session to network handling engine. |
|
120 * Own. |
|
121 */ |
|
122 CNWSession* iSession; |
|
123 |
|
124 /** |
|
125 * Cached network info structure. |
|
126 */ |
|
127 TNWInfo iInfo; |
|
128 |
|
129 /** |
|
130 * A true value if registered to network. |
|
131 */ |
|
132 TBool iRegistered; |
|
133 |
|
134 /** |
|
135 * Profile API. |
|
136 */ |
|
137 CRepository* iProfileApi; |
|
138 |
|
139 /** |
|
140 * Timer object for 1-minute delay |
|
141 */ |
|
142 CPeriodic* iPeriodic; |
|
143 }; |
|
144 |
|
145 #endif // C_AINWSDLGCONTROLLER_H |
|
146 |
|
147 // End of file. |