messagingfw/sendas/server/inc/csendasattachment.h
changeset 62 db3f5fa34ec7
parent 0 8e480a14352b
equal deleted inserted replaced
60:9f5ae1728557 62:db3f5fa34ec7
       
     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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __CSENDASATTACHMENT_H__
       
    17 #define __CSENDASATTACHMENT_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <f32file.h>
       
    21 
       
    22 // forward declarations
       
    23 class MSendAsAttachmentObserver;
       
    24 class CBaseMtm;
       
    25 
       
    26 /**
       
    27 @internalComponent
       
    28 @released
       
    29 */
       
    30 class CSendAsAttachment : public CActive
       
    31 	{
       
    32 public:
       
    33 	static CSendAsAttachment* NewL(MSendAsAttachmentObserver& aObserver, CBaseMtm& aClientMtm);
       
    34 	virtual ~CSendAsAttachment();
       
    35 	//
       
    36 	void AddExistingFileAttachmentL(RFile& aAttachment);
       
    37 	void AddExistingFileAttachmentWithMimeTypeL(RFile& aAttachment, const TDesC8& aMimeType, TUint aCharset);
       
    38 	void AddFileLinkAttachmentL(const TDesC& aFileName);
       
    39 	void AddFileLinkAttachmentWithMimeTypeL(const TDesC& aFileName, const TDesC8& aMimeType, TUint aCharset);
       
    40 	void CreateNewFileAttachmentL(RFile& aAttachment, const TDesC& aFileName);
       
    41 	void CreateNewFileAttachmentWithMimeTypeL(RFile& aAttachment, const TDesC& aFileName, const TDesC8& aMimeType, TUint aCharset);
       
    42 private:
       
    43 	CSendAsAttachment(MSendAsAttachmentObserver& aObserver, CBaseMtm& aClientMtm);
       
    44 	//
       
    45 	void CompleteL(TInt aError);
       
    46 	// from CSendAsActive
       
    47 	virtual void RunL();
       
    48 	virtual void DoCancel();
       
    49 	virtual TInt RunError(TInt aError);
       
    50 private:
       
    51 	enum TSendAsAttachmentState
       
    52 		{
       
    53 		EIdle				 = 0,
       
    54 		EAddingAttachment,
       
    55 		ECreatingAttachment,
       
    56 		EAttachmentComplete
       
    57 		};
       
    58 private:
       
    59 	MSendAsAttachmentObserver*	iObserver;
       
    60 	CBaseMtm&					iClientMtm;
       
    61 	TSendAsAttachmentState		iState;
       
    62 	};
       
    63 
       
    64 #endif	// __CSENDASATTACHMENT_H__