epoc32/include/caf/embeddedobject.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000 (2010-03-16)
branchSymbian2
changeset 2 2fe1408b6811
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@2
     5
* under the terms of the License "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@2
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description: 
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
williamr@2
    19
williamr@2
    20
williamr@2
    21
/**
williamr@2
    22
 @file
williamr@2
    23
 @publishedPartner
williamr@2
    24
 @released
williamr@2
    25
*/
williamr@2
    26
williamr@2
    27
williamr@2
    28
#ifndef __EMBEDDEDOBJECT_H__
williamr@2
    29
#define __EMBEDDEDOBJECT_H__
williamr@2
    30
williamr@2
    31
#include <apmstd.h>
williamr@2
    32
#include <caf/virtualpath.h>
williamr@2
    33
#include <caf/caftypes.h>
williamr@2
    34
williamr@2
    35
namespace ContentAccess
williamr@2
    36
	{
williamr@2
    37
	/** Represents a content object embedded within a file
williamr@2
    38
	The agent defined uniqueId field describes the location of the object within 
williamr@2
    39
	the file.
williamr@2
    40
williamr@2
    41
	@publishedPartner
williamr@2
    42
	@released
williamr@2
    43
	*/
williamr@2
    44
	class CEmbeddedObject : public CBase
williamr@2
    45
		{
williamr@2
    46
	public:
williamr@2
    47
		/** Create a new CEmbeddedObject with a different name and uniqueId
williamr@2
    48
williamr@2
    49
		@param aUniqueId The UniqueId of the embedded object
williamr@2
    50
		@param aName A user friendly name for the object
williamr@2
    51
		@param aMimeType The mime type of the object (if it not a container object)
williamr@2
    52
		@param aType The type of object (Content, container, agentspecific etc)
williamr@2
    53
		@return a CEmbeddedObject
williamr@2
    54
		*/
williamr@2
    55
		IMPORT_C static CEmbeddedObject* NewL(const TDesC& aUniqueId, const TDesC& aName, const TDesC8& aMimeType, TEmbeddedType aType);
williamr@2
    56
williamr@2
    57
		/** Create a new CEmbeddedObject where the Name field is the same as the uniqueId
williamr@2
    58
williamr@2
    59
		@param aUniqueId The UniqueId of the embedded object
williamr@2
    60
		@param aMimeType The mime type of the object (if it not a container object)
williamr@2
    61
		@param aType The type of object (Content, container, agentspecific etc)
williamr@2
    62
		@return a CEmbeddedObject
williamr@2
    63
		*/
williamr@2
    64
		IMPORT_C static CEmbeddedObject* NewL(const TDesC& aUniqueId, const TDesC8& aMimeType, TEmbeddedType aType);
williamr@2
    65
williamr@2
    66
		/** Create a new CEmbeddedObject from a stream 
williamr@2
    67
williamr@2
    68
		@param aStream The stream to read the CEmbeddedObject from
williamr@2
    69
		@return a CEmbeddedObject
williamr@2
    70
		*/
williamr@2
    71
		IMPORT_C static CEmbeddedObject* NewL(RReadStream& aStream);
williamr@2
    72
williamr@2
    73
		/** destructor */
williamr@2
    74
		virtual ~CEmbeddedObject();
williamr@2
    75
williamr@2
    76
		/** The agent defined UniqueId 
williamr@2
    77
		@return The uniqueId
williamr@2
    78
		*/
williamr@2
    79
		IMPORT_C const TDesC& UniqueId() const;
williamr@2
    80
		
williamr@2
    81
		/** User friendly name of the object 
williamr@2
    82
		@return The name of the object
williamr@2
    83
		*/
williamr@2
    84
		IMPORT_C const TDesC& Name() const;
williamr@2
    85
		
williamr@2
    86
		/** The type of object 
williamr@2
    87
		@return The type
williamr@2
    88
		*/
williamr@2
    89
		IMPORT_C TEmbeddedType Type() const;	
williamr@2
    90
williamr@2
    91
		/** Mime type of the object
williamr@2
    92
		@return The mime type of the object or KNullDesC8() if this is a container object
williamr@2
    93
		*/
williamr@2
    94
		IMPORT_C const TDesC8& MimeType() const;
williamr@2
    95
williamr@2
    96
		/** Allow the class write itself out to a stream 
williamr@2
    97
williamr@2
    98
		@param aStream The stream to write to
williamr@2
    99
		*/ 
williamr@2
   100
		IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
williamr@2
   101
williamr@2
   102
	private:
williamr@2
   103
		CEmbeddedObject(TEmbeddedType aType);
williamr@2
   104
		void ConstructL(const TDesC& aUniqueId, const TDesC& aName, const TDesC8& aMimeType);
williamr@2
   105
williamr@2
   106
		void InternalizeL(RReadStream& aStream);
williamr@2
   107
williamr@2
   108
	private:
williamr@2
   109
		TEmbeddedType iType;
williamr@2
   110
		HBufC* iUniqueId;
williamr@2
   111
		HBufC* iName;
williamr@2
   112
		TBuf8 <KMaxDataTypeLength> iMimeType;
williamr@2
   113
		};
williamr@2
   114
williamr@2
   115
	} // namespace ContentAccess
williamr@2
   116
williamr@2
   117
#endif