1 /* |
|
2 * Copyright (c) 2002 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 the License "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: Declaration of class CWalletWrapper. |
|
15 * |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef WALLET_WRAPPER_H |
|
21 #define WALLET_WRAPPER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 |
|
26 #ifdef __WALLET |
|
27 #include <WalletBrowserObserver.h> |
|
28 #endif |
|
29 |
|
30 |
|
31 typedef enum |
|
32 { |
|
33 WALLET_XHTML_FILL_ALL, |
|
34 WALLET_XHTML_FILL_ONE, |
|
35 WALLET_XHTML_FILL_CLOSED, |
|
36 }Wallet_XHTML_FillOption; |
|
37 |
|
38 typedef enum |
|
39 { |
|
40 WALLET_XHTML_FAILURE, |
|
41 WALLET_XHTML_SUCCESS, |
|
42 WALLET_XHTML_OUT_OF_MEMORY, |
|
43 WALLET_XHTML_UNEXPECTED_ERROR, |
|
44 WALLET_XHTML_BAD_INPUT_PARAM |
|
45 }WALLET_XHTML_Status_t; |
|
46 |
|
47 |
|
48 // FORWARD DECLARATION |
|
49 class CBrCtl; |
|
50 |
|
51 |
|
52 /** |
|
53 * |
|
54 * wallet wrapper handling whole wallet realted function |
|
55 * |
|
56 * @lib Browserengine.lib |
|
57 * @since Series 60 2.0 |
|
58 */ |
|
59 class CWalletWrapper : |
|
60 public CBase |
|
61 #ifdef __WALLET |
|
62 , |
|
63 public MWalletObserver |
|
64 #endif |
|
65 { |
|
66 /* |
|
67 * Wallet status |
|
68 */ |
|
69 enum TWalletStatus |
|
70 { |
|
71 EWalletCreated = 0, ///< Wallet already crated |
|
72 EEWalletNotExist = -1 ///< wallet already not created. |
|
73 }; |
|
74 /* |
|
75 * Wallet tpye |
|
76 */ |
|
77 enum WalletType |
|
78 { |
|
79 EEcmlNo, ///< No conatin any ecml filed |
|
80 EEcml ///< Conatin ecml filed |
|
81 }; |
|
82 |
|
83 public: // construction |
|
84 |
|
85 /** |
|
86 * Two-phased constructor. Leaves on failure. |
|
87 * @return The constructed model |
|
88 */ |
|
89 static CWalletWrapper* NewL( CBrCtl* aParent); |
|
90 |
|
91 /** |
|
92 * Destructor. |
|
93 */ |
|
94 virtual ~CWalletWrapper(); |
|
95 |
|
96 protected: // construction |
|
97 |
|
98 /** |
|
99 * Constructor. |
|
100 */ |
|
101 CWalletWrapper( CBrCtl* aParent); |
|
102 |
|
103 /** |
|
104 * Second phase constructor. Leaves on failure. |
|
105 */ |
|
106 void ConstructL(); |
|
107 |
|
108 public: // used to deriving from MKimonoWalletWrapper |
|
109 |
|
110 TBool WalletUI_VisibleCloseWallet(); |
|
111 WALLET_XHTML_Status_t WalletFetch_Start( WALLET_XHTML_Status_t (callback) |
|
112 (Wallet_XHTML_FillOption, TUint16*, void*), |
|
113 TUint16* header, |
|
114 TBool ecml_exists, |
|
115 void* context); |
|
116 void WalletFetch_CloseWallet( TBool end_pressed ); |
|
117 WALLET_XHTML_Status_t WalletFetch_GetData( TUint16* field_name, |
|
118 TUint16** field_value, |
|
119 TBool none_filled); |
|
120 WALLET_XHTML_Status_t (*iWalletCallback) (Wallet_XHTML_FillOption, TUint16*, void*); |
|
121 |
|
122 public: // from kimone TSK |
|
123 |
|
124 /** |
|
125 * wallet already crated or not |
|
126 * @since Series 60 2.0 |
|
127 * @param - |
|
128 * @return TBool wallet status |
|
129 */ |
|
130 TBool ValletIsCreated(); |
|
131 |
|
132 /** |
|
133 * called when user press use wallet in the browser view |
|
134 * @since Series 60 2.0 |
|
135 * @param - |
|
136 * @return - |
|
137 */ |
|
138 void CmdUseWalletInfoL( ); |
|
139 |
|
140 /** |
|
141 * called when user press close wallet in the browser view |
|
142 * @since Series 60 2.0 |
|
143 * @param - |
|
144 * @return TBool vallet status |
|
145 */ |
|
146 void CmdCloseWalletL( ); |
|
147 |
|
148 /** |
|
149 * assyncron wallet destroyer |
|
150 * @since Series 60 2.0 |
|
151 * @param aWrapper pointer to the CWalletWrapper |
|
152 * @return TInt callback int value |
|
153 */ |
|
154 static TInt DestroyWalletL( TAny* aWrapper ); |
|
155 |
|
156 /** |
|
157 * Asyncronous close for wallet on browser exit. |
|
158 * @since Series 60 2.0 |
|
159 * @param aWait pointer to CActiveSchedulerWait |
|
160 */ |
|
161 void CmdCloseWalletOnExitL ( TAny* aWait ); |
|
162 |
|
163 |
|
164 public: // From MWalletObserver |
|
165 |
|
166 /** |
|
167 * vallet Handle the wallet messages |
|
168 * @since Series 60 2.0 |
|
169 * @param aOperationId wallet operation id |
|
170 * @param aData wallet data |
|
171 * @return - |
|
172 */ |
|
173 #ifdef __WALLET |
|
174 void HandleWalletMessageL( enum TWalletOperationId aOperationId, TAny* aData); |
|
175 #endif |
|
176 |
|
177 private: // data |
|
178 #ifdef __WALLET |
|
179 MBrowserObserver *iWallet; ///< not owned handled by function |
|
180 #endif |
|
181 |
|
182 TWalletStatus iWalletStatus; ///< wallet status |
|
183 WalletType iWalletType; ///< wallet type |
|
184 TAny* iContext; |
|
185 HBufC *iWalletInfoBuffer; |
|
186 CBrCtl *iBrCtl; // not owned |
|
187 CIdle* iAsyncCallBack; ///< asincron desroyer callback |
|
188 TBool iFillingFaliure; |
|
189 TAny* iActiveWait; |
|
190 }; |
|
191 |
|
192 #endif |
|
193 |
|
194 // End of file |
|