javauis/lcdui_akn/javalcdui/inc.nokialcdui/MMIDCanvasGraphicsItem.h
branchRCL_3
changeset 14 04becd199f91
equal deleted inserted replaced
13:f5050f1da672 14:04becd199f91
       
     1 /*
       
     2 * Copyright (c) 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: Defines an interface for LCDUI Canvas Graphics Item component.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MMIDCANVASGRAPHICSITEM_H
       
    20 #define MMIDCANVASGRAPHICSITEM_H
       
    21 
       
    22 // EXTERNAL INCLUDES
       
    23 #include    <e32std.h>
       
    24 #include    <lcdui.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class MMIDCustomComponentContainer;
       
    28 
       
    29 // CLASS DESCRIPTION
       
    30 /**
       
    31  * Interface for the Graphics item component.
       
    32  *
       
    33  * This interface can be used to interact as a custom UI component
       
    34  * in LCDUI components that implement a container for custom
       
    35  * components.
       
    36  *
       
    37  * The client can use this interface to access information about
       
    38  * UI controls that the implementing class provides.
       
    39  *
       
    40  * @since S60 5.0
       
    41  */
       
    42 class MMIDCanvasGraphicsItem : public MMIDComponent
       
    43 {
       
    44 public: // Type definitions
       
    45 
       
    46 public: // New methods
       
    47     /**
       
    48      * Returns the component type.
       
    49      * @return  The component type as a MMIDComponent::TType enum.
       
    50      */
       
    51     virtual TType Type() const
       
    52     {
       
    53         return ECanvasGraphicsItem;
       
    54     }
       
    55 
       
    56     /**
       
    57      * Sets the size of this canvas graphics item.
       
    58      *
       
    59      * @param aWidth
       
    60      *          The width of the item in pixels.
       
    61      * @param aHeight
       
    62      *          The height of the item in pixels.
       
    63      * @since S60 5.0
       
    64      */
       
    65     virtual void SetSizeL(const TInt aWidth, const TInt aHeight) = 0;
       
    66 
       
    67     /**
       
    68      * Sets the parent of this graphics item component. The parent must
       
    69      * implement the custom component container interface in order to
       
    70      * provide necessary services for registering custom UI components.
       
    71      *
       
    72      * The ownership of the parent is not transffered to this object.
       
    73      *
       
    74      * @param aComponentContainer The parent MIDP custom component
       
    75      *        container.
       
    76      * @since S60 5.0
       
    77      */
       
    78     virtual void SetParentL(
       
    79         MMIDCustomComponentContainer* aComponentContainer) = 0;
       
    80 
       
    81     /**
       
    82      * Sets the direct container of this graphics item component.
       
    83      *
       
    84      * Note that the graphics item does not necessary need to have direct
       
    85      * container. If the parent component is responsible for somekind of
       
    86      * custom drawing using direct screena access, this method can be used
       
    87      * to register the direct container.
       
    88      *
       
    89      * The graphics item adds itself to the direct container so that it
       
    90      * is not able to draw on top of the graphics item when direct content
       
    91      * is added to the screen.
       
    92      *
       
    93      * @param aDirectContainer The direct container of this compoennt if
       
    94      *        any. <code>NULL</code> removes the current container.
       
    95      * @since S60 5.0
       
    96      */
       
    97     virtual void SetDirectContainerL(
       
    98         MDirectContainer* aDirectContainer) = 0;
       
    99 
       
   100     /**
       
   101      * Sets the elevation of this graphics item component.
       
   102      *
       
   103      * If the specified elevation exeeds to amount of items in the
       
   104      * custom component container, the item becomes the topmost item
       
   105      * in the custom component stack.
       
   106      *
       
   107      * Note that the elevation requsted may not be the actual elevation
       
   108      * of the item (if, for example, the elevation is higher than the
       
   109      * amount of all items). The actual elevation can be fetched using
       
   110      * <code>Elevation()</code>.
       
   111      *
       
   112      * @param aElevation The new elevation (Z-position) of this item.
       
   113      * @since S60 5.0
       
   114      */
       
   115     virtual void SetElevationL(TInt aElevation) = 0;
       
   116 
       
   117     /**
       
   118      * Returns the elevation of this graphics item component.
       
   119      *
       
   120      * @return The elevation of this graphics item component.
       
   121      * @since S60 5.0
       
   122      */
       
   123     virtual TInt Elevation() = 0;
       
   124 
       
   125     /**
       
   126      * Sets this graphics item component visible if it is hidden.
       
   127      *
       
   128      * Depending on the current status of the graphics item, this operation
       
   129      * is no-op if there is nothing to be done. (i.e. the graphics item is set
       
   130      * hidden when it is already hidden).
       
   131      *
       
   132      * @param aVisible Indicates the visibility status of the graphics item.
       
   133      * @since S60 5.0
       
   134      */
       
   135     virtual void SetVisibleL(TBool aVisible) = 0;
       
   136 
       
   137     /**
       
   138      * Sets the position of this graphics item component.
       
   139      *
       
   140      * @param aX The x coordinate of the anchor point.
       
   141      * @param aY The y coordinate of the anchor point.
       
   142      * @since S60 5.0
       
   143      */
       
   144     virtual void SetPosition(const TInt aX, const TInt aY) = 0;
       
   145 
       
   146 protected: // Destructor
       
   147 
       
   148     /**
       
   149      * Destructor. Disallows destruction through this interface
       
   150      */
       
   151     virtual ~MMIDCanvasGraphicsItem() {}
       
   152 };
       
   153 
       
   154 #endif // MMIDCANVASGRAPHICSITEM_H
       
   155 
       
   156 // End of file