os/security/contentmgmt/contentaccessfwfordrm/inc/attribute.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2003-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
*
sl@0
    16
*/
sl@0
    17
sl@0
    18
sl@0
    19
/**
sl@0
    20
 @file
sl@0
    21
 @publishedPartner
sl@0
    22
 @deprecated
sl@0
    23
*/
sl@0
    24
sl@0
    25
#ifndef __CAF_ATTRIBUTE_H__
sl@0
    26
#define __CAF_ATTRIBUTE_H__
sl@0
    27
sl@0
    28
#ifndef REMOVE_CAF1
sl@0
    29
sl@0
    30
#include <e32base.h>
sl@0
    31
#include <f32file.h>
sl@0
    32
#include <caf/caftypes.h>
sl@0
    33
sl@0
    34
sl@0
    35
namespace ContentAccess
sl@0
    36
{
sl@0
    37
	class CAgentContent;
sl@0
    38
	class CAgentFactory;
sl@0
    39
	class CBitset;
sl@0
    40
	
sl@0
    41
	/**
sl@0
    42
	 * Encapsulates the attributes of a piece of content. 
sl@0
    43
	 *
sl@0
    44
	 * These attributes will be required by DRM-aware
sl@0
    45
	 * applications in order that they can uphold DRM policies in a
sl@0
    46
	 * well-behaved manner. In general, clients set one or more attributes
sl@0
    47
	 * in the <i>Query</i> set, make a <i>GetL</i> call, and then
sl@0
    48
	 * read the agent's reponse from the <i>Response</i> set.
sl@0
    49
	 *
sl@0
    50
	 * CAttribute is a container for a number of separate
sl@0
    51
	 * ContentAccess::CBitset objects. These individual bitsets contain:
sl@0
    52
	 * -# Queries - what the client is interested in knowing.
sl@0
    53
	 * -# Responses - the answers to the queries.
sl@0
    54
	 * -# Capabilities - which attributes the system is able to support.
sl@0
    55
	 *
sl@0
    56
	 * Access to the bitset operations themselves can be achieved via the
sl@0
    57
	 * ContentAccess::CAttribute::AttributeSetL operation.
sl@0
    58
	 *
sl@0
    59
	 * @publishedPartner
sl@0
    60
	 * @deprecated 
sl@0
    61
	 */
sl@0
    62
	class CAttribute : public CBase
sl@0
    63
		{
sl@0
    64
	public:
sl@0
    65
		/**
sl@0
    66
		 Constructs a new attribute given an agent and file handle.
sl@0
    67
		 
sl@0
    68
		 @param aAgentUid	The agent Uid
sl@0
    69
		 @param aFile		A file handle 
sl@0
    70
		 @return			The new CAttribute.
sl@0
    71
		 
sl@0
    72
		 @internalComponent
sl@0
    73
		 @released		 
sl@0
    74
		 */
sl@0
    75
		static CAttribute* NewLC(TUid aAgentUid, RFile& aFile);
sl@0
    76
		
sl@0
    77
		/**
sl@0
    78
		 Constructs a new attribute given an agent and content.
sl@0
    79
		 
sl@0
    80
		 @param aAgentUid	The agent Uid
sl@0
    81
		 @param aURI		The pathname of the target content.
sl@0
    82
		 @param aShareMode Optional share mode for opening attributes of this content, defaults to EContentShareReadOnly. This parameter has no effect unless the content is a local file on the device.
sl@0
    83
		 @return			The new CAttribute.
sl@0
    84
		 
sl@0
    85
		 @internalComponent
sl@0
    86
		 @released
sl@0
    87
		 */
sl@0
    88
		static CAttribute* NewLC(TUid aAgentUid, const TDesC& aURI, TContentShareMode aShareMode=EContentShareReadOnly);
sl@0
    89
sl@0
    90
#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT		
sl@0
    91
		/**
sl@0
    92
		 Constructs a new attribute given an agent and WMDRM header data.
sl@0
    93
		 
sl@0
    94
		 @param aAgentUid	The agent Uid
sl@0
    95
		 @param aHeaderData	Header data of WMDRM content
sl@0
    96
		 @return			The new CAttribute.
sl@0
    97
		 
sl@0
    98
		 @internalComponent
sl@0
    99
		 @released		 
sl@0
   100
		 */
sl@0
   101
		static CAttribute* NewLC(TUid aAgentUid, const TDesC8& aHeaderData);
sl@0
   102
#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
sl@0
   103
		
sl@0
   104
		virtual ~CAttribute();
sl@0
   105
sl@0
   106
		/**
sl@0
   107
		 * Returns a reference to the query set
sl@0
   108
		 *
sl@0
   109
		 * The bits of the query-set should be set or cleared prior to the "GetL()" 
sl@0
   110
		 * call to specify which attributes the client is interested in.
sl@0
   111
		 *
sl@0
   112
		 * @note	Set is probably best used inline to access some of the 
sl@0
   113
		 * 			CBitset operations directly.
sl@0
   114
		 * 			@code 
sl@0
   115
		 * 			// Set EIsProtected in the Query set.
sl@0
   116
		 * 			MyAttr->QuerySet(EQuerySet).Set(EIsProtected);
sl@0
   117
		 * 			@endcode
sl@0
   118
		 *
sl@0
   119
		 * @return	A CBitset refererence.
sl@0
   120
		 */
sl@0
   121
		IMPORT_C CBitset& QuerySet();
sl@0
   122
sl@0
   123
		/**
sl@0
   124
		 * Returns a reference to the response set. 
sl@0
   125
		 * 
sl@0
   126
		 * The response set will only be valid after a call to the "GetL()" operation.
sl@0
   127
		 *
sl@0
   128
		 * @return	A CBitset refererence.
sl@0
   129
		 */
sl@0
   130
		IMPORT_C const CBitset& ResponseSet() const;
sl@0
   131
		
sl@0
   132
		/**
sl@0
   133
		 * Resets the attribute object completely. 
sl@0
   134
		 */ 
sl@0
   135
		IMPORT_C void Reset();
sl@0
   136
		
sl@0
   137
		/**
sl@0
   138
		 * Delivers the attribute object to the relevant agent for
sl@0
   139
		 * querying. 
sl@0
   140
		 * 
sl@0
   141
		 * The agent will set or reset the ResponseSet() bits for any QuerySet() bits 
sl@0
   142
		 * that are set
sl@0
   143
		 */
sl@0
   144
		IMPORT_C void GetL();
sl@0
   145
		
sl@0
   146
	private:
sl@0
   147
		void ConstructL(TUid aAgentUid, RFile& aFile);
sl@0
   148
		void ConstructL(TUid aAgentUid, const TDesC& aURI, TContentShareMode aShareMode=EContentShareReadOnly);
sl@0
   149
sl@0
   150
#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
sl@0
   151
		void ConstructL(TUid aAgentUid, const TDesC8& aHeaderData);
sl@0
   152
#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
sl@0
   153
	
sl@0
   154
		CAttribute();
sl@0
   155
				
sl@0
   156
	private:
sl@0
   157
		/** The real object used to retrieve attributes. */
sl@0
   158
		CAgentContent* iAgentContent;
sl@0
   159
		CAgentFactory* iAgentFactory;
sl@0
   160
sl@0
   161
		CBitset* iQuerySet;
sl@0
   162
		CBitset* iResponseSet;
sl@0
   163
		};
sl@0
   164
	}
sl@0
   165
sl@0
   166
#endif // REMOVE_CAF1
sl@0
   167
sl@0
   168
#endif // __ATTRIBUTE_H__
sl@0
   169