author | Pat Downey <patd@symbian.org> |
Wed, 01 Sep 2010 12:27:42 +0100 | |
branch | RCL_3 |
changeset 62 | 19bba8228ff0 |
parent 61 | b183ec05bd8c |
permissions | -rw-r--r-- |
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
62 | 2 |
* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). |
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
5 |
* under the terms of "Eclipse Public License v1.0" |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
8 |
* |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
9 |
* Initial Contributors: |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
11 |
* |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
12 |
* Contributors: |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
14 |
* Description: Implementation of policymanagement components |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
15 |
* |
62 | 16 |
* |
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
*/ |
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
|
62 | 19 |
|
20 |
#ifndef POLICTY_ENGINE_UI_HEADER_ |
|
21 |
#define POLICTY_ENGINE_UI_HEADER_ |
|
22 |
||
23 |
// INCLUDES |
|
24 |
#include <e32base.h> |
|
25 |
#include <eiknotapi.h> |
|
26 |
||
27 |
// CONSTANTS |
|
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
28 |
|
62 | 29 |
_LIT8( KUserAcceptMark, "A"); |
30 |
_LIT8( KUserDenyMark, "D"); |
|
31 |
const TUint KDelimeterChar = '|'; |
|
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
32 |
|
62 | 33 |
enum TUserResponse |
34 |
{ |
|
35 |
EUserAccept, |
|
36 |
EUserDeny, |
|
37 |
}; |
|
38 |
||
39 |
// FORWARD DECLARATIONS |
|
40 |
||
41 |
class CCoeEnv; |
|
42 |
class CPolicyEngineUi; |
|
43 |
||
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
44 |
|
62 | 45 |
class CPolicyEngineNotifier : public CBase, public MEikSrvNotifierBase2 |
46 |
{ |
|
47 |
public: |
|
48 |
||
49 |
CPolicyEngineNotifier(); |
|
50 |
~CPolicyEngineNotifier(); |
|
51 |
static CPolicyEngineNotifier* NewL(); |
|
52 |
void ConstructL(); |
|
53 |
||
54 |
void Complete( TUserResponse aResponse); |
|
55 |
||
56 |
public: //From MEikSrvNotifierBase2 |
|
57 |
||
58 |
void Release(); |
|
59 |
TNotifierInfo RegisterL(); |
|
60 |
TNotifierInfo Info() const; |
|
61 |
TPtrC8 StartL(const TDesC8& aBuffer); |
|
62 |
void StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage); |
|
63 |
void Cancel(); |
|
64 |
TPtrC8 UpdateL(const TDesC8& aBuffer); |
|
65 |
||
66 |
private: |
|
67 |
CPolicyEngineUi * iPolicyEngineUi; |
|
68 |
||
69 |
/** |
|
70 |
* refers connections is intialized or not |
|
71 |
*/ |
|
72 |
TNotifierInfo iInfo; ///< Notifier info |
|
73 |
||
74 |
TInt iReplySlot; |
|
75 |
RMessagePtr2 iMessage; |
|
76 |
}; |
|
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
77 |
|
62 | 78 |
|
79 |
||
80 |
/** |
|
81 |
* This class provides a wrapper for some common dialogs for the policy engine |
|
82 |
* |
|
83 |
* @lib policyengineui.lib |
|
84 |
*/ |
|
85 |
class CPolicyEngineUi : public CActive |
|
86 |
{ |
|
87 |
public: // Constructors and destructor |
|
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
88 |
|
62 | 89 |
/** |
90 |
* Constructor. |
|
91 |
*/ |
|
92 |
CPolicyEngineUi(); |
|
93 |
||
94 |
/** |
|
95 |
* Two-phased constructor. |
|
96 |
*/ |
|
97 |
static CPolicyEngineUi* NewL(); |
|
98 |
||
99 |
/** |
|
100 |
* Destructor. |
|
101 |
*/ |
|
102 |
virtual ~CPolicyEngineUi(); |
|
103 |
||
104 |
void ActivateL( const TDesC8& aCorporate, const TDesC8& aRandomPart, CPolicyEngineNotifier* iNotifier); |
|
105 |
||
106 |
void RunL(); |
|
107 |
TInt RunError(TInt aError); |
|
108 |
void DoCancel(); |
|
109 |
||
110 |
public: |
|
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
111 |
|
62 | 112 |
/** |
113 |
* Execute corporate policy question chain, which user deny or accept. One response generated. |
|
114 |
* @param aCorporate - Corparate name used in queries |
|
115 |
* @param aRandomPart - Random part of certificate, which user must know. |
|
116 |
* @return TUserResponse - Response value for user |
|
117 |
*/ |
|
118 |
||
119 |
TUserResponse ShowCorporateConfirmationDialogL( const TDesC8& aCorporate, |
|
120 |
const TDesC8& aRandomPart); |
|
121 |
private: |
|
122 |
||
123 |
//private enums |
|
124 |
enum TDialog |
|
125 |
{ |
|
126 |
EControl = 0, |
|
127 |
EQuestion, |
|
128 |
ERemove, |
|
129 |
EDenied, |
|
130 |
EUnMatch |
|
131 |
}; |
|
132 |
||
133 |
enum TDlgResp |
|
134 |
{ |
|
135 |
EOkResp, |
|
136 |
ECancelResp |
|
137 |
}; |
|
138 |
||
139 |
private: |
|
140 |
||
141 |
/** |
|
142 |
* Two-phased constructor. |
|
143 |
*/ |
|
144 |
void ConstructL(); |
|
145 |
||
146 |
||
147 |
TInt ShowDialogL( const TDialog& aDialog); |
|
148 |
TDlgResp ShowConfirmationQueryL( const TDesC& aText, const TBool& aWithCancel ); |
|
149 |
TDlgResp ShowPossessionMessageQueryL(); |
|
150 |
TDlgResp DataQueryL( const TDesC& aText, TDes& aInput ); |
|
151 |
||
152 |
private: // Data |
|
61
b183ec05bd8c
Revision: 201033
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
58
diff
changeset
|
153 |
|
62 | 154 |
HBufC * iCorporate; |
155 |
HBufC * iRandomPart; |
|
156 |
TInt iState; |
|
157 |
CPolicyEngineNotifier * iNotifier; |
|
158 |
||
159 |
TInt iResourceFileOffset; |
|
160 |
CCoeEnv* iCoeEnv; // not owned |
|
161 |
}; |
|
0
b497e44ab2fc
Revision: 200949
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
162 |
|
62 | 163 |
|
164 |
#endif // POLICTY_ENGINE_UI_HEADER_ |
|
165 |
||
166 |
// End of File |