menucontentsrv/handlerinc/menuapphandler.h
changeset 0 79c6a41cd166
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     1 /*
       
     2 * Copyright (c) 2009 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 *
       
    16 */
       
    17 
       
    18 #ifndef __MENUAPPHANDLER_H__
       
    19 #define __MENUAPPHANDLER_H__
       
    20 
       
    21 #include "mcsmenuhandlerplugin.h"
       
    22 
       
    23 #include <e32base.h>
       
    24 
       
    25 class CEikonEnv;
       
    26 
       
    27 /**
       
    28 * Handler for menu items of type "menu:app".
       
    29 */
       
    30 NONSHARABLE_CLASS( CMenuAppHandler ): public CMenuHandlerPlugin
       
    31     {
       
    32 
       
    33 public:     // construction
       
    34 
       
    35     /**
       
    36     * Destructor.
       
    37     */
       
    38     virtual ~CMenuAppHandler();
       
    39 
       
    40     /**
       
    41     * Two-phased constructor. Leaves on failure.
       
    42     * @param aMenu Menu.
       
    43     * @return The constructed object.
       
    44     */
       
    45     static CMenuAppHandler* NewL( RMenu &aMenu );
       
    46 
       
    47 protected:  // construction
       
    48 
       
    49     /**
       
    50     * Constructor.
       
    51     * @param aMenu Menu.
       
    52     */
       
    53     CMenuAppHandler( RMenu &aMenu );
       
    54 
       
    55     /**
       
    56     * Second-phase constructor.
       
    57     */
       
    58     void ConstructL();
       
    59 
       
    60 public:     // from CMenuHandler
       
    61 
       
    62     /**
       
    63     * Query support for item type.
       
    64     * @param aType Type.
       
    65     * @return ETrue if handler supports this type, EFalse otherwise.
       
    66     */
       
    67     TBool SupportsType( const TDesC& aType );
       
    68 
       
    69     /**
       
    70     * Handle command.
       
    71     * @param aItem Item of supported type.
       
    72     * @param aCommand Command.
       
    73     * @param aParams. Command parameters.
       
    74     * @param aStatus Observer request status. When the operation completes,
       
    75     * this status will be completed with the resulting error code.
       
    76     * @return Asynchronous operation. Owned by the caller.
       
    77     */
       
    78     CMenuOperation* HandleCommandL(
       
    79         CMenuItem& aItem,
       
    80         const TDesC8& aCommand,
       
    81         const TDesC8& aParams,
       
    82         TRequestStatus& aStatus );
       
    83         
       
    84 private:    // internal
       
    85 
       
    86     void LaunchApplicationL( const TUid aUid, const TDesC8 &aParam, TInt aViewId );
       
    87 
       
    88 private:    // data
       
    89     
       
    90     CEikonEnv* iEikEnv;
       
    91     
       
    92     };
       
    93 
       
    94 #endif // __MENUAPPHANDLER_H__