os/mm/mmlibs/mmfw/src/Client/Video/mmfsubtitleutility.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 /**
    17  @file
    18  @internalComponent
    19 */
    20 
    21 #ifndef MMFSUBTITLEUTILITY_H
    22 #define MMFSUBTITLEUTILITY_H
    23 
    24 #include <w32std.h>
    25 #include <mmf/common/mmfvideosubtitlecustomcommands.h>
    26 
    27 // Utility functions for subtitle support
    28 NONSHARABLE_CLASS( CMMFSubtitleUtility ): public CBase
    29 	{
    30 private:
    31 	friend class CTestStepUnitMMFVidClient;
    32 
    33 	// class for storing CRP related data
    34 	class TCrpData
    35 		{
    36 	public:
    37 		TCrpData(TInt aWindowId) : iWindowId(aWindowId), iCrpId(0), iCrpRect() {}
    38 
    39 	public:
    40 		TInt iWindowId;
    41 		TWsGraphicId iCrpId;
    42 		TRect iCrpRect;
    43 		};
    44 
    45 public:
    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();
    59 
    60 private:
    61 	CMMFSubtitleUtility(RMMFController& aController);
    62 	void ConstructL(RWsSession &aWs);
    63 	void DrawCrp(RWindow& aWindow, TInt aCrpIdx, TBool aCallBeginRedraw);
    64 	TInt FindCrpArrayIndex(TInt aWindowId);
    65 
    66 private:
    67 	RMMFVideoPlaySubtitleSupportCustomCommands iSubtitleSupportCustomCommands;
    68 	CWsScreenDevice *iDevice;
    69 	CWindowGc* iSubtitleGc;
    70 	RArray<TLanguage> iSubtitleLanguages;
    71 	RArray<TCrpData> iCrpDataArray;
    72 	};
    73 	
    74 #endif // MMFSUBTITLEUTILITY_H