javauis/mmapi_qt/baseline/inc/mmmadisplay.h
changeset 23 98ccebc37403
child 26 dc7c549001d5
equal deleted inserted replaced
21:2a9601315dfc 23:98ccebc37403
       
     1 /*
       
     2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Interface for displays, which can show images.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MMMADISPLAY_H
       
    20 #define MMMADISPLAY_H
       
    21 
       
    22 #include "jni.h"
       
    23 //  FORWARD DECLARATIONS
       
    24 class CFbsBitmap;
       
    25 class MMMADisplayWindow;
       
    26 class MUiEventConsumer;
       
    27 class MMMAGuiPlayer;
       
    28 
       
    29 //  CLASS DEFINITION
       
    30 /*
       
    31 -----------------------------------------------------------------------------
       
    32 
       
    33     DESCRIPTION
       
    34 
       
    35     Interface for displays, which can show images. Display properties
       
    36     can be changed through this interface.
       
    37 
       
    38 -----------------------------------------------------------------------------
       
    39 */
       
    40 NONSHARABLE_CLASS(MMMADisplay)
       
    41 {
       
    42 public:
       
    43     /**
       
    44       * Describes the currently running thread type.
       
    45       */
       
    46     enum TThreadType
       
    47     {
       
    48         EMmaThread = 0, // MMAPI thread
       
    49         EUiThread  = 1  // UI thread (LCDUI or ESWT)
       
    50     };
       
    51 
       
    52     /**
       
    53      * Display can be deleted through this interface.
       
    54      */
       
    55     virtual ~MMMADisplay()
       
    56     {
       
    57     };
       
    58 
       
    59     /**
       
    60      * Draws bitmap. Implementation may ignore <code>aBitmap</code>
       
    61      * parameter and implements own drawing procedure. This method must also redraw
       
    62      * the display if needed.
       
    63      *
       
    64      * @param aBitmap Bitmap to be drawn.
       
    65      */
       
    66     virtual void DrawFrameL(const CFbsBitmap* aBitmap) = 0;
       
    67 
       
    68     /**
       
    69      * Getter for display's size.
       
    70      *
       
    71      * @return Display size.
       
    72      */
       
    73     virtual TSize DisplaySize() = 0;
       
    74 
       
    75     /**
       
    76      * Sets display size or leaves if not supported or
       
    77      * size cannot be changed.
       
    78      *
       
    79      * @param aSize New size for the display.
       
    80      */
       
    81     virtual void SetDisplaySizeL(const TSize& aSize) = 0;
       
    82 
       
    83     /**
       
    84      * Sets display location.
       
    85      *
       
    86      * @param aPosition New position for the display.
       
    87      */
       
    88     virtual void SetDisplayLocationL(const TPoint& aPosition) = 0;
       
    89 
       
    90     /**
       
    91      * Returns position where display is drawn.
       
    92      *
       
    93      * @return Display location.
       
    94      */
       
    95     virtual TPoint DisplayLocation() = 0;
       
    96 
       
    97     /**
       
    98      * Sets display fullscreen mode on/off.
       
    99      *
       
   100      * @param aFullScreen Fullscreen mode.
       
   101      */
       
   102     virtual void SetFullScreenL(TBool aFullScreen) = 0;
       
   103 
       
   104     /**
       
   105      * Sets display visible or hides it.
       
   106      *
       
   107      * @param aVisible ETrue if display is visible,
       
   108      *                 EFalse if display is invisible.
       
   109      */
       
   110     virtual void SetVisible(TBool aVisible) = 0;
       
   111 
       
   112     /**
       
   113      * Called when source size is changed. This is also called when
       
   114      * source size is available for the first time.
       
   115      *
       
   116      * @param aSourceSize New content's size.
       
   117      */
       
   118     virtual void SourceSizeChanged(const TSize& aSourceSize) = 0;
       
   119     
       
   120     virtual TSize SourceSize() = 0;
       
   121     
       
   122 		virtual void SetUIPlayer(MMMAGuiPlayer* player) = 0;
       
   123     /**
       
   124      * Sets display's window. Ownership is not transfered.
       
   125      *
       
   126      * @param aWindow New window used for drawing.
       
   127      **/
       
   128     virtual void SetWindowL(MMMADisplayWindow* aWindow) = 0;
       
   129 
       
   130     /**
       
   131      * Getter for window.
       
   132      *
       
   133      * @return Display's window or NULL if not set.
       
   134      */
       
   135     virtual MMMADisplayWindow* Window() = 0;
       
   136 
       
   137     /**
       
   138      * Returns visibility of the display.
       
   139      *
       
   140      * @return ETrue if display is visible,
       
   141      *         EFalse if display is invisible.
       
   142      */
       
   143     virtual TBool IsVisible() = 0;
       
   144 
       
   145     /**
       
   146      * Returns fullscreen state of the display.
       
   147      *
       
   148      * @return ETrue if display is fullscreen,
       
   149      *         EFalse if display is not fullscreen.
       
   150      */
       
   151     virtual TBool IsFullScreen() = 0;
       
   152     /**
       
   153      *Sets the foreground state of the midlet
       
   154      *
       
   155      * @param ETrue if midlet is in foreground,
       
   156      *         EFalse if midlet is in background
       
   157      */
       
   158     virtual void SetForeground(TBool aForeground, TBool aUseEventServer) = 0;
       
   159 
       
   160     /**
       
   161      * Gets notification that there is container to draw assigned
       
   162      *
       
   163      * @return ETrue if container have been set
       
   164      *         EFalse if container is not set
       
   165      */
       
   166     virtual TBool HasContainer() = 0;
       
   167 
       
   168     /**
       
   169      * Gets resources necessary to start DirectScreenAccess
       
   170      * Doesn't run in mmapi event server thread!
       
   171      *
       
   172      * @since S60 v5.0
       
   173      * @param "aConsumer" A consumer of callback
       
   174      * @param "aThreadType" Indicates the thread type (UI or MMAPI)
       
   175      */
       
   176    /* virtual void UIGetDSAResources(
       
   177         MUiEventConsumer& aConsumer,
       
   178         TThreadType aThreadType) = 0;
       
   179 */
       
   180     /**
       
   181      * Invokes a callback in UI thread
       
   182      *
       
   183      * @since S60 v5.0
       
   184      * @param "aConsumer" A consumer of callback
       
   185      * @param "aCallbackId" A number identifying the callback
       
   186      */
       
   187  /*   virtual void UIGetCallback(
       
   188         MUiEventConsumer& aConsumer,
       
   189         TInt aCallbackId) = 0;
       
   190         */
       
   191         
       
   192         /**
       
   193     * Trigger a function call CalledBackInUiThread() from java in UI thread
       
   194     * arg 'placeholder' is used to identify the function, to be called back from UI Thread
       
   195     */    
       
   196     virtual void GetCallbackInUiThread(TInt placeholder) = 0;
       
   197     
       
   198     /**
       
   199     * Called from java in UI thread context
       
   200     * arg 'placeholder' is used to identify the function, to be called back from UI Thread
       
   201     */ 
       
   202     virtual void CalledBackInUiThread(TInt placeholder) = 0;
       
   203 };
       
   204 
       
   205 #endif // MMMADISPLAY_H