javauis/lcdui_akn/javalcdui/inc/reflcdui.h
branchRCL_3
changeset 14 04becd199f91
child 24 6c158198356e
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 2003-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 between LCDUI and MMAPI
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef REFLCDUI_H
       
    20 #define REFLCDUI_H
       
    21 
       
    22 #include <w32std.h>
       
    23 
       
    24 class MDirectContent;
       
    25 class RWsSession;
       
    26 class CWsScreenDevice;
       
    27 class RWindowBase;
       
    28 
       
    29 
       
    30 /**
       
    31  * A receiver of asynchronous callbacks which are invoked
       
    32  * by MDirectContainer::MdcAsyncGetDSAResources()
       
    33  * and MDirectContainer:: MdcAsyncGetUICallback.
       
    34  * All the methods runs in UI thread.
       
    35  *
       
    36  * @since  S60 v5.0
       
    37  */
       
    38 class MUiEventConsumer
       
    39 {
       
    40 public:
       
    41     /**
       
    42      * Callback to MDirectContainer::MdcAsyncGetDSAResources().
       
    43      * Provides resources to enable starting DirectScreenAccess.
       
    44      * All these resources have to be used from the thread where it was
       
    45      * created in!
       
    46      *
       
    47      * @since  S60 v5.0
       
    48      * @param "aWs" UI Window server session
       
    49      * @param "aScreenDevice" Screen device to draw DSA to
       
    50      * @param "aWindow" The window to draw directly
       
    51      */
       
    52     virtual void MdcDSAResourcesCallback(
       
    53         RWsSession &aWs,
       
    54         CWsScreenDevice &aScreenDevice,
       
    55         RWindowBase &aWindow) = 0;
       
    56 
       
    57     /**
       
    58      * Callback to MDirectContainer:: MdcAsyncGetUICallback.
       
    59      *
       
    60      * @since  S60 v5.0
       
    61      * @param "aCallbackId" Contains the value as specified
       
    62      * in callback invoker
       
    63      */
       
    64     virtual void MdcUICallback(const TInt aCallbackId) = 0;
       
    65 };
       
    66 
       
    67 /**
       
    68  * A container, such as a Canvas or Item, on which content can be displayed.
       
    69  */
       
    70 class MDirectContainer
       
    71 {
       
    72 public:
       
    73 
       
    74     /**
       
    75      * Set the content.
       
    76      *
       
    77      * @param "aContent" Content which is displayed on this container.
       
    78      */
       
    79     virtual void MdcAddContent(MDirectContent* aContent) = 0;
       
    80 
       
    81     /**
       
    82      * Remove the content. This will called when the Player is closed.
       
    83      *
       
    84      * @param "aContent" Content which is displayed on this container.
       
    85      */
       
    86     virtual void MdcRemoveContent(MDirectContent* aContent) = 0;
       
    87 
       
    88     /**
       
    89      * Adds content bound to this container. Container will not allow painting in this region
       
    90      *
       
    91      * @param aRect Content bounds
       
    92      */
       
    93     virtual void MdcAddContentBounds(const TRect& aRect) = 0;
       
    94 
       
    95     /**
       
    96      * Removes one content bound from this container.
       
    97      * Container will now allow painting to this region
       
    98      *
       
    99      * @param aRect Content bound to be removed.
       
   100      */
       
   101     virtual void MdcRemoveContentBounds(const TRect& aRect) = 0;
       
   102 
       
   103     /**
       
   104      * Get a rect of a window (with respect to screen) on which content can be displayed.
       
   105      * If this changes, MdcContainerWindowRectChanged() should be called.
       
   106      *
       
   107      * @returns Rect of a window for content display. Returns empty rect if item
       
   108      * is not yet added to a form.
       
   109      */
       
   110     virtual TRect MdcContainerWindowRect() const = 0;
       
   111 
       
   112     /**
       
   113      * Get the visiblity of the container. The content must not be displayed
       
   114      * when it's container is invisible.
       
   115      * If this changes MdcContainerVisibilityChanged should be called.
       
   116      *
       
   117      * @returns "aVisible" ETrue if the container is visible, EFalse if it is invisible.
       
   118      */
       
   119     virtual TBool MdcContainerVisibility() const = 0;
       
   120 
       
   121     /**
       
   122      * Get the bounds of the area that the content can occupy.
       
   123      * The content should be clipped to this area.
       
   124      * If this changes MdcContentBoundsChanged should be called.
       
   125      *
       
   126      * @returns Maximum area that the content can occupy in screen co-ordinates.
       
   127      */
       
   128     virtual TRect MdcContentBounds() const = 0;
       
   129 
       
   130     /**
       
   131      * Get the area on the Item on which content can be displayed. The content
       
   132      * should draw to all of this area.
       
   133      * This should only be called when the content is displayed on an Item.
       
   134      * If this changes MdcItemContentRectChanged should be called.
       
   135      *
       
   136      * @param "aContentRect" Return parameter for content area in Item co-ordinates.
       
   137      * @param "aScreenRect" Return parameter for content area in screen co-ordinates.
       
   138      */
       
   139     virtual void MdcItemContentRect(TRect& aContentRect,TRect& aScreenRect) const = 0;
       
   140 
       
   141     /**
       
   142      * Allows a control created for content display to pass on pointer events.
       
   143      *
       
   144      * @param "aPointerEvent" The pointer event. iPosition will be reset to the
       
   145      * parent window position. iParentPosition will be invalid for the container.
       
   146      */
       
   147     virtual void MdcHandlePointerEventL(TPointerEvent& aPointerEvent) = 0;
       
   148 
       
   149     /**
       
   150      * Flush the container content
       
   151      *
       
   152      * @param "aRect" The content area to be proceeded.
       
   153      */
       
   154     virtual void MdcFlushContainer(const TRect& aRect) = 0;
       
   155 
       
   156     /**
       
   157      * Invokes callback aConsumer->MdcDSAResourcesCallback in UI thread.
       
   158      * Used in case when MMAPI needs to start DSA within UI thread.
       
   159      *
       
   160      * @since  S60 v5.0
       
   161      * @param "aConsumer" A consumer of callback
       
   162      */
       
   163     virtual void MdcGetDSAResources(MUiEventConsumer& aConsumer) = 0;
       
   164 
       
   165     /**
       
   166      * Invokes callback aConsumer->MdcUICallback in UI thread.
       
   167      * Used in case when MMAPI needs to run some operation within UI thread.
       
   168      *
       
   169      * @since  S60 v5.0
       
   170      * @param "aConsumer" A consumer of callback
       
   171      * @param "aCallbackId" A number identifying the callback
       
   172      */
       
   173     virtual void MdcGetUICallback(
       
   174         MUiEventConsumer& aConsumer,
       
   175         const TInt aCallbackId) = 0;
       
   176 
       
   177 #ifdef RD_JAVA_NGA_ENABLED
       
   178     /**
       
   179      * Notifies container about added content in UI thread.
       
   180      *
       
   181      * @since  S60 v9.2
       
   182      */
       
   183     virtual void MdcNotifyContentAdded() {}
       
   184 #endif
       
   185 };
       
   186 
       
   187 /**
       
   188  * Content, such as a video clip or camera view finder, which is displayed on a container.
       
   189  */
       
   190 class MDirectContent
       
   191 {
       
   192 public:
       
   193     /**
       
   194      * Notify content that container window rect (Symbian RWindow)
       
   195      * is available.
       
   196      *
       
   197      * @param "aRect" New window Rect on which content can be displayed
       
   198      */
       
   199     virtual void MdcContainerWindowRectChanged(const TRect& aRect) = 0;
       
   200 
       
   201     /**
       
   202      * Notify content that container visiblity has changed. The content must not
       
   203      * be displayed when it's container is invisible.
       
   204      *
       
   205      * @param "aVisible" ETrue if the container is visible, EFalse if it is invisible.
       
   206      */
       
   207     virtual void MdcContainerVisibilityChanged(TBool aVisible) = 0;
       
   208 
       
   209     /**
       
   210      * Notify content that the container bounds have changed.
       
   211      *
       
   212      * @param "aRect" Maximum area the content can occupy in screen co-ordinates.
       
   213      * The content should be clipped to this area.
       
   214      */
       
   215     virtual void MdcContentBoundsChanged(const TRect& aRect) = 0;
       
   216 
       
   217     /**
       
   218      * Notify content that its display area has changed.
       
   219      * This should only be called when the content is displayed on an Item.
       
   220      *
       
   221      * @param "aDisplayRect" Display area in Item co-ordinates.
       
   222      * @param "aScreenRect" Display area in screen co-ordinates.
       
   223      */
       
   224     virtual void MdcItemContentRectChanged(const TRect& aContentRect,const TRect& aScreenRect) = 0;
       
   225 
       
   226     /**
       
   227      * Notify content that container is about to be destoryed.
       
   228      */
       
   229     virtual void MdcContainerDestroyed() = 0;
       
   230 
       
   231     /**
       
   232      * Notify content that any drawing
       
   233      * via direct screen access must be aborted
       
   234      */
       
   235     virtual void MdcAbortDSA() = 0;
       
   236 
       
   237     /**
       
   238      * Allow the content to draw
       
   239      * via direct screen access after MdcAbortDSA
       
   240      */
       
   241     virtual void MdcResumeDSA() = 0;
       
   242 };
       
   243 
       
   244 #endif // REFLCDUI_H
       
   245