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