javauis/mmapi_akn/baseline/inc/mmmadisplay.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 15 Sep 2010 12:05:25 +0300
branchRCL_3
changeset 77 7cee158cb8cd
parent 66 2455ef1f5bbc
child 83 26b2b12093af
permissions -rw-r--r--
Revision: v2.2.13 Kit: 201036

/*
* 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:  Interface for displays, which can show images.
*
*/


#ifndef MMMADISPLAY_H
#define MMMADISPLAY_H

//  FORWARD DECLARATIONS
class CFbsBitmap;
class MMMADisplayWindow;
class MUiEventConsumer;

//  CLASS DEFINITION
/*
-----------------------------------------------------------------------------

    DESCRIPTION

    Interface for displays, which can show images. Display properties
    can be changed through this interface.

-----------------------------------------------------------------------------
*/
NONSHARABLE_CLASS(MMMADisplay)
{
public:
    /**
      * Describes the currently running thread type.
      */
    enum TThreadType
    {
        EMmaThread = 0, // MMAPI thread
        EUiThread  = 1  // UI thread (LCDUI or ESWT)
    };

    /**
     * Display can be deleted through this interface.
     */
    virtual ~MMMADisplay()
    {
    };

    /**
     * Draws bitmap. Implementation may ignore <code>aBitmap</code>
     * parameter and implements own drawing procedure. This method must also redraw
     * the display if needed.
     *
     * @param aBitmap Bitmap to be drawn.
     */
    virtual void DrawFrameL(const CFbsBitmap* aBitmap) = 0;

    /**
     * Getter for display's size.
     *
     * @return Display size.
     */
    virtual TSize DisplaySize() = 0;

    /**
     * Sets display size or leaves if not supported or
     * size cannot be changed.
     *
     * @param aSize New size for the display.
     */
    virtual void SetDisplaySizeL(const TSize& aSize) = 0;

    /**
     * Sets display location.
     *
     * @param aPosition New position for the display.
     */
    virtual void SetDisplayLocationL(const TPoint& aPosition) = 0;

    /**
     * Returns position where display is drawn.
     *
     * @return Display location.
     */
    virtual TPoint DisplayLocation() = 0;

    /**
     * Sets display fullscreen mode on/off.
     *
     * @param aFullScreen Fullscreen mode.
     */
    virtual void SetFullScreenL(TBool aFullScreen) = 0;

    /**
     * Sets display visible or hides it.
     *
     * @param aVisible ETrue if display is visible,
     *                 EFalse if display is invisible.
     */
    virtual void SetVisible(TBool aVisible) = 0;

    /**
     * Called when source size is changed. This is also called when
     * source size is available for the first time.
     *
     * @param aSourceSize New content's size.
     */
    virtual void SourceSizeChanged(const TSize& aSourceSize) = 0;

    /**
     * Sets display's window. Ownership is not transfered.
     *
     * @param aWindow New window used for drawing.
     **/
    virtual void SetWindowL(MMMADisplayWindow* aWindow) = 0;

    /**
     * Getter for window.
     *
     * @return Display's window or NULL if not set.
     */
    virtual MMMADisplayWindow* Window() = 0;

    /**
     * Returns visibility of the display.
     *
     * @return ETrue if display is visible,
     *         EFalse if display is invisible.
     */
    virtual TBool IsVisible() = 0;

    /**
     * Returns fullscreen state of the display.
     *
     * @return ETrue if display is fullscreen,
     *         EFalse if display is not fullscreen.
     */
    virtual TBool IsFullScreen() = 0;
    /**
     *Sets the foreground state of the midlet
     *
     * @param ETrue if midlet is in foreground,
     *         EFalse if midlet is in background
     */
    virtual void SetForeground(TBool aForeground, TBool aUseEventServer) = 0;

    /**
     * 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() = 0;

    /**
     * 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)
     */
    virtual void UIGetDSAResources(
        MUiEventConsumer& aConsumer,
        TThreadType aThreadType) = 0;

    /**
     * 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) = 0;

    /**
     * Fixes screen UI orientation.
     *
     * @param aFix If ETrue, the UI orientation will be fixed.
     *                If EFalse, the standard UI orientation is restored.        
     */
    virtual void FixUIOrientation(TBool aFix) = 0;
    
    
    /**
     * Allow player to free the clipping rect for
     * UI usage. required in case of RTSP live streaming player
     * stop and then start, to avoid the black screen in that time gap
     */
    virtual void RemoveClippingRegionPublic() = 0;
    /**
     * Allow player to get the clipping rect from
     * UI usage. required in case of RTSP live streaming player
     * start after stop, to avoid the black screen while its playing video
     */
    virtual void SetClippingRegionPublic() = 0;
};

#endif // MMMADISPLAY_H