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: /** sl@0: @file sl@0: @internalComponent sl@0: */ sl@0: sl@0: #ifndef MMFSUBTITLEUTILITY_H sl@0: #define MMFSUBTITLEUTILITY_H sl@0: sl@0: #include sl@0: #include sl@0: sl@0: // Utility functions for subtitle support sl@0: NONSHARABLE_CLASS( CMMFSubtitleUtility ): public CBase sl@0: { sl@0: private: sl@0: friend class CTestStepUnitMMFVidClient; sl@0: sl@0: // class for storing CRP related data sl@0: class TCrpData sl@0: { sl@0: public: sl@0: TCrpData(TInt aWindowId) : iWindowId(aWindowId), iCrpId(0), iCrpRect() {} sl@0: sl@0: public: sl@0: TInt iWindowId; sl@0: TWsGraphicId iCrpId; sl@0: TRect iCrpRect; sl@0: }; sl@0: sl@0: public: sl@0: static CMMFSubtitleUtility* NewL(RMMFController& aController, RWsSession &aWs); sl@0: ~CMMFSubtitleUtility(); sl@0: static TBool SubtitlesAvailable(RMMFController& aController); sl@0: TInt AddSubtitleConfig(const TMMFSubtitleWindowConfig& aConfig); sl@0: TInt RemoveSubtitleConfig(TInt aWindowId); sl@0: TInt UpdateSubtitleConfig(const TMMFSubtitleWindowConfig& aConfig); sl@0: TInt EnableSubtitles(); sl@0: void DisableSubtitles(); sl@0: TArray SupportedSubtitleLanguagesL(); sl@0: void HandleCrpReady(RWindow& aWindow); sl@0: void RedrawSubtitle(RWindow& aWindow, const TRect& aRedrawRect); sl@0: TInt SetSubtitleLanguage(TLanguage aSubtitleLanguage); sl@0: TLanguage SubtitleLanguage(); sl@0: sl@0: private: sl@0: CMMFSubtitleUtility(RMMFController& aController); sl@0: void ConstructL(RWsSession &aWs); sl@0: void DrawCrp(RWindow& aWindow, TInt aCrpIdx, TBool aCallBeginRedraw); sl@0: TInt FindCrpArrayIndex(TInt aWindowId); sl@0: sl@0: private: sl@0: RMMFVideoPlaySubtitleSupportCustomCommands iSubtitleSupportCustomCommands; sl@0: CWsScreenDevice *iDevice; sl@0: CWindowGc* iSubtitleGc; sl@0: RArray iSubtitleLanguages; sl@0: RArray iCrpDataArray; sl@0: }; sl@0: sl@0: #endif // MMFSUBTITLEUTILITY_H