os/security/contentmgmt/contentaccessfwfordrm/inc/EmbeddedObject.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/security/contentmgmt/contentaccessfwfordrm/inc/EmbeddedObject.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,113 @@
     1.4 +/*
     1.5 +* Copyright (c) 2004-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 + @publishedAll
    1.25 + @released
    1.26 +*/
    1.27 +
    1.28 +
    1.29 +#ifndef __EMBEDDEDOBJECT_H__
    1.30 +#define __EMBEDDEDOBJECT_H__
    1.31 +
    1.32 +#include <apmstd.h>
    1.33 +#include <caf/virtualpath.h>
    1.34 +#include <caf/caftypes.h>
    1.35 +
    1.36 +namespace ContentAccess
    1.37 +	{
    1.38 +	/** Represents a content object embedded within a file
    1.39 +	The agent defined uniqueId field describes the location of the object within 
    1.40 +	the file.
    1.41 +
    1.42 +	*/
    1.43 +	class CEmbeddedObject : public CBase
    1.44 +		{
    1.45 +	public:
    1.46 +		/** Create a new CEmbeddedObject with a different name and uniqueId
    1.47 +
    1.48 +		@param aUniqueId The UniqueId of the embedded object
    1.49 +		@param aName A user friendly name for the object
    1.50 +		@param aMimeType The mime type of the object (if it not a container object)
    1.51 +		@param aType The type of object (Content, container, agentspecific etc)
    1.52 +		@return a CEmbeddedObject
    1.53 +		*/
    1.54 +		IMPORT_C static CEmbeddedObject* NewL(const TDesC& aUniqueId, const TDesC& aName, const TDesC8& aMimeType, TEmbeddedType aType);
    1.55 +
    1.56 +		/** Create a new CEmbeddedObject where the Name field is the same as the uniqueId
    1.57 +
    1.58 +		@param aUniqueId The UniqueId of the embedded object
    1.59 +		@param aMimeType The mime type of the object (if it not a container object)
    1.60 +		@param aType The type of object (Content, container, agentspecific etc)
    1.61 +		@return a CEmbeddedObject
    1.62 +		*/
    1.63 +		IMPORT_C static CEmbeddedObject* NewL(const TDesC& aUniqueId, const TDesC8& aMimeType, TEmbeddedType aType);
    1.64 +
    1.65 +		/** Create a new CEmbeddedObject from a stream 
    1.66 +
    1.67 +		@param aStream The stream to read the CEmbeddedObject from
    1.68 +		@return a CEmbeddedObject
    1.69 +		*/
    1.70 +		IMPORT_C static CEmbeddedObject* NewL(RReadStream& aStream);
    1.71 +
    1.72 +		/** destructor */
    1.73 +		virtual ~CEmbeddedObject();
    1.74 +
    1.75 +		/** The agent defined UniqueId 
    1.76 +		@return The uniqueId
    1.77 +		*/
    1.78 +		IMPORT_C const TDesC& UniqueId() const;
    1.79 +		
    1.80 +		/** User friendly name of the object 
    1.81 +		@return The name of the object
    1.82 +		*/
    1.83 +		IMPORT_C const TDesC& Name() const;
    1.84 +		
    1.85 +		/** The type of object 
    1.86 +		@return The type
    1.87 +		*/
    1.88 +		IMPORT_C TEmbeddedType Type() const;	
    1.89 +
    1.90 +		/** Mime type of the object
    1.91 +		@return The mime type of the object or KNullDesC8() if this is a container object
    1.92 +		*/
    1.93 +		IMPORT_C const TDesC8& MimeType() const;
    1.94 +
    1.95 +		/** Allow the class write itself out to a stream 
    1.96 +
    1.97 +		@param aStream The stream to write to
    1.98 +		*/ 
    1.99 +		IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
   1.100 +
   1.101 +	private:
   1.102 +		CEmbeddedObject(TEmbeddedType aType);
   1.103 +		void ConstructL(const TDesC& aUniqueId, const TDesC& aName, const TDesC8& aMimeType);
   1.104 +
   1.105 +		void InternalizeL(RReadStream& aStream);
   1.106 +
   1.107 +	private:
   1.108 +		TEmbeddedType iType;
   1.109 +		HBufC* iUniqueId;
   1.110 +		HBufC* iName;
   1.111 +		TBuf8 <KMaxDataTypeLength> iMimeType;
   1.112 +		};
   1.113 +
   1.114 +	} // namespace ContentAccess
   1.115 +
   1.116 +#endif