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 "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef __MMSVATTACHMENTMANAGERSYNC_H__
17 #define __MMSVATTACHMENTMANAGERSYNC_H__
21 #include <cmsvattachment.h>
23 class MMsvAttachmentManagerSync
25 Defines the attachment management extensions interface.
27 This class is a pure virtual interface class that defines the APIs to be used for
28 by MTMs and implementors of MMsvAttachmentManager.
30 This API extends the MMsvAttachmentManager with synchronous calls for deleting
31 and creating attachments.
40 Creates a new empty attachment file.
42 The caller is returned an open writable file handle to an empty attachment file in the message
43 store. The caller must pass in an uninitialised file handle. If the request is sucessful the file handle
44 is open and must close by the caller once the data has been written to it.
46 @param aFileName The filename to assign to the newly create attachment file.
47 @param aAttachmentFile An uninitialised file handle. This is opened and can be written to if the
48 request is successful. The ownership is transferred . The caller must close the file handle.
49 @param aAttachmentInfo The attachment info associated with the file.
50 If the routine does not leave, then ownership will be transferred to the
51 attachment manager. If the routine does leave then ownership will not have
52 been transfered and the caller is responsible for cleanup.
53 @leave KErrAccessDenied If attachment manager is in read-only mode.
55 virtual void CreateAttachmentL(const TDesC& aFileName, RFile& aAttachmentFile, CMsvAttachment* aAttachmentInfo) = 0;
60 Renames the physical filename of an attachment.
62 @param aIndex The array index position of the attachment to be renamed.
63 @param aNewName The new name of the attachment.
64 @leave KErrAccessDenied If attachment manager is in read-only mode.
65 @leave KErrAlreadyExists If the supplied attachment filename already exists.
67 virtual void RenameAttachmentL(TInt aIndex, const TDesC& aNewName) = 0;
71 Removes the attachment from the message entry.
73 This changes the array index values of all the attachments after the removed one.
74 Attachment files stored in the message store are deleted. Linked files and message entry
75 attachments are not deleted, this is left to the caller to do if required.
77 @param aParam The array index position of the attachment to be removed.
78 @leave KErrAccessDenied If attachment manager is in read-only mode.
80 virtual void RemoveAttachmentL(TInt aIndex) = 0;
83 Modify existing attachment
84 @param aAttachmentInfo The attachment info associated with the file.
85 If the routine does not leave, then ownership will be transferred to the
86 attachment manager. If the routine does leave then ownership will not have
87 been transfered and the caller is responsible for cleanup.
88 @leave KErrAccessDenied If attachment manager is in read-only mode.
90 virtual void ModifyAttachmentInfoL(CMsvAttachment* aAttachmentInfo) = 0;
94 #endif // __MMSVATTACHMENTMANAGERSYNC_H__