os/mm/mmlibs/mmfw/tsrc/mmvalidationsuite/mmvalidationsuiteapp/inc/mvsvideocontrol.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 #ifndef MVSVIDEOCONTROL_H
    17 #define MVSVIDEOCONTROL_H
    18 
    19 #include <coecntrl.h>
    20 #include <surfaceeventhandler.h>
    21 
    22 class CMVSPipControl :
    23 	public CCoeControl,
    24 	public MMMFSurfaceEventHandler
    25 	{
    26 public:
    27 	enum TRenderType
    28 		{
    29 		EUseMmf,
    30 		EUseCrp
    31 		};
    32 		
    33 public:
    34 	static CMVSPipControl* NewL(RWindowTreeNode& aParent);
    35 	~CMVSPipControl();
    36 
    37 	// MMMFSurfaceEventHandler
    38 	void MmsehSurfaceCreated(TInt aDisplayId, const TSurfaceId& aId, const TRect& aCropRect, TVideoAspectRatio aAspectRatio);
    39 	void MmsehSurfaceParametersChanged(const TSurfaceId& aId, const TRect& aCropRect, TVideoAspectRatio aAspectRatio);
    40 	void MmsehRemoveSurface(const TSurfaceId& aId);
    41 
    42 	void SetRenderType(TRenderType aRenderType);
    43 	void Clear();
    44 	RWindow& ControlWindow() const;
    45 
    46 private:
    47 	CMVSPipControl();
    48 	void ConstructL(RWindowTreeNode& aParent);
    49 
    50 	void Draw(const TRect& aRect) const;
    51 
    52 private:
    53 	TRenderType iRenderType;
    54 	TInt iDisplayId;
    55 	TRect iCropRect;
    56 	};
    57 
    58 
    59 class CMVSVideoControl : public CCoeControl
    60 	{
    61 public:
    62 	static CMVSVideoControl* NewLC(CMVSVideoPlayAgent& aVideoPlayAgent, TInt aDisplay, RWindowTreeNode& aParent);
    63 	static CMVSVideoControl* NewL(CMVSVideoPlayAgent& aVideoPlayAgent, TInt aDisplay, RWindowTreeNode& aParent);
    64 
    65 	~CMVSVideoControl();
    66 
    67 	RWindow& ControlWindow() const;
    68 	TInt ScreenNumber() const;
    69 	
    70 	CMVSPipControl& Pip() const;
    71 	void EnablePip(CMVSPipControl::TRenderType aRenderType);
    72 	void DisablePip();
    73 
    74 	void SetOverlayTextL(const TDesC& aOverlayText);
    75 	void ClearOverlayText();
    76 
    77 private:
    78 	CMVSVideoControl(CMVSVideoPlayAgent& aVideoPlayAgent, TInt aDisplay);
    79 	
    80 	void ConstructL(RWindowTreeNode& aParent);
    81 	void Draw(const TRect& aRect) const;
    82 
    83 	TInt CountComponentControls() const;
    84 	CCoeControl* ComponentControl(TInt aIndex) const;
    85 
    86 private:
    87 	CMVSVideoPlayAgent& iVideoPlayAgent;
    88 	TInt iDisplay;
    89 	CMVSPipControl* iPip;
    90 	
    91 	RBuf    iOverlayText;   // Text to be drawn on top of video
    92 	};
    93 
    94 #endif // MVSVIDEOCONTROL_H
    95