First public contribution.
1 // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef MMFVIDEOSUBTITLECUSTOMCOMMANDS_H
17 #define MMFVIDEOSUBTITLECUSTOMCOMMANDS_H
19 #include <mmf/common/mmfcontroller.h>
20 #include <mmf/common/mmfvideo.h>
25 * Unique identifier for subtitle custom command interface
29 const TUid KUidInterfaceMMFVideoPlaySubtitleSupport = {0x10285C9D};
32 * Identifier for subtitle message Crp Ready, used by AviController to indicate
33 * the CRP is ready to be drawn.
37 const TUid KMMFEventCategoryVideoSubtitleCrpReady = {0x10285C9E};
40 * Class encapsulates all window information required for DevSubtitle to initialize the CRP.
43 * This class is used to send subtitle window client configuration to controller
45 class TMMFSubtitleWindowConfig
48 /** Window unique identifier */
51 /** Video window clip rectangle */
52 TRect iWindowClipRect;
54 /** Video window display mode */
55 TDisplayMode iDisplayMode;
57 /** Video rotation angle */
58 TVideoRotation iRotation;
65 * Mixin class for subtitle custom commands implemented by the controller. The custom
66 * command parser calls methods in this class to deliver the requests to the
69 class MMMFVideoPlaySubtitleSupportCustomCommandImplementor
73 * Gets the CRP parameters associated with a display
75 * @param aWindowId Unique identifier of the window.
76 * @param aId Return the CRP id associated with the given display id
77 * @param aCrpRect Return the subtitle region for drawing the CRP
79 virtual void MvpsusGetCrpParametersL(TInt aWindowId, TWsGraphicId& aId, TRect& aCrpRect) = 0;
82 * Adds subtitle configuration data for a window.
84 * @param aConfig Subtitle configuration data for a window.
86 virtual void MvpsusAddSubtitleConfigL(const TMMFSubtitleWindowConfig& aConfig) = 0;
89 * Removes the subtitle configuration data associated with the given window.
91 * @param aWindowId Unique identifier of the window associated with the
92 * configuration data being removed.
94 virtual void MvpsusRemoveSubtitleConfigL(TInt aWindowId) = 0;
97 * Reconfigures the subtitle configuration.
99 * @param aConfig Subtitle configuration data for a window.
101 virtual void MvpsusUpdateSubtitleConfigL(const TMMFSubtitleWindowConfig& aConfig) = 0;
104 * Checks if subtitles are available in the current video stream.
106 * @param aAvailable When this method returns, this is set the ETrue if the
107 * current video stream subtitles.
108 * @leave KErrNotSupported if the controller does not support subtitles. Otherwise
109 * another system-wide error code.
111 virtual void MvpsusGetSubtitlesAvailableL(TBool& aAvailable) = 0;
114 * Disables subtitles during video playback.
116 * @leave System wide error code
118 virtual void MvpsusDisableSubtitlesL() = 0;
121 * Enables subtitles during video playback.
123 * @leave KErrNotSupported if subtitles are not supported
124 * @leave KErrNotFound if subtitle data is not found
125 * @leave Otherwise leaves with any of the system wide error codes.
127 virtual void MvpsusEnableSubtitlesL() = 0;
130 * Gets the current subtitle language
132 * @param aLanguage When this method returns, this is set the the current subtitle language.
133 * @leave KErrNotSupported The enabled subtitle does not contain language
135 * @leave Otherwise leaves with any of the system wide error codes.
137 virtual void MvpsusGetSubtitleLanguageL(TLanguage& aLanguage) = 0;
140 * Gets array of all supported languages that are available in the current
143 * @param aAvailable When this function returns, this array will hold the
144 * supported languages.
145 * @leave KErrNotSupported The enabled subtitle does not contain language
147 * @leave Otherwise leaves with any of the system wide error codes.
149 virtual void MvpsusGetSupportedSubtitleLanguagesL(RArray<TLanguage>& aAvailable) = 0;
152 * Sets the current subtitle language
154 * @param aLanguage Language to be used for subtitle stream.
155 * @leave KErrNotSupported The enabled subtitle does not support the requested
157 * @leave Otherwise leaves with any of the system wide error codes.
159 virtual void MvpsusSetSubtitleLanguageL(TLanguage aLanguage) = 0;
166 * Custom command parser class to be used by controller plugins wishing to support
167 * custom subtitle commands in a video play controller.
169 * The controller plugin must be derived from
170 * MMMFVideoPlaySubtitleSupportCustomCommandImplementor to use this class. The
171 * controller plugin should create an object of this type and add it to the list of
172 * custom command parsers in the controller framework.
174 * @see MMMFVideoPlaySubtitleSupportCustomCommandImplementor
175 * @see RMMFVideoPlaySubtitleSupportCustomCommands
177 class CMMFVideoPlaySubtitleSupportCustomCommandParser : public CMMFCustomCommandParserBase
180 IMPORT_C static CMMFVideoPlaySubtitleSupportCustomCommandParser* NewL(MMMFVideoPlaySubtitleSupportCustomCommandImplementor& aImplementor);
181 IMPORT_C ~CMMFVideoPlaySubtitleSupportCustomCommandParser();
182 void HandleRequest(TMMFMessage& aMessage);
185 CMMFVideoPlaySubtitleSupportCustomCommandParser(MMMFVideoPlaySubtitleSupportCustomCommandImplementor& aImplementor);
187 void DoHandleRequestL(TMMFMessage& aMessage);
189 void DoAddSubtitleConfigL(TMMFMessage& aMessage);
190 void DoRemoveSubtitleConfigL(TMMFMessage& aMessage);
191 void DoUpdateSubtitleConfigL(TMMFMessage& aMessage);
192 void DoGetSubtitlesAvailableL(TMMFMessage& aMessage);
193 void DoDisableSubtitlesL(TMMFMessage& aMessage);
194 void DoEnableSubtitlesL(TMMFMessage& aMessage);
195 void DoGetSupportedLanguagesDataL(TMMFMessage& aMessage);
196 void DoGetSupportedLanguagesCountL(TMMFMessage& aMessage);
197 void DoGetSubtitleLanguageL(TMMFMessage& aMessage);
198 void DoSetSubtitleLanguageL(TMMFMessage& aMessage);
199 void DoGetCrpParametersL(TMMFMessage& aMessage);
202 MMMFVideoPlaySubtitleSupportCustomCommandImplementor& iImplementor;
203 RArray<TLanguage> iAvailableLanguages;
210 * Client class to access functionality specific to a subtitle supported playback
211 * controller. The class uses the custom command function of the controller plugin,
212 * and removes the necessity for the client to formulate the custom commands.
214 class RMMFVideoPlaySubtitleSupportCustomCommands : public RMMFCustomCommandsBase
218 IMPORT_C RMMFVideoPlaySubtitleSupportCustomCommands(RMMFController& aController);
219 IMPORT_C TInt AddSubtitleConfig(const TMMFSubtitleWindowConfig& aConfig);
220 IMPORT_C TInt RemoveSubtitleConfig(TInt aWindowId);
221 IMPORT_C TInt UpdateSubtitleConfig(const TMMFSubtitleWindowConfig& aConfig);
222 IMPORT_C TInt GetSubtitlesAvailable(TBool& aAvailable);
223 IMPORT_C TInt DisableSubtitles();
224 IMPORT_C TInt EnableSubtitles();
225 IMPORT_C TInt GetCrpParameters(TInt aWindowId, TWsGraphicId& aId, TRect& aCrpRect);
226 IMPORT_C TInt GetSubtitleLanguage(TLanguage& aLanguage);
227 IMPORT_C void GetSupportedSubtitleLanguagesL(RArray<TLanguage>& aSubtitleLanguages);
228 IMPORT_C TInt SetSubtitleLanguage(TLanguage aSubtitleLanguage);
231 #endif // MMFVIDEOSUBTITLECUSTOMCOMMANDS_H