mmuifw_plat/mul_sliderwidget_api/inc/mul/imulsliderwidget.h
changeset 17 3eca7e70b1b8
parent 3 4526337fb576
equal deleted inserted replaced
3:4526337fb576 17:3eca7e70b1b8
     1 /*
       
     2 * Copyright (c) 2007 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:  Widget interface with utilities for slider widget.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef I_MUL_SLIDERWIDGET_H
       
    19 #define I_MUL_SLIDERWIDGET_H
       
    20 
       
    21 //WidgetModel includes
       
    22 #include <alf/ialfwidget.h>
       
    23 #include <alf/alfevent.h>
       
    24 #include <alf/alfwidgetevents.h>
       
    25 #include <alf/ialfwidgetfactory.h>
       
    26 #include <mul/imulslidermodel.h>
       
    27 #include <alf/alflayout.h>
       
    28 #include<alf/ialfwidgeteventhandler.h>
       
    29 //osn includes
       
    30 #include <osn/osndefines.h>
       
    31 #include <osn/ustring.h>
       
    32 
       
    33 namespace Alf
       
    34     {
       
    35 namespace mulsliderwidget
       
    36     {
       
    37     /**
       
    38      * @namespace mulsliderwidget
       
    39      * 
       
    40      * ident specifies the unique identifier for the grid widget.
       
    41      */
       
    42     static const IfId ident =
       
    43         {
       
    44         0, "mulsliderwidget"
       
    45         };
       
    46     static const Utf8* const KBaseElementName = "BaseElement";
       
    47     }
       
    48 
       
    49 
       
    50 
       
    51 /**
       
    52  * The data which can be used as last (optional) paramenter of 
       
    53  * IAlfWidgetFactory::createWidget function while creating the slider widget 
       
    54  * imperatively. If this data is not passed, default values are used
       
    55  * to create visualization.
       
    56  *
       
    57  */
       
    58 class MulSliderInitData : public AlfCustomInitDataBase
       
    59     {
       
    60 public:
       
    61     /**
       
    62      * mBaseElementLoadId visualization base element is created 
       
    63      *             using Load ID.
       
    64      */
       
    65     const char* mBaseElementLoadId;
       
    66     
       
    67     /* mBaseElementData pointed to baseElement custom data
       
    68 	   * All baseelement related data are in this class
       
    69      */
       
    70  
       
    71     AlfCustomInitDataBase *mBaseElementData;
       
    72     };
       
    73     
       
    74     
       
    75 /**
       
    76  * Interface for the slider widget.
       
    77  *
       
    78  *
       
    79  * Default visualization of slider contains following components.
       
    80  * <ul>
       
    81  * <li>Handle (The position of the handle shows the current tick position)</li>
       
    82  * <li>Track (Place holder for Handle)</li>
       
    83  * </ul>
       
    84  *
       
    85  *
       
    86  *  A slider widget is used along with photos,coverflow and list widget.
       
    87  * <ul> 
       
    88  * <li> template 1 is used i.e. in 2D coverflow as a navigational component.
       
    89  * 
       
    90  * <li> template 3 is used i.e. in Photos as a pop-up zoom slider.
       
    91  *
       
    92  * <li> template 7 is used i.e. in Video Centre list view as a progressive
       
    93  * downloading track counter/progress bar.
       
    94  * There is no potrait version of this template.
       
    95  * 
       
    96  * </ul>
       
    97  * The communication between slider and the widgets happens by means of an
       
    98  * event ETypePrimaryValueChange from slider and in response widgets directly
       
    99  * update slider's model.
       
   100  * Slider handles both Key and Pointer Events.
       
   101  *
       
   102  * KeyEvents : EStdKeyRightArrow,EStdKeyLeftArrow,EEventKeyDown,EEventKeyUp.
       
   103  * PointerEvents : EButton1Down,EDrag.
       
   104  *
       
   105  *
       
   106  */
       
   107 class IMulSliderWidget: public IAlfWidget
       
   108     {
       
   109 public:
       
   110     /**
       
   111      * Get the type of widget.
       
   112      * 
       
   113      * @return The type of widget
       
   114      */
       
   115     static  const IfId& type()
       
   116         {
       
   117         return mulsliderwidget::ident;
       
   118         }
       
   119 
       
   120     /**
       
   121      * Gets the Base Element Name.
       
   122      *
       
   123      * @return The base element's name
       
   124      */
       
   125     static inline const char* baseElementName()
       
   126         {
       
   127         return mulsliderwidget::KBaseElementName;
       
   128         }
       
   129     	/**
       
   130 		 * Get the model for widget.
       
   131 		 *
       
   132 		 * @return model of the slider widget
       
   133 		 */
       
   134 		virtual IMulSliderModel& SliderModel() = 0;
       
   135 		
       
   136 		/**
       
   137 		 * Set the transparency for the background of the slider widget.
       
   138 		 *
       
   139 		 * @param True,  to set background as transparent
       
   140 		 * @param False, to set background as opaque	
       
   141 		 */
       
   142 		virtual void MakeTransparent( bool aTransparent ) = 0;
       
   143 		
       
   144 		/**
       
   145 		 * Enable/Disable key handling .
       
   146 		 *
       
   147 		 * @param aVal: True,  to handle keyevents by Application
       
   148 		 * 		 	  False, to handle keyevents as defined in the control	
       
   149 		 */
       
   150 		virtual void SetHandleKeyEvent( bool aVal ) = 0;    
       
   151 		/**
       
   152 		 * Hide or Show widget  .
       
   153 		 *
       
   154 		 * @param aShow: True,  Shows the widget
       
   155 		 * 		 	  False, Hides the widget	
       
   156 		 * @param aTransitionTime: Transition time to show/Hide.
       
   157 		 */
       
   158 		virtual void ShowWidget(bool aShow, int aTransitionTime =0) = 0;
       
   159 		/**
       
   160 		 * Returns the state of the Widget(Hide/show).
       
   161 		 *
       
   162 		 */
       
   163 		virtual bool IsHidden() = 0;
       
   164 		
       
   165 		/**
       
   166 		 * Returns the container layout.
       
   167 		 *
       
   168 		 */
       
   169 		virtual const CAlfLayout& ContainerLayout() = 0; 
       
   170     	   /**
       
   171 		 * Add an observer to widget inorder to get event notifications
       
   172 		 * from the widget. Widget can have multiple observersers.
       
   173 		 *
       
   174 		 * @param aObserver Observer of widget.
       
   175 		 **/
       
   176 		virtual void AddEventHandler( IAlfWidgetEventHandler& aObserver) = 0;
       
   177 		/**
       
   178 		 * Remove an observer to widget
       
   179 		 *
       
   180 		 * @param aObserver Observer of widget.
       
   181 		 */
       
   182 		virtual void RemoveEventHandler( IAlfWidgetEventHandler& aObserver) = 0;  
       
   183     /**
       
   184      * Destructor.
       
   185      */	
       
   186     virtual ~IMulSliderWidget() {}
       
   187 
       
   188     };
       
   189 
       
   190     } // namespace Alf
       
   191 
       
   192 #endif // I_MUL_SLIDERWIDGET_H
       
   193 //End Of File