First public contribution.
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Interface definition for UPS dialog creator ECOM plug-in.
26 #ifndef DIALOGCREATOR_H
27 #define DIALOGCREATOR_H
31 #include <ups/policy.h>
32 #include <ups/ups.hrh>
34 namespace UserPromptService
41 Abstract base class for dialog creator ECOM plug-ins.
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
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
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.
55 class CDialogCreator : public CActive
58 IMPORT_C static CDialogCreator* NewL(const TUid& aDialogCreatorImplementationId);
61 Asynchronously retrieves and prepares the data needed to display the dialog.
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
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.
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;
85 Asynchronously, displays the dialog created by PrepareDialog and interprets the result.
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
91 @param aOptionSelected The option selected by the user.\n
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
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
103 @param aStatus The request object to complete once the dialog has been closed.
106 virtual void DisplayDialog(
107 CPolicy::TOptions& aOptionSelected,
108 const CFingerprint*& aFingerprint,
109 TUint& aEvaluatorInfo,
110 TRequestStatus& aStatus) = 0;
112 IMPORT_C TInt GetExtension(TUint aExtensionId, TAny*& a0, TAny* a1);
113 IMPORT_C ~CDialogCreator();
115 IMPORT_C CDialogCreator();
116 IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
119 TUid iDtor_ID_Key; // Required by ECOM
123 #endif // DIALGOCREATOR_H