|
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: HTI Internet Access Point handler. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CHTIIAPHANDLER_H |
|
20 #define CHTIIAPHANDLER_H |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <cmpsettingsconsts.h> |
|
25 #include <HTIServicePluginInterface.h> |
|
26 |
|
27 // CONSTANTS |
|
28 |
|
29 // MACROS |
|
30 |
|
31 // DATA TYPES |
|
32 enum TApFieldDataType |
|
33 { |
|
34 EDataTypeText, |
|
35 EDataTypeBool, |
|
36 EDataTypeUint, |
|
37 EDataTypeText8, |
|
38 EDataTypeUnknown |
|
39 }; |
|
40 |
|
41 struct TApField |
|
42 { |
|
43 TInt iId; |
|
44 HBufC* iData; |
|
45 TApFieldDataType iDataType; |
|
46 }; |
|
47 |
|
48 // FUNCTION PROTOTYPES |
|
49 |
|
50 // FORWARD DECLARATIONS |
|
51 |
|
52 // CLASS DECLARATION |
|
53 /** |
|
54 * HTI Internet Access Point handler. |
|
55 */ |
|
56 class CHtiIAPHandler : public CBase |
|
57 { |
|
58 public: |
|
59 enum TLegacyApFieldCodes |
|
60 { |
|
61 EApWapStartPage = 3, |
|
62 EApIspDefaultTelNumber = 18, |
|
63 EApIspUseLoginScript = 20, |
|
64 EApIspLoginScript = 21, |
|
65 EApIspLoginName = 23, |
|
66 EApIspLoginPass = 24, |
|
67 EApIspIfPromptForAuth = 29, |
|
68 EApIspIfCallbackEnabled = 33, |
|
69 EApIspIfCallbackType = 34, |
|
70 EApIspIfCallbackInfo = 35, |
|
71 EApIspIPAddr = 38, |
|
72 EApIspIPNameServer1 = 42, |
|
73 EApIspIPNameServer2 = 43, |
|
74 EApIspEnableIpHeaderComp = 44, |
|
75 EApIspDisablePlainTextAuth = 46, |
|
76 EApIspBearerSpeed = 49, |
|
77 EApIspBearerCallTypeIsdn = 50, |
|
78 EApIspInitString = 52, |
|
79 EApGprsAccessPointName = 58, |
|
80 EApGprsPdpType = 59, |
|
81 EApProxyServerAddress = 91, |
|
82 EApProxyPortNumber = 93, |
|
83 EApIP6NameServer1 = 104, |
|
84 EApIP6NameServer2 = 105, |
|
85 EApWlanNetworkName = 163, |
|
86 EApWlanNetworkMode = 164, |
|
87 EApWlanSecurityMode = 165, |
|
88 |
|
89 // new fields that do not exist in legacy TApMember enum |
|
90 EApSeamlessnessLevel = 200 |
|
91 }; |
|
92 |
|
93 /** |
|
94 * Two-phased constructor. |
|
95 */ |
|
96 static CHtiIAPHandler* NewL(); |
|
97 |
|
98 /** |
|
99 * Called when there is a message to be processed by this service. |
|
100 * @param aMessage message body destinated to the servive |
|
101 * @param aPriority message priority |
|
102 */ |
|
103 void ProcessMessageL( const TDesC8& aMessage, |
|
104 THtiMessagePriority aPriority ); |
|
105 |
|
106 /** |
|
107 * Destructor. |
|
108 */ |
|
109 virtual ~CHtiIAPHandler(); |
|
110 |
|
111 /** |
|
112 * Sets the dispatcher to send outgoing messages to. |
|
113 * @param aDispatcher pointer to dispatcher instance |
|
114 */ |
|
115 void SetDispatcher( MHtiDispatcher* aDispatcher ); |
|
116 |
|
117 private: |
|
118 |
|
119 /** |
|
120 * C++ default constructor. |
|
121 */ |
|
122 CHtiIAPHandler(); |
|
123 |
|
124 /** |
|
125 * 2nd phase constructor. |
|
126 */ |
|
127 void ConstructL(); |
|
128 |
|
129 private: // helpers |
|
130 |
|
131 void HandleCreateIapL( const TDesC8& aData ); |
|
132 void HandleDeleteIapL( const TDesC8& aData ); |
|
133 void HandleCreateDestinationL( const TDesC8& aData ); |
|
134 void HandleDeleteDestinationL( const TDesC8& aData ); |
|
135 void ModifyDestinationL( const TInt aCommand, const TDesC8& aData ); |
|
136 void SetDefaultConnectionL( const TDesC8& aData ); |
|
137 |
|
138 void ParseCreateMessageL( const TDesC8& aData ); |
|
139 TInt GetAccessPointUIDL(); |
|
140 TInt GetDestinationIDL( const TDesC& aName ); |
|
141 void CloseActiveConnectionsL(); |
|
142 |
|
143 TUint GetBearerUID( const TInt aBearerType ); |
|
144 void MapLegacyFieldIDs(); |
|
145 void ResolveFieldDataTypes(); |
|
146 |
|
147 void SendOkMsgL( const TDesC8& aData ); |
|
148 void SendErrorMessageL( TInt aError, const TDesC8& aDescription ); |
|
149 |
|
150 private: // Data |
|
151 |
|
152 // Pointer to the dispatcher (referenced) |
|
153 MHtiDispatcher* iDispatcher; // referenced |
|
154 |
|
155 // Name of the connection to create/delete |
|
156 TBuf<KMaxConnNameLength> iConnName; |
|
157 TBuf<KMaxConnNameLength> iDestName; |
|
158 |
|
159 // The type of Access Point to create |
|
160 TUint iBearerType; |
|
161 |
|
162 // The fields to add to the Access Point |
|
163 RArray<TApField> iFields; |
|
164 |
|
165 }; |
|
166 |
|
167 #endif // CHTIIAPHANDLER_H |
|
168 |
|
169 // End of file |
|
170 |