sl@0: // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #ifndef MMFVIDEOSUBTITLECUSTOMCOMMANDS_H sl@0: #define MMFVIDEOSUBTITLECUSTOMCOMMANDS_H sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: /** sl@0: * Unique identifier for subtitle custom command interface sl@0: * @publishedPartner sl@0: * @prototype sl@0: */ sl@0: const TUid KUidInterfaceMMFVideoPlaySubtitleSupport = {0x10285C9D}; sl@0: sl@0: /** sl@0: * Identifier for subtitle message Crp Ready, used by AviController to indicate sl@0: * the CRP is ready to be drawn. sl@0: * @publishedPartner sl@0: * @prototype sl@0: */ sl@0: const TUid KMMFEventCategoryVideoSubtitleCrpReady = {0x10285C9E}; sl@0: sl@0: /** sl@0: * Class encapsulates all window information required for DevSubtitle to initialize the CRP. sl@0: * @publishedPartner sl@0: * @prototype sl@0: * This class is used to send subtitle window client configuration to controller sl@0: */ sl@0: class TMMFSubtitleWindowConfig sl@0: { sl@0: public: sl@0: /** Window unique identifier */ sl@0: TInt iWindowId; sl@0: sl@0: /** Video window clip rectangle */ sl@0: TRect iWindowClipRect; sl@0: sl@0: /** Video window display mode */ sl@0: TDisplayMode iDisplayMode; sl@0: sl@0: /** Video rotation angle */ sl@0: TVideoRotation iRotation; sl@0: }; sl@0: sl@0: /** sl@0: * @publishedPartner sl@0: * @prototype sl@0: * sl@0: * Mixin class for subtitle custom commands implemented by the controller. The custom sl@0: * command parser calls methods in this class to deliver the requests to the sl@0: * controller. sl@0: */ sl@0: class MMMFVideoPlaySubtitleSupportCustomCommandImplementor sl@0: { sl@0: public: sl@0: /** sl@0: * Gets the CRP parameters associated with a display sl@0: * sl@0: * @param aWindowId Unique identifier of the window. sl@0: * @param aId Return the CRP id associated with the given display id sl@0: * @param aCrpRect Return the subtitle region for drawing the CRP sl@0: */ sl@0: virtual void MvpsusGetCrpParametersL(TInt aWindowId, TWsGraphicId& aId, TRect& aCrpRect) = 0; sl@0: sl@0: /** sl@0: * Adds subtitle configuration data for a window. sl@0: * sl@0: * @param aConfig Subtitle configuration data for a window. sl@0: */ sl@0: virtual void MvpsusAddSubtitleConfigL(const TMMFSubtitleWindowConfig& aConfig) = 0; sl@0: sl@0: /** sl@0: * Removes the subtitle configuration data associated with the given window. sl@0: * sl@0: * @param aWindowId Unique identifier of the window associated with the sl@0: * configuration data being removed. sl@0: */ sl@0: virtual void MvpsusRemoveSubtitleConfigL(TInt aWindowId) = 0; sl@0: sl@0: /** sl@0: * Reconfigures the subtitle configuration. sl@0: * sl@0: * @param aConfig Subtitle configuration data for a window. sl@0: */ sl@0: virtual void MvpsusUpdateSubtitleConfigL(const TMMFSubtitleWindowConfig& aConfig) = 0; sl@0: sl@0: /** sl@0: * Checks if subtitles are available in the current video stream. sl@0: * sl@0: * @param aAvailable When this method returns, this is set the ETrue if the sl@0: * current video stream subtitles. sl@0: * @leave KErrNotSupported if the controller does not support subtitles. Otherwise sl@0: * another system-wide error code. sl@0: */ sl@0: virtual void MvpsusGetSubtitlesAvailableL(TBool& aAvailable) = 0; sl@0: sl@0: /** sl@0: * Disables subtitles during video playback. sl@0: * sl@0: * @leave System wide error code sl@0: */ sl@0: virtual void MvpsusDisableSubtitlesL() = 0; sl@0: sl@0: /** sl@0: * Enables subtitles during video playback. sl@0: * sl@0: * @leave KErrNotSupported if subtitles are not supported sl@0: * @leave KErrNotFound if subtitle data is not found sl@0: * @leave Otherwise leaves with any of the system wide error codes. sl@0: */ sl@0: virtual void MvpsusEnableSubtitlesL() = 0; sl@0: sl@0: /** sl@0: * Gets the current subtitle language sl@0: * sl@0: * @param aLanguage When this method returns, this is set the the current subtitle language. sl@0: * @leave KErrNotSupported The enabled subtitle does not contain language sl@0: * information. sl@0: * @leave Otherwise leaves with any of the system wide error codes. sl@0: */ sl@0: virtual void MvpsusGetSubtitleLanguageL(TLanguage& aLanguage) = 0; sl@0: sl@0: /** sl@0: * Gets array of all supported languages that are available in the current sl@0: * video player. sl@0: * sl@0: * @param aAvailable When this function returns, this array will hold the sl@0: * supported languages. sl@0: * @leave KErrNotSupported The enabled subtitle does not contain language sl@0: * information sl@0: * @leave Otherwise leaves with any of the system wide error codes. sl@0: */ sl@0: virtual void MvpsusGetSupportedSubtitleLanguagesL(RArray& aAvailable) = 0; sl@0: sl@0: /** sl@0: * Sets the current subtitle language sl@0: * sl@0: * @param aLanguage Language to be used for subtitle stream. sl@0: * @leave KErrNotSupported The enabled subtitle does not support the requested sl@0: * language. sl@0: * @leave Otherwise leaves with any of the system wide error codes. sl@0: */ sl@0: virtual void MvpsusSetSubtitleLanguageL(TLanguage aLanguage) = 0; sl@0: }; sl@0: sl@0: /** sl@0: * @publishedPartner sl@0: * @prototype sl@0: * sl@0: * Custom command parser class to be used by controller plugins wishing to support sl@0: * custom subtitle commands in a video play controller. sl@0: * sl@0: * The controller plugin must be derived from sl@0: * MMMFVideoPlaySubtitleSupportCustomCommandImplementor to use this class. The sl@0: * controller plugin should create an object of this type and add it to the list of sl@0: * custom command parsers in the controller framework. sl@0: * sl@0: * @see MMMFVideoPlaySubtitleSupportCustomCommandImplementor sl@0: * @see RMMFVideoPlaySubtitleSupportCustomCommands sl@0: */ sl@0: class CMMFVideoPlaySubtitleSupportCustomCommandParser : public CMMFCustomCommandParserBase sl@0: { sl@0: public: sl@0: IMPORT_C static CMMFVideoPlaySubtitleSupportCustomCommandParser* NewL(MMMFVideoPlaySubtitleSupportCustomCommandImplementor& aImplementor); sl@0: IMPORT_C ~CMMFVideoPlaySubtitleSupportCustomCommandParser(); sl@0: void HandleRequest(TMMFMessage& aMessage); sl@0: sl@0: private: sl@0: CMMFVideoPlaySubtitleSupportCustomCommandParser(MMMFVideoPlaySubtitleSupportCustomCommandImplementor& aImplementor); sl@0: sl@0: void DoHandleRequestL(TMMFMessage& aMessage); sl@0: sl@0: void DoAddSubtitleConfigL(TMMFMessage& aMessage); sl@0: void DoRemoveSubtitleConfigL(TMMFMessage& aMessage); sl@0: void DoUpdateSubtitleConfigL(TMMFMessage& aMessage); sl@0: void DoGetSubtitlesAvailableL(TMMFMessage& aMessage); sl@0: void DoDisableSubtitlesL(TMMFMessage& aMessage); sl@0: void DoEnableSubtitlesL(TMMFMessage& aMessage); sl@0: void DoGetSupportedLanguagesDataL(TMMFMessage& aMessage); sl@0: void DoGetSupportedLanguagesCountL(TMMFMessage& aMessage); sl@0: void DoGetSubtitleLanguageL(TMMFMessage& aMessage); sl@0: void DoSetSubtitleLanguageL(TMMFMessage& aMessage); sl@0: void DoGetCrpParametersL(TMMFMessage& aMessage); sl@0: sl@0: private: sl@0: MMMFVideoPlaySubtitleSupportCustomCommandImplementor& iImplementor; sl@0: RArray iAvailableLanguages; sl@0: }; sl@0: sl@0: /** sl@0: * @publishedPartner sl@0: * @prototype sl@0: * sl@0: * Client class to access functionality specific to a subtitle supported playback sl@0: * controller. The class uses the custom command function of the controller plugin, sl@0: * and removes the necessity for the client to formulate the custom commands. sl@0: */ sl@0: class RMMFVideoPlaySubtitleSupportCustomCommands : public RMMFCustomCommandsBase sl@0: { sl@0: public: sl@0: sl@0: IMPORT_C RMMFVideoPlaySubtitleSupportCustomCommands(RMMFController& aController); sl@0: IMPORT_C TInt AddSubtitleConfig(const TMMFSubtitleWindowConfig& aConfig); sl@0: IMPORT_C TInt RemoveSubtitleConfig(TInt aWindowId); sl@0: IMPORT_C TInt UpdateSubtitleConfig(const TMMFSubtitleWindowConfig& aConfig); sl@0: IMPORT_C TInt GetSubtitlesAvailable(TBool& aAvailable); sl@0: IMPORT_C TInt DisableSubtitles(); sl@0: IMPORT_C TInt EnableSubtitles(); sl@0: IMPORT_C TInt GetCrpParameters(TInt aWindowId, TWsGraphicId& aId, TRect& aCrpRect); sl@0: IMPORT_C TInt GetSubtitleLanguage(TLanguage& aLanguage); sl@0: IMPORT_C void GetSupportedSubtitleLanguagesL(RArray& aSubtitleLanguages); sl@0: IMPORT_C TInt SetSubtitleLanguage(TLanguage aSubtitleLanguage); sl@0: }; sl@0: sl@0: #endif // MMFVIDEOSUBTITLECUSTOMCOMMANDS_H