|
1 /* |
|
2 * Copyright (c) 2007-2009 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: |
|
15 * Interface definition for UPS dialog creator ECOM plug-in. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 @publishedPartner |
|
23 @released |
|
24 */ |
|
25 |
|
26 #ifndef DIALOGCREATOR_H |
|
27 #define DIALOGCREATOR_H |
|
28 |
|
29 #include <e32base.h> |
|
30 #include <e32cmn.h> |
|
31 #include <ups/policy.h> |
|
32 #include <ups/ups.hrh> |
|
33 |
|
34 namespace UserPromptService |
|
35 { |
|
36 class CClientEntity; |
|
37 class CFingerprint; |
|
38 class CPromptRequest; |
|
39 |
|
40 /** |
|
41 Abstract base class for dialog creator ECOM plug-ins. |
|
42 |
|
43 Dialog creators are responsible for generating and displaying prompt dialogs. Normally, |
|
44 the notifier framework (RNotifier) would be used to interact with the user interface layer.\n |
|
45 |
|
46 In addition to the data supplied by the system server the dialog creator may |
|
47 also include data from other servers such as AppArc or the SIS registry. |
|
48 Since retrieving this extra information may take an unpredictable amount of time the dialog |
|
49 creator PrepareDialog method is asynchronous to ensure the user prompt service is |
|
50 not blocked. |
|
51 |
|
52 - A new dialog creator object is created for each request that requires a prompt. The object |
|
53 is destroyed after DisplayDialog has been called. |
|
54 */ |
|
55 class CDialogCreator : public CActive |
|
56 { |
|
57 public: |
|
58 IMPORT_C static CDialogCreator* NewL(const TUid& aDialogCreatorImplementationId); |
|
59 |
|
60 /** |
|
61 Asynchronously retrieves and prepares the data needed to display the dialog. |
|
62 |
|
63 The const parameters aRequest, aPolicy, aFingerprints, aDialogCreatorParams persist |
|
64 until after the the dialog creator has been destroyed; therefore, the dialog creator |
|
65 may safely use pointers to this data internally.\n |
|
66 |
|
67 @param aRequest The parameters supplied by the system server. |
|
68 @param aPolicy The policy being evaluated. |
|
69 @param aFingerprints The array of finger prints generated by the policy evaluator.\n |
|
70 This may be empty if the policy does not allow the Always or Never options. |
|
71 @param aClientEntity Identifies the entity within the client process that requested the service.\n |
|
72 NULL if the client processs is not an execution host. |
|
73 @param aDialogCreatorParams Opaque data generated by the policy evaluator. |
|
74 @param aStatus The request object to complete once the dialog is ready. |
|
75 */ |
|
76 virtual void PrepareDialog( |
|
77 const CPromptRequest& aRequest, |
|
78 const CPolicy& aPolicy, |
|
79 const RPointerArray<CFingerprint>& aFingerprints, |
|
80 const CClientEntity* aClientEntity, |
|
81 const TAny* aDialogCreatorParams, |
|
82 TRequestStatus& aStatus) = 0; |
|
83 |
|
84 /** |
|
85 Asynchronously, displays the dialog created by PrepareDialog and interprets the result. |
|
86 |
|
87 Note that the UPS server expects aOptionSelected to match one of the enabled options specified |
|
88 in the policy entry which was passed into PrepareDialog. If no legal option is selected, it will be treated |
|
89 as a ENo. |
|
90 |
|
91 @param aOptionSelected The option selected by the user.\n |
|
92 (OUT parameter) |
|
93 @param aFingerprint A reference to a pointer used to return the fingerprint to use in the new |
|
94 decision record if the Always or Never button was selected.\n |
|
95 Ownership is NOT transferred to the caller.\n |
|
96 (OUT parameter) |
|
97 @param aEvaluatorInfo The value to write to the decision record's evaluatorInfo field if |
|
98 the Always or Never option was selected. The default |
|
99 value for this field is 0x00000000 for a new record or the |
|
100 previous value if the policy evaluator forced a prompt to be |
|
101 displayed and a decision record already existed.\n |
|
102 (IN/OUT parameter) |
|
103 @param aStatus The request object to complete once the dialog has been closed. |
|
104 |
|
105 */ |
|
106 virtual void DisplayDialog( |
|
107 CPolicy::TOptions& aOptionSelected, |
|
108 const CFingerprint*& aFingerprint, |
|
109 TUint& aEvaluatorInfo, |
|
110 TRequestStatus& aStatus) = 0; |
|
111 |
|
112 IMPORT_C TInt GetExtension(TUint aExtensionId, TAny*& a0, TAny* a1); |
|
113 IMPORT_C ~CDialogCreator(); |
|
114 protected: |
|
115 IMPORT_C CDialogCreator(); |
|
116 IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1); |
|
117 private: |
|
118 TAny* iReserved; |
|
119 TUid iDtor_ID_Key; // Required by ECOM |
|
120 }; |
|
121 } |
|
122 |
|
123 #endif // DIALGOCREATOR_H |