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