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: @publishedPartner sl@0: @prototype sl@0: */ sl@0: sl@0: #ifndef MMFSUBTITLEGRAPHIC_H sl@0: #define MMFSUBTITLEGRAPHIC_H sl@0: sl@0: #include sl@0: #include sl@0: sl@0: /** sl@0: * Client representation of a window-server-side subtitle drawer sl@0: */ sl@0: NONSHARABLE_CLASS(CMMFSubtitleGraphic): public CWsGraphic sl@0: { sl@0: public: sl@0: IMPORT_C static CMMFSubtitleGraphic* NewL(); sl@0: IMPORT_C virtual ~CMMFSubtitleGraphic(); sl@0: IMPORT_C void Clear(); sl@0: IMPORT_C TInt DrawFrame(TInt aFrameHandle, const TRect& aDirtyRegion, const TTimeIntervalMicroSeconds& aDisplayDuration); sl@0: IMPORT_C TInt Initialize(TInt aBuffer1, TInt aBuffer2); sl@0: IMPORT_C void Initialize(); sl@0: IMPORT_C TInt SwapFrame(TUint aExpectedBuffer, const TRect& aDirtyRegion, const TTimeIntervalMicroSeconds& aDisplayDuration); sl@0: sl@0: private: sl@0: CMMFSubtitleGraphic(); sl@0: void ConstructL(); sl@0: sl@0: // Utility functions sl@0: TInt CheckBitmapHandle(TInt aHandle); sl@0: sl@0: // From CWsGraphic sl@0: void HandleMessage(const TDesC8 &aData); sl@0: void OnReplace(); sl@0: sl@0: private: sl@0: enum TSubtitleGraphicState sl@0: { sl@0: ESubtitleGraphicStateWaiting = 1, sl@0: ESubtitleGraphicStateInit = 2, sl@0: ESubtitleGraphicStateInitSimple = 3 sl@0: }; sl@0: sl@0: TSubtitleGraphicState iState; sl@0: sl@0: // Used to check bitmap handles. Constructed as part of the object to avoid sl@0: // duplicate allocation. sl@0: CFbsBitmap* iTempBitmap; sl@0: }; sl@0: sl@0: #endif