idlefw/plugins/mcsplugin/handler/inc/mcsplugincompletedoperation.h
branchRCL_3
changeset 30 a5a39a295112
parent 0 79c6a41cd166
equal deleted inserted replaced
29:0efa10d348c0 30:a5a39a295112
       
     1 /*
       
     2 * Copyright (c) 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:  Definition of completed menu operation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __MCSPLUGINCOMPLETEDOPERATION_H__
       
    20 #define __MCSPLUGINCOMPLETEDOPERATION_H__
       
    21 
       
    22 #include <mcsmenuoperation.h>
       
    23 #include <e32base.h>
       
    24 
       
    25 class RMenu;
       
    26 
       
    27 /**
       
    28  *  @ingroup group_mcsplugin
       
    29  *
       
    30  *  Completed CMenuOperation.
       
    31  *  Utility class to wrap synchronous functionality as asynchronous menu
       
    32  *  operation. Used in CMenuHandlers and other menu operations where the
       
    33  *  API requires an asynchronous operation but the concrete functionality
       
    34  *  is synchronous and the result is already available.
       
    35  *  @lib mcsmenu.lib
       
    36  *  @since S60 v9.1
       
    37  */
       
    38 NONSHARABLE_CLASS( CMCSPluginCompletedOperation ): public CMenuOperation
       
    39     {
       
    40 
       
    41 public:
       
    42 
       
    43     /**
       
    44      * Destructor.
       
    45      */
       
    46     virtual ~CMCSPluginCompletedOperation();
       
    47 
       
    48     /**
       
    49     * Two-phased constructor. Constructs an operation that is already complete.
       
    50     * @param aMenu Menu.
       
    51     * @param aPriority Active Object priority.
       
    52     * @param aStatus Observer request status. Completes with aError.
       
    53     * @param aError Completion code (result of the operation).
       
    54     * @return Asynchronous operation. Owned by the caller.
       
    55     */
       
    56     static CMCSPluginCompletedOperation* NewL(
       
    57         RMenu &aMenu,
       
    58         TInt aPriority,
       
    59         TRequestStatus &aObserverStatus,
       
    60         TInt aError );
       
    61 
       
    62 private:
       
    63 
       
    64     /**
       
    65     * Constructor
       
    66     * @param aMenu Menu.
       
    67     * @param aPriority Active Object priority.
       
    68     * @param aStatus Observer request status.
       
    69     */
       
    70     CMCSPluginCompletedOperation(
       
    71         RMenu &aMenu,
       
    72         TInt aPriority,
       
    73         TRequestStatus &aObserverStatus );
       
    74 
       
    75     /**
       
    76     * Report completion.
       
    77     * @param aError Completion code (result of the operation).
       
    78     */
       
    79     void ReportCompletion( TInt aError );
       
    80 
       
    81 // from base class CActive
       
    82 
       
    83     /**
       
    84     * Report completion to observer.
       
    85     */
       
    86     void RunL();
       
    87 
       
    88     /**
       
    89     * Cancel object (never called).
       
    90     */
       
    91     void DoCancel();
       
    92 
       
    93     /**
       
    94     * Handle error.
       
    95     * @param aError Error code.
       
    96     * @return KErrNone.
       
    97     */
       
    98     TInt RunError( TInt aError );
       
    99 
       
   100     };
       
   101 
       
   102 #endif // __MCSPLUGINCOMPLETEDOPERATION_H__