mmuifw_plat/alf_scrollbarwidget_api/inc/alf/ialfscrollbardefaultbaseelement.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:  interface for the scrollbar default lct base element.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef I_ALF_SCROLLBARDEFAULTLCTBASEELEMENT_H
       
    19 #define I_ALF_SCROLLBARDEFAULTLCTBASEELEMENT_H
       
    20 
       
    21 #include <alf/ialfelement.h>
       
    22 #include <alf/ialfwidget.h>
       
    23 #include <alf/ialfinterfacebase.h>
       
    24 #include <alf/alfevent.h>
       
    25 #include <alf/alfwidgetevents.h>
       
    26 
       
    27 using namespace osncore;
       
    28 
       
    29 namespace Alf
       
    30     {
       
    31     /**
       
    32      * @namespace alfscrollbardefaultbaseelement
       
    33      *
       
    34      * ident specifies the unique identifier for the base-element.
       
    35      */
       
    36     namespace alfscrollbardefaultbaseelement
       
    37         {
       
    38         static const IfId ident =
       
    39             {
       
    40             0,"BaseElement" 
       
    41             };
       
    42         }
       
    43 /**
       
    44  * An interface for the default base element of the scrollbar.
       
    45  *
       
    46  * The default base element is an interface that contains the basic layouting and scrolling logic of the scrollbar widget.
       
    47  * The base element provides a simple scrollbar visualization.
       
    48  * It allows the user to:
       
    49  * 1. Specify the TotalLength  ViewLength and ThumbWidth
       
    50  * 2. Specify the opacity of thumb with respect to widget opacity
       
    51  *
       
    52  * The default  base element of the scrollbar uses Anchor Layout  
       
    53  *
       
    54  * The default base element also acts as an eventhandler and currently listens to following events:
       
    55  * 1. EEventModelChanged, EEventScrollBarClicked
       
    56  *
       
    57  * default  base element handles EEventScrollBarClicked event(Custom Event) which are convetred to higher level events
       
    58  * like EEventScrollUp ,EEventScrollDown,EEventScrollLeft,EEventScrollRight ,
       
    59  * On receiving these events, the default base element accordingly changes the position of the thumb  
       
    60  *
       
    61  * 
       
    62  *  @lib alfscrollbarwidget.lib
       
    63 
       
    64  *  @since S60 ?S60_version
       
    65  */
       
    66 class IAlfScrollBarDefaultBaseElement: public IAlfInterfaceBase 
       
    67     {
       
    68 
       
    69 public:
       
    70     
       
    71     /**
       
    72      * Getter for the type identifier of this interface.
       
    73      * Usage:
       
    74      * @code
       
    75      * IAlfElement* element;
       
    76      * IAlfBaseElement* baseElement = 
       
    77      * static_cast<IAlfScrollBarBaseElement*> ( 
       
    78      * element->makeInterface (IAlfScrollBarBaseElement::type() ) );
       
    79      * @endcode
       
    80      * @see \link IAlfInterfaceBase \endlink for
       
    81      * \link IAlfInterfaceBase::makeInterface \endlink
       
    82      * The above code provides all the interfaces of ScrollBar base element.
       
    83      * @since S60 ?S60_version
       
    84      * @return Identifier of this interface.
       
    85      */
       
    86     static inline const IfId& type()
       
    87         {
       
    88         return alfscrollbardefaultbaseelement :: ident;
       
    89         }
       
    90     
       
    91     
       
    92     /**
       
    93      * Sets the animation time for the thumb movement
       
    94      * Controls the movement of the thumb in the context of
       
    95      * scroll
       
    96      * @param aTime, Animation time in milliseconds
       
    97      */
       
    98     virtual void setThumbAnimationTime ( int aTime ) = 0;
       
    99 
       
   100     /**
       
   101      * Gets the Thumb animation time.
       
   102      *
       
   103      * @return Animation time.
       
   104      */
       
   105     virtual int getThumbAnimationTime() const = 0;
       
   106 
       
   107     /**
       
   108      * This function is deprecated. Use attribute APIs to set or get opacity.
       
   109      * Sets the Opacity of widget.
       
   110      * Default value of scrollbar opacity is 1.0.
       
   111      * 
       
   112      * @param aOpacity Opacity of the scrollbar. The value should be between 0.0
       
   113      *                  to 1.0. 
       
   114      *
       
   115      * @exception AlfException
       
   116      */
       
   117     virtual void setOpacity(float aOpacity)=0;
       
   118 
       
   119     /**
       
   120      * This function is deprecated. Use attribute APIs to set or get opacity.
       
   121      * Gets the Opacity of widget.
       
   122      *
       
   123      * @return: Thumb opacity
       
   124      */
       
   125     virtual float getOpacity() const=0;
       
   126     
       
   127     /**
       
   128      * Sets the Opacity of thumb. This is relative to widget opacity.Default value is 1.0.
       
   129      * The value of aOpacity should be between 0.0 to 1.0
       
   130      * @param aOpacity Opacity of the thumb
       
   131      */
       
   132     virtual void setThumbOpacity ( float aOpacity ) = 0;
       
   133 
       
   134     /**
       
   135      * Gets the Opacity of thumb.
       
   136      *
       
   137      * @return: Thumb opacity
       
   138      */
       
   139     virtual float getThumbOpacity() const = 0;
       
   140     
       
   141 
       
   142     /** 
       
   143      * Destructor.
       
   144      */
       
   145     virtual ~IAlfScrollBarDefaultBaseElement() {}
       
   146     }; // class IAlfScrollBarDefaultBaseElement
       
   147     } // namespace Alf
       
   148 
       
   149 #endif // IALF_SCROLLBARDEFAULTLCTBASEELEMENT_H