mobilemessaging/unieditor/mtm/inc/UniMtmUi.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 *       CUniMtmUi - UI part of the Unified Message MTM type to Symbian OS Messaging
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __UNIMTMUI_H
       
    22 #define __UNIMTMUI_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <mtmuibas.h>
       
    26 #include <MuiuMsgEditorLauncher.h> // for launch flags
       
    27 
       
    28 // CONSTANTS
       
    29 
       
    30 // MACROS
       
    31 
       
    32 // DATA TYPES
       
    33 // Editor types used to launch the correct application
       
    34 enum TEditorType
       
    35     {
       
    36     EReadOnly,
       
    37     EEditExisting,
       
    38     ECreateNewMessage,
       
    39     ESpecialEditor
       
    40     };
       
    41 
       
    42 // FUNCTION PROTOTYPES
       
    43 
       
    44 
       
    45 // FORWARD DECLARATIONS
       
    46 class CUniClientMtm;
       
    47 
       
    48 
       
    49 // CLASS DECLARATION
       
    50 
       
    51 /**
       
    52 * CUniMtmUi - UI part of the unified message MTM type to Symbian OS Messaging
       
    53 *
       
    54 * @since 0.9
       
    55 */
       
    56 class CUniMtmUi : public CBaseMtmUi
       
    57     {
       
    58     public:  // Constructors and destructor
       
    59         
       
    60         /**
       
    61         * Symbian OS constructor
       
    62         * @param aBaseMtm client MTM
       
    63         * @param aRegisteredMtmDll registry dll
       
    64         * @return a new unified MTM UI object.
       
    65         */
       
    66         static CUniMtmUi* NewL(
       
    67             CBaseMtm& aBaseMtm,
       
    68             CRegisteredMtmDll& aRegisteredMtmDll );
       
    69         
       
    70         /**
       
    71         * Destructor.
       
    72         */
       
    73         ~CUniMtmUi();
       
    74         
       
    75     public:  // New functions
       
    76         
       
    77         
       
    78     public: // Functions from base classes
       
    79         
       
    80         /**
       
    81         * From CBaseMtmUi: Capability check.
       
    82         */
       
    83         TInt QueryCapability( TUid aCapability, TInt& aResponse );
       
    84         
       
    85         /**
       
    86         * From CBaseMtmUi: not supported in Series 60
       
    87         */
       
    88         CMsvOperation* DeleteServiceL(
       
    89             const TMsvEntry& aService,
       
    90             TRequestStatus& aStatus );
       
    91         
       
    92         /**
       
    93         * From CBaseMtmUi: Create a new entry. Launches unified editor.
       
    94         * Asynchronous.
       
    95         * Settings are not checked here.
       
    96         * @param aEntry entry to be created
       
    97         * @param aParent parent entry
       
    98         * @param aStatus follows the operation progress
       
    99         * @return started operation
       
   100         */
       
   101         CMsvOperation* CreateL(
       
   102             const TMsvEntry& aEntry,
       
   103             CMsvEntry& aParent,
       
   104             TRequestStatus& aStatus );
       
   105         
       
   106         /**
       
   107         * From CBaseMtmUi: not supported in Series 60
       
   108         */
       
   109         CMsvOperation* DeleteFromL(
       
   110             const CMsvEntrySelection& aSelection,
       
   111             TRequestStatus& aStatus );
       
   112         
       
   113         /**
       
   114         * From CBaseMtmUi:
       
   115         * This method is not supported
       
   116         */
       
   117         CMsvOperation* CancelL(
       
   118             TRequestStatus& aStatus,
       
   119             const CMsvEntrySelection& aSelection );
       
   120         
       
   121         /**
       
   122         * From CBaseMtmUi: Handles open request to the message
       
   123         * entry having context. Asynchronous.
       
   124         * @param aStatus follows the operation progress
       
   125         * @return started operation
       
   126         */
       
   127         CMsvOperation* OpenL( TRequestStatus& aStatus );
       
   128         
       
   129         /**
       
   130         * From CBaseMtmUi: As the other OpenL() but gets the first entry
       
   131         * in a selection and opens it.
       
   132         */
       
   133         CMsvOperation* OpenL(
       
   134             TRequestStatus& aStatus,
       
   135             const CMsvEntrySelection& aSelection );
       
   136         
       
   137         /**
       
   138         * From CBaseMtmUi: not supported in Series 60
       
   139         */
       
   140         CMsvOperation* CloseL( TRequestStatus& aStatus );
       
   141         
       
   142         /**
       
   143         * From CBaseMtmUi: not supported in Series 60
       
   144         */
       
   145         CMsvOperation* CloseL(
       
   146             TRequestStatus& aStatus,
       
   147             const CMsvEntrySelection& aSelection );
       
   148         
       
   149         /**
       
   150         * From CBaseMtmUi: Opens UniEditor for editing a message. 
       
   151         * @param aStatus follows the operation progress
       
   152         * @return started operation
       
   153         */
       
   154         CMsvOperation* EditL( TRequestStatus& aStatus );
       
   155         
       
   156         /**
       
   157         * From CBaseMtmUi: As the other EditL(), but gets the first entry in
       
   158         * a selection and edits it.
       
   159         */
       
   160         CMsvOperation* EditL(
       
   161             TRequestStatus& aStatus,
       
   162             const CMsvEntrySelection& aSelection );
       
   163         
       
   164         /**
       
   165         * From CBaseMtmUi: 
       
   166         * This method is not supported
       
   167         * @param aStatus follows the operation progress
       
   168         * @return started operation
       
   169         */
       
   170         CMsvOperation* ViewL( TRequestStatus& aStatus );
       
   171         
       
   172         /**
       
   173         * From CBaseMtmUi: 
       
   174         * This method is not supported
       
   175         */
       
   176         CMsvOperation* ViewL(
       
   177             TRequestStatus& aStatus,
       
   178             const CMsvEntrySelection& aSelection );
       
   179         
       
   180         /**
       
   181         * From CBaseMtmUi: Opens UniEditor for message Reply.
       
   182         * This method is not supported
       
   183         * @param aStatus follows the operation progress
       
   184         * @return started operation
       
   185         */
       
   186         CMsvOperation* ReplyL(
       
   187             TMsvId aDestination,
       
   188             TMsvPartList aPartlist,
       
   189             TRequestStatus& aCompletionStatus );
       
   190         
       
   191         /**
       
   192         * From CBaseMtmUi: Opens UniEditor for forwarding message.
       
   193         * This method is not supported
       
   194         * @param aStatus follows the operation progress
       
   195         * @return started operation
       
   196         */
       
   197         CMsvOperation* ForwardL(
       
   198             TMsvId aDestination,
       
   199             TMsvPartList aPartList,
       
   200             TRequestStatus& aCompletionStatus );
       
   201         
       
   202         /**
       
   203         * From CBaseMtmUi: Copy a message from outbox to remote service (=send)
       
   204         * Context should be in MTM folder/service.
       
   205         * @param aSelection messages to be copied/sent
       
   206         * @param aStatus follows the operation progress
       
   207         * @return operation started
       
   208         */
       
   209         CMsvOperation* CopyToL(
       
   210             const CMsvEntrySelection& aSelection,
       
   211             TRequestStatus& aStatus );
       
   212         
       
   213         /**
       
   214         * From CBaseMtmUi: Move a message from outbox to remote service (=send)
       
   215         * Context should be in MTM folder/service.
       
   216         * @param aSelection messages to be moved/sent
       
   217         * @param aStatus follows the operation progress
       
   218         * @return operation started
       
   219         */
       
   220         CMsvOperation* MoveToL(
       
   221             const CMsvEntrySelection& aSelection,
       
   222             TRequestStatus& aStatus );
       
   223         
       
   224         /**
       
   225         * From CBaseMtmUi: Copy a message from remote service to inbox.
       
   226         * Just leaves with "not supported".
       
   227         */
       
   228         CMsvOperation* CopyFromL(
       
   229             const CMsvEntrySelection& aSelection,
       
   230             TMsvId aTargetId,
       
   231             TRequestStatus& aStatus );
       
   232         
       
   233         /**
       
   234         * From CBaseMtmUi: Move a message from remote service to inbox.
       
   235         * Just leaves with "not supported".
       
   236         */
       
   237         CMsvOperation* MoveFromL(
       
   238             const CMsvEntrySelection& aSelection,
       
   239             TMsvId aTargetId,
       
   240             TRequestStatus& aStatus );
       
   241         
       
   242         /**
       
   243         * From CBaseMtmUi: Perform an asynchronous operation
       
   244         */
       
   245         CMsvOperation* InvokeAsyncFunctionL(
       
   246             TInt aFunctionId,
       
   247             const CMsvEntrySelection& aSelection,
       
   248             TRequestStatus& aCompletionStatus,
       
   249             TDes8& aParameter );
       
   250         
       
   251         /**
       
   252         * From CBaseMtmUi: Perform a synchronous operation
       
   253         */
       
   254         void InvokeSyncFunctionL(
       
   255             TInt aFunctionId,
       
   256             const CMsvEntrySelection& aSelection,
       
   257             TDes8& aParameter );
       
   258         
       
   259         /**
       
   260         * From CBaseMtmUi: Used for display operation summary (usually completed operations).
       
   261         * Not in use.
       
   262         */
       
   263         TInt DisplayProgressSummary( const TDesC8& aProgress ) const;
       
   264         
       
   265         static void ConvertUtcToLocalTime( TTime& aTime );
       
   266         
       
   267        
       
   268     protected:  // New functions
       
   269     
       
   270         /**
       
   271         * Handles the actual launching of editor or viewer when viewing or editing a 
       
   272         * message.
       
   273         * @param aStatus follows the operation progress.
       
   274         * @param aSession Message server session to be used.
       
   275         * @param aEditorType Editor type used to launch the correct application. 
       
   276         *                    Defaults to EEditExisting.
       
   277         * @return started operation
       
   278         */        
       
   279         CMsvOperation* LaunchEditorApplicationL(
       
   280             TRequestStatus& aStatus,
       
   281             CMsvSession& aSession,
       
   282             TEditorType aEditorType = EEditExisting );
       
   283     
       
   284         /**
       
   285         * Performs CopyToL or MoveToL operation
       
   286         * @param aSelection the entries to be sent
       
   287         * @param aStatus follows the operation progress
       
   288         * @param aCopyOnly defines is it copy or move
       
   289         * @return started operation
       
   290         */
       
   291         CMsvOperation* CopyMoveToL(
       
   292             const CMsvEntrySelection& aSelection,
       
   293             TRequestStatus& aStatus,
       
   294             TBool aCopyOnly );
       
   295     
       
   296     
       
   297     protected:  // Functions from base classes
       
   298     
       
   299         /**
       
   300         * From CBaseMtmUi: Returns resource file
       
   301         * @param aFileName Store resource file here
       
   302         */
       
   303         void GetResourceFileName( TFileName& aFileName ) const;
       
   304     
       
   305     
       
   306     private:
       
   307     
       
   308         /**
       
   309         * From CBaseMtmUi: construction.
       
   310         * @param
       
   311         * @return
       
   312         */
       
   313         void ConstructL();
       
   314     
       
   315         /**
       
   316         * From CBaseMtmUi: constructor.
       
   317         * @param aBaseMtm client MTM reference
       
   318         * @param aRegisteredMtmDll Registry DLL
       
   319         * @return
       
   320         */
       
   321         CUniMtmUi( CBaseMtm& aBaseMtm, CRegisteredMtmDll& aRegisteredMtmDll );
       
   322    
       
   323         /**
       
   324         * Opens message info popup.
       
   325         * @param aStatus follows the operation progress
       
   326         * @param aParameter contains message size from Editor, otherwise empty
       
   327         * @return started operation
       
   328         */
       
   329         CMsvOperation* OpenMessageInfoL(
       
   330             TRequestStatus& aCompletionStatus,
       
   331             TDes8& aParameter );
       
   332         
       
   333         /**
       
   334         * Creates To:, Cc, and Bcc recipient lists for Message Info.
       
   335         * Creation of Cc and Bcc recipients list are created, if 
       
   336         * these fields are variated On.
       
   337         * Every created recipient buffer object increases pushed object count 
       
   338         * by one. Thus pushed object count is 1-3 depending on variation.
       
   339         * If a field is variated Off, recipients are appended to 
       
   340         * To: or Cc: fields.
       
   341         * @param aRecip  IN  Recipient array
       
   342         * @param aTo     OUT To recipients array
       
   343         * @param aCc     OUT Cc recipients array
       
   344         * @param aBcc    OUT Bcc Recipient array
       
   345         * @param aAddHeadersVariation variation bit flags
       
   346         */
       
   347         void TurnRecipientsArrayIntoStringsLC(
       
   348                             const   CMsvRecipientList&  aRecip,
       
   349                             HBufC*&                     aTo,
       
   350                             HBufC*&                     aCc,
       
   351                             HBufC*&                     aBcc, 
       
   352                             TInt                        aAddHeadersVariation ) const; 
       
   353     
       
   354         /**
       
   355         * Message size - integer to string converter
       
   356         * Converts message size in bytes to a kilobyte string. Rounds the bytes up to the
       
   357         * next full kilo. I.e:
       
   358         * 0 -> 0KB
       
   359         * 1 -> 1KB
       
   360         * 1024 -> 1KB
       
   361         * 1025 -> 2KB
       
   362         * @param aTarget returned size string
       
   363         * @param aFileSize source size
       
   364         */
       
   365         void MessageSizeToStringL( TDes& aTarget, TInt aFileSize ) const; 
       
   366     
       
   367         /**
       
   368         * Checks if the message is effectively empty
       
   369         * @return boolean - empty or not empty
       
   370         */
       
   371         TBool IsMessageEmptyL() const;
       
   372 
       
   373     private:    // Data
       
   374     
       
   375         
       
   376         
       
   377         
       
   378     };
       
   379     
       
   380 #endif      // __UNIMTMUI_H
       
   381     
       
   382     // End of File
       
   383