src/hbwidgets/sliders/hbprogressslider.h
changeset 0 16d8024aca5e
child 1 f7ac710697a9
equal deleted inserted replaced
-1:000000000000 0:16d8024aca5e
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (developer.feedback@nokia.com)
       
     6 **
       
     7 ** This file is part of the HbWidgets module of the UI Extensions for Mobile.
       
     8 **
       
     9 ** GNU Lesser General Public License Usage
       
    10 ** This file may be used under the terms of the GNU Lesser General Public
       
    11 ** License version 2.1 as published by the Free Software Foundation and
       
    12 ** appearing in the file LICENSE.LGPL included in the packaging of this file.
       
    13 ** Please review the following information to ensure the GNU Lesser General
       
    14 ** Public License version 2.1 requirements will be met:
       
    15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    16 **
       
    17 ** In addition, as a special exception, Nokia gives you certain additional
       
    18 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    20 **
       
    21 ** If you have questions regarding the use of this file, please contact
       
    22 ** Nokia at developer.feedback@nokia.com.
       
    23 **
       
    24 ****************************************************************************/
       
    25 
       
    26 #ifndef HBPROGRESSSLIDER_H
       
    27 #define HBPROGRESSSLIDER_H
       
    28 
       
    29 #include <hbprogressbar.h>
       
    30 #include <hbicon.h>
       
    31 
       
    32 class HbProgressSliderPrivate;
       
    33 
       
    34 class HB_WIDGETS_EXPORT HbProgressSlider : public HbProgressBar
       
    35 {
       
    36     Q_OBJECT
       
    37     Q_PROPERTY(int sliderValue READ sliderValue WRITE setSliderValue)
       
    38     Q_PROPERTY(HbIcon thumbIcon READ thumbIcon WRITE setThumbIcon)
       
    39     Q_PROPERTY(QString sliderToolTip READ sliderToolTip WRITE setSliderToolTip)
       
    40     Q_PROPERTY(SliderState state READ sliderState WRITE setSliderState)
       
    41     Q_ENUMS(SliderState)
       
    42 
       
    43     /* Deprecated */
       
    44     Q_PROPERTY(QString handleToolTip READ handleToolTip WRITE setHandleToolTip)
       
    45     Q_PROPERTY(HandleState state READ handleState WRITE setHandleState)    
       
    46 
       
    47 public:
       
    48 
       
    49     /* Deprecated */
       
    50     enum HandleState
       
    51     {
       
    52         PlayNormal,
       
    53         PlayPressed,
       
    54         PauseNormal,
       
    55         PausePressed
       
    56     };
       
    57 
       
    58     enum SliderState
       
    59     {
       
    60         SliderStatePlayNormal,
       
    61         SliderStatePlayPressed,
       
    62         SliderStatePauseNormal,
       
    63         SliderStatePausePressed
       
    64     };
       
    65 
       
    66     HbProgressSlider(QGraphicsItem *parent = 0);
       
    67     ~HbProgressSlider();
       
    68 
       
    69     void setThumbIcon(const HbIcon &icon);
       
    70     HbIcon thumbIcon() const;
       
    71 
       
    72     enum { Type = Hb::ItemType_ProgressSlider };
       
    73     int type() const { return Type; }
       
    74 
       
    75     virtual void setInvertedAppearance(bool inverted);
       
    76 
       
    77     virtual void setGeometry(const QRectF & rect);
       
    78 
       
    79     int sliderValue() const;
       
    80     bool isSliderDown() const;
       
    81 
       
    82     /* Deprecated*/
       
    83     void setHandleToolTip(const QString &text);
       
    84     QString handleToolTip() const;
       
    85 
       
    86     /* Deprecated*/
       
    87     void setHandleState(HbProgressSlider::HandleState state);
       
    88     HbProgressSlider::HandleState handleState() const;
       
    89 
       
    90     void setSliderToolTip(const QString &text);
       
    91     QString sliderToolTip() const;
       
    92 
       
    93     void setSliderState(HbProgressSlider::SliderState state);
       
    94     HbProgressSlider::SliderState sliderState() const;
       
    95 
       
    96     QGraphicsItem* primitive(HbStyle::Primitive primitive) const; 
       
    97 
       
    98 signals:
       
    99     void sliderPressed();
       
   100     void sliderReleased();
       
   101     void sliderMoved(int value);
       
   102 
       
   103 public slots :
       
   104     void setSliderValue(int value);
       
   105     void updatePrimitives();
       
   106 
       
   107 protected:
       
   108     HbProgressSlider(HbProgressSliderPrivate &dd,QGraphicsItem *parent = 0);
       
   109     void mousePressEvent(QGraphicsSceneMouseEvent *event);
       
   110     void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
       
   111     void showEvent( QShowEvent * event );
       
   112     virtual void initStyleOption(HbStyleOption *option) const;
       
   113     QVariant itemChange(GraphicsItemChange change,const QVariant & value);
       
   114     bool sceneEventFilter(QGraphicsItem *obj,QEvent *event);
       
   115 
       
   116 private:
       
   117     Q_DECLARE_PRIVATE_D( d_ptr, HbProgressSlider)
       
   118     Q_DISABLE_COPY( HbProgressSlider )
       
   119 };
       
   120 
       
   121 #endif // HBPROGRESSSLIDER_H
       
   122