diff -r 41c0a814d878 -r 6c9acdc6adc0 logsui/logsapp/tsrc/ut_logsapp/stubs/hbstubs.cpp --- a/logsui/logsapp/tsrc/ut_logsapp/stubs/hbstubs.cpp Fri Jun 11 13:38:41 2010 +0300 +++ b/logsui/logsapp/tsrc/ut_logsapp/stubs/hbstubs.cpp Thu Jun 24 14:44:14 2010 +0300 @@ -29,6 +29,8 @@ #include #include #include +#include +#include int actionCount = 0; Qt::Orientation windowOrientation = Qt::Vertical; @@ -50,6 +52,9 @@ HbActivityManager testActivityManager; Hb::ActivationReason testActivationReason = Hb::ActivationReasonNormal; QString testActivityId = "LogsViewMatches"; +QList testViewItems; +bool testEnsureVisibleCalled = false; +bool testScrollToCalled = false; void HbStubHelper::reset() { @@ -63,10 +68,12 @@ testActivationReason = Hb::ActivationReasonNormal; testActivityId = "LogsViewMatches"; testActivities.clear(); + qDeleteAll(testViewItems); + testViewItems.clear(); + testScrollToCalled = false; + testEnsureVisibleCalled = false; } - - int HbStubHelper::widgetActionsCount() { return actionCount; @@ -135,6 +142,21 @@ testActivityId = activityId; } +QList& HbStubHelper::listItems() +{ + return testViewItems; +} + +bool HbStubHelper::listScrollToCalled() +{ + return testScrollToCalled; +} + +bool HbStubHelper::listEnsureVisibleCalled() +{ + return testEnsureVisibleCalled; +} + // ----------------------------------------------------------------------------- // // ----------------------------------------------------------------------------- @@ -331,7 +353,6 @@ void HbMainWindow::setCurrentView(HbView *view, bool animate, Hb::ViewSwitchFlags flags) { - Q_UNUSED(animate) Q_UNUSED(flags) testView = view; } @@ -404,3 +425,39 @@ Q_UNUSED(colorRole); return testColor; } + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HbListView::scrollTo(const QModelIndex &index, ScrollHint hint) +{ + Q_UNUSED(index); + Q_UNUSED(hint); + testScrollToCalled = true; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +QList HbAbstractItemView::visibleItems() const +{ + QList visible; + foreach ( HbListViewItem* item, testViewItems ){ + visible.append( item ); + } + return visible; +} + +// ----------------------------------------------------------------------------- +// +// ----------------------------------------------------------------------------- +// +void HbScrollArea::ensureVisible(const QPointF &position, qreal xMargin, qreal yMargin) +{ + Q_UNUSED(position); + Q_UNUSED(xMargin); + Q_UNUSED(yMargin); + testEnsureVisibleCalled = true; +}