55 |
55 |
56 void scrollTo(const QModelIndex &index); |
56 void scrollTo(const QModelIndex &index); |
57 |
57 |
58 bool getItemOutline(const QModelIndex& index, QPolygonF& points); |
58 bool getItemOutline(const QModelIndex& index, QPolygonF& points); |
59 void aboutToChangeOrientation(); |
59 void aboutToChangeOrientation(); |
60 void orientationChanged(Qt::Orientation orientation); |
60 virtual void orientationChanged(Qt::Orientation orientation); |
61 |
61 |
62 QList<QModelIndex> getVisibleItemIndices() const; |
62 QList<QModelIndex> getVisibleItemIndices() const; |
63 Qt::Orientation scrollDirection() const; |
63 Qt::Orientation scrollDirection() const; |
64 |
64 |
65 void setIndexFeedbackPolicy( HgWidget::IndexFeedbackPolicy policy); |
65 void setIndexFeedbackPolicy( HgWidget::IndexFeedbackPolicy policy); |
66 HgWidget::IndexFeedbackPolicy indexFeedbackPolicy() const; |
66 HgWidget::IndexFeedbackPolicy indexFeedbackPolicy() const; |
67 void setDefaultImage(QImage defaultImage); |
67 void setDefaultImage(QImage defaultImage); |
68 |
68 |
69 void setItemSizePolicy(HgWidget::ItemSizePolicy policy); |
69 void setItemSizePolicy(HgWidget::ItemSizePolicy policy); |
70 HgWidget::ItemSizePolicy itemSizePolicy() const; |
70 HgWidget::ItemSizePolicy itemSizePolicy() const; |
71 |
71 |
72 void setItemSize(const QSizeF& size); |
72 void setItemSize(const QSizeF& size); |
73 QSizeF itemSize() const; |
73 QSizeF itemSize() const; |
74 |
74 |
75 void setItemSpacing(const QSizeF& size); |
75 void setItemSpacing(const QSizeF& size); |
76 QSizeF itemSpacing() const; |
76 QSizeF itemSpacing() const; |
77 |
77 |
78 HgWidget *q_ptr; |
78 HgWidget *q_ptr; |
79 |
79 |
80 private: |
80 private: |
81 |
81 |
82 void clearCurrentModel(); |
82 void clearCurrentModel(); |
83 void initializeNewModel(); |
83 void initializeNewModel(); |
84 |
84 |
85 void adjustGeometry(); |
85 void adjustGeometry(); |
86 |
86 |
87 void createScrollBar(Qt::Orientation orientation); |
87 void createScrollBar(Qt::Orientation orientation); |
88 |
88 |
89 void setScrollBarPolicy(HgWidget::ScrollBarPolicy policy); |
89 void setScrollBarPolicy(HgWidget::ScrollBarPolicy policy); |
90 void replaceScrollBar(HbScrollBar *scrollBar); |
90 void replaceScrollBar(HbScrollBar *scrollBar); |
91 |
91 |
92 virtual void updateScrollMetrics( qreal pos = 0 ); |
92 virtual void updateScrollMetrics( qreal pos = 0 ); |
93 void prepareScrollBars( qreal pos = 0); |
93 void prepareScrollBars( qreal pos = 0); |
96 void displayScrollBar(qreal pos = 0); |
96 void displayScrollBar(qreal pos = 0); |
97 void setScrollBarMetrics(qreal pos = 0); |
97 void setScrollBarMetrics(qreal pos = 0); |
98 |
98 |
99 void lostForeground(); |
99 void lostForeground(); |
100 void gainedForeground(); |
100 void gainedForeground(); |
101 |
101 virtual void updateCurrentItem(const QModelIndex ¤tItem); |
|
102 |
102 // private slot functions |
103 // private slot functions |
103 void _q_scrollPositionChanged(qreal index, bool scrollBarAnimation); |
104 void _q_scrollPositionChanged(qreal index, bool scrollBarAnimation); |
104 void _q_releaseItems( int releaseStart, int releaseEnd ); |
105 void _q_releaseItems( int releaseStart, int releaseEnd ); |
105 void _q_requestItems( int requestStart, int requestEnd ); |
106 void _q_requestItems( int requestStart, int requestEnd ); |
106 void _q_hideScrollBars(); |
107 void _q_hideScrollBars(); |
110 void _q_moveRows(const QModelIndex &sourceParent, int sourceStart, |
111 void _q_moveRows(const QModelIndex &sourceParent, int sourceStart, |
111 int sourceEnd, const QModelIndex &destinationParent, |
112 int sourceEnd, const QModelIndex &destinationParent, |
112 int destinationRow); |
113 int destinationRow); |
113 void _q_modelReset(); |
114 void _q_modelReset(); |
114 void _q_groovePressed(qreal value, Qt::Orientation orientation); |
115 void _q_groovePressed(qreal value, Qt::Orientation orientation); |
|
116 void _q_updateCurrentItem(const QModelIndex ¤t, const QModelIndex &previous); |
115 |
117 |
116 void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); |
118 void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); |
117 |
119 |
118 void initBufferManager(int itemCount); |
120 void initBufferManager(int itemCount); |
119 |
121 |
120 protected: |
122 protected: |
121 |
|
122 QGraphicsLinearLayout *mLayout; |
|
123 |
123 |
124 HgContainer *mContainer; |
124 HgContainer *mContainer; |
125 HgScrollBufferManager *mBufferManager; |
125 HgScrollBufferManager *mBufferManager; |
126 |
126 |
127 QAbstractItemModel *mModel; |
127 QAbstractItemModel *mModel; |
128 QItemSelectionModel *mSelectionModel; |
|
129 QItemSelectionModel *mDefaultSelectionModel; |
128 QItemSelectionModel *mDefaultSelectionModel; |
130 |
129 |
131 HbScrollBar *mScrollBar; |
130 HbScrollBar *mScrollBar; |
132 HgWidget::ScrollBarPolicy mScrollBarPolicy; |
131 HgWidget::ScrollBarPolicy mScrollBarPolicy; |
133 bool mAbleToScroll; |
132 bool mAbleToScroll; |