Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __CMSVATTACHMENT_H__
17 #define __CMSVATTACHMENT_H__
23 Attachment Id for uniquely identifying attachments.
25 This is unique on a per message entry basis.
30 typedef TUint TMsvAttachmentId;
38 _LIT8(KEpocMimeTypeDrm,"X-Epoc/DRM.Receipt");
40 class CMsvAttributeManager;
43 Represents a single attachment and information about the attachment.
45 This object is used to represent all types of attachments (file, linked file or message
46 entry). Note that some APIs may not be valid for particular attachment types. This is
47 described under each method. It is the responsibility of the client to ensure that the
48 data about the attachment is set such as its mime-type or size.
53 class CMsvAttachment : public CBase
57 Enum to define the different types of attachments supported by messaging.
59 enum TMsvAttachmentType
62 File attachment. This is a file attachment that is copied into the message store.
66 Linked file attachment. This is an attachment that is linked to using its file path,
67 this is not copied into the message store.
71 Message entry attachment. This is a message entry that is registered as an attachment.
77 IMPORT_C static CMsvAttachment* NewL(TMsvAttachmentType aType);
78 IMPORT_C static CMsvAttachment* NewL(TMsvAttachmentType aType, TInt aSize, HBufC8* aMimeType, HBufC* aAttachmentName);
80 IMPORT_C static CMsvAttachment* NewL(const CMsvAttachment& aAttachment);
82 IMPORT_C ~CMsvAttachment();
84 IMPORT_C TMsvAttachmentId Id() const;
85 IMPORT_C void SetId(TMsvAttachmentId aId);
87 IMPORT_C TMsvAttachmentType Type() const;
89 IMPORT_C TMsvId EntryAttachmentId() const;
90 void SetEntryAttachmentId(TMsvId aEntryId);
92 IMPORT_C const TDesC& AttachmentName() const;
93 IMPORT_C void SetAttachmentNameL(const TDesC& aAttachmentName);
95 IMPORT_C const TDesC& FilePath() const;
96 void SetFilePathL(const TDesC& aFilePath);
98 IMPORT_C TInt Size() const;
99 IMPORT_C void SetSize(TInt aSize);
101 IMPORT_C const TDesC8& MimeType() const;
102 IMPORT_C void SetMimeTypeL(const TDesC8& aMimeType);
104 IMPORT_C TBool Complete() const;
105 IMPORT_C void SetComplete(TBool aComplete);
107 IMPORT_C void SetDesC8AttributeL(TUid aAttributeId, const TDesC8& aAttribute);
108 IMPORT_C TInt GetDesC8Attribute(TUid aAttributeId, TPtrC8& aAttribute) const;
109 IMPORT_C void RemoveDesC8Attribute(TUid aAttributeId);
111 IMPORT_C void SetIntAttributeL(TUid aAttributeId, TInt aAttribute);
112 IMPORT_C TInt GetIntAttribute(TUid aAttributeId, TInt& aAttribute) const;
113 IMPORT_C void RemoveIntAttribute(TUid aAttributeId);
115 void InternalizeL(RReadStream& aStream);
116 void ExternalizeL(RWriteStream& aStream) const;
118 TBool IsPathRequired() const;
121 CMsvAttachment(TMsvAttachmentType aType);
122 CMsvAttachment(TMsvAttachmentType aType, TInt aSize, HBufC8* aMimeType, HBufC* aAttachmentName);
124 void ConstructL(const CMsvAttachment& aAttachment);
127 /** The unique attachment Id. This is unique per message entry and is auto-assigned. */
128 TMsvAttachmentId iId;
130 /** The attachment type. */
131 TMsvAttachmentType iType;
133 /** Size of the attachment in bytes. */
136 /** Descriptor indicating the mime type of the attachment. */
139 /** The full file path and file name of attachment files and linked files. */
142 /** The message entry Id of the entry attachment. */
145 /** Name of the attachment to identify to the attachment. */
146 HBufC* iAttachmentName;
148 /** Attachment entry completeness flag. */
151 /** Attribute manager for handling the attributes for this attachment. */
152 CMsvAttributeManager* iAttributeManager;
154 /** Flag to indicate whether a path needs to be added. */
158 #endif // __CMSVATTACHMENT_H__