homescreenplugins/videoahlplugin/inc/videoactionhandler.h
changeset 0 96612d01cf9f
equal deleted inserted replaced
-1:000000000000 0:96612d01cf9f
       
     1 /*
       
     2 * Copyright (c) 2008 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:   interface class declaration for action handler plugin dll*
       
    15 */
       
    16 
       
    17 
       
    18 #ifndef C_VIDEO_ACTION_HANDLER_H
       
    19 #define C_VIDEO_ACTION_HANDLER_H
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <ahplugin.h>
       
    23 
       
    24 
       
    25 // FORWARD DECLARATION
       
    26 class CLiwMap;
       
    27 class TLiwVariant;
       
    28 class TVideoPlayerActivationMessage;
       
    29 class CMediatorEventProvider;
       
    30 
       
    31 class CVideoActionHandler : public CAHPlugin
       
    32 	{
       
    33 
       
    34 public:
       
    35 
       
    36 	/**
       
    37 	 * Standard Symbian 2 phase constructor
       
    38 	 */
       
    39 	static CVideoActionHandler* NewL();
       
    40 	
       
    41 	/**
       
    42 	 * Standard Symbian 2 phase constructor
       
    43 	 */
       
    44 	static CVideoActionHandler* NewLC();
       
    45 
       
    46 	/**
       
    47 	 * Standard C++ destructor.
       
    48 	 */
       
    49 	~CVideoActionHandler ();
       
    50 
       
    51 	/**
       
    52 	 * Executes provided action
       
    53 	 *
       
    54 	 * @return status code
       
    55 	 */
       
    56 	TInt ExecuteActionL( const CLiwMap* aMap );
       
    57 private:
       
    58 
       
    59 	/**
       
    60 	 * Standard Symbian 2nd phase constructor.
       
    61 	 */
       
    62 	void ConstructL();
       
    63 
       
    64 private:
       
    65 
       
    66     /**
       
    67      * Method extracts data from map provided and sets 
       
    68      * activation message data based on that
       
    69      * 
       
    70      * @param aMap           map containing data from the matrix menu
       
    71      * @param aActivationMsg messatge struct where data is saved
       
    72      * 
       
    73      * @return KErrNone if message prepared ok, otherwise a systemwide error
       
    74      */
       
    75     TInt PrepareMessageL( const CLiwMap* aMap, TVideoPlayerActivationMessage& aActivationMsg );
       
    76     
       
    77     /**
       
    78      * Method starts a TV & Video -related application providing a startupmessage given,
       
    79      * 
       
    80      * @param TMpxVideoPlayerActivationMessage message for application
       
    81      * 
       
    82      * @return KErrNone if message prepared ok, otherwise a systemwide error
       
    83      */
       
    84     TInt StartAppL( TVideoPlayerActivationMessage& aMessage );
       
    85 	
       
    86     /**
       
    87      * Launch the media settings application
       
    88      *
       
    89      * @param TMpxVideoPlayerActivationMessage message for application
       
    90      *
       
    91      * @return KErrNone if message prepared ok, otherwise a systemwide error
       
    92      */
       
    93     TInt LaunchMediaSettingsL( TVideoPlayerActivationMessage& aMessage );
       
    94        
       
    95     /**
       
    96      * Launch the my videos application (MPX Video Player)
       
    97      * 
       
    98      * @param TMpxVideoPlayerActivationMessage message for application
       
    99      *  
       
   100      * @return KErrNone if message prepared ok, otherwise a systemwide error
       
   101      */
       
   102     TInt LaunchMyVideosL( TVideoPlayerActivationMessage& aMessage );
       
   103        
       
   104     /**
       
   105      * Launch the given application via UID, or bring it to the foregroud with the activation message
       
   106      * 
       
   107      * @param TMpxVideoPlayerActivationMessage message for application
       
   108      * @param TUid appUID The UID3 of the application to be launched
       
   109      * @param TInt aActivationMessage The message to send the process already running
       
   110      * 
       
   111      * @return KErrNone if message prepared ok, otherwise a systemwide error
       
   112      */
       
   113     TInt LaunchMatrixTaskL( TVideoPlayerActivationMessage& aMessage, TUid appUID, TInt aActivationMessage );
       
   114     
       
   115 	/**
       
   116 	 * Extract Variant data. Triest to find a data based on the 
       
   117 	 * aKeyName provided from the map.
       
   118 	 * 
       
   119 	 * @param aMap     map where to search data from
       
   120 	 * @param aVariant variant where data is saved to
       
   121 	 * @param aKeyName Key identification for data search
       
   122 	 * 
       
   123 	 * @return KErrNone if data found and extracted ok.
       
   124 	 */
       
   125 	TInt ExtractVariant( const CLiwMap* aMap,
       
   126 						 TLiwVariant& aVariant,
       
   127 						 const TDesC8& aKeyName );
       
   128 	
       
   129     /**
       
   130      * Sends Mediator event 
       
   131      * 
       
   132      * @param aEvent Event to be sent.
       
   133      */
       
   134 	void SendMediatorEvent( TInt aEvent );
       
   135 	
       
   136     /**
       
   137      * Loads Last watched video data
       
   138      * 
       
   139      * @param TMpxVideoPlayerActivationMessage message to put the data
       
   140      */
       
   141     void LoadLwDataL( TVideoPlayerActivationMessage& aMessage );
       
   142     
       
   143     /**
       
   144      * Tries to bring the video player app to foreground
       
   145      * 
       
   146      *  @return Was the task found and successfully brought to foreground.
       
   147      */    
       
   148     TInt TryBringVideoPlayerToForegroundL();
       
   149 	
       
   150 // DATA
       
   151 	
       
   152     /**
       
   153      * Mediator event provider
       
   154      */
       
   155 	CMediatorEventProvider* iMediatorEventProvider; 
       
   156 
       
   157 	};
       
   158 
       
   159 #endif /* C_VIDEO_ACTION_HANDLER_H */