os/mm/mmlibs/mmfw/inc/mmf/ControllerFramework/mmfvideosubtitlecustomcommands.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mmlibs/mmfw/inc/mmf/ControllerFramework/mmfvideosubtitlecustomcommands.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,231 @@
     1.4 +// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef MMFVIDEOSUBTITLECUSTOMCOMMANDS_H
    1.20 +#define MMFVIDEOSUBTITLECUSTOMCOMMANDS_H
    1.21 +
    1.22 +#include <mmf/common/mmfcontroller.h>
    1.23 +#include <mmf/common/mmfvideo.h>
    1.24 +#include <gdi.h>
    1.25 +#include <w32std.h>
    1.26 +
    1.27 +/**
    1.28 + * Unique identifier for subtitle custom command interface
    1.29 + * @publishedPartner
    1.30 + * @prototype
    1.31 + */
    1.32 +const TUid KUidInterfaceMMFVideoPlaySubtitleSupport = {0x10285C9D};
    1.33 +
    1.34 +/**
    1.35 + * Identifier for subtitle message Crp Ready, used by AviController to indicate 
    1.36 + * the CRP is ready to be drawn.
    1.37 + * @publishedPartner
    1.38 + * @prototype
    1.39 + */
    1.40 +const TUid KMMFEventCategoryVideoSubtitleCrpReady = {0x10285C9E};
    1.41 +
    1.42 +/**
    1.43 + * Class encapsulates all window information required for DevSubtitle to initialize the CRP.
    1.44 + * @publishedPartner
    1.45 + * @prototype
    1.46 + * This class is used to send subtitle window client configuration to controller
    1.47 + */
    1.48 +class TMMFSubtitleWindowConfig
    1.49 +	{
    1.50 +public:
    1.51 +	/** Window unique identifier */
    1.52 +	TInt iWindowId; 
    1.53 +
    1.54 +	/** Video window clip rectangle */
    1.55 +	TRect iWindowClipRect;
    1.56 +
    1.57 +	/** Video window display mode */
    1.58 +	TDisplayMode iDisplayMode;
    1.59 +	
    1.60 +	/** Video rotation angle */
    1.61 +	TVideoRotation iRotation;
    1.62 +	};
    1.63 +
    1.64 +/**
    1.65 + * @publishedPartner 
    1.66 + * @prototype
    1.67 + * 
    1.68 + * Mixin class for subtitle custom commands implemented by the controller. The custom
    1.69 + * command parser calls methods in this class to deliver the requests to the
    1.70 + * controller.
    1.71 + */
    1.72 +class MMMFVideoPlaySubtitleSupportCustomCommandImplementor
    1.73 +	{
    1.74 +public:
    1.75 +	/**
    1.76 +	 * Gets the CRP parameters associated with a display
    1.77 +	 * 
    1.78 +	 * @param aWindowId Unique identifier of the window.
    1.79 +	 * @param aId Return the CRP id associated with the given display id
    1.80 +	 * @param aCrpRect Return the subtitle region for drawing the CRP
    1.81 +	 */
    1.82 +	virtual void MvpsusGetCrpParametersL(TInt aWindowId, TWsGraphicId& aId, TRect& aCrpRect) = 0;
    1.83 +	
    1.84 +	/**
    1.85 +	 * Adds subtitle configuration data for a window.
    1.86 +	 * 
    1.87 +	 * @param aConfig Subtitle configuration data for a window.
    1.88 +	 */
    1.89 +	virtual void MvpsusAddSubtitleConfigL(const TMMFSubtitleWindowConfig& aConfig) = 0;
    1.90 +	
    1.91 +	/**
    1.92 +	 * Removes the subtitle configuration data associated with the given window.
    1.93 +	 * 
    1.94 +	 * @param aWindowId Unique identifier of the window associated with the 
    1.95 +	 * configuration data being removed.
    1.96 +	 */
    1.97 +	virtual void MvpsusRemoveSubtitleConfigL(TInt aWindowId) = 0;
    1.98 +	
    1.99 +	/** 
   1.100 +	 * Reconfigures the subtitle configuration.
   1.101 +	 * 
   1.102 +	 * @param aConfig Subtitle configuration data for a window.
   1.103 +	 */
   1.104 +	virtual void MvpsusUpdateSubtitleConfigL(const TMMFSubtitleWindowConfig& aConfig) = 0;
   1.105 +	
   1.106 +	/** 
   1.107 +	 * Checks if subtitles are available in the current video stream.  
   1.108 +	 * 
   1.109 +	 * @param aAvailable When this method returns, this is set the ETrue if the 
   1.110 +	 * current video stream subtitles.  
   1.111 +	 * @leave KErrNotSupported if the controller does not support subtitles.  Otherwise
   1.112 +	 * another system-wide error code.
   1.113 +	 */
   1.114 +	virtual void MvpsusGetSubtitlesAvailableL(TBool& aAvailable) = 0;
   1.115 +	
   1.116 +	/**
   1.117 +	 * Disables subtitles during video playback.
   1.118 +	 * 
   1.119 +	 * @leave System wide error code
   1.120 +	 */
   1.121 +	virtual void MvpsusDisableSubtitlesL() = 0;
   1.122 +	
   1.123 +	/**
   1.124 +	 * Enables subtitles during video playback.
   1.125 +	 * 
   1.126 +	 * @leave KErrNotSupported if subtitles are not supported
   1.127 +	 * @leave KErrNotFound if subtitle data is not found
   1.128 +	 * @leave Otherwise leaves with any of the system wide error codes.
   1.129 +	 */
   1.130 +	virtual void MvpsusEnableSubtitlesL() = 0;
   1.131 +	
   1.132 +	/**
   1.133 +	 * Gets the current subtitle language
   1.134 +	 * 
   1.135 +	 * @param aLanguage When this method returns, this is set the the current subtitle language.
   1.136 +	 * @leave KErrNotSupported The enabled subtitle does not contain language
   1.137 +	 * information.
   1.138 +	 * @leave Otherwise leaves with any of the system wide error codes.
   1.139 +	 */
   1.140 +	virtual void MvpsusGetSubtitleLanguageL(TLanguage& aLanguage) = 0;
   1.141 +	
   1.142 +	/**
   1.143 +	 * Gets array of all supported languages that are available in the current 
   1.144 +	 * video player.
   1.145 +	 * 
   1.146 +	 * @param aAvailable When this function returns, this array will hold the
   1.147 +	 * supported languages.
   1.148 +	 * @leave KErrNotSupported The enabled subtitle does not contain language 
   1.149 +	 * information
   1.150 +	 * @leave Otherwise leaves with any of the system wide error codes.
   1.151 +	 */
   1.152 +	virtual void MvpsusGetSupportedSubtitleLanguagesL(RArray<TLanguage>& aAvailable) = 0;
   1.153 +	
   1.154 +	/**
   1.155 +	 * Sets the current subtitle language
   1.156 +	 * 
   1.157 +	 * @param aLanguage Language to be used for subtitle stream.
   1.158 +	 * @leave KErrNotSupported The enabled subtitle does not support the requested 
   1.159 +	 * language.
   1.160 +	 * @leave Otherwise leaves with any of the system wide error codes.
   1.161 +	 */
   1.162 +	virtual void MvpsusSetSubtitleLanguageL(TLanguage aLanguage) = 0;
   1.163 +	};
   1.164 +
   1.165 +/**
   1.166 + * @publishedPartner 
   1.167 + * @prototype
   1.168 + * 
   1.169 + * Custom command parser class to be used by controller plugins wishing to support 
   1.170 + * custom subtitle commands in a video play controller.
   1.171 + * 
   1.172 + * The controller plugin must be derived from 
   1.173 + * MMMFVideoPlaySubtitleSupportCustomCommandImplementor to use this class. The 
   1.174 + * controller plugin should create an object of this type and add it to the list of 
   1.175 + * custom command parsers in the controller framework.
   1.176 + * 
   1.177 + * @see MMMFVideoPlaySubtitleSupportCustomCommandImplementor
   1.178 + * @see RMMFVideoPlaySubtitleSupportCustomCommands
   1.179 + */
   1.180 +class CMMFVideoPlaySubtitleSupportCustomCommandParser : public CMMFCustomCommandParserBase
   1.181 +	{
   1.182 +public:
   1.183 +	IMPORT_C static CMMFVideoPlaySubtitleSupportCustomCommandParser* NewL(MMMFVideoPlaySubtitleSupportCustomCommandImplementor& aImplementor);
   1.184 +	IMPORT_C ~CMMFVideoPlaySubtitleSupportCustomCommandParser();
   1.185 +	void HandleRequest(TMMFMessage& aMessage);
   1.186 +	
   1.187 +private:
   1.188 +	CMMFVideoPlaySubtitleSupportCustomCommandParser(MMMFVideoPlaySubtitleSupportCustomCommandImplementor& aImplementor);
   1.189 +	
   1.190 +	void DoHandleRequestL(TMMFMessage& aMessage);
   1.191 +	
   1.192 +	void DoAddSubtitleConfigL(TMMFMessage& aMessage);
   1.193 +	void DoRemoveSubtitleConfigL(TMMFMessage& aMessage);
   1.194 +	void DoUpdateSubtitleConfigL(TMMFMessage& aMessage);
   1.195 +	void DoGetSubtitlesAvailableL(TMMFMessage& aMessage);
   1.196 +	void DoDisableSubtitlesL(TMMFMessage& aMessage);
   1.197 +	void DoEnableSubtitlesL(TMMFMessage& aMessage);
   1.198 +	void DoGetSupportedLanguagesDataL(TMMFMessage& aMessage);
   1.199 +	void DoGetSupportedLanguagesCountL(TMMFMessage& aMessage);
   1.200 +	void DoGetSubtitleLanguageL(TMMFMessage& aMessage);
   1.201 +	void DoSetSubtitleLanguageL(TMMFMessage& aMessage);
   1.202 +	void DoGetCrpParametersL(TMMFMessage& aMessage);
   1.203 +
   1.204 +private:
   1.205 +	MMMFVideoPlaySubtitleSupportCustomCommandImplementor& iImplementor;
   1.206 +	RArray<TLanguage> iAvailableLanguages;
   1.207 +	};
   1.208 +
   1.209 +/**
   1.210 + * @publishedPartner 
   1.211 + * @prototype
   1.212 + * 
   1.213 + * Client class to access functionality specific to a subtitle supported playback 
   1.214 + * controller. The class uses the custom command function of the controller plugin, 
   1.215 + * and removes the necessity for the client to formulate the custom commands.
   1.216 + */
   1.217 +class RMMFVideoPlaySubtitleSupportCustomCommands : public RMMFCustomCommandsBase
   1.218 +	{
   1.219 +public:
   1.220 +
   1.221 +	IMPORT_C RMMFVideoPlaySubtitleSupportCustomCommands(RMMFController& aController);
   1.222 +	IMPORT_C TInt AddSubtitleConfig(const TMMFSubtitleWindowConfig& aConfig);
   1.223 +	IMPORT_C TInt RemoveSubtitleConfig(TInt aWindowId);
   1.224 +	IMPORT_C TInt UpdateSubtitleConfig(const TMMFSubtitleWindowConfig& aConfig);
   1.225 +	IMPORT_C TInt GetSubtitlesAvailable(TBool& aAvailable);
   1.226 +	IMPORT_C TInt DisableSubtitles();
   1.227 +	IMPORT_C TInt EnableSubtitles();
   1.228 +	IMPORT_C TInt GetCrpParameters(TInt aWindowId, TWsGraphicId& aId, TRect& aCrpRect);
   1.229 +	IMPORT_C TInt GetSubtitleLanguage(TLanguage& aLanguage);
   1.230 +	IMPORT_C void GetSupportedSubtitleLanguagesL(RArray<TLanguage>& aSubtitleLanguages);
   1.231 +	IMPORT_C TInt SetSubtitleLanguage(TLanguage aSubtitleLanguage);
   1.232 +	};
   1.233 +
   1.234 +#endif // MMFVIDEOSUBTITLECUSTOMCOMMANDS_H