sl@0: /* sl@0: * Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * sl@0: */ sl@0: sl@0: sl@0: /** sl@0: @file sl@0: @publishedPartner sl@0: @deprecated sl@0: */ sl@0: sl@0: #ifndef __CAF_ATTRIBUTE_H__ sl@0: #define __CAF_ATTRIBUTE_H__ sl@0: sl@0: #ifndef REMOVE_CAF1 sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: sl@0: namespace ContentAccess sl@0: { sl@0: class CAgentContent; sl@0: class CAgentFactory; sl@0: class CBitset; sl@0: sl@0: /** sl@0: * Encapsulates the attributes of a piece of content. sl@0: * sl@0: * These attributes will be required by DRM-aware sl@0: * applications in order that they can uphold DRM policies in a sl@0: * well-behaved manner. In general, clients set one or more attributes sl@0: * in the Query set, make a GetL call, and then sl@0: * read the agent's reponse from the Response set. sl@0: * sl@0: * CAttribute is a container for a number of separate sl@0: * ContentAccess::CBitset objects. These individual bitsets contain: sl@0: * -# Queries - what the client is interested in knowing. sl@0: * -# Responses - the answers to the queries. sl@0: * -# Capabilities - which attributes the system is able to support. sl@0: * sl@0: * Access to the bitset operations themselves can be achieved via the sl@0: * ContentAccess::CAttribute::AttributeSetL operation. sl@0: * sl@0: * @publishedPartner sl@0: * @deprecated sl@0: */ sl@0: class CAttribute : public CBase sl@0: { sl@0: public: sl@0: /** sl@0: Constructs a new attribute given an agent and file handle. sl@0: sl@0: @param aAgentUid The agent Uid sl@0: @param aFile A file handle sl@0: @return The new CAttribute. sl@0: sl@0: @internalComponent sl@0: @released sl@0: */ sl@0: static CAttribute* NewLC(TUid aAgentUid, RFile& aFile); sl@0: sl@0: /** sl@0: Constructs a new attribute given an agent and content. sl@0: sl@0: @param aAgentUid The agent Uid sl@0: @param aURI The pathname of the target content. sl@0: @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: @return The new CAttribute. sl@0: sl@0: @internalComponent sl@0: @released sl@0: */ sl@0: static CAttribute* NewLC(TUid aAgentUid, const TDesC& aURI, TContentShareMode aShareMode=EContentShareReadOnly); sl@0: sl@0: #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT sl@0: /** sl@0: Constructs a new attribute given an agent and WMDRM header data. sl@0: sl@0: @param aAgentUid The agent Uid sl@0: @param aHeaderData Header data of WMDRM content sl@0: @return The new CAttribute. sl@0: sl@0: @internalComponent sl@0: @released sl@0: */ sl@0: static CAttribute* NewLC(TUid aAgentUid, const TDesC8& aHeaderData); sl@0: #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT sl@0: sl@0: virtual ~CAttribute(); sl@0: sl@0: /** sl@0: * Returns a reference to the query set sl@0: * sl@0: * The bits of the query-set should be set or cleared prior to the "GetL()" sl@0: * call to specify which attributes the client is interested in. sl@0: * sl@0: * @note Set is probably best used inline to access some of the sl@0: * CBitset operations directly. sl@0: * @code sl@0: * // Set EIsProtected in the Query set. sl@0: * MyAttr->QuerySet(EQuerySet).Set(EIsProtected); sl@0: * @endcode sl@0: * sl@0: * @return A CBitset refererence. sl@0: */ sl@0: IMPORT_C CBitset& QuerySet(); sl@0: sl@0: /** sl@0: * Returns a reference to the response set. sl@0: * sl@0: * The response set will only be valid after a call to the "GetL()" operation. sl@0: * sl@0: * @return A CBitset refererence. sl@0: */ sl@0: IMPORT_C const CBitset& ResponseSet() const; sl@0: sl@0: /** sl@0: * Resets the attribute object completely. sl@0: */ sl@0: IMPORT_C void Reset(); sl@0: sl@0: /** sl@0: * Delivers the attribute object to the relevant agent for sl@0: * querying. sl@0: * sl@0: * The agent will set or reset the ResponseSet() bits for any QuerySet() bits sl@0: * that are set sl@0: */ sl@0: IMPORT_C void GetL(); sl@0: sl@0: private: sl@0: void ConstructL(TUid aAgentUid, RFile& aFile); sl@0: void ConstructL(TUid aAgentUid, const TDesC& aURI, TContentShareMode aShareMode=EContentShareReadOnly); sl@0: sl@0: #ifdef SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT sl@0: void ConstructL(TUid aAgentUid, const TDesC8& aHeaderData); sl@0: #endif //SYMBIAN_ENABLE_SDP_WMDRM_SUPPORT sl@0: sl@0: CAttribute(); sl@0: sl@0: private: sl@0: /** The real object used to retrieve attributes. */ sl@0: CAgentContent* iAgentContent; sl@0: CAgentFactory* iAgentFactory; sl@0: sl@0: CBitset* iQuerySet; sl@0: CBitset* iResponseSet; sl@0: }; sl@0: } sl@0: sl@0: #endif // REMOVE_CAF1 sl@0: sl@0: #endif // __ATTRIBUTE_H__ sl@0: