|
1 /* |
|
2 * Copyright (c) 2004 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: Connection UI implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __CIMPSPRESENCECONNECTIONUIIMP_H |
|
19 #define __CIMPSPRESENCECONNECTIONUIIMP_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32base.h> |
|
23 #include "cimpspresenceconnectionuing.h" |
|
24 #include "CCnUiSapStoreProxy.h" |
|
25 |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CIMPSSAPSettingsStore; |
|
29 class MIMPSConnProcessObserver; |
|
30 class MCnUiConnectionHandler; |
|
31 class CCnUiConnModeRewaker; |
|
32 |
|
33 |
|
34 |
|
35 // CLASS DECLARATION |
|
36 /** |
|
37 * CIMPSPresenceConnectionUiImp. |
|
38 * Implements the CIMPSPresenceConnectionUi features. |
|
39 * |
|
40 * @since 2.1 |
|
41 */ |
|
42 NONSHARABLE_CLASS( CIMPSPresenceConnectionUiImp ) : public CBase |
|
43 { |
|
44 public: // Two-phased constructors and destructor |
|
45 |
|
46 /** |
|
47 * Two-phased constructor. |
|
48 * @param aSapStore The SAP Settings store to use. |
|
49 * If NULL pointer is used, creates a temporary one |
|
50 * when needed. |
|
51 */ |
|
52 static CIMPSPresenceConnectionUiImp* NewL( TIMPSConnectionClient aClient, |
|
53 CIMPSSAPSettingsStore* aSapStore ); |
|
54 |
|
55 |
|
56 /** |
|
57 * Destructor. |
|
58 */ |
|
59 ~CIMPSPresenceConnectionUiImp(); |
|
60 |
|
61 private: |
|
62 |
|
63 /** |
|
64 * C++ constructor. |
|
65 */ |
|
66 CIMPSPresenceConnectionUiImp( TIMPSConnectionClient aClient, |
|
67 CIMPSSAPSettingsStore* aSapStore ); |
|
68 |
|
69 |
|
70 /** |
|
71 * Symbian OS constructor. |
|
72 */ |
|
73 void ConstructL(); |
|
74 |
|
75 |
|
76 public: // Connection methods for CIMPSPresenceConnectionUi |
|
77 |
|
78 /** |
|
79 * Implements login as described in CIMPSPresenceConnectionUi. |
|
80 * @see CIMPSPresenceConnectionUi |
|
81 * @since 2.1 |
|
82 */ |
|
83 TInt LoginL( TIMPSConnectionClient aClient, |
|
84 TIMPSLoginType aLoginType, |
|
85 CPEngNWSessionSlotID2& aNWSessionSlotID, |
|
86 MIMPSConnProcessObserver* aObserver, |
|
87 CIMPSSAPSettings* aSap = NULL, TBool aLastLoginSap = EFalse ); |
|
88 |
|
89 |
|
90 /** |
|
91 * Implements logout as described in CIMPSPresenceConnectionUi. |
|
92 * @see CIMPSPresenceConnectionUi |
|
93 * @since 2.1 |
|
94 */ |
|
95 TInt LogoutL( const CPEngNWSessionSlotID2& aNWSessionSlotID, |
|
96 MIMPSConnProcessObserver* aObserver ); |
|
97 |
|
98 |
|
99 |
|
100 /** |
|
101 * Implements application exit handling as described |
|
102 * in CIMPSPresenceConnectionUi. |
|
103 * |
|
104 * @see CIMPSPresenceConnectionUi |
|
105 * @since 2.1 |
|
106 */ |
|
107 TInt HandleApplicationExitL( TIMPSConnectionClient aClient, |
|
108 TIMPSExitType aExitType, |
|
109 const CPEngNWSessionSlotID2& aNWSessionSlotID, |
|
110 MIMPSConnProcessObserver* aObserver ); |
|
111 |
|
112 /** |
|
113 * Implements the fetching of active NWSessionSlotID as described in |
|
114 * CIMPSPresenceConnectionUi. |
|
115 * @see CIMPSPresenceConnectionUi |
|
116 * @since 3.0 |
|
117 */ |
|
118 CPEngNWSessionSlotID2* GetActiveNWSessionSlotIDL( TIMPSConnectionClient aClient ); |
|
119 |
|
120 |
|
121 /** |
|
122 * Implements logged in sap get as described in |
|
123 * CIMPSPresenceConnectionUi. |
|
124 * @see CIMPSPresenceConnectionUi |
|
125 * @since 2.1 |
|
126 */ |
|
127 TInt GetLoggedInSapL( const CPEngNWSessionSlotID2& aNWSessionSlotID, |
|
128 CIMPSSAPSettings& aSap ); |
|
129 |
|
130 |
|
131 /** |
|
132 * Implements pure connection status get from Presence |
|
133 * Engine as described in CIMPSPresenceConnectionUi. |
|
134 * |
|
135 * @see CIMPSPresenceConnectionUi |
|
136 * @since 2.1 |
|
137 */ |
|
138 TPEngNWSessionSlotState PureServiceStatusL( |
|
139 const CPEngNWSessionSlotID2& aNWSessionSlotID ); |
|
140 |
|
141 |
|
142 /** |
|
143 * Implements connection operation get as |
|
144 * described in CIMPSPresenceConnectionUi. |
|
145 * |
|
146 * @see CIMPSPresenceConnectionUi |
|
147 * @since 2.1 |
|
148 */ |
|
149 TIMPSConnectionOperation CurrentConnectionOperationL( HBufC*& aAddtionalDesc ); |
|
150 |
|
151 /** |
|
152 * Implements client login status getting as |
|
153 * described in CIMPSPresenceConnectionUi. |
|
154 * |
|
155 * @see CIMPSPresenceConnectionUi |
|
156 * @since 3.0 |
|
157 */ |
|
158 TBool LoggedInL( TIMPSConnectionClient aClient ); |
|
159 |
|
160 public: // Other methods for CIMPSPresenceConnectionUi |
|
161 |
|
162 /** |
|
163 * Displays a domain selection query |
|
164 * described in CIMPSPresenceConnectionUi. |
|
165 * |
|
166 * @see CIMPSPresenceConnectionUi |
|
167 * @since 3.1u |
|
168 */ |
|
169 TInt DisplayDomainSelectionQueryL( TDes& aSelectedDomain, |
|
170 CIMPSSAPSettings* aSap ); |
|
171 |
|
172 public: // New methods, left public to allow testing |
|
173 |
|
174 /** |
|
175 * Remaps internal login error codes to external ones as |
|
176 * defined in CIMPSPresenceConnectionUi interface. |
|
177 * |
|
178 * @see CIMPSPresenceConnectionUi |
|
179 * @since 2.1 |
|
180 */ |
|
181 static TInt MapToUiLoginReturnStatus( TInt aOperationResult ); |
|
182 |
|
183 |
|
184 private: // New helper methods |
|
185 |
|
186 /** |
|
187 * Stores network session slot ownership |
|
188 * |
|
189 * @return error code |
|
190 */ |
|
191 void StoreNWSessionOwnershipL( const CPEngNWSessionSlotID2& aNWSessionSlotID ); |
|
192 |
|
193 /** |
|
194 * Restores network session slot ownership |
|
195 * |
|
196 * @return error code |
|
197 */ |
|
198 void ReStoreNWSessionOwnershipL(); |
|
199 |
|
200 /** |
|
201 * Calls ResetAndDestroy to given array |
|
202 * @since 3.0 |
|
203 * @param aObject Array (RPointerArray<CPEngNWSessionSlotID2>) |
|
204 */ |
|
205 static void DestroyCloseModelArray( TAny* aObject ); |
|
206 |
|
207 |
|
208 private: //Data |
|
209 |
|
210 ///<SapStore proxy, owned |
|
211 CCnUiSapStoreProxy iSapStoreProxy; |
|
212 |
|
213 ///<Synchronous connection handler, owned |
|
214 MCnUiConnectionHandler* iConnHandler; |
|
215 |
|
216 ///<Connection mode rewaker, owned |
|
217 CCnUiConnModeRewaker* iConnModeRewaker; |
|
218 |
|
219 ///<Client using Connection UI |
|
220 TIMPSConnectionClient iClient; |
|
221 |
|
222 }; |
|
223 |
|
224 #endif //__CIMPSPRESENCECONNECTIONUIIMP_H |
|
225 // End of File |
|
226 |
|
227 |