src/hbwidgets/itemviews/hbabstractviewitem.h
changeset 34 ed14f46c0e55
parent 3 11d3954df52a
equal deleted inserted replaced
31:7516d6d86cf5 34:ed14f46c0e55
    30 #include <hbnamespace.h>
    30 #include <hbnamespace.h>
    31 #include <hbeffect.h>
    31 #include <hbeffect.h>
    32 
    32 
    33 #include <QHash>
    33 #include <QHash>
    34 
    34 
    35 QT_BEGIN_NAMESPACE
       
    36 class QModelIndex;
       
    37 QT_END_NAMESPACE
       
    38 
       
    39 class HbAbstractViewItemPrivate;
    35 class HbAbstractViewItemPrivate;
    40 class HbAbstractViewItemShared;
    36 class HbAbstractViewItemShared;
    41 class HbAbstractItemView;
    37 class HbAbstractItemView;
    42 class HbStyleOptionAbstractViewItem;
       
    43 class HbStyleParameters;
    38 class HbStyleParameters;
    44 class HbFrameBackground;
    39 class HbFrameBackground;
       
    40 class HbStylePrimitiveData;
       
    41 
       
    42 class QGraphicsObject;
       
    43 class QModelIndex;
    45 
    44 
    46 class HB_WIDGETS_EXPORT HbAbstractViewItem : public HbWidget
    45 class HB_WIDGETS_EXPORT HbAbstractViewItem : public HbWidget
    47 {
    46 {
    48     Q_OBJECT
    47     Q_OBJECT
    49 
    48 
    85     void setDefaultFrame(const HbFrameBackground &frame);
    84     void setDefaultFrame(const HbFrameBackground &frame);
    86     HbFrameBackground defaultFrame() const;
    85     HbFrameBackground defaultFrame() const;
    87 
    86 
    88     Hb::ModelItemType modelItemType() const;
    87     Hb::ModelItemType modelItemType() const;
    89 
    88 
       
    89     virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
       
    90 
    90 public slots:
    91 public slots:
    91     void updatePrimitives();
    92     void updatePrimitives();
    92 
    93 
    93 signals:
    94 signals:
    94     void pressed(const QPointF &position);
    95     void pressed(const QPointF &position);
   100 
   101 
   101     HbAbstractViewItem(const HbAbstractViewItem &source);
   102     HbAbstractViewItem(const HbAbstractViewItem &source);
   102     HbAbstractViewItem &operator=(const HbAbstractViewItem &source);
   103     HbAbstractViewItem &operator=(const HbAbstractViewItem &source);
   103 
   104 
   104     HbAbstractViewItem( HbAbstractViewItemPrivate &dd, QGraphicsItem *parent );
   105     HbAbstractViewItem( HbAbstractViewItemPrivate &dd, QGraphicsItem *parent );
   105     void initStyleOption(HbStyleOptionAbstractViewItem *option) const;
   106     void initPrimitiveData( HbStylePrimitiveData     *primitiveData, 
       
   107                             const QGraphicsObject    *primitive);
   106     virtual void polish(HbStyleParameters& params);
   108     virtual void polish(HbStyleParameters& params);
   107 
   109 
   108     virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
   110     virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value);
   109     virtual bool event(QEvent *e);
   111     virtual bool event(QEvent *e);
   110 
   112 
   112 
   114 
   113     virtual void pressStateChanged(bool value, bool animate);
   115     virtual void pressStateChanged(bool value, bool animate);
   114 
   116 
   115     virtual void gestureEvent(QGestureEvent *event);
   117     virtual void gestureEvent(QGestureEvent *event);
   116 
   118 
       
   119     virtual void changeEvent(QEvent *event);
       
   120 
       
   121 protected slots:
       
   122     
       
   123     void updatePixmapCache();
       
   124 
   117 private:
   125 private:
   118     Q_DECLARE_PRIVATE_D( d_ptr, HbAbstractViewItem )
   126     Q_DECLARE_PRIVATE_D( d_ptr, HbAbstractViewItem )
   119     Q_PRIVATE_SLOT(d_func(), void _q_animationFinished(const HbEffect::EffectStatus &status))
   127     Q_PRIVATE_SLOT(d_func(), void _q_animationFinished(const HbEffect::EffectStatus &status))
       
   128     Q_PRIVATE_SLOT(d_func(), void _q_childrenChanged())
   120 
   129 
   121     friend class HbAbstractViewItemShared;
   130     friend class HbAbstractViewItemShared;
   122 };
   131 };
   123 
   132 
   124 #endif /*HBABSTRACTVIEWITEM_H*/
   133 #endif /*HBABSTRACTVIEWITEM_H*/