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