mmplugins/mmfwplugins/src/Plugin/subtitle/subtitlegraphic/mmfsubtitlegraphic.h
changeset 0 40261b775718
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     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  @publishedPartner
       
    19  @prototype
       
    20 */
       
    21 
       
    22 #ifndef MMFSUBTITLEGRAPHIC_H
       
    23 #define MMFSUBTITLEGRAPHIC_H
       
    24 
       
    25 #include <e32std.h>
       
    26 #include <w32std.h>
       
    27 
       
    28 /** 
       
    29  * Client representation of a window-server-side subtitle drawer
       
    30 */
       
    31 NONSHARABLE_CLASS(CMMFSubtitleGraphic): public CWsGraphic
       
    32     {
       
    33 public:
       
    34     IMPORT_C static CMMFSubtitleGraphic* NewL();
       
    35     IMPORT_C virtual ~CMMFSubtitleGraphic();
       
    36 	IMPORT_C void Clear();
       
    37 	IMPORT_C TInt DrawFrame(TInt aFrameHandle, const TRect& aDirtyRegion, const TTimeIntervalMicroSeconds& aDisplayDuration);
       
    38 	IMPORT_C TInt Initialize(TInt aBuffer1, TInt aBuffer2);
       
    39 	IMPORT_C void Initialize();
       
    40 	IMPORT_C TInt SwapFrame(TUint aExpectedBuffer, const TRect& aDirtyRegion, const TTimeIntervalMicroSeconds& aDisplayDuration);
       
    41 
       
    42 private:
       
    43 	CMMFSubtitleGraphic();
       
    44 	void ConstructL();
       
    45 	
       
    46 	// Utility functions
       
    47 	TInt CheckBitmapHandle(TInt aHandle);
       
    48 	
       
    49 	// From CWsGraphic
       
    50 	void HandleMessage(const TDesC8 &aData);
       
    51 	void OnReplace();
       
    52 
       
    53 private:
       
    54 	enum TSubtitleGraphicState
       
    55 		{
       
    56 		ESubtitleGraphicStateWaiting 		= 1,
       
    57 		ESubtitleGraphicStateInit			= 2,
       
    58 		ESubtitleGraphicStateInitSimple		= 3
       
    59 		};	
       
    60 		
       
    61 	TSubtitleGraphicState iState;
       
    62 		
       
    63 	// Used to check bitmap handles.  Constructed as part of the object to avoid
       
    64 	// duplicate allocation.
       
    65 	CFbsBitmap* iTempBitmap;
       
    66 	};
       
    67 
       
    68 #endif