src/hbwidgets/sliders/hbratingslider.h
changeset 34 ed14f46c0e55
parent 1 f7ac710697a9
equal deleted inserted replaced
31:7516d6d86cf5 34:ed14f46c0e55
    32 
    32 
    33 class HB_WIDGETS_EXPORT HbRatingSlider : public HbWidget
    33 class HB_WIDGETS_EXPORT HbRatingSlider : public HbWidget
    34 {
    34 {
    35     Q_OBJECT
    35     Q_OBJECT
    36     Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
    36     Q_PROPERTY(bool readOnly READ isReadOnly WRITE setReadOnly)
    37 	Q_PROPERTY(int numberOfIcons READ numberOfIcons WRITE setNumberOfIcons)
    37     Q_PROPERTY(int numberOfIcons READ numberOfIcons WRITE setNumberOfIcons)
    38 	Q_PROPERTY(int stepCount READ stepCount WRITE setStepCount)
    38     Q_PROPERTY(int stepCount READ stepCount WRITE setStepCount)
    39 	Q_PROPERTY(int currentRating READ currentRating WRITE setCurrentRating)
    39     Q_PROPERTY(int currentRating READ currentRating WRITE setCurrentRating)
    40 	Q_PROPERTY(QString unRatedIconName READ unRatedIconName WRITE setUnRatedIconName)
    40     Q_PROPERTY(QString unRatedIconName READ unRatedIconName WRITE setUnRatedIconName)
    41 	Q_PROPERTY(QString ratedIconName READ ratedIconName WRITE setRatedIconName)
    41     Q_PROPERTY(QString ratedIconName READ ratedIconName WRITE setRatedIconName)
       
    42     Q_PROPERTY(QString toolTipText READ toolTipText WRITE setToolTipText)
    42 
    43 
    43 public:
    44 public:
    44     explicit HbRatingSlider(QGraphicsItem *parent = 0);
    45     explicit HbRatingSlider(QGraphicsItem *parent = 0);
    45     ~HbRatingSlider();
    46     ~HbRatingSlider();
    46 
    47 
    47     enum { Type = Hb::ItemType_RatingSlider };
    48     enum { Type = Hb::ItemType_RatingSlider };
    48     int type() const { return Type; }
    49     int type() const { return Type; }
    49 	
    50     
    50 	void setNumberOfIcons(int number);
    51     void setNumberOfIcons(int number);
    51 	int numberOfIcons() const;
    52     int numberOfIcons() const;
    52 
    53 
    53 	void setStepCount(int count);
    54     void setStepCount(int count);
    54 	int stepCount()const;
    55     int stepCount()const;
    55 
    56 
    56     bool isReadOnly() const;
    57     bool isReadOnly() const;
    57     void setReadOnly(bool value);
    58     void setReadOnly(bool value);
    58 
    59 
    59     void setCurrentRating(int currentRating);
    60     void setCurrentRating(int currentRating);
    61 
    62 
    62     void setUnRatedIconName(const QString name);
    63     void setUnRatedIconName(const QString name);
    63     QString unRatedIconName() const;
    64     QString unRatedIconName() const;
    64 
    65 
    65     void setRatedIconName(const QString name);
    66     void setRatedIconName(const QString name);
    66 	QString ratedIconName() const;
    67     QString ratedIconName() const;
    67 
    68 
    68 	QGraphicsItem * primitive(HbStyle::Primitive primitive) const; 
    69     void setToolTipText(const QString tooltip);
    69 	
    70     QString toolTipText() const;
    70 	void setGeometry(const QRectF &rect);
    71 
       
    72     void setGeometry(const QRectF &rect);
       
    73 
       
    74     QGraphicsItem *primitive(const QString &itemName) const;
    71 
    75 
    72 public slots :
    76 public slots :
    73     void updatePrimitives();
    77     void updatePrimitives();
    74 
    78 
    75 signals:
    79 signals:
    80     HbRatingSlider(HbRatingSliderPrivate &dd,QGraphicsItem *parent = 0);
    84     HbRatingSlider(HbRatingSliderPrivate &dd,QGraphicsItem *parent = 0);
    81 
    85 
    82     void mousePressEvent(QGraphicsSceneMouseEvent *event);
    86     void mousePressEvent(QGraphicsSceneMouseEvent *event);
    83 #ifndef HB_GESTURE_FW
    87 #ifndef HB_GESTURE_FW
    84     void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
    88     void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
    85     void mouseMoveEvent (QGraphicsSceneMouseEvent *event) ;    
    89     void mouseMoveEvent (QGraphicsSceneMouseEvent *event) ;
    86 #else
    90 #else
    87     virtual void gestureEvent(QGestureEvent *event);
    91     virtual void gestureEvent(QGestureEvent *event);
    88 #endif
    92 #endif
    89     void initStyleOption(HbStyleOption *option) const;
    93     void initStyleOption(HbStyleOption *option) const;
    90     void changeEvent(QEvent *event);
    94     void changeEvent(QEvent *event);
    91 	QVariant itemChange(GraphicsItemChange change, const QVariant &value);
    95     QVariant itemChange(GraphicsItemChange change, const QVariant &value);
    92 
    96 
    93 private:
    97 private:
    94     Q_DECLARE_PRIVATE_D( d_ptr, HbRatingSlider)
    98     Q_DECLARE_PRIVATE_D( d_ptr, HbRatingSlider)
    95     Q_DISABLE_COPY( HbRatingSlider )
    99     Q_DISABLE_COPY( HbRatingSlider )
    96 };
   100 };