emailuis/emailui/sendasmtm/inc/cfssendashelper.h
branchRCL_3
changeset 17 8592a65ad3fb
parent 16 4ce476e64c59
child 19 b13141f05c3d
equal deleted inserted replaced
16:4ce476e64c59 17:8592a65ad3fb
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Definition of the class CFsSendAsHelper.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CFSSENDASHELPER_H
       
    20 #define CFSSENDASHELPER_H
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <apmstd.h>
       
    24 
       
    25 #include <cmsvrecipientlist.h>
       
    26 //<cmail>
       
    27 #include "cfsmailcommon.h"
       
    28 //</cmail>
       
    29 // ---------------------------------------------------------------------------
       
    30 
       
    31 class CFSMailAddress;
       
    32 
       
    33 /**
       
    34  * This class is having functions which are used by Integration MTM to create
       
    35  * a message and to launch Freestyle UI editor.
       
    36  *
       
    37  * @since S60 3.1
       
    38  * @lib fssendashelper.lib
       
    39  */
       
    40 class CFsSendAsHelper : public CBase
       
    41 {
       
    42 public: // constructors and destructor
       
    43     /**
       
    44      * Constructs new object.
       
    45      * @return created object.
       
    46     */
       
    47     IMPORT_C static CFsSendAsHelper* NewL();
       
    48 
       
    49     /** 
       
    50      * Destructor
       
    51     */
       
    52     IMPORT_C ~CFsSendAsHelper();
       
    53 
       
    54 public:    
       
    55     /**
       
    56      * Called from MTM when a file is selected to through sendas functionality.
       
    57      * The file full path and mimetype are stored which will be later used to
       
    58      * create mail and launch FS UI.
       
    59      * @param aFileName Filename including full path
       
    60      * @param aMimeType Mime type of the file that need to be attached
       
    61      * @param aCharSet Charcaterset of the file
       
    62     */
       
    63     IMPORT_C void AddAttachmentL(const TDesC& aFileName,
       
    64         const TDesC8& aMimeType, TUint aCharSet);    
       
    65     /**
       
    66      * Called from MTM when a file is selected to through sendas functionality.
       
    67      * The file full path and mimetype are stored which will be later used to
       
    68      * create mail and launch FS UI.
       
    69      * @param aFile Handle to an attachment file. Ownership is transferred
       
    70      * @param aMimeType Mime type of the file that need to be attached
       
    71      * @param aCharSet Charcaterset of the file
       
    72     */
       
    73     IMPORT_C void AddAttachmentL( RFile& aFile,
       
    74         const TDesC8& aMimeType, TUint aCharSet);    
       
    75    
       
    76     /**
       
    77      * Called from MTM when a address is selected to send an e-mail.
       
    78      * The Address and Alias of the address if present are stored 
       
    79      * which will be later used to create mail and launch FS UI
       
    80      * @param aAddress Mail address of the recipient
       
    81      * @param aAlias Alias of the address, this can be NULL
       
    82      * @param aType Type of recipient.
       
    83     */
       
    84     IMPORT_C void AddRecipientL(const TDesC& aAddress, const TDesC& aAlias, 
       
    85         TMsvRecipientType aType);
       
    86     
       
    87     /**
       
    88      * Called from MTM when a subject need to be set for the mail. The subject
       
    89      * will be stored which will be later used to create mail and launch FS UI.
       
    90      * @param aSubject Subject of the mail.
       
    91     */
       
    92     IMPORT_C void SetSubjectL(const TDesC& aSubject);
       
    93 
       
    94     /**
       
    95      * Called from MTM when certain text need to be made as body of the mail.
       
    96      * Usually the case when notepad file is selected to send using sendas
       
    97      * functionality. The contents of body will be stored which will be later 
       
    98      * used to create mail while launching FS UI.
       
    99      * @param aBody body part of the mail.
       
   100     */
       
   101     IMPORT_C void SetBodyL(const TDesC& aBody);
       
   102 
       
   103     /**
       
   104      * Called from MTM after either of setting subject, recipients,  
       
   105      * attachments or/and body. The message will be created with the right
       
   106      * data and will be stored to drafts of mail box. The messageid of the 
       
   107      * createdmessage will be externalized which is used later to launch UI.
       
   108      *
       
   109      * @param aPluginId Plug-in Id
       
   110      * @param aId Mailbox Id. 
       
   111     */
       
   112     IMPORT_C void StoreDataL( TUint aPluginId, TUint aId );
       
   113 
       
   114     /**
       
   115      * Called from MTM either to create empty mail or to create mail with some
       
   116      * contents.
       
   117      * @param aPluginId Plug-in Id
       
   118      * @param aId Mailbox Id.
       
   119      * @param aIsEmptyMail True if empty message need to be created.
       
   120      * @param aIsSettings True if settings view need to be launched.
       
   121     */
       
   122     IMPORT_C void LaunchUiL(TUint aPluginId, TUint aId, 
       
   123         TBool aIsEmptyMail = EFalse, TBool aIsSettings = EFalse );
       
   124 
       
   125 private: // constructors
       
   126     /**
       
   127      * Constructor
       
   128      */
       
   129     CFsSendAsHelper();
       
   130 
       
   131     /**
       
   132      * Second-phase constructor.
       
   133      */
       
   134     void ConstructL();
       
   135 
       
   136     /*
       
   137      * Displays mailbox not available note.
       
   138      */
       
   139     void DisplayMailboxNotAvailableNoteL();
       
   140 
       
   141     /*
       
   142      * Checks whether the mailbox is available or not
       
   143      * @param aPluginId Plugin ID or the mailbox. 
       
   144      * @return KErrNone if mailbox available, KErrNotSupported otherwise.
       
   145      */
       
   146     TInt IsMailboxAvailable( TInt aPluginId );
       
   147 private: // data
       
   148     // Subject of the message
       
   149     HBufC* iSubject;
       
   150 
       
   151     // Body of the message    
       
   152     HBufC* iBody;
       
   153 
       
   154     // Filehandles that need to be attached.
       
   155     RArray< RFile > iFiles;
       
   156     
       
   157     // Filenames that need to be attached
       
   158     RPointerArray<HBufC> iFileNames;
       
   159 
       
   160     // Mimetypes of the attached filehandles
       
   161     RPointerArray<HBufC8> iMimeTypesFile;
       
   162     // Mimetypes of the attached filenames
       
   163     RPointerArray<HBufC8> iMimeTypesFileName;
       
   164 
       
   165     // To recipients of the mail
       
   166     RPointerArray<CFSMailAddress> iToAddresses;
       
   167     // Cc recipients of the mail
       
   168     RPointerArray<CFSMailAddress> iCcAddresses;  
       
   169     // Bcc recipients of the mail
       
   170     RPointerArray<CFSMailAddress> iBccAddresses;
       
   171 
       
   172     //If Filehandles are passed to the framework (plugin)
       
   173     TBool isPassed;
       
   174     
       
   175     // Message to be displayed when trying to use MfE or Ozone mailbox
       
   176     // while in mass storage mode. Own.
       
   177     HBufC* iMassStorageNote;
       
   178 };
       
   179 #endif  //CFSSENDASHELPER_H