mobilemessaging/unieditor/mtm/inc/UniClientMtm.h
changeset 79 2981cb3aa489
parent 0 72b543305e3a
equal deleted inserted replaced
25:84d9eb65b26f 79:2981cb3aa489
       
     1 /*
       
     2 * Copyright (c) 2005-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:   
       
    15 *     Client Mtm for uni messaging.
       
    16 *     This is the API for accessing uni messages. An uni message ends up to be a sms or mms message.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 #ifndef __UNICLIENTMTM_H__
       
    23 #define __UNICLIENTMTM_H__
       
    24 
       
    25 //  INCLUDES
       
    26 #include  <mtclbase.h> // base client mtm
       
    27 #include  <e32std.h>   // TTimeInterval & TTime
       
    28 
       
    29 
       
    30 // CONSTANTS
       
    31 
       
    32 // MACROS
       
    33 
       
    34 // DATA TYPES
       
    35 
       
    36 enum TUniMessageTypeSetting
       
    37     {
       
    38     EUniMessageTypeSettingAutomatic = 0,
       
    39     EUniMessageTypeSettingSms, // This includes also fax & pager
       
    40     EUniMessageTypeSettingMms
       
    41     };
       
    42 
       
    43 enum TUniMessageTypeLocking
       
    44     {
       
    45     EUniMessageTypeLockingNotSet = 0, // This means it's not handled yet by anyone
       
    46     EUniMessageTypeLocked,
       
    47     EUniMessageTypeNotLocked
       
    48     };
       
    49 
       
    50 // FUNCTION PROTOTYPES
       
    51 
       
    52 // FORWARD DECLARATIONS
       
    53 
       
    54 class CUniHeaders;
       
    55 class CMsvMimeHeaders;
       
    56 class CMsvFindText;
       
    57 class CMmsAttachmentWaiter;
       
    58 class CMsgTextUtils;
       
    59 
       
    60 // CLASS DECLARATION
       
    61 
       
    62 /**
       
    63 *  Client Mtm for unified messaging subsystem.
       
    64 *  This class will be the interface to the UI component
       
    65 *  and other messaging component that might want to handle unified messages
       
    66 *  (For example SendAs interface).
       
    67 *
       
    68 *   Note: new functions has to be added as last virtual functions in order
       
    69 *   not to to break the vtable 
       
    70 */
       
    71 class CUniClientMtm :public CBaseMtm
       
    72     {
       
    73     public:  // Constructors and destructor
       
    74         // constructor is private!
       
    75 
       
    76         /**
       
    77         * Factory function.
       
    78         * The only function exported by this polymorphic interface dll.<br>
       
    79         * This function is not directly called by the application that needs
       
    80         * access, it is called by an instance of CClientMtmRegistry class.
       
    81         * @param  aRegisteredMtmDll Reference to Mtm Dll registry class
       
    82         * @param  aSession Reference to a Message Server session.
       
    83         * @return Pointer to CUniClientMtm class.
       
    84         *
       
    85         * <PRE>
       
    86         * Example of getting access to this class:
       
    87         *
       
    88         * // Called by a Uikon application that implements
       
    89         * // MMsvSessionObserver interface
       
    90         *
       
    91         * iSession = CMsvSession::OpenSyncL(*this);
       
    92         * CleanupStack::PushL(iSession);
       
    93         * iClientMtmRegistry = CClientMtmRegistry::NewL(*iSession);
       
    94         * CleanupStack::PushL(iClientMtmRegistry);
       
    95         * iClientMtm = (CUniClientMtm *) iClientMtmRegistry->
       
    96         *               NewMtmL(KUidUniMtm);
       
    97         * CleanupStack::PushL(iClientMtm);
       
    98         *
       
    99         * // - do other initialization -
       
   100         *
       
   101         * CleanupStack::Pop(3);    //iSession, iClientMtmRegistry, iClientMtm
       
   102         *
       
   103         * // - call any public functions in CUniClientMtm
       
   104         *
       
   105         * // When the application finishes,
       
   106         * // it must delete the objects in reverse order:
       
   107         * delete iClientMtm;
       
   108         * delete iClientMtmRegistry;
       
   109         * delete iSession;
       
   110         * </PRE>
       
   111         */
       
   112         IMPORT_C static CUniClientMtm* NewL(
       
   113             CRegisteredMtmDll& aRegisteredMtmDll,
       
   114             CMsvSession& aSession );
       
   115         
       
   116         /**
       
   117         * Destructor.
       
   118         */
       
   119         virtual ~CUniClientMtm();
       
   120 
       
   121     public:  // New functions
       
   122 
       
   123         // ----------------------------------------------------------
       
   124         // Functions to create and modify message entries
       
   125 
       
   126         /**
       
   127         * Create a new message entry
       
   128         *
       
   129         * @param aDestination target folder
       
   130         * @return Id of the created message
       
   131         */
       
   132         virtual TMsvId CreateNewEntryL( TMsvId aDestination );
       
   133         
       
   134         // -------------------------------------------------------------------
       
   135         // GENERAL MESSAGE INFORMATION METHODS 
       
   136 
       
   137         /**
       
   138         * Message size accessor. SaveMessageL and LoadMessageL updates the 
       
   139         * value.
       
   140         * @return size of all message parts in bytes including both
       
   141         * attachments and internal header structures. The actual message
       
   142         * size in transmission is smaller due to the header
       
   143         * binary encoding.
       
   144         */
       
   145         virtual TInt32 MessageSize();
       
   146               
       
   147         /**
       
   148         * Message description mutator. 
       
   149         * This provides a method to override the default message description.
       
   150         * The next SaveMessageL saves the description text in the 
       
   151         * TMsvEntry::iDescription.
       
   152         * Note that this method does not check the text length, so avoid long 
       
   153         * descriptions to minimize memory usage.
       
   154         * @param aText message description
       
   155         */
       
   156         virtual void SetMessageDescriptionL( const TDesC& aText );
       
   157        
       
   158         // -------------------------------------------------------------------
       
   159         // FUNCTIONS TO HANDLE MESSAGE ATTACHMENTS
       
   160 
       
   161         /**
       
   162         * Create text/plain attachment. <br>
       
   163         * Creates a text attachment from descriptor.
       
   164         * Has option to convert all unicode paragraph separator marks to
       
   165         *     line feeds.
       
   166         * Converts text from unicode (ucs-2) to utf-8 before storing it.
       
   167         * @param aStore an open EditStore. Caller must commit store
       
   168         *     (several attachments can be added before committing store)
       
   169         * @param aAttachmentId returned ID of the new attachment entry
       
   170         * @param aText UNICODE text to be added as a text/plain attachment.
       
   171         * @param aFile suggested filename for the attachment
       
   172         * @param aConvertParagraphSeparator flag to tell if the function 
       
   173         *     will search for all 0x2029 characters (Unicode paragraph
       
   174         *     separator) and replace them with 0x000a (line feed).
       
   175         *     aConvertParagraphSeparator == ETrue: convert
       
   176         *     aConvertParagraphSeparator == EFalse: do not convert
       
   177         */
       
   178         virtual void CreateTextAttachmentL(
       
   179             CMsvStore& aStore,
       
   180             TMsvAttachmentId& aAttachmentId,
       
   181             const TDesC& aText,
       
   182             const TDesC& aFile,
       
   183             TBool aConvertParagraphSeparator = ETrue );
       
   184        
       
   185         /**
       
   186         * Accessor for message type setting
       
   187         * @return Message type setting
       
   188         */
       
   189         virtual TUniMessageTypeSetting MessageTypeSetting() const;
       
   190         
       
   191         /**
       
   192         * Mutator for message type setting
       
   193         * @param aSetting Message type setting
       
   194         */
       
   195         virtual void SetMessageTypeSetting( TUniMessageTypeSetting aSetting );
       
   196 
       
   197         /**
       
   198         * Accessor for message type locking
       
   199         * @return Message type locking
       
   200         */
       
   201         virtual TUniMessageTypeLocking MessageTypeLocking() const;
       
   202         
       
   203         /**
       
   204         * Mutator for message type locking
       
   205         * @param aLocking Message type locking
       
   206         */
       
   207         virtual void SetMessageTypeLocking( TUniMessageTypeLocking aLocking );
       
   208 
       
   209         /**
       
   210         * Accessor for message root
       
   211         * @return Message root
       
   212         */
       
   213         virtual TMsvAttachmentId MessageRoot() const;
       
   214         
       
   215         /**
       
   216         * Mutator for message root
       
   217         * @param aLocking Message root
       
   218         */
       
   219         virtual void SetMessageRoot( TMsvAttachmentId aRoot );
       
   220 
       
   221         /**
       
   222         * From CBaseMtm: Store current entry data.
       
   223         * The caller must set the message to complete and visible when it is ready.
       
   224         */
       
   225         virtual void SaveMessageL( CMsvStore& aEditStore, TMsvEntry& aEntry ); 
       
   226 
       
   227     public:  // FUNCTIONS FROM BASE CLASSES
       
   228 
       
   229         /**
       
   230         * From CBaseMtm: Return type of this Mtm
       
   231         * @return Registered Mtm type
       
   232         */
       
   233         inline TUid Type() const;
       
   234 
       
   235         // Context specific functions
       
   236 
       
   237         /**
       
   238         * From CBaseMtm: Set current context
       
   239         * @param aEntry Pointer to entry instance
       
   240         */
       
   241         inline void SetCurrentEntryL( CMsvEntry* aEntry );        
       
   242 
       
   243         /**
       
   244         * From CBaseMtm: Switch context to entry defined by aId.
       
   245         * @param aId Entry id in message store.
       
   246         */
       
   247         inline void SwitchCurrentEntryL( TMsvId aId );
       
   248         
       
   249         /**
       
   250         * From CBaseMtm: return reference to current entry
       
   251         * @return reference to entry instance
       
   252         */
       
   253         inline CMsvEntry& Entry() const;
       
   254         
       
   255         /**
       
   256         * From CBaseMtm: Query if entry context has been set
       
   257         * @return ETrue, if context has been set, EFalse, if not
       
   258         */
       
   259         inline TBool HasContext() const;
       
   260 
       
   261         // Message specific functions
       
   262 
       
   263         /**
       
   264         * From CBaseMtm: Store current entry data.
       
   265         * The caller must set the message to complete and visible when it is ready.
       
   266         */
       
   267         void SaveMessageL(); 
       
   268 
       
   269         /**
       
   270         * From CBaseMtm: Restore current entry data.
       
   271         */
       
   272         void LoadMessageL();
       
   273 
       
   274         /**
       
   275         * From CBaseMtm: Validates that selected parts of current message are
       
   276         *     legal.
       
   277         * @param aPartList Flags specifying which parts to validate.
       
   278         *     (defined in MTMDEF.H).
       
   279         *     KMsvMessagePartPartBody is ignored.
       
   280         *     KMsvMessagePartRecipient is supported.
       
   281         *     KMsvMessagePartOriginator is supported.
       
   282         *     KMsvMessagePartDescription is ignored.
       
   283         *     KMsvMessagePartDate is ignored.
       
   284         *     KMsvMessagePartAttachments is supported.
       
   285         * @return Flags that specify which or the specified parts were valid.
       
   286         */
       
   287         TMsvPartList ValidateMessage( TMsvPartList aPartList );
       
   288         
       
   289         /**
       
   290         * From CBaseMtm: Searches for specified text in selected parts of
       
   291         * current message.
       
   292         * @param aPartList Flags specifying which parts to search.
       
   293         *     (defined in MTMDEF.H).
       
   294         *     KMsvMessagePartPartBody is ignored.
       
   295         *     KMsvMessagePartRecipient is supported.
       
   296         *     KMsvMessagePartOriginator is supported.
       
   297         *     KMsvMessagePartDescription is supported.
       
   298         *     KMsvMessagePartDate is ignored.
       
   299         *     KMsvMessagePartAttachments is ignored.
       
   300         * Following find attributes are supported:
       
   301         *     KMsvFindCaseSensitive
       
   302         *     KMsvFindWholeWord
       
   303         * @return Flags that specify in which of the specified parts the text
       
   304         *     was found.
       
   305         */
       
   306         TMsvPartList Find( const TDesC& aTextToFind, TMsvPartList aPartList );
       
   307 
       
   308         /**
       
   309         * From CBaseMtm 
       
   310         * Not supported. 
       
   311         * @leave KErrNotSupported
       
   312         */
       
   313         CMsvOperation* ReplyL(
       
   314             TMsvId aDestination,
       
   315             TMsvPartList aPartlist,
       
   316             TRequestStatus& aCompletionStatus );
       
   317         
       
   318         /**
       
   319         * From CBaseMtm 
       
   320         * Not supported. 
       
   321         * @leave KErrNotSupported
       
   322         */
       
   323         CMsvOperation* ForwardL(
       
   324             TMsvId aDestination,
       
   325             TMsvPartList aPartList,
       
   326             TRequestStatus& aCompletionStatus );
       
   327 
       
   328         /**
       
   329         * From CBaseMtm: Adds an addressee. Cannot distiguish To, Cc, and Bcc.
       
   330         * New addresses are handled as To type of addresses.
       
   331         * @param aRealAddress Reference to an address string
       
   332         */
       
   333         void AddAddresseeL( const TDesC& aRealAddress );
       
   334         
       
   335         /**
       
   336         * From CBaseMtm: Adds an addressee. Cannot distiguish To, Cc, and Bcc.
       
   337         * New addresses are handled as To type of addresses. 
       
   338         * @param aRealAddress Reference to an address string
       
   339         * @param aAlias Reference to a descriptive name (not a real address)
       
   340         */
       
   341         void AddAddresseeL( const TDesC& aRealAddress, const TDesC& aAlias );
       
   342         
       
   343         /**
       
   344         * From CBaseMtm: Adds a typed addressee (To, Cc or Bcc )
       
   345         * @param aType recipient type (EMsvRecipientTo, EMsvRecipientCc,
       
   346         *     or EMsvRecipientBcc)
       
   347         * @param aRealAddress Reference to an address string
       
   348         */
       
   349         virtual void AddAddresseeL(
       
   350             TMsvRecipientType aType,
       
   351             const TDesC& aRealAddress);
       
   352         
       
   353         /**
       
   354         * From CBaseMtm: Adds a typed addressee (To, Cc or Bcc )
       
   355         * @param aType recipient type (EMsvRecipientTo, EMsvRecipientCc,
       
   356         *     or EMsvRecipientBcc)
       
   357         * @param aRealAddress Reference to an address string
       
   358         * @param aAlias Reference to a descriptive name (not a real address)
       
   359         */
       
   360         virtual void AddAddresseeL(
       
   361             TMsvRecipientType aType,
       
   362             const TDesC& aRealAddress,
       
   363             const TDesC& aAlias);
       
   364         
       
   365         /**
       
   366         * From CBaseMtm: Removes an entry from addressee list.
       
   367         *     Cannot distinguish To, Cc and Bcc.
       
   368         * @param aIndex Index to the array of addresses.
       
   369         */
       
   370         void RemoveAddressee( TInt aIndex );
       
   371 
       
   372         /**
       
   373         * From CBaseMtm Rich text body accessor
       
   374         * @return reference to the rich text body
       
   375         */
       
   376         inline CRichText& Body();
       
   377 
       
   378         /**
       
   379         * From CBaseMtm Rich text body accessor
       
   380         * @return reference to the rich text body
       
   381         */
       
   382         inline const CRichText& Body() const;
       
   383 
       
   384         /**
       
   385         * From CBaseMtm: Sets the message subject
       
   386         * @param aSubject Subject as text string.
       
   387         */
       
   388         void SetSubjectL( const TDesC& aSubject );
       
   389         
       
   390         /**
       
   391         * From CBaseMtm: Subject accessor
       
   392         * @return Constant pointer descriptor pointing to subject
       
   393         */
       
   394         const TPtrC SubjectL() const;
       
   395 
       
   396         // General MTM-specific functionality
       
   397 
       
   398         /**
       
   399         * From CBaseMtm:
       
   400         * @param aCapability Uid specifying which capablity is queried
       
   401         * @param aResponse reference to an integer that will contain the value
       
   402         *     describing the capability at return.
       
   403         * @return error code, KErrNone, if specified capability is known
       
   404         *     to Mtm,
       
   405         *     KErrNotSupported, if capability Uid is unknown
       
   406         */
       
   407         TInt QueryCapability( TUid aCapability, TInt& aResponse );
       
   408 
       
   409         /**
       
   410         * From CBaseMtm 
       
   411         * Not supported. 
       
   412         * @leave KErrNotSupported
       
   413         */
       
   414         void InvokeSyncFunctionL(
       
   415             TInt aFunctionId,
       
   416             const CMsvEntrySelection& aSelection,
       
   417             TDes8& aParameter );
       
   418         
       
   419         /**
       
   420         * From CBaseMtm 
       
   421         * Not supported. 
       
   422         * Returns operation with status: KErrNotSupported
       
   423         */
       
   424         CMsvOperation*  InvokeAsyncFunctionL(
       
   425             TInt aFunctionId,
       
   426             const CMsvEntrySelection& aSelection,
       
   427             TDes8& aParameter,
       
   428             TRequestStatus& aCompletionStatus );
       
   429         
       
   430         /**
       
   431         * From CBaseMtm: Return session that was set at initialization
       
   432         * @return Reference to session object
       
   433         */
       
   434         inline CMsvSession& Session();
       
   435 
       
   436         // Functions for SendAs support
       
   437         // These functions get the edit store from the current entry.
       
   438         // The caller should not hold the store open.
       
   439         // The store is committed and closed after each operation
       
   440         
       
   441         /**
       
   442         * From CBaseMtm Adds a file attachment to the current message entry.
       
   443         * The attachment is referenced by its file path and is copied into the
       
   444         *     message store. 
       
   445         * Only one asynchronous operation can be run at any one time.
       
   446         * @param aFilePath The full path specification of the attachment file.
       
   447         * @param aMimeType The mime type of the attachment file.
       
   448         * @param aCharset The character set in case the attachment is of text type
       
   449         *        if not relevant for current attachment type, set aCharset to 0
       
   450         * @param aStatus The request status to complete.
       
   451         * @leave System-wide error codes.
       
   452         */
       
   453         void AddAttachmentL( const TDesC& aFilePath,
       
   454             const TDesC8& aMimeType,
       
   455             TUint aCharset,
       
   456             TRequestStatus& aStatus );
       
   457 
       
   458         /**
       
   459         * From CBaseMtm Adds a file attachment to the current message entry.
       
   460         * The attachment is referenced by an open file handle and is copied
       
   461         *     into the message store. 
       
   462         * Only one asynchronous operation can be run at any one time.
       
   463         * @param aFile An open file handle for the file attachment.
       
   464         *        The function closes the file handle when done.
       
   465         *        The caller should not attempt to close the handle afterwards
       
   466         *        Use as follows:
       
   467         *        CleanupStack::CleanupClosePush( aFile );
       
   468         *        AddAttachmentL( aFile, ... );
       
   469         *        CleanupStack::Pop(); // get handle off cleanup stack
       
   470         * @param aMimeType The mime type of the attachment file.
       
   471         * @param aCharset The character set in case the attachment is of text type
       
   472         *        if not relevant for current attachment type, set aCharset to 0
       
   473         * @param aStatus The request status to complete.
       
   474         * @leave System-wide error codes.
       
   475         */
       
   476         void AddAttachmentL( RFile& aFile,
       
   477             const TDesC8& aMimeType,
       
   478             TUint aCharset,
       
   479             TRequestStatus& aStatus );
       
   480         
       
   481         /**
       
   482         * From CBaseMtm Adds a file attachment to the current message entry
       
   483         *     as a linked file.
       
   484         * The attachment is referenced by its file path and is not copied
       
   485         *     into the message store. The attachment file is always used from
       
   486         *     its original location on disk indicated by the aFilePath
       
   487         *     parameter. Only one asynchronous operation can be run at any
       
   488         *     one time.
       
   489         * @param aFilePath The full path specification of the attachment file.
       
   490         * @param aMimeType The mime type of the attachment file.
       
   491         * @param aCharset The character set in case the attachment is of text type
       
   492         *        if not relevant for current attachment type, set aCharset to 0
       
   493         * @param aStatus The request status to complete.
       
   494         * @leave System-wide error codes.
       
   495         */
       
   496         void AddLinkedAttachmentL( const TDesC& aFilePath,
       
   497             const TDesC8& aMimeType,
       
   498             TUint aCharset,
       
   499             TRequestStatus& aStatus );
       
   500         
       
   501         /**
       
   502         * From CBaseMtm 
       
   503         * Not supported. 
       
   504         * @leave KErrNotSupported
       
   505         */
       
   506         void AddEntryAsAttachmentL( TMsvId aAttachmentId,
       
   507             TRequestStatus& aStatus );
       
   508         
       
   509         /**
       
   510         * From CBaseMtm
       
   511         * @param aFileName suggested filename
       
   512         * @param aAttachmentFile An open file handle for the file attachment.
       
   513         * @param aMimeType The mime type of the attachment file.
       
   514         * @param aCharset The character set in case the attachment is of text type
       
   515         *        if not relevant for current attachment type, set aCharset to 0
       
   516         * @param aStatus The request status to complete.
       
   517         * @leave System-wide error codes.
       
   518         */
       
   519         void CreateAttachmentL( const TDesC& aFileName,
       
   520             RFile& aAttachmentFile,
       
   521             const TDesC8& aMimeType,
       
   522             TUint aCharset,
       
   523             TRequestStatus& aStatus);
       
   524 
       
   525         /**
       
   526         * From CBaseMtm Cancels the current attachment operation.
       
   527         */
       
   528         void CancelAttachmentOperation();
       
   529         
       
   530         // End of attachment funtions to support SendAs
       
   531 
       
   532         /**
       
   533         * From CBaseMtm: Create an empty entry in the outbox<br>
       
   534         * and set it as current context.<br>
       
   535         * The entry will be invisible and under construction.
       
   536         * @param aServiceId Service id for the new entry.
       
   537         */
       
   538         void CreateMessageL( TMsvId aServiceId );
       
   539         
       
   540         /**
       
   541         * From CBaseMtm:BIO functions to support the SendAs API.
       
   542         * The function is not supported.
       
   543         * Entry().Entry().iBioType will be set by SendAs if this function does
       
   544         *    not leave.
       
   545         * The default implementation in CBaseMtm is to do nothing.
       
   546         */
       
   547         void BioTypeChangedL( TUid aBioTypeUid );
       
   548     
       
   549         /**
       
   550         * From CBaseMtm: Return id of default service.
       
   551         * @return default service
       
   552         */
       
   553         TMsvId DefaultServiceL() const;
       
   554         
       
   555         /**
       
   556         * From CBaseMtm: Remove default service
       
   557         * Does nothing. Deletion of service not supported
       
   558         */
       
   559         void RemoveDefaultServiceL();
       
   560         
       
   561         /**
       
   562         * From CBaseMtm: Change default service
       
   563         * Does nothing. Changing of default service not supported
       
   564         */
       
   565         void ChangeDefaultServiceL(const TMsvId& aService);
       
   566 
       
   567     protected:  // New functions
       
   568 
       
   569 
       
   570     protected:  // Functions from base classes
       
   571         
       
   572         /**
       
   573         * From CBaseMtm: Called after the context of this instance
       
   574         * has been changed to another entry.
       
   575         */
       
   576         void ContextEntrySwitched();
       
   577 
       
   578         /**
       
   579         * From CBaseMtm: React to changes 
       
   580         * This functions does not do anything.
       
   581         * @param aEvent Code that tells which event has occurred.
       
   582         *     Event codes defined in MSVAPI.H
       
   583         * @param arg1 Depends on Event
       
   584         * @param arg2 Depends on Event
       
   585         * @param arg3 Depends on Event
       
   586         */
       
   587         void HandleEntryEventL(
       
   588             TMsvEntryEvent aEvent,
       
   589             TAny* arg1,
       
   590             TAny* arg2,
       
   591             TAny* arg3 );
       
   592 
       
   593         /**
       
   594         * By default Symbian OS constructor is private.
       
   595         * @param aRegisteredMtmDll Reference to Mtm Dll registry class
       
   596         * @param aSession Reference to a Message Server session.
       
   597         */
       
   598         CUniClientMtm(
       
   599             CRegisteredMtmDll& aRegisteredMtmDll,
       
   600             CMsvSession& aSession );
       
   601 
       
   602         void ConstructL();
       
   603         
       
   604     private:
       
   605 
       
   606         /**
       
   607         * This method builds the iAddresseeList from the iUniHeaders data.
       
   608         */
       
   609         void BuildAddresseeListL();
       
   610 
       
   611         /**
       
   612         * This methods adds entries from the the specified array to
       
   613         *     iAddresseeList.
       
   614         * @param aArray recipient array.
       
   615         */
       
   616         void BuildAddresseeListL(
       
   617             const CDesCArray& aArray, TMsvRecipientType aValue); 
       
   618 
       
   619         /**
       
   620         * Attachments size
       
   621         * @return size of all attachments, binary data + mime headers.
       
   622         */
       
   623         TInt32 AttachmentsSizeL();
       
   624 
       
   625         /**
       
   626         * Attachments size
       
   627         * @return size of all attachments, binary data + mime headers.
       
   628         */
       
   629         TInt32 AttachmentsSizeL( CMsvStore& aStore );
       
   630 
       
   631         /**
       
   632         * Find text from the given recipient list.
       
   633         * @param aTextToFind a text to be searched
       
   634         * @param aPartList message part list
       
   635         * @param aRecipients the recipient list
       
   636         * @param aFindText CMsvFindText object to help in the find
       
   637         * @return ETrue if match found.
       
   638         */
       
   639         TBool FindInRecipientL( 
       
   640             const TDesC& aTextToFind,
       
   641             TMsvPartList aPartlist,
       
   642             const CDesCArray& aRecipients,
       
   643             CMsvFindText& aFindText );
       
   644             
       
   645         /**
       
   646         * Add an attachment from public location either as copied file or
       
   647         *     linked file.
       
   648         * @param aFilePath The full path specification of the attachment file.
       
   649         * @param aMimeType The mime type of the attachment file.
       
   650         * @param aType CMsvAttachment::EMsvFile or
       
   651         *     CMsvAttachment::EMsvLinkedFile
       
   652         * @param aStatus The request status to complete when request has
       
   653         *     completed.
       
   654         * @param aCharacter set IANA MIBEnum of the character set for the
       
   655         *     attachment if needed.
       
   656         */
       
   657         void AddFilePathAttachmentL(const TDesC& aFilePath,
       
   658             const TDesC8& aMimeType,
       
   659             CMsvAttachment::TMsvAttachmentType aType,
       
   660             TRequestStatus& aStatus,
       
   661             const TUint aCharacterSet = 0 );
       
   662         
       
   663         /**
       
   664         * Tries to recognize character set of the given file. 
       
   665         * @since    3.0
       
   666         * @param    aFile       IN File to be recognized
       
   667         * @return   MIB id of the character set
       
   668         */
       
   669         TUint RecognizeCharSetL( RFile& aFile );
       
   670         
       
   671         /**
       
   672         * Sets the needed data fields for CMsvAttachment.
       
   673         * Creates and initializes CMsvMimeHeaders for the attachment.
       
   674         *
       
   675         * @return Size of the mime headers in bytes
       
   676         */
       
   677         TInt InitializeAttachmentL(
       
   678             MMsvAttachmentManager& aManager,
       
   679             CMsvAttachment& aAttachment,
       
   680             const TDesC& aFileName,
       
   681             const TDesC8& aMimeType,
       
   682             TInt aFileSize,
       
   683             TUint aCharset );
       
   684             
       
   685         /**
       
   686         * Sets the content location mime header.
       
   687         * This function needs to be called when attachments have been converted
       
   688         *    from ucs-2 to utf8.
       
   689         * Other mime headers have been correctly set by the conversion routine
       
   690         *
       
   691         * @param aStore edit store
       
   692         * @param aAttaId attchement if for the attachment to be handled
       
   693         * @param aFilename suggested filename
       
   694         */
       
   695         void SetContentLocationForConvertedAttL(
       
   696             CMsvStore& aStore,
       
   697             TMsvAttachmentId aAttaId,
       
   698             const TDesC& aFileName );
       
   699             
       
   700         
       
   701         /**
       
   702         * See function Find. DoFind is called in TRAP in Find function.
       
   703         */
       
   704         TMsvPartList DoFindL( const TDesC& aTextToFind, TMsvPartList aPartList );
       
   705 
       
   706             
       
   707 
       
   708     public:     // Data
       
   709     
       
   710     protected:  // Data
       
   711         
       
   712         CUniHeaders*  iUniHeaders;   // Unified message headers        
       
   713         TInt          iMessageDrive; // messages are on C: drive by default,
       
   714                                      // may be moved to other drive
       
   715         CMsgTextUtils* iTextUtils;
       
   716         
       
   717     private:    // Data
       
   718         // active object that commits the store when attachment operation
       
   719         // is complete
       
   720         CMmsAttachmentWaiter* iAttaWaiter;
       
   721 
       
   722     public:     // Friend classes
       
   723 
       
   724     protected:  // Friend classes
       
   725 
       
   726     private:    // Friend classes
       
   727 
       
   728     };
       
   729 
       
   730 #include "UniClientMtm.inl"
       
   731 
       
   732 #endif      // __UNICLIENTMTM_H__   
       
   733             
       
   734 // End of File
       
   735