|
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @publishedAll |
|
19 @released |
|
20 */ |
|
21 |
|
22 #ifndef CS_MOBILITY_APIEXT_H |
|
23 #define CS_MOBILITY_APIEXT_H |
|
24 |
|
25 #include <es_sock.h> |
|
26 |
|
27 #include <comms-infras/es_api_ext.h> |
|
28 #include <comms-infras/api_ext_msg.h> |
|
29 |
|
30 class RCommsMobilityApiExt : public RCommsApiExtension<EMobilityApiExt> |
|
31 /** |
|
32 Comms Mobility API extension for client not running an Active Scheduler. |
|
33 |
|
34 This class can actually be used by any client, one running an Active Scheduler |
|
35 and one that is not. However, if the Active Scheduler is present, |
|
36 it is recommended to use CActiveCommsMobilityApiExt which is much simpler. |
|
37 |
|
38 @see CActiveCommsMobilityApiExt |
|
39 |
|
40 @publishedAll |
|
41 @released |
|
42 */ |
|
43 { |
|
44 public: |
|
45 IMPORT_C explicit RCommsMobilityApiExt(); |
|
46 IMPORT_C void Close(); |
|
47 |
|
48 IMPORT_C void RegisterForMobilityNotification(TDes8& aResponseEventBuf, TRequestStatus& aStatus); |
|
49 IMPORT_C void CancelMobilityNotification(); |
|
50 |
|
51 IMPORT_C void MigrateToPreferredCarrier(); |
|
52 IMPORT_C void IgnorePreferredCarrier(); |
|
53 IMPORT_C void NewCarrierAccepted(); |
|
54 IMPORT_C void NewCarrierRejected(); |
|
55 }; |
|
56 |
|
57 |
|
58 class MMobilityProtocolResp |
|
59 /** |
|
60 Comms Mobility API extension protocol. |
|
61 Used with CActiveCommsMobilityApiExt to reqister for mobility response messages. |
|
62 |
|
63 @publishedAll |
|
64 @released |
|
65 */ |
|
66 { |
|
67 public: |
|
68 virtual void PreferredCarrierAvailable(TAccessPointInfo aOldAP, TAccessPointInfo aNewAP, TBool aIsUpgrade, TBool aIsSeamless) = 0; |
|
69 virtual void NewCarrierActive(TAccessPointInfo aNewAP, TBool aIsSeamless) = 0; |
|
70 virtual void Error(TInt aError) = 0; |
|
71 }; |
|
72 |
|
73 class CActiveCommsMobilityApiExt : public CActive |
|
74 /** |
|
75 Comms Mobility API extension for client running an Active Scheduler.. Whenever an Active |
|
76 Scheduler is present, this API is recommended over RCommsMobilityApiExt because of its simplicity. |
|
77 |
|
78 With few important exceptions, CActiveCommsMobilityApiExt exports very similar APIs to RCommsMobilityApiExt |
|
79 |
|
80 @see RCommsMobilityApiExt |
|
81 |
|
82 @publishedAll |
|
83 @released |
|
84 */ |
|
85 { |
|
86 public: |
|
87 IMPORT_C static CActiveCommsMobilityApiExt* NewL(RCommsSubSession& aExtensionProvider,MMobilityProtocolResp& aProtocol); |
|
88 IMPORT_C ~CActiveCommsMobilityApiExt(); |
|
89 |
|
90 IMPORT_C void MigrateToPreferredCarrier(); |
|
91 IMPORT_C void IgnorePreferredCarrier(); |
|
92 IMPORT_C void NewCarrierAccepted(); |
|
93 IMPORT_C void NewCarrierRejected(); |
|
94 |
|
95 protected: |
|
96 void ConstructL(RCommsSubSession& aExtensionProvider); |
|
97 explicit CActiveCommsMobilityApiExt(MMobilityProtocolResp& aProtocol); |
|
98 |
|
99 private: |
|
100 void DoCancel(); |
|
101 void RunL(); |
|
102 TInt RunError(TInt aError); |
|
103 |
|
104 private: |
|
105 MMobilityProtocolResp& iProtocol; |
|
106 RCommsMobilityApiExt iExtApi; |
|
107 RBuf8 iResponseBuf; |
|
108 }; |
|
109 |
|
110 #endif // CS_MOBILITY_APIEXT_H |
|
111 |