authorisation/userpromptutils/inc/upsnotifierutil.h
changeset 8 35751d3474b7
equal deleted inserted replaced
2:675a964f4eb5 8:35751d3474b7
       
     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 * Classes used for communication between the reference dialog creator
       
    16 * and the reference notifier implementations.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 /**
       
    22  @file
       
    23  @internalTechnology 
       
    24  @test
       
    25 */
       
    26 
       
    27 #ifndef UPSNOTIFIERUTIL_H
       
    28 #define UPSNOTIFIERUTIL_H
       
    29 
       
    30 #include <e32base.h>
       
    31 #include <e32cmn.h>
       
    32 #include <s32strm.h>
       
    33 #include <ups/policy.h>
       
    34 #include <ups/upsconst.h>
       
    35 #include <ups/upstypes.h>
       
    36 
       
    37 namespace UserPromptService
       
    38 	{
       
    39 	/**
       
    40 	Enum for bitmask that influences visual style or behavior of dialog.
       
    41 	*/
       
    42 	typedef enum 
       
    43 		{
       
    44 		ETrustedClient	= 0x0001,		///< Client SID is protected so client name is trusted
       
    45 		EBuiltInApp	= 0x0002		///< Built-in application ... exe loaded for Z drive.
       
    46 		} TUpsDialogFlags;
       
    47 				
       
    48 	/**
       
    49 	Contains the data needed to display a prompt.
       
    50 	*/
       
    51 	NONSHARABLE_CLASS(CPromptData) : public CBase
       
    52 		{
       
    53 	public:		
       
    54 		IMPORT_C static CPromptData* NewL();
       
    55 		IMPORT_C void InternalizeL(RReadStream& aStream);
       
    56 		IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
       
    57 		~CPromptData();
       
    58 	private:
       
    59 		CPromptData();
       
    60 		void Reset();
       
    61 	public:
       
    62 		RBuf iClientName;                    ///< From AppArc, SIS registry or process filename
       
    63 		RBuf iVendorName;                    ///< Vendor name
       
    64 		TSecureId iClientSid;                ///< SID of client application requesting the service
       
    65 		TSecureId iServerSid;                ///< Needed to lookup localized text for service
       
    66 		TServiceId iServiceId;               ///< ID of the requested service
       
    67 		RBuf iDestination;                   ///< The destination of the request
       
    68 		RBuf8 iOpaqueData;                   ///< The Opaque data
       
    69 		RPointerArray<HBufC> iDescriptions;  ///< Array of fingerprint descriptions
       
    70 		TUint32 iOptions;                    ///< A bit field containing the set of allowed responses (CPolicy::TOptions)
       
    71 		TUint32 iFlags;                      ///< Dialog style e.g. whether client identity is trusted
       
    72 		};
       
    73 			
       
    74 	class TPromptResult
       
    75 		{
       
    76 	public: 
       
    77 		TPromptResult();
       
    78 		CPolicy::TOptions iSelected;    ///< The button that was pressed
       
    79 		TInt iDestination;              ///< The destination selected if applicable.
       
    80 		};
       
    81 	
       
    82 	inline TPromptResult::TPromptResult() : 
       
    83 		iSelected(CPolicy::ENo), iDestination(0) 
       
    84 		{
       
    85 		}		
       
    86 	}
       
    87 #endif // UPSNOTIFIERUTIL_H