|
1 /* |
|
2 * Copyright (c) 2002-2005 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 |
|
19 |
|
20 |
|
21 #ifndef M_SEN_MOBILITY_OBSERVER_H |
|
22 #define M_SEN_MOBILITY_OBSERVER_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <flogger.h> |
|
26 #include <e32std.h> |
|
27 #include <in_sock.h> |
|
28 #include <es_enum.h> |
|
29 #include <CommDbConnPref.h> |
|
30 #include <comms-infras/cs_mobility_apiext.h> |
|
31 #include <connpref.h> |
|
32 #include "SenXmlReader.h" |
|
33 #include "MSenTransport.h" |
|
34 #include "SenWSDescription.h" |
|
35 |
|
36 class CALRObserver : public CActive, public MMobilityProtocolResp |
|
37 { |
|
38 public: // Constructors and destructor |
|
39 |
|
40 /** |
|
41 * NewL is first phase of two-phased constructor. |
|
42 */ |
|
43 static CALRObserver * NewL(MMobilityProtocolResp &aMobilityObserver, CSenXmlReader &aReader) ; |
|
44 /** |
|
45 * Destructor. |
|
46 */ |
|
47 ~CALRObserver (); |
|
48 |
|
49 public: // From MMobilityProtocolResp |
|
50 |
|
51 void PreferredCarrierAvailable( TAccessPointInfo aOldAPInfo, |
|
52 TAccessPointInfo aNewAPInfo, |
|
53 TBool aIsUpgrade, |
|
54 TBool aIsSeamless ); |
|
55 |
|
56 void NewCarrierActive( TAccessPointInfo aNewAPInfo, TBool aIsSeamless ); |
|
57 |
|
58 void Error( TInt aError ); |
|
59 |
|
60 //Wrapper for MMobilityProtocolResp methods |
|
61 |
|
62 void MigrateToPreferredCarrier(); |
|
63 |
|
64 void IgnorePreferredCarrier(); |
|
65 |
|
66 void NewCarrierAccepted(); |
|
67 |
|
68 void NewCarrierRejected(); |
|
69 |
|
70 // From CActive |
|
71 void DoCancel() ; |
|
72 void RunL() ; |
|
73 TInt RunError( TInt aError ); |
|
74 |
|
75 //functions for Client session usage |
|
76 TUint32 GetActiveIap() ; |
|
77 HBufC8* GetNewIapAsTransportPropertyL() ; |
|
78 TUint32 GetActiveSnap() ; |
|
79 void SetDialogPref(TBool aDialogPref) ; |
|
80 TInt OpenConnectionL(TDesC8& aAppTransportProperties, |
|
81 MSenTransport &aTransport, |
|
82 CSenWSDescription& aInitializer, |
|
83 HBufC8*& aNewTransportProperties) ; |
|
84 |
|
85 |
|
86 private: |
|
87 |
|
88 /** |
|
89 * C++ default constructor. |
|
90 */ |
|
91 CALRObserver(MMobilityProtocolResp &aMobilityObserver, CSenXmlReader &aReader) ; |
|
92 TInt StartConnection(TUint32& aId, TBool aIsSnapId) ; |
|
93 TInt OpenSocketSever() ; |
|
94 void RefreshAvailabilityL() ; |
|
95 |
|
96 /** |
|
97 * By default Symbian OS constructor is private. |
|
98 */ |
|
99 void ConstructL(); |
|
100 RConnection iConnection ; |
|
101 RSocketServ iSocketServer; |
|
102 MMobilityProtocolResp &iMobilityObserver ; |
|
103 CActiveCommsMobilityApiExt* iMobility; |
|
104 TUint32 iIapId; |
|
105 TUint32 iNewIapId; |
|
106 TUint32 iSnapId; |
|
107 TCommDbConnPref iPrefs; |
|
108 TConnSnapPref iSNAPPrefs; |
|
109 CSenXmlReader &iReader ; |
|
110 private: // Data |
|
111 }; |
|
112 |
|
113 #endif /*M_SEN_MOBILITY_OBSERVER_H */ |