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.
21 #ifndef MMFSUBTITLEUTILITY_H
22 #define MMFSUBTITLEUTILITY_H
25 #include <mmf/common/mmfvideosubtitlecustomcommands.h>
27 // Utility functions for subtitle support
28 NONSHARABLE_CLASS( CMMFSubtitleUtility ): public CBase
31 friend class CTestStepUnitMMFVidClient;
33 // class for storing CRP related data
37 TCrpData(TInt aWindowId) : iWindowId(aWindowId), iCrpId(0), iCrpRect() {}
46 static CMMFSubtitleUtility* NewL(RMMFController& aController, RWsSession &aWs);
47 ~CMMFSubtitleUtility();
48 static TBool SubtitlesAvailable(RMMFController& aController);
49 TInt AddSubtitleConfig(const TMMFSubtitleWindowConfig& aConfig);
50 TInt RemoveSubtitleConfig(TInt aWindowId);
51 TInt UpdateSubtitleConfig(const TMMFSubtitleWindowConfig& aConfig);
52 TInt EnableSubtitles();
53 void DisableSubtitles();
54 TArray<TLanguage> SupportedSubtitleLanguagesL();
55 void HandleCrpReady(RWindow& aWindow);
56 void RedrawSubtitle(RWindow& aWindow, const TRect& aRedrawRect);
57 TInt SetSubtitleLanguage(TLanguage aSubtitleLanguage);
58 TLanguage SubtitleLanguage();
61 CMMFSubtitleUtility(RMMFController& aController);
62 void ConstructL(RWsSession &aWs);
63 void DrawCrp(RWindow& aWindow, TInt aCrpIdx, TBool aCallBeginRedraw);
64 TInt FindCrpArrayIndex(TInt aWindowId);
67 RMMFVideoPlaySubtitleSupportCustomCommands iSubtitleSupportCustomCommands;
68 CWsScreenDevice *iDevice;
69 CWindowGc* iSubtitleGc;
70 RArray<TLanguage> iSubtitleLanguages;
71 RArray<TCrpData> iCrpDataArray;
74 #endif // MMFSUBTITLEUTILITY_H