--- a/ganeswidgets/inc/HgContainer.h Fri Sep 17 08:35:50 2010 +0300
+++ b/ganeswidgets/inc/HgContainer.h Mon Oct 04 02:07:13 2010 +0300
@@ -45,8 +45,8 @@
void setItemCount(int count);
int itemCount() const;
- int rowCount() const;
-
+ int currentRowCount() const;
+
QList<HgWidgetItem*> items() const;
HgWidgetItem* itemByIndex(const QModelIndex &index) const;
HgWidgetItem* itemByIndex(const int &index) const;
@@ -58,7 +58,7 @@
void dimensions(qreal &screenSize, qreal &worldSize);
Qt::Orientation orientation() const;
- void setOrientation(Qt::Orientation orientation, bool animate=true);
+ virtual void setOrientation(Qt::Orientation orientation, bool animate=true);
// new size for the widget. calls resize.
void scrollToPosition(qreal value, bool animate = false);
@@ -138,10 +138,12 @@
virtual HgMediaWallRenderer* createRenderer(Qt::Orientation scrollDirection)=0;
virtual qreal getCameraDistance(qreal springVelocity);
virtual qreal getCameraRotationY(qreal springVelocity);
- virtual void handleTapAction(const QPointF& pos, HgWidgetItem* hitItem, int hitItemIndex);
- virtual void handleLongTapAction(const QPointF& pos, HgWidgetItem* hitItem, int hitItemIndex);
+ virtual bool handleTapAction(const QPointF& pos, HgWidgetItem* hitItem, int hitItemIndex);
+ virtual bool handleLongTapAction(const QPointF& pos, HgWidgetItem* hitItem, int hitItemIndex);
virtual void onScrollPositionChanged(qreal pos);
virtual void loadIndicatorGraphics(bool loadIfExists = false);
+ virtual bool handleTap(Qt::GestureState state, const QPointF &pos) = 0;
+ virtual bool handleLongTap(Qt::GestureState state, const QPointF &pos);
protected:
@@ -159,9 +161,6 @@
void initSpringForScrolling();
void boundSpring();
bool handlePanning(QPanGesture *gesture);
- bool handleTap(Qt::GestureState state, const QPointF &pos);
- bool handleLongTap(Qt::GestureState state, const QPointF &pos);
- bool handleItemAction(const QPointF &pos, ItemActionType action);
void selectItem(int index);
void updateSelectedItem();
@@ -171,8 +170,7 @@
HgWidgetItem* getItemAt(const QPointF& pos, int& index);
void startLongPressWatcher(const QPointF& pos);
void stopLongPressWatcher();
- bool updateSelectionModel(HgWidgetItem* item);
-
+ bool handleItemSelection(HgWidgetItem* item);
virtual void updateItemSizeAndSpacing();
virtual QSizeF getAutoItemSize() const;
@@ -226,6 +224,7 @@
QModelIndex mDelayedScrollToIndex;
bool mIgnoreGestureAction;
bool mHandleLongPress;
+ bool mEmitScrollingEnded;
};
#endif