1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/security/contentmgmt/contentaccessfwfordrm/inc/attribute.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,169 @@
1.4 +/*
1.5 +* Copyright (c) 2003-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 +*
1.19 +*/
1.20 +
1.21 +
1.22 +/**
1.23 + @file
1.24 + @publishedPartner
1.25 + @deprecated
1.26 +*/
1.27 +
1.28 +#ifndef __CAF_ATTRIBUTE_H__
1.29 +#define __CAF_ATTRIBUTE_H__
1.30 +
1.31 +#ifndef REMOVE_CAF1
1.32 +
1.33 +#include <e32base.h>
1.34 +#include <f32file.h>
1.35 +#include <caf/caftypes.h>
1.36 +
1.37 +
1.38 +namespace ContentAccess
1.39 +{
1.40 + class CAgentContent;
1.41 + class CAgentFactory;
1.42 + class CBitset;
1.43 +
1.44 + /**
1.45 + * Encapsulates the attributes of a piece of content.
1.46 + *
1.47 + * These attributes will be required by DRM-aware
1.48 + * applications in order that they can uphold DRM policies in a
1.49 + * well-behaved manner. In general, clients set one or more attributes
1.50 + * in the <i>Query</i> set, make a <i>GetL</i> call, and then
1.51 + * read the agent's reponse from the <i>Response</i> set.
1.52 + *
1.53 + * CAttribute is a container for a number of separate
1.54 + * ContentAccess::CBitset objects. These individual bitsets contain:
1.55 + * -# Queries - what the client is interested in knowing.
1.56 + * -# Responses - the answers to the queries.
1.57 + * -# Capabilities - which attributes the system is able to support.
1.58 + *
1.59 + * Access to the bitset operations themselves can be achieved via the
1.60 + * ContentAccess::CAttribute::AttributeSetL operation.
1.61 + *
1.62 + * @publishedPartner
1.63 + * @deprecated
1.64 + */
1.65 + class CAttribute : public CBase
1.66 + {
1.67 + public:
1.68 + /**
1.69 + Constructs a new attribute given an agent and file handle.
1.70 +
1.71 + @param aAgentUid The agent Uid
1.72 + @param aFile A file handle
1.73 + @return The new CAttribute.
1.74 +
1.75 + @internalComponent
1.76 + @released
1.77 + */
1.78 + static CAttribute* NewLC(TUid aAgentUid, RFile& aFile);
1.79 +
1.80 + /**
1.81 + Constructs a new attribute given an agent and content.
1.82 +
1.83 + @param aAgentUid The agent Uid
1.84 + @param aURI The pathname of the target content.
1.85 + @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.
1.86 + @return The new CAttribute.
1.87 +
1.88 + @internalComponent
1.89 + @released
1.90 + */
1.91 + static CAttribute* NewLC(TUid aAgentUid, const TDesC& aURI, TContentShareMode aShareMode=EContentShareReadOnly);
1.92 +
1.93 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.94 + /**
1.95 + Constructs a new attribute given an agent and WMDRM header data.
1.96 +
1.97 + @param aAgentUid The agent Uid
1.98 + @param aHeaderData Header data of WMDRM content
1.99 + @return The new CAttribute.
1.100 +
1.101 + @internalComponent
1.102 + @released
1.103 + */
1.104 + static CAttribute* NewLC(TUid aAgentUid, const TDesC8& aHeaderData);
1.105 +#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.106 +
1.107 + virtual ~CAttribute();
1.108 +
1.109 + /**
1.110 + * Returns a reference to the query set
1.111 + *
1.112 + * The bits of the query-set should be set or cleared prior to the "GetL()"
1.113 + * call to specify which attributes the client is interested in.
1.114 + *
1.115 + * @note Set is probably best used inline to access some of the
1.116 + * CBitset operations directly.
1.117 + * @code
1.118 + * // Set EIsProtected in the Query set.
1.119 + * MyAttr->QuerySet(EQuerySet).Set(EIsProtected);
1.120 + * @endcode
1.121 + *
1.122 + * @return A CBitset refererence.
1.123 + */
1.124 + IMPORT_C CBitset& QuerySet();
1.125 +
1.126 + /**
1.127 + * Returns a reference to the response set.
1.128 + *
1.129 + * The response set will only be valid after a call to the "GetL()" operation.
1.130 + *
1.131 + * @return A CBitset refererence.
1.132 + */
1.133 + IMPORT_C const CBitset& ResponseSet() const;
1.134 +
1.135 + /**
1.136 + * Resets the attribute object completely.
1.137 + */
1.138 + IMPORT_C void Reset();
1.139 +
1.140 + /**
1.141 + * Delivers the attribute object to the relevant agent for
1.142 + * querying.
1.143 + *
1.144 + * The agent will set or reset the ResponseSet() bits for any QuerySet() bits
1.145 + * that are set
1.146 + */
1.147 + IMPORT_C void GetL();
1.148 +
1.149 + private:
1.150 + void ConstructL(TUid aAgentUid, RFile& aFile);
1.151 + void ConstructL(TUid aAgentUid, const TDesC& aURI, TContentShareMode aShareMode=EContentShareReadOnly);
1.152 +
1.153 +#ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.154 + void ConstructL(TUid aAgentUid, const TDesC8& aHeaderData);
1.155 +#endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT
1.156 +
1.157 + CAttribute();
1.158 +
1.159 + private:
1.160 + /** The real object used to retrieve attributes. */
1.161 + CAgentContent* iAgentContent;
1.162 + CAgentFactory* iAgentFactory;
1.163 +
1.164 + CBitset* iQuerySet;
1.165 + CBitset* iResponseSet;
1.166 + };
1.167 + }
1.168 +
1.169 +#endif // REMOVE_CAF1
1.170 +
1.171 +#endif // __ATTRIBUTE_H__
1.172 +