|
1 /* |
|
2 * Copyright (c) 2002-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: Message handler |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CNWMESSAGEHANDLER_H |
|
21 #define CNWMESSAGEHANDLER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "NWHandlingEngine.h" |
|
25 #include "CNWSession.h" |
|
26 #include <mmtsy_names.h> |
|
27 #include <etel.h> |
|
28 #include <rmmcustomapi.h> |
|
29 #include <etelmm.h> |
|
30 |
|
31 // CONSTANTS |
|
32 // Max length of network provider name. |
|
33 const TInt KNWSubscriberIdLength = 15; |
|
34 // Max value of the SubscriberIdCounter. |
|
35 const TInt KMaxSubscriberIdRequests = 10; |
|
36 |
|
37 |
|
38 // DATA TYPES |
|
39 // Subscriber identity |
|
40 typedef TBuf<KNWSubscriberIdLength> TNWSubscriberId; |
|
41 |
|
42 // CLASS DECLARATION |
|
43 //Internal Network info definition |
|
44 struct TNWInterInfo |
|
45 { |
|
46 TUint iCellId; // Cell Id |
|
47 TUint iLac; // Location area code |
|
48 TNWSubscriberId iSubscriberId; // Subscriber identity |
|
49 TBool iAreaKnown; // Location Area known used for CELL_DCH mode |
|
50 }; |
|
51 |
|
52 |
|
53 // FORWARD DECLARATIONS |
|
54 class CNWNetworkMonitorBase; |
|
55 class CNWNetworkCurrentNetworkMonitor; |
|
56 class CNWNetworkModeMonitor; |
|
57 class CNWNetworkRegistrationStatusMonitor; |
|
58 class CNWProgrammableOperatorNameCommand; |
|
59 class CNWServiceProviderNameCommand; |
|
60 class CNWNetworkProviderNameCommand; |
|
61 class CNWSubscriberIdCommand; |
|
62 class RMmCustomAPI; |
|
63 |
|
64 // CLASS DECLARATION |
|
65 |
|
66 /** |
|
67 * Handles network related messages. |
|
68 * |
|
69 * @lib networkhandling.dll |
|
70 * @since Series 60_2.8 |
|
71 */ |
|
72 class CNWMessageHandler : public CBase |
|
73 { |
|
74 public: // Destructor |
|
75 |
|
76 /** |
|
77 * Destructor. |
|
78 */ |
|
79 IMPORT_C virtual ~CNWMessageHandler(); |
|
80 |
|
81 public: // New functions |
|
82 |
|
83 /** |
|
84 * Reroutes messages to the client |
|
85 * @param aMessage is the message id |
|
86 */ |
|
87 IMPORT_C virtual void SendMessage( |
|
88 MNWMessageObserver::TNWMessages aMessage ); |
|
89 |
|
90 |
|
91 #ifdef TEF_LOGGING_ENABLED |
|
92 /** |
|
93 * Help function for logging. |
|
94 * @param aMessage MNWMessageObserver::TNWMessages aMessage |
|
95 * @return message name, given the id of message. |
|
96 */ |
|
97 TPtrC GetNameByMessage( MNWMessageObserver::TNWMessages aMessage ) const; |
|
98 #endif |
|
99 |
|
100 /** |
|
101 * Handle Subscribe ID change |
|
102 */ |
|
103 virtual void HandleSubscriberIdChange(); |
|
104 |
|
105 /** |
|
106 * Reroutes error messages to the client |
|
107 * @param aOperation is failed operation |
|
108 * @param aErrorCode is returned Symbion OS Error Code |
|
109 */ |
|
110 IMPORT_C void SendErrorMessage( |
|
111 MNWMessageObserver::TNWOperation aOperation, |
|
112 TInt aErrorCode ); |
|
113 |
|
114 /** |
|
115 * Update Operator name reading status |
|
116 */ |
|
117 virtual void HandleUpdateReadingStatus( |
|
118 const TNWRead& aElementFile, TBool aReadStatus ); |
|
119 |
|
120 protected: |
|
121 |
|
122 /** |
|
123 * C++ default constructor. |
|
124 */ |
|
125 IMPORT_C CNWMessageHandler( CNWSession& aNetworkData, |
|
126 MNWMessageObserver& aMessageObserver, |
|
127 TNWInfo& aNWInfo ); |
|
128 |
|
129 /** |
|
130 * Initializes base class member variables |
|
131 */ |
|
132 void BaseConstructL(); |
|
133 |
|
134 |
|
135 protected: // Data |
|
136 // Array holding network monitors. |
|
137 RPointerArray<class CNWNetworkMonitorBase> iMonitorContainer; |
|
138 //Pointer to the CNWNetworkProviderNameCommand object |
|
139 CNWNetworkProviderNameCommand* iNetworkProviderNameCommand; |
|
140 //Pointer to the CNWSubscriberIdCommandCommand object |
|
141 CNWSubscriberIdCommand* iSubscriberIdCommand; |
|
142 //Pointer to the CNWProgrammableOperatorNameCommand object |
|
143 CNWProgrammableOperatorNameCommand* iProgrammableOperatorNameCommand; |
|
144 //Pointer to the CNWServiceProviderNameHandler object |
|
145 CNWServiceProviderNameCommand* iServiceProviderNameCommand; |
|
146 // Tells if phone is registered to network |
|
147 TBool iIsRegistered; |
|
148 // CNWSession object which handles network related commands |
|
149 CNWSession& iNetworkData; |
|
150 //Reference to MNWMessageObserver |
|
151 MNWMessageObserver& iMessageObserver; |
|
152 // Reference to the client's network info struct |
|
153 TNWInfo& iNetworkInfo; |
|
154 // ETel server connection |
|
155 RTelServer iServer; |
|
156 // ETel phone connection |
|
157 RMobilePhone iPhone; |
|
158 //Custom API object |
|
159 RMmCustomAPI iCustomAPI; |
|
160 // Pointer to the internal network info structure. |
|
161 TNWInterInfo iInterNetworkInfo; |
|
162 // Previous network status |
|
163 TNWStatus iPreviousStatus; |
|
164 }; |
|
165 |
|
166 #endif // CNWMessageHandler_H |
|
167 |
|
168 // End of File |