|
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 "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 * Bio control for Provisioning documents. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef CWPBIOCONTROL_H |
|
21 #define CWPBIOCONTROL_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32cmn.h> |
|
25 #include <MSVAPI.H> |
|
26 #include <hbsymbianvariant.h> |
|
27 #include <hbdevicedialogsymbian.h> |
|
28 #include <CWPBootstrap.h> |
|
29 #include "CWPSaver.h" |
|
30 #include <ProvisioningUIDs.h> |
|
31 #include <CpMessage.h> |
|
32 #include <CpQtSpView.h> |
|
33 |
|
34 class CWPEngine; |
|
35 class CWPNameValue; |
|
36 class CWPPushMessage; |
|
37 class CWPBootstarp; |
|
38 class CpMessage; |
|
39 class CpQtSp; |
|
40 |
|
41 const TInt KMaxPinSize = 20; |
|
42 |
|
43 // CLASS DECLARATION |
|
44 |
|
45 /** |
|
46 * Bio control for OMA Provisioning messages. |
|
47 * @since 2.0 |
|
48 */ |
|
49 |
|
50 class CDummyObserver : public CBase, public MMsvSessionObserver |
|
51 { |
|
52 public: |
|
53 void HandleSessionEventL(TMsvSessionEvent, TAny*, TAny*, TAny*) {}; |
|
54 }; |
|
55 |
|
56 |
|
57 class CWPBioControl: public CActive, MHbDeviceDialogObserver |
|
58 { |
|
59 public: // Constructor and destructor |
|
60 |
|
61 /** |
|
62 * Two-phased constructor. |
|
63 * @param aObserver Reference to the Bio control observer. |
|
64 * @param aSession Reference to Message Server session. |
|
65 * @param aId Id of the message. |
|
66 * @param aEditorOrViewerMode Enum for the mode, is it as editor or viewer. |
|
67 * @param aFileName The newly created object. |
|
68 * @param aFile file handle to provisioning content. |
|
69 */ |
|
70 IMPORT_C static CWPBioControl* NewL( CMsvSession* aSession,TMsvId aId,CpQtSp* sp); |
|
71 ~CWPBioControl(); |
|
72 RPointerArray<CWPNameValue>* CollectItemsLC() const; |
|
73 |
|
74 void SaveSettingsL(); |
|
75 void DoSaveL(); |
|
76 void RestoreMsgL(); |
|
77 TInt getAuth(); |
|
78 // from MHbDeviceDialogObserver |
|
79 void DataReceived( CHbSymbianVariantMap& aData ); |
|
80 void DeviceDialogClosed(TInt aCompletionCode); |
|
81 void SaveSettingStatus(); |
|
82 void saveDefaultSetting(); |
|
83 void postAuthetication(); |
|
84 void updateAuthetication(); |
|
85 void authenticationFailed(); |
|
86 void senderUnknownContinue(); |
|
87 void senderUnknownCancel(); |
|
88 protected: // from CActive |
|
89 void DoCancel(); |
|
90 void RunL(); |
|
91 |
|
92 private: // Constructors |
|
93 |
|
94 /** |
|
95 * Constructor is prohibited. |
|
96 * @param aObserver Reference to the Bio control observer. |
|
97 * @param aSession Reference to Message Server session. |
|
98 * @param aId Id of the message in Message Server. |
|
99 * @param aEditorOrViewerMode Enum for the mode, is it as editor or viewer. |
|
100 * @param aFileName The newly created object. |
|
101 * @param aFile file handle to provisioning content. |
|
102 */ |
|
103 CWPBioControl( CMsvSession* aSession,TMsvId aId); |
|
104 void ConstructL(CMsvSession* aSession,TMsvId aId,CpQtSp* sp); |
|
105 |
|
106 private: |
|
107 |
|
108 void AddItemsL(); |
|
109 void CollateAndAddItemsL( RPointerArray<CWPNameValue>& aItems ); |
|
110 TBool AuthenticateL( CWPPushMessage& aMessage ); |
|
111 static TInt Compare( const CWPNameValue& aImpl1,const CWPNameValue& aImpl2 ); |
|
112 void SetCenrepKeyL(const TDesC8& aValue); |
|
113 void SaveMessageL(); |
|
114 static void Cleanup( TAny* aAny ); |
|
115 TInt WaitUntilDeviceDialogClosed(); |
|
116 private: |
|
117 CWPEngine* iEngine; |
|
118 CWPPushMessage* iMessage; |
|
119 CDummyObserver* iObserver; |
|
120 CMsvSession* iSession; |
|
121 TMsvId iId; |
|
122 TMsvEntry iEntry; |
|
123 TInt ireturnkey; |
|
124 CHbDeviceDialogSymbian* iDevDialog; |
|
125 CWPBootstrap* ibootstrap; |
|
126 TInt itries; |
|
127 TInt iAuth; |
|
128 CActiveSchedulerWait* iWait; |
|
129 TBool iIsDisplayingDialog; |
|
130 TInt iCompletionCode; |
|
131 CpMessage* iMsg; |
|
132 CpQtSp* iSp; |
|
133 }; |
|
134 |
|
135 |
|
136 |
|
137 #endif // CWPBIOCONTROL_H |
|
138 |
|
139 // End of File |