mobilemessaging/unieditor/application/inc/UniEditorSendOperation.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2006,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:   CUniEditorSendOperation, asynchronous object for message sending
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __UNIEDITORSENDOPERATION_H
       
    21 #define __UNIEDITORSENDOPERATION_H
       
    22 
       
    23 // INCLUDES
       
    24 #include "UniEditorOperation.h"
       
    25 #include "UniEditorDocument.h"
       
    26 #include "UniEditorSaveOperation.h"
       
    27 
       
    28 // CONSTANTS
       
    29 
       
    30 // MACROS
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 
       
    34 class CMDXMLDocument;
       
    35 class CUniEditorHeader;
       
    36 class CMsgEditorView;
       
    37 class CMsgEditorAppUi;
       
    38 class CMsvOperation;
       
    39 class CUniEditorPlugin;
       
    40 
       
    41 // DATA TYPES
       
    42 
       
    43 // FUNCTION PROTOTYPES
       
    44 
       
    45 // CLASS DECLARATION
       
    46 
       
    47 /**
       
    48 * CUniEditorSendOperation, Storage for single attachment in presentation. 
       
    49 *
       
    50 * @since 3.2
       
    51 */
       
    52 class CUniEditorSendOperation : public CUniEditorOperation
       
    53     {
       
    54     public:  // New methods
       
    55 
       
    56         /**
       
    57         * Factory method that creates this object.
       
    58         *
       
    59         * @since    3.2
       
    60         * @param    aObserver
       
    61         * @return   Pointer to instance in cleanup stack
       
    62         */
       
    63         static CUniEditorSendOperation* NewL(
       
    64             MUniEditorOperationObserver& aObserver,
       
    65             CUniEditorDocument& aDocument,
       
    66             CUniEditorHeader& aHeader,
       
    67             CUniEditorPlugin& aPlugin,
       
    68             CMsgEditorView& aView,
       
    69             RFs& aFs );
       
    70 
       
    71         /**
       
    72         * Destructor
       
    73         */
       
    74         virtual ~CUniEditorSendOperation();
       
    75 
       
    76         /**
       
    77         * Starts send operation
       
    78         */
       
    79         void Send();
       
    80 
       
    81     protected: 
       
    82 
       
    83         /**
       
    84         * From CActive
       
    85         */
       
    86         void RunL();
       
    87 
       
    88         /**
       
    89         * From CUniEditorOperation
       
    90         */
       
    91         void DoCancelCleanup();
       
    92 
       
    93         /**
       
    94         * From CUniEditorOperation
       
    95         */
       
    96         void HandleOperationEvent( TUniEditorOperationType aOperation,
       
    97                                    TUniEditorOperationEvent aEvent );
       
    98 
       
    99     private:
       
   100 
       
   101         /**
       
   102         * C++ constructor.
       
   103         */
       
   104         CUniEditorSendOperation(
       
   105             MUniEditorOperationObserver& aObserver,
       
   106             CUniEditorDocument& aDocument,
       
   107             CUniEditorHeader& aHeader,
       
   108             CUniEditorPlugin& aPlugin,
       
   109             CMsgEditorView& aView,
       
   110             RFs& aFs );
       
   111 
       
   112         /**
       
   113         * 2nd phase constructor.
       
   114         */
       
   115         void ConstructL();
       
   116 
       
   117         /**
       
   118         * Performs send step
       
   119         */
       
   120         void DoSendStepL();
       
   121 
       
   122         /**
       
   123         * Removes duplicate addresses
       
   124         */
       
   125         void DoRemoveDuplicateAddressesL();
       
   126 
       
   127         /**
       
   128         * Saves the message
       
   129         */
       
   130         void DoSave();
       
   131 
       
   132         /**
       
   133         * Converts the message
       
   134         */
       
   135         void DoConvertL();
       
   136 
       
   137         /**
       
   138         * Sends the messsage
       
   139         */
       
   140         void DoSendL();
       
   141         
       
   142     protected: // data
       
   143 
       
   144         // assigned to iOperationState in base class
       
   145         enum TUniEditorSendState
       
   146             {
       
   147             EUniEditorSendRemoveDuplicateAddresses,
       
   148             EUniEditorSendSave,
       
   149             EUniEditorSendConvert,
       
   150             EUniEditorSendPluginSend,
       
   151             EUniEditorSendEnd
       
   152             };
       
   153 
       
   154         CUniEditorHeader& iHeader;
       
   155         CUniEditorPlugin& iPlugin;
       
   156         CMsgEditorView& iView;
       
   157 
       
   158         CUniEditorSaveOperation* iSaveOperation;
       
   159 
       
   160         TMsvId iConvertedEntry;
       
   161     };
       
   162 
       
   163 #endif // __UNIEDITORSENDOPERATION_H