epoc32/include/caf/embeddedobject.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
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
 @file
williamr@4
    21
 @publishedAll
williamr@2
    22
 @released
williamr@2
    23
*/
williamr@2
    24
williamr@2
    25
williamr@2
    26
#ifndef __EMBEDDEDOBJECT_H__
williamr@2
    27
#define __EMBEDDEDOBJECT_H__
williamr@2
    28
williamr@2
    29
#include <apmstd.h>
williamr@2
    30
#include <caf/virtualpath.h>
williamr@2
    31
#include <caf/caftypes.h>
williamr@2
    32
williamr@2
    33
namespace ContentAccess
williamr@2
    34
	{
williamr@2
    35
	/** Represents a content object embedded within a file
williamr@2
    36
	The agent defined uniqueId field describes the location of the object within 
williamr@2
    37
	the file.
williamr@2
    38
williamr@2
    39
	*/
williamr@2
    40
	class CEmbeddedObject : public CBase
williamr@2
    41
		{
williamr@2
    42
	public:
williamr@2
    43
		/** Create a new CEmbeddedObject with a different name and uniqueId
williamr@2
    44
williamr@2
    45
		@param aUniqueId The UniqueId of the embedded object
williamr@2
    46
		@param aName A user friendly name for the object
williamr@2
    47
		@param aMimeType The mime type of the object (if it not a container object)
williamr@2
    48
		@param aType The type of object (Content, container, agentspecific etc)
williamr@2
    49
		@return a CEmbeddedObject
williamr@2
    50
		*/
williamr@2
    51
		IMPORT_C static CEmbeddedObject* NewL(const TDesC& aUniqueId, const TDesC& aName, const TDesC8& aMimeType, TEmbeddedType aType);
williamr@2
    52
williamr@2
    53
		/** Create a new CEmbeddedObject where the Name field is the same as the uniqueId
williamr@2
    54
williamr@2
    55
		@param aUniqueId The UniqueId of the embedded object
williamr@2
    56
		@param aMimeType The mime type of the object (if it not a container object)
williamr@2
    57
		@param aType The type of object (Content, container, agentspecific etc)
williamr@2
    58
		@return a CEmbeddedObject
williamr@2
    59
		*/
williamr@2
    60
		IMPORT_C static CEmbeddedObject* NewL(const TDesC& aUniqueId, const TDesC8& aMimeType, TEmbeddedType aType);
williamr@2
    61
williamr@2
    62
		/** Create a new CEmbeddedObject from a stream 
williamr@2
    63
williamr@2
    64
		@param aStream The stream to read the CEmbeddedObject from
williamr@2
    65
		@return a CEmbeddedObject
williamr@2
    66
		*/
williamr@2
    67
		IMPORT_C static CEmbeddedObject* NewL(RReadStream& aStream);
williamr@2
    68
williamr@2
    69
		/** destructor */
williamr@2
    70
		virtual ~CEmbeddedObject();
williamr@2
    71
williamr@2
    72
		/** The agent defined UniqueId 
williamr@2
    73
		@return The uniqueId
williamr@2
    74
		*/
williamr@2
    75
		IMPORT_C const TDesC& UniqueId() const;
williamr@2
    76
		
williamr@2
    77
		/** User friendly name of the object 
williamr@2
    78
		@return The name of the object
williamr@2
    79
		*/
williamr@2
    80
		IMPORT_C const TDesC& Name() const;
williamr@2
    81
		
williamr@2
    82
		/** The type of object 
williamr@2
    83
		@return The type
williamr@2
    84
		*/
williamr@2
    85
		IMPORT_C TEmbeddedType Type() const;	
williamr@2
    86
williamr@2
    87
		/** Mime type of the object
williamr@2
    88
		@return The mime type of the object or KNullDesC8() if this is a container object
williamr@2
    89
		*/
williamr@2
    90
		IMPORT_C const TDesC8& MimeType() const;
williamr@2
    91
williamr@2
    92
		/** Allow the class write itself out to a stream 
williamr@2
    93
williamr@2
    94
		@param aStream The stream to write to
williamr@2
    95
		*/ 
williamr@2
    96
		IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
williamr@2
    97
williamr@2
    98
	private:
williamr@2
    99
		CEmbeddedObject(TEmbeddedType aType);
williamr@2
   100
		void ConstructL(const TDesC& aUniqueId, const TDesC& aName, const TDesC8& aMimeType);
williamr@2
   101
williamr@2
   102
		void InternalizeL(RReadStream& aStream);
williamr@2
   103
williamr@2
   104
	private:
williamr@2
   105
		TEmbeddedType iType;
williamr@2
   106
		HBufC* iUniqueId;
williamr@2
   107
		HBufC* iName;
williamr@2
   108
		TBuf8 <KMaxDataTypeLength> iMimeType;
williamr@2
   109
		};
williamr@2
   110
williamr@2
   111
	} // namespace ContentAccess
williamr@2
   112
williamr@2
   113
#endif