mmuifw_plat/alf_scrollbarwidget_api/inc/alf/ialfscrollbarwidget.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 scrollbar widget.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef I_ALF_SCROLLBARWIDGET_H
       
    19 #define I_ALF_SCROLLBARWIDGET_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 
       
    27 //osn includes
       
    28 #include <osn/osndefines.h>
       
    29 #include <osn/ustring.h>
       
    30 
       
    31 namespace Alf
       
    32     {
       
    33 namespace alfscrollbarwidget
       
    34     {
       
    35     /**
       
    36      * @namespace alfscrollbarwidget
       
    37      * 
       
    38      * ident specifies the unique identifier for the grid widget.
       
    39      */
       
    40     static const IfId ident =
       
    41         {
       
    42         0, "alfscrollbarwidget"
       
    43         };
       
    44     static const Utf8* const KBaseElementName = "BaseElement";
       
    45     }
       
    46 
       
    47 /**
       
    48  * Enumeration of selectionchanged events generated by the grid widget.
       
    49  */
       
    50 enum
       
    51     {
       
    52     EEventScrollBarClicked = ELastCommonWidgetEvent+1111,
       
    53     EEventScrollBarTouchDown,
       
    54     EEventScrollBarDrag
       
    55     };
       
    56     
       
    57     
       
    58 /**
       
    59  * Interface for the scrollbar widget.
       
    60  *
       
    61  * Default visualization of scrollbar contains following components.
       
    62  * <ul>
       
    63  * <li>Thumb (The size of the Thumb shows the amount of scrollable content)</li>
       
    64  * <li>Track (Place holder for Thumb)</li>
       
    65  * </ul>
       
    66  * 
       
    67  * A scrollbar widget is used along with a scrollable widget,  
       
    68  * <ul> 
       
    69  * <li>to show the amount of scrollable content inside scrollable widget by 
       
    70  * means of thumb size</li>
       
    71  * <li>to generate scroll events(MoveUp and Movedown, PageUp PageDown and drag)
       
    72  * </li>
       
    73  * <li>to show the view start position in the scrollbale content</li>
       
    74  * </ul>
       
    75  *
       
    76  * The communication between scrollbar and scrollable widget happens through 
       
    77  * events. Scrollbar handles only pointer events which are converted to higher
       
    78  * level events like <b>EEventScrollUp, EEventScrollDown, EEventScrollLeft,
       
    79  * EEventScrollRight, EEventScrollPageUp, EEventScrollPageDown, 
       
    80  * EEventScrollPageLeft and EEventScrollPageRight</b>
       
    81  * and sent to scrollable widget.Scrollable widget can also generate similar 
       
    82  * higher level events in response to key and pointer events.In which case it 
       
    83  * is scrollable widget's resposibility to send these events to scrollbar.
       
    84  *
       
    85  */
       
    86 class IAlfScrollBarWidget: public IAlfWidget
       
    87     {
       
    88 public:
       
    89     /**
       
    90      * Get the type of widget.
       
    91      * 
       
    92      * @return The type of widget
       
    93      */
       
    94     static  const IfId& type()
       
    95         {
       
    96         return alfscrollbarwidget::ident;
       
    97         }
       
    98 
       
    99     /**
       
   100      * Gets the Base Element Name.
       
   101      *
       
   102      * @return The base element's name
       
   103      */
       
   104     static inline const char* baseElementName()
       
   105         {
       
   106         return alfscrollbarwidget::KBaseElementName;
       
   107         }
       
   108         
       
   109     /**
       
   110      * Destructor.
       
   111      */	
       
   112     virtual ~IAlfScrollBarWidget() {}
       
   113     /**
       
   114      * Sets whether or not tactile feedback is enabled.
       
   115      *
       
   116      * @param aFlag Whether or not tactile is enabled.
       
   117      */
       
   118     virtual void enableTactile(bool aFlag) = 0; 
       
   119     
       
   120     /**
       
   121      * Returns the state of tactile feedback whether it is enabled/disabled.
       
   122      *
       
   123      * @param aEnabled Whether or not tactile is enabled.
       
   124      */
       
   125     virtual bool IsTactileEnabled() = 0;
       
   126 
       
   127     };
       
   128 
       
   129     } // namespace Alf
       
   130 
       
   131 #endif // IALF_SCROLLBARWIDGET_H
       
   132 //End Of File