1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/authorisation/userpromptservice/policies/inc/dialogcreator.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,123 @@
1.4 +/*
1.5 +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +* Interface definition for UPS dialog creator ECOM plug-in.
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +/**
1.24 + @file
1.25 + @publishedPartner
1.26 + @released
1.27 +*/
1.28 +
1.29 +#ifndef DIALOGCREATOR_H
1.30 +#define DIALOGCREATOR_H
1.31 +
1.32 +#include <e32base.h>
1.33 +#include <e32cmn.h>
1.34 +#include <ups/policy.h>
1.35 +#include <ups/ups.hrh>
1.36 +
1.37 +namespace UserPromptService
1.38 + {
1.39 + class CClientEntity;
1.40 + class CFingerprint;
1.41 + class CPromptRequest;
1.42 +
1.43 + /**
1.44 + Abstract base class for dialog creator ECOM plug-ins.
1.45 +
1.46 + Dialog creators are responsible for generating and displaying prompt dialogs. Normally,
1.47 + the notifier framework (RNotifier) would be used to interact with the user interface layer.\n
1.48 +
1.49 + In addition to the data supplied by the system server the dialog creator may
1.50 + also include data from other servers such as AppArc or the SIS registry.
1.51 + Since retrieving this extra information may take an unpredictable amount of time the dialog
1.52 + creator PrepareDialog method is asynchronous to ensure the user prompt service is
1.53 + not blocked.
1.54 +
1.55 + - A new dialog creator object is created for each request that requires a prompt. The object
1.56 + is destroyed after DisplayDialog has been called.
1.57 + */
1.58 + class CDialogCreator : public CActive
1.59 + {
1.60 + public:
1.61 + IMPORT_C static CDialogCreator* NewL(const TUid& aDialogCreatorImplementationId);
1.62 +
1.63 + /**
1.64 + Asynchronously retrieves and prepares the data needed to display the dialog.
1.65 +
1.66 + The const parameters aRequest, aPolicy, aFingerprints, aDialogCreatorParams persist
1.67 + until after the the dialog creator has been destroyed; therefore, the dialog creator
1.68 + may safely use pointers to this data internally.\n
1.69 +
1.70 + @param aRequest The parameters supplied by the system server.
1.71 + @param aPolicy The policy being evaluated.
1.72 + @param aFingerprints The array of finger prints generated by the policy evaluator.\n
1.73 + This may be empty if the policy does not allow the Always or Never options.
1.74 + @param aClientEntity Identifies the entity within the client process that requested the service.\n
1.75 + NULL if the client processs is not an execution host.
1.76 + @param aDialogCreatorParams Opaque data generated by the policy evaluator.
1.77 + @param aStatus The request object to complete once the dialog is ready.
1.78 + */
1.79 + virtual void PrepareDialog(
1.80 + const CPromptRequest& aRequest,
1.81 + const CPolicy& aPolicy,
1.82 + const RPointerArray<CFingerprint>& aFingerprints,
1.83 + const CClientEntity* aClientEntity,
1.84 + const TAny* aDialogCreatorParams,
1.85 + TRequestStatus& aStatus) = 0;
1.86 +
1.87 + /**
1.88 + Asynchronously, displays the dialog created by PrepareDialog and interprets the result.
1.89 +
1.90 + Note that the UPS server expects aOptionSelected to match one of the enabled options specified
1.91 + in the policy entry which was passed into PrepareDialog. If no legal option is selected, it will be treated
1.92 + as a ENo.
1.93 +
1.94 + @param aOptionSelected The option selected by the user.\n
1.95 + (OUT parameter)
1.96 + @param aFingerprint A reference to a pointer used to return the fingerprint to use in the new
1.97 + decision record if the Always or Never button was selected.\n
1.98 + Ownership is NOT transferred to the caller.\n
1.99 + (OUT parameter)
1.100 + @param aEvaluatorInfo The value to write to the decision record's evaluatorInfo field if
1.101 + the Always or Never option was selected. The default
1.102 + value for this field is 0x00000000 for a new record or the
1.103 + previous value if the policy evaluator forced a prompt to be
1.104 + displayed and a decision record already existed.\n
1.105 + (IN/OUT parameter)
1.106 + @param aStatus The request object to complete once the dialog has been closed.
1.107 +
1.108 + */
1.109 + virtual void DisplayDialog(
1.110 + CPolicy::TOptions& aOptionSelected,
1.111 + const CFingerprint*& aFingerprint,
1.112 + TUint& aEvaluatorInfo,
1.113 + TRequestStatus& aStatus) = 0;
1.114 +
1.115 + IMPORT_C TInt GetExtension(TUint aExtensionId, TAny*& a0, TAny* a1);
1.116 + IMPORT_C ~CDialogCreator();
1.117 + protected:
1.118 + IMPORT_C CDialogCreator();
1.119 + IMPORT_C virtual TInt Extension_(TUint aExtensionId, TAny*& a0, TAny* a1);
1.120 + private:
1.121 + TAny* iReserved;
1.122 + TUid iDtor_ID_Key; // Required by ECOM
1.123 + };
1.124 + }
1.125 +
1.126 +#endif // DIALGOCREATOR_H