williamr@2: /* williamr@2: * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * under the terms of the License "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: /** williamr@2: @file williamr@4: @publishedAll williamr@2: @released williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef __EMBEDDEDOBJECT_H__ williamr@2: #define __EMBEDDEDOBJECT_H__ williamr@2: williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@2: namespace ContentAccess williamr@2: { williamr@2: /** Represents a content object embedded within a file williamr@2: The agent defined uniqueId field describes the location of the object within williamr@2: the file. williamr@2: williamr@2: */ williamr@2: class CEmbeddedObject : public CBase williamr@2: { williamr@2: public: williamr@2: /** Create a new CEmbeddedObject with a different name and uniqueId williamr@2: williamr@2: @param aUniqueId The UniqueId of the embedded object williamr@2: @param aName A user friendly name for the object williamr@2: @param aMimeType The mime type of the object (if it not a container object) williamr@2: @param aType The type of object (Content, container, agentspecific etc) williamr@2: @return a CEmbeddedObject williamr@2: */ williamr@2: IMPORT_C static CEmbeddedObject* NewL(const TDesC& aUniqueId, const TDesC& aName, const TDesC8& aMimeType, TEmbeddedType aType); williamr@2: williamr@2: /** Create a new CEmbeddedObject where the Name field is the same as the uniqueId williamr@2: williamr@2: @param aUniqueId The UniqueId of the embedded object williamr@2: @param aMimeType The mime type of the object (if it not a container object) williamr@2: @param aType The type of object (Content, container, agentspecific etc) williamr@2: @return a CEmbeddedObject williamr@2: */ williamr@2: IMPORT_C static CEmbeddedObject* NewL(const TDesC& aUniqueId, const TDesC8& aMimeType, TEmbeddedType aType); williamr@2: williamr@2: /** Create a new CEmbeddedObject from a stream williamr@2: williamr@2: @param aStream The stream to read the CEmbeddedObject from williamr@2: @return a CEmbeddedObject williamr@2: */ williamr@2: IMPORT_C static CEmbeddedObject* NewL(RReadStream& aStream); williamr@2: williamr@2: /** destructor */ williamr@2: virtual ~CEmbeddedObject(); williamr@2: williamr@2: /** The agent defined UniqueId williamr@2: @return The uniqueId williamr@2: */ williamr@2: IMPORT_C const TDesC& UniqueId() const; williamr@2: williamr@2: /** User friendly name of the object williamr@2: @return The name of the object williamr@2: */ williamr@2: IMPORT_C const TDesC& Name() const; williamr@2: williamr@2: /** The type of object williamr@2: @return The type williamr@2: */ williamr@2: IMPORT_C TEmbeddedType Type() const; williamr@2: williamr@2: /** Mime type of the object williamr@2: @return The mime type of the object or KNullDesC8() if this is a container object williamr@2: */ williamr@2: IMPORT_C const TDesC8& MimeType() const; williamr@2: williamr@2: /** Allow the class write itself out to a stream williamr@2: williamr@2: @param aStream The stream to write to williamr@2: */ williamr@2: IMPORT_C void ExternalizeL(RWriteStream& aStream) const; williamr@2: williamr@2: private: williamr@2: CEmbeddedObject(TEmbeddedType aType); williamr@2: void ConstructL(const TDesC& aUniqueId, const TDesC& aName, const TDesC8& aMimeType); williamr@2: williamr@2: void InternalizeL(RReadStream& aStream); williamr@2: williamr@2: private: williamr@2: TEmbeddedType iType; williamr@2: HBufC* iUniqueId; williamr@2: HBufC* iName; williamr@2: TBuf8 iMimeType; williamr@2: }; williamr@2: williamr@2: } // namespace ContentAccess williamr@2: williamr@2: #endif