pushmtm/MtmUiInc/PushViewMessageOp.h
branchRCL_3
changeset 64 6385c4c93049
parent 63 4baee4f15982
child 65 8e6fa1719340
equal deleted inserted replaced
63:4baee4f15982 64:6385c4c93049
     1 /*
       
     2 * Copyright (c) 2002 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 the License "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:  Declaration of CPushViewMessageOp.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef PUSHVIEWMESSAGEOP_H
       
    21 #define PUSHVIEWMESSAGEOP_H
       
    22 
       
    23 // INCLUDE FILES
       
    24 
       
    25 #include "PushMtmUiOperation.h"
       
    26 #include <e32base.h>
       
    27 #include <apparc.h>
       
    28 #include <AknServerApp.h>
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 
       
    32 class CDocumentHandler;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37 * This asynchronous operation is responsible for launching the appropriate 
       
    38 * application (embedded if possible) that is capable of rendering the text 
       
    39 * of an SI message.
       
    40 * The operation uses the Document Handler to lauch the appropriate handler 
       
    41 * application.
       
    42 */
       
    43 class CPushViewMessageOp : public CPushMtmUiOperation, 
       
    44                            public MAknServerAppExitObserver
       
    45     {
       
    46     public: // Constructors and destructor
       
    47 
       
    48         /**
       
    49         * Two-phased constructor. Leaves on failure.
       
    50         * @param aSession Message Server Session to be used by this operation.
       
    51         * @param aEntryId Id of entry to operate on.
       
    52         * @param aObserverStatus Observer's status.
       
    53         * @return The constructed object.
       
    54         */
       
    55         static CPushViewMessageOp* NewL( CMsvSession& aSession, 
       
    56                                          TMsvId aEntryId, 
       
    57                                          TRequestStatus& aObserverStatus );
       
    58 
       
    59         /**
       
    60         * Destructor.
       
    61         */
       
    62         virtual ~CPushViewMessageOp();
       
    63 
       
    64     public: // Functions from CPushMtmOperation
       
    65 
       
    66         /**
       
    67         * Start or restart the operation.
       
    68         * Current implementation calls Cancel and invokes RunL.
       
    69         * Derived classes may override this.
       
    70         */
       
    71         void StartL();
       
    72 
       
    73     protected: // Constructors
       
    74 
       
    75         /**
       
    76         * Constructor.
       
    77         * @param aSession Message Server Session to be used by this operation.
       
    78         * @param aEntryId Id of entry to operate on.
       
    79         * @param aObserverStatus Observer's status.
       
    80         */
       
    81         CPushViewMessageOp( CMsvSession& aSession, 
       
    82                             TMsvId aEntryId, 
       
    83                             TRequestStatus& aObserverStatus );
       
    84 
       
    85         /**
       
    86         * Symbian OS constructor.
       
    87         */
       
    88         void ConstructL();
       
    89 
       
    90     protected: // New functions
       
    91 
       
    92         /**
       
    93         * Show information note and cancel the operation.
       
    94         */
       
    95         void NotifyAndCancelL( TInt aResId );
       
    96 
       
    97     protected: // Functions from base classes
       
    98 
       
    99         /**
       
   100         * Current implementation calls SignalObserver( KErrNone ).
       
   101         * Derived classes should override this and also should 
       
   102         * call SignalObserver.
       
   103         */
       
   104         void RunL();
       
   105 
       
   106         /**
       
   107         * Cancel protocol implementation.
       
   108         */
       
   109         void DoCancel();
       
   110 
       
   111         /**
       
   112         * Leave handler protocol implementation: it is called when 
       
   113         * RunL leaves. The observer is signaled if a leave occures. 
       
   114         * The leave code is not forwarded to the scheduler.
       
   115         */
       
   116         TInt RunError( TInt aError );
       
   117 
       
   118         /**
       
   119         * Call-back for entry event handling.
       
   120         */
       
   121         void HandleEntryEventL( TMsvEntryEvent aEvent, 
       
   122                                 TAny* aArg1, TAny* aArg2, TAny* aArg3 );
       
   123 
       
   124     protected: // From MAknServerAppExitObserver
       
   125 
       
   126         void HandleServerAppExit( TInt aReason );
       
   127 
       
   128     private: // Data
       
   129 
       
   130         CDocumentHandler* iDocHandler; ///< Owned.
       
   131         TBool iIsCancelled;
       
   132     };
       
   133 
       
   134 #endif // PUSHVIEWMESSAGEOP_H
       
   135 
       
   136 // End of file.