videocollection/hgmyvideos/inc/vcxhgmyvideosaiwmenuhandler.h
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     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 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:  A class to manage AIW provided menu items*
       
    15 */
       
    16 
       
    17 
       
    18 #ifndef VCXHGMYVIDEOSAIWMENUHANDLER_H
       
    19 #define VCXHGMYVIDEOSAIWMENUHANDLER_H
       
    20 
       
    21 #include <e32std.h>
       
    22 
       
    23 class CAiwServiceHandler;
       
    24 class CEikMenuPane;
       
    25 class CMediaRecognizer;
       
    26 class CAiwGenericParamList;
       
    27 
       
    28 /**
       
    29  *  A class to manage AIW provided menu items
       
    30  *
       
    31  */
       
    32 NONSHARABLE_CLASS(CHgMyVideosAiwMenuHandler) : public CBase
       
    33     {
       
    34     public:
       
    35 
       
    36         CHgMyVideosAiwMenuHandler();
       
    37 
       
    38         virtual ~CHgMyVideosAiwMenuHandler();
       
    39 
       
    40         /**
       
    41          * Attach AIW menu items to a menu pane.
       
    42          *
       
    43          * @param aMenuPaneId    Menu pane ID where to add AIW menu items
       
    44          */
       
    45         void AttachMenuL( TInt aMenuPaneId );
       
    46 
       
    47         /**
       
    48          * Detach AIW menu items from a menu pane.
       
    49          *
       
    50          * @param aMenuPaneId    Menu pane ID where to add AIW menu items
       
    51          */
       
    52         void DetachMenu( TInt aMenuPaneId );
       
    53 
       
    54         /**
       
    55          * Pass a submenu to AIW for dynamic initialization.
       
    56          *
       
    57          * @param aMenuPane      Menu pane where to add AIW menu items
       
    58          * @return               ETrue if this menu was handled by AIW
       
    59          */
       
    60         TBool TryHandleSubmenuL( CEikMenuPane* aMenuPane );
       
    61 
       
    62         /**
       
    63          * Initialize an AIW provided menu pane.
       
    64          *
       
    65          * @param aResourceId    Resource ID for this menu
       
    66          * @param aMenuPane      Menu pane ID where to add AIW menu items
       
    67          * @param aPath          Full file path
       
    68          * @param aMimeType      MIME type or KNullDesC for autodetect
       
    69          */
       
    70         void InitializeMenuPaneL(
       
    71             TInt aResourceId,
       
    72             CEikMenuPane* aMenuPane,
       
    73             const TDesC& aPath,
       
    74             const TDesC& aMimeType );
       
    75 
       
    76         /**
       
    77          * Check if a given command ID is for an AIW command
       
    78          *
       
    79          * @param aCommand       Command ID
       
    80          * @return               ETrue if this is an AIW command
       
    81          */
       
    82         TBool IsAiwCommand( TInt aCommand );
       
    83 
       
    84         /**
       
    85          * Execute an AIW command
       
    86          *
       
    87          * @param aCommand       Command ID
       
    88          * @param aPath          Full file path
       
    89          * @param aMimeType      MIME type for track or KNullDesC for autodetect
       
    90          */
       
    91         void HandleAiwCommandL(
       
    92             TInt aCommand,
       
    93             const TDesC& aPath,
       
    94             const TDesC& aMimeType );
       
    95 
       
    96         /**
       
    97         *  Closes any potential open AIW menus
       
    98         *
       
    99         */
       
   100         void CloseOpenAiwMenuL();
       
   101         
       
   102         /**
       
   103          *  Verify if AIW menu is active
       
   104          *
       
   105          * @return ETrue if AIW menu is active or EFalse
       
   106          */
       
   107         TBool IsMenuActive();        
       
   108 
       
   109     private:
       
   110 
       
   111         /**
       
   112         * Fill file path and MIME type generic parameters for AIW.
       
   113         */
       
   114         void FillAiwParamsL(
       
   115             CAiwGenericParamList& aAiwParamsList,
       
   116             const TDesC& aPath,
       
   117             const TDesC& aMimeType );
       
   118 
       
   119     private: // data
       
   120 
       
   121         /**
       
   122          * AIW service handler implementation.
       
   123          * Own.
       
   124          */
       
   125         CAiwServiceHandler* iAiwServiceHandler;
       
   126 
       
   127         /**
       
   128          * Media recognizer for autodetecting MIME types.
       
   129          * Own.
       
   130          */
       
   131         CMediaRecognizer* iMediaRecognizer;
       
   132 
       
   133         /**
       
   134          * Flag for active AIW menu, ETrue if active or EFalse if not
       
   135          * 
       
   136          */
       
   137         TBool     iMenuActive;
       
   138         
       
   139         /**
       
   140          * Active AIW command ID when executing AIW command
       
   141          */
       
   142         TInt      iCommand;
       
   143         
       
   144         /**
       
   145          * AIW parameter filepath string
       
   146          * 
       
   147          */
       
   148         HBufC*    iPath;
       
   149         
       
   150         /**
       
   151          * AIW parameter mimetype string
       
   152          * 
       
   153          */
       
   154         HBufC*    iMimeType;
       
   155     };
       
   156 
       
   157 #endif // VCXHGMYVIDEOSAIWMENUHANDLER_H