mobilemessaging/mmsui/viewerinc/MmsViewerLaunchOperation.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2002-2006 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 *       CMmsViewerLaunchOperation, asynchronous operation for object saving
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 #ifndef __MMSVIEWERLAUNCHOPERATION_H
       
    23 #define __MMSVIEWERLAUNCHOPERATION_H
       
    24 
       
    25 // INCLUDES
       
    26 
       
    27 #include <e32base.h>
       
    28 #include <e32std.h>
       
    29 
       
    30 #include <msgasynccontrolobserver.h>    
       
    31 #include <unislideloader.h>
       
    32 
       
    33 #include "UniMmsViewerDocument.h"
       
    34 #include "MmsViewerOperation.h"
       
    35 
       
    36 // CONSTANTS
       
    37 
       
    38 // MACROS
       
    39 
       
    40 // FORWARD DECLARATIONS
       
    41 
       
    42 class CMsgEditorView;
       
    43 class CMmsViewerHeader;
       
    44 
       
    45 // DATA TYPES
       
    46 
       
    47 // FUNCTION PROTOTYPES
       
    48 
       
    49 // CLASS DECLARATION
       
    50 
       
    51 /**
       
    52 * CMmsViewerLaunchOperation, Storage for single attachment in presentation. 
       
    53 *
       
    54 * @since 2.0
       
    55 */
       
    56 class CMmsViewerLaunchOperation :   public CMmsViewerOperation,
       
    57                                     public MMmsDocumentObserver,
       
    58                                     public MUniSlideLoaderObserver
       
    59     {
       
    60     public:  // New methods
       
    61 
       
    62         /**
       
    63         * Factory method that creates this object.
       
    64         *
       
    65         * @since    3.0
       
    66         */
       
    67         CMmsViewerLaunchOperation(
       
    68             MUniObjectObserver*         aUniObjectObserver,
       
    69             MMsgAsyncControlObserver&   aControlObserver,
       
    70             MMmsViewerOperationObserver& aOperationObserver,
       
    71             CMmsViewerDocument& aDocument,
       
    72             CMsgEditorView& aView,
       
    73             RFs& aFs );
       
    74 
       
    75         /**
       
    76         * Destructor
       
    77         *
       
    78         * @since    3.0
       
    79         */
       
    80         virtual ~CMmsViewerLaunchOperation();
       
    81 
       
    82         /**
       
    83         *
       
    84         */
       
    85         void Launch();
       
    86 
       
    87         inline CMmsViewerHeader* DetachHeader();
       
    88         inline CUniSlideLoader* DetachSlideLoader();
       
    89         inline TInt ParseResult();
       
    90 
       
    91     private:
       
    92 
       
    93         void DoLaunchStepL();
       
    94 
       
    95         void DoInitializeL();
       
    96         void DoPrepareHeaderL();
       
    97         void DoPrepareBodyL();
       
    98         void DoPrepareErrorResponseMessageL();
       
    99         void DoPrepare3GPPBodyL();
       
   100         
       
   101         /**
       
   102         * From CActive
       
   103         */
       
   104         void DoCancel();
       
   105 
       
   106         /**
       
   107         * From CActive
       
   108         */
       
   109         void RunL();
       
   110     
       
   111         /**
       
   112         * From CActive
       
   113         */
       
   114         TInt RunError( TInt aError );
       
   115 
       
   116         void InitializeReady( TInt aParseResult, TInt aError );
       
   117         void SlideLoadReady( TInt aError );
       
   118 
       
   119     protected: 
       
   120 
       
   121         /**
       
   122         * 2nd phase constructor.
       
   123         *
       
   124         * @since    2.0
       
   125         */
       
   126         void ConstructL();
       
   127 
       
   128     private:
       
   129 
       
   130     protected: // data
       
   131 
       
   132         enum TMmsLaunchState
       
   133             {
       
   134             EMmsLaunchInitialize = 0,
       
   135             EMmsLaunchPrepareHeader,
       
   136             EMmsLaunchPrepareBody,
       
   137             EMmsLaunchEnd
       
   138             };
       
   139 
       
   140         MMsgAsyncControlObserver&   iControlObserver;
       
   141         CUniSlideLoader*            iSlideLoader;
       
   142         CMsgEditorView&             iView;
       
   143         CMmsViewerHeader*           iHeader;
       
   144 
       
   145         TInt                        iLaunchState;
       
   146         TInt                        iParseResult;
       
   147         TInt                        iError;
       
   148         TBool                       iIsInitialised;
       
   149         MUniObjectObserver*         iUniObjectObserver;
       
   150     };
       
   151 
       
   152 inline CMmsViewerHeader* CMmsViewerLaunchOperation::DetachHeader()
       
   153     {
       
   154     CMmsViewerHeader* header = iHeader;
       
   155     iHeader = NULL;
       
   156     return header;
       
   157     }
       
   158 
       
   159 inline CUniSlideLoader* CMmsViewerLaunchOperation::DetachSlideLoader()
       
   160     {
       
   161     CUniSlideLoader* slideLoader = iSlideLoader;
       
   162     iSlideLoader = NULL;
       
   163     return slideLoader;
       
   164     }
       
   165 
       
   166 inline TInt CMmsViewerLaunchOperation::ParseResult()
       
   167     {
       
   168     return iParseResult;
       
   169     }
       
   170 
       
   171 #endif // __MMSVIEWERLAUNCHOPERATION_H