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 "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.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: #ifndef __MMSVATTACHMENTMANAGERSYNC_H__ williamr@2: #define __MMSVATTACHMENTMANAGERSYNC_H__ williamr@2: williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@2: class MMsvAttachmentManagerSync williamr@2: /** williamr@2: Defines the attachment management extensions interface. williamr@2: williamr@2: This class is a pure virtual interface class that defines the APIs to be used for williamr@2: by MTMs and implementors of MMsvAttachmentManager. williamr@2: williamr@2: This API extends the MMsvAttachmentManager with synchronous calls for deleting williamr@2: and creating attachments. williamr@2: williamr@2: @see CMsvAttachment williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: { williamr@2: public: williamr@2: /** williamr@2: Creates a new empty attachment file. williamr@2: williamr@2: The caller is returned an open writable file handle to an empty attachment file in the message williamr@2: store. The caller must pass in an uninitialised file handle. If the request is sucessful the file handle williamr@2: is open and must close by the caller once the data has been written to it. williamr@2: williamr@2: @param aFileName The filename to assign to the newly create attachment file. williamr@2: @param aAttachmentFile An uninitialised file handle. This is opened and can be written to if the williamr@2: request is successful. The ownership is transferred . The caller must close the file handle. williamr@2: @param aAttachmentInfo The attachment info associated with the file. williamr@2: If the routine does not leave, then ownership will be transferred to the williamr@2: attachment manager. If the routine does leave then ownership will not have williamr@2: been transfered and the caller is responsible for cleanup. williamr@2: @leave KErrAccessDenied If attachment manager is in read-only mode. williamr@2: */ williamr@2: virtual void CreateAttachmentL(const TDesC& aFileName, RFile& aAttachmentFile, CMsvAttachment* aAttachmentInfo) = 0; williamr@2: williamr@2: williamr@2: williamr@2: /** williamr@2: Renames the physical filename of an attachment. williamr@2: williamr@2: @param aIndex The array index position of the attachment to be renamed. williamr@2: @param aNewName The new name of the attachment. williamr@2: @leave KErrAccessDenied If attachment manager is in read-only mode. williamr@2: @leave KErrAlreadyExists If the supplied attachment filename already exists. williamr@2: */ williamr@2: virtual void RenameAttachmentL(TInt aIndex, const TDesC& aNewName) = 0; williamr@2: williamr@2: williamr@2: /** williamr@2: Removes the attachment from the message entry. williamr@2: williamr@2: This changes the array index values of all the attachments after the removed one. williamr@2: Attachment files stored in the message store are deleted. Linked files and message entry williamr@2: attachments are not deleted, this is left to the caller to do if required. williamr@2: williamr@2: @param aParam The array index position of the attachment to be removed. williamr@2: @leave KErrAccessDenied If attachment manager is in read-only mode. williamr@2: */ williamr@2: virtual void RemoveAttachmentL(TInt aIndex) = 0; williamr@2: williamr@2: /** williamr@2: Modify existing attachment williamr@2: @param aAttachmentInfo The attachment info associated with the file. williamr@2: If the routine does not leave, then ownership will be transferred to the williamr@2: attachment manager. If the routine does leave then ownership will not have williamr@2: been transfered and the caller is responsible for cleanup. williamr@2: @leave KErrAccessDenied If attachment manager is in read-only mode. williamr@2: */ williamr@2: virtual void ModifyAttachmentInfoL(CMsvAttachment* aAttachmentInfo) = 0; williamr@2: williamr@2: }; williamr@2: williamr@2: #endif // __MMSVATTACHMENTMANAGERSYNC_H__