mulwidgets/common/inc/imulembedablewidget.h
changeset 17 3eca7e70b1b8
parent 3 4526337fb576
equal deleted inserted replaced
3:4526337fb576 17:3eca7e70b1b8
     1 /*
       
     2 * Copyright (c) 2007-2008 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 embedabld widget
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef I_MULEMBEDABLEWIDGET_H
       
    20 #define I_MULEMBEDABLEWIDGET_H
       
    21 #include <mul/mulvisualitem.h>
       
    22 #include <alf/ialfwidgeteventhandler.h>
       
    23 namespace Alf
       
    24     {
       
    25 
       
    26 /** @class IMulEmbedableWidget
       
    27  *  @brief Interface for Embedable widget.
       
    28  *
       
    29  *  Every widget that can be embeded need to implement this interface.
       
    30  *  Parent widget will use this interface to access embeded widget.
       
    31  */
       
    32 class IMulEmbedableWidget
       
    33     {
       
    34 public:
       
    35 
       
    36     /**
       
    37      * Set/Update data of Embeded widget.
       
    38 	 * Parent widget will provides its own visual item as parameter
       
    39 	 * embeded widget will have to construct new visual item from provided visual item
       
    40 	 * and remove unwanted attributes and call update on singel item model.
       
    41 	 *
       
    42 	 * @param aItem Parent widget's data in visual item format
       
    43 	 */ 
       
    44    	virtual void SetData(const MulVisualItem& aItem) = 0;
       
    45 	
       
    46 	
       
    47 	/**
       
    48      * Return data in format of visual item.
       
    49 	 * Parent will used this api to update its own data model.
       
    50 	 *
       
    51 	 * @return  Data of embeded widget
       
    52 	 */
       
    53 	virtual const MulVisualItem& Data() = 0;
       
    54 	
       
    55 	/**
       
    56 	 * Add as eventhandler for embeded widget.
       
    57 	 * Parent will use this api to add itself and client as event handler of child widget.
       
    58 	 * 
       
    59 	 * @param aHandler Event handler
       
    60 	 */
       
    61 	virtual void AddEventHandler( IAlfWidgetEventHandler& aHandler ) = 0;
       
    62 
       
    63 	/**
       
    64 	 * Remove as eventhandler form embeded widget.
       
    65 	 * Parent can remvoe itself and client as event handler using this api
       
    66 	 * 
       
    67  	 * @param aHandler Event handler
       
    68 	 */
       
    69 	virtual void RemoveEventHandler( IAlfWidgetEventHandler& aHandler ) = 0;
       
    70 	
       
    71 	/**
       
    72 	 * Return container layout of embeded widget
       
    73 	 * Parent can use this api to show or hide widget and position child widget.
       
    74 	 * 
       
    75 	 * @return Layout of embeded widget.
       
    76 	 */
       
    77 	virtual const CAlfLayout& ContainerLayout() = 0;
       
    78 	
       
    79     };
       
    80 
       
    81 
       
    82     } // namespace Alf
       
    83 
       
    84 #endif // I_MULEMBEDABLEWIDGET_H
       
    85 
       
    86 //End of file
       
    87