/*
* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description: This class implements MMMADisplay
*
*/
#ifndef CMMADISPLAY_H
#define CMMADISPLAY_H
// INCLUDES
#include <reflcdui.h>
#include "mmmadisplay.h"
// CONSTANTS
// FORWARD DECLARATIONS
class MMMADisplayWindow;
// CLASS DECLARATION
/**
* This class implements MMMADisplay
*
*
*/
NONSHARABLE_CLASS(CMMADisplay): public CBase,
public MMMADisplay,
public MDirectContent
{
public:
// Constructors and destructors
~CMMADisplay(); // Destructor ()
protected: // Constructors and destructors
// Default constructor, protected to allow derivation
CMMADisplay();
void Construct(MDirectContainer* aDirectContainer);
public: // Methods derived from MMMADisplay
void DrawFrameL(const CFbsBitmap* aBitmap);
TSize DisplaySize();
void SetDisplaySizeL(const TSize& aSize);
void SetVisible(TBool aValue);
void SetWindowL(MMMADisplayWindow* aWindow);
MMMADisplayWindow* Window();
TBool IsVisible();
TBool IsFullScreen();
virtual void SetForeground(TBool aIsForeground, TBool UseEventServer);
virtual void FixUIOrientation(TBool aFix);
/**
* Gets notification that there is container to draw assigned
*
* @return ETrue if container have been set
* EFalse if container is not set
*/
virtual TBool HasContainer();
/**
* Gets resources necessary to start DirectScreenAccess
* Doesn't run in mmapi event server thread!
*
* @since S60 v5.0
* @param "aConsumer" A consumer of callback
* @param "aThreadType" Indicates the thread type (UI or MMAPI)
*/
void UIGetDSAResources(
MUiEventConsumer& aConsumer,
MMMADisplay::TThreadType aThreadType);
/**
* Invokes a callback in UI thread
*
* @since S60 v5.0
* @param "aConsumer" A consumer of callback
* @param "aCallbackId" A number identifying the callback
*/
virtual void UIGetCallback(
MUiEventConsumer& aConsumer,
TInt aCallbackId);
public: // Methods derived from MDirectContent
/**
* Used to obtain RWindow rect
*/
virtual void MdcContainerWindowRectChanged(const TRect& aRect);
/**
* Same functionality is shared in canvas and item displays.
*/
virtual void MdcContainerVisibilityChanged(TBool aVisible);
/**
* Default implementation, panics in debug build. Must be written in
* derived classes if needed.
*/
virtual void MdcItemContentRectChanged(const TRect& aContentRect,
const TRect& aScreenRect);
/**
* Notify content that container is about to be destoryed.
*/
virtual void MdcContainerDestroyed();
/**
* Notify player's window that any drawing
* via direct screen access must be aborted
*/
void MdcAbortDSA();
/**
* Allow player's window to draw
* via direct screen access after MdcAbortDSA
*/
void MdcResumeDSA();
protected:// New Methods
/**
* Scales drawarea to full screen. Aspect ratio of the source size
* will be maintained.
*/
TRect ScaleToFullScreen(const TSize& aFullScreenSize,
const TSize& aSourceSize);
/**
* Set clipping region to LCDUI UI component according
* to current window drawrect so that the LCDUI component
* does not paint over the area that is occupied by video.
* Based on current visibility of video image, this method
* either sets or removes the clipping region.
* LCDUI component is then redrawn.
*/
void SetClippingRegion();
/**
* Remove currently set clip region and refresh canvas
*/
void RemoveClippingRegion();
/**
* Add clip region
*/
void AddClippingRegion();
/**
* Set whether java side had set the size or not
*/
void UserRectSet();
/**
* Is user rect set
*/
TBool IsUserRectSet();
protected: // Data
/**
* Not owned.
* Actual drawing place of the content.
*/
MMMADisplayWindow* iWindow;
/**
* Source contents size.
*/
TSize iSourceSize;
/**
* Indicates visibility set from from Java.
*/
TBool iVisible;
/**
* Screenmode set from Java.
*/
TBool iFullScreen;
/**
* Is native container visible.
*/
TBool iContainerVisible;
/**
* Draw rect set from java.
*/
TRect iUserRect;
/**
* Is User Rect Set?
*/
TBool iUserRectSet;
/**
* Not owned, obtained from lcdui components.
*/
MDirectContainer* iDirectContainer;
/**
* Clip rectangle currently set to LCDUI.
* NOTE: need to be removed at last during destruction phase!
*/
TRect iClipRect;
/**
* Is midlet is in foreground ?
*/
TBool iIsForeground;
/**
* Indicates that iUserRect has been changed
* during container invisibility
*/
TBool iResetDrawRect;
};
#endif // CMMADISPLAY_H