Update contrib.
2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
26 #ifndef __RIGHTSINFO_H__
27 #define __RIGHTSINFO_H__
30 #include <caf/caftypes.h>
35 namespace ContentAccess
38 /** Rights class to store a summary description of the rights and a unique
39 reference to the rights object within an Agent
42 class CRightsInfo : public CBase
46 /** Construct a new CRightsInfo
48 @param aDescription A generic text description of the rights supplied by the agent "Content XYZ Expiry date mm/dd/yy" etc
49 @param aUniqueId A uniqueId used to refer to this particular rights object within the agent it came from
50 @param aRightsTypeMask A bitmask of TRightsType entries applicable to this rights object
51 @param aRightsStatus The current status of this rights object
52 @return A CRightsInfo object
54 IMPORT_C static CRightsInfo* NewL(const TDesC& aDescription, const TDesC& aUniqueId, TInt aRightsTypeMask, TRightsStatus aRightsStatus);
56 /** Construct a new CRightsInfo from a stream */
57 IMPORT_C static CRightsInfo* NewL(RReadStream& aStream);
59 virtual ~CRightsInfo();
61 /** returns a string describing the rights object
62 @capability DRM Access to DRM rights is not permitted for processes without DRM capability.
64 IMPORT_C const TDesC& Description() const;
66 /** returns a string with a unique Id used to identify a particular rights object
67 @capability DRM Access to DRM rights is not permitted for processes without DRM capability.
69 IMPORT_C const TDesC& UniqueId() const;
71 /** Returns a bit mask of TRightsTypeMask flags. A rights object can be stateless and/or consumable
73 @see ContentAccess::TRightsTypeMask
75 @capability DRM Access to DRM rights is not permitted for processes without DRM capability.
77 IMPORT_C TInt RightsType() const;
79 /** The state of the rights
81 @see ContentAccess::TRightsStatus
83 @capability DRM Access to DRM rights is not permitted for processes without DRM capability.
85 IMPORT_C TRightsStatus RightsStatus() const;
87 /** Write this CRightsInfo object to a stream
89 @param aStream The stream
91 IMPORT_C void ExternalizeL(RWriteStream &aStream) const;
96 CRightsInfo(TInt aRightsType, TRightsStatus aRightsStatus);
97 void ConstructL(const TDesC& aDescription, const TDesC& aUniqueId);
99 void InternalizeL(RReadStream& aStream);
107 TRightsStatus iRightsStatus;
110 /** Interface used by agents as a base class for their own rights objects
112 Agent derived classes will contain a complete object capable of describing
113 rights for content managed by that agent.
115 All derived classes must implement the serialization functions InternalizeL()
119 class MAgentRightsBase
122 virtual void ExternalizeL(RWriteStream& aStream) const = 0;
123 virtual void InternalizeL(RReadStream& aStream) = 0;