--- a/homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsidlestate.h Wed Jun 23 18:03:36 2010 +0300
+++ b/homescreenapp/stateplugins/hshomescreenstateplugin/inc/hsidlestate.h Tue Jul 06 14:06:53 2010 +0300
@@ -22,6 +22,9 @@
#include <QTimer>
#include <QPointF>
#include <QPointer>
+#include <QRectF>
+
+#include "hswidgetpositioningonwidgetmove.h"
#include "hstest_global.h"
HOMESCREEN_TEST_CLASS(HomeScreenStatePluginTest)
@@ -29,6 +32,7 @@
class QGraphicsItem;
class QGraphicsSceneMouseEvent;
class QPropertyAnimation;
+class QGestureEvent;
class HbAction;
class HbContinuousFeedback;
class HsIdleWidget;
@@ -39,6 +43,8 @@
class XQSettingsManager;
#endif
+class HsWidgetHost;
+
class HsIdleState : public QState
{
Q_OBJECT
@@ -50,11 +56,8 @@
signals:
void event_applicationLibrary();
void event_waitInput();
- void event_widgetInteraction();
- void event_sceneInteraction();
void event_moveWidget();
void event_moveScene();
- void event_sceneMenu();
void event_selectWallpaper();
void event_addPage();
void event_removePage();
@@ -77,97 +80,86 @@
void showTrashBin();
void removeActivePage();
void deleteZoneAnimation();
+ QList<QRectF> createInactiveWidgetRects();
+ void updatePagePresentationToWidgetSnap();
+ void resetSnapPosition();
+ void showVerticalLine();
+ void showHorizontalLine();
+ void hideVerticalLine();
+ void hideHorizontalLine();
-private slots:
- void action_disableUserInteraction();
- void action_enableUserInteraction();
+private slots:
void action_idle_setupView();
void action_idle_layoutNewWidgets();
void action_idle_showActivePage();
void action_idle_connectOrientationChangeEventHandler();
+ void action_idle_orientationChanged();
void action_idle_installEventFilter();
void action_idle_cleanupView();
void action_idle_disconnectOrientationChangeEventHandler();
void action_idle_uninstallEventFilter();
void action_waitInput_updateOptionsMenu();
- void action_waitInput_connectMouseEventHandlers();
+ void action_waitInput_connectGestureHandlers();
void action_waitInput_publishIdleKey();
- void action_waitInput_disconnectMouseEventHandlers();
+ void action_waitInput_disconnectGestureHandlers();
void action_waitInput_resetNewWidgets();
- void action_widgetInteraction_connectMouseEventHandlers();
- void action_widgetInteraction_connectGestureTimers();
- void action_widgetInteraction_disconnectMouseEventHandlers();
- void action_widgetInteraction_disconnectGestureTimers();
- void action_sceneInteraction_connectMouseEventHandlers();
- void action_sceneInteraction_connectGestureTimers();
- void action_sceneInteraction_disconnectMouseEventHandlers();
- void action_sceneInteraction_disconnectGestureTimers();
void action_moveWidget_reparentToControlLayer();
void action_moveWidget_startWidgetDragEffect();
- void action_moveWidget_connectMouseEventHandlers();
+ void action_moveWidget_connectGestureHandlers();
+ void action_moveWidget_setWidgetSnap();
+
void action_moveWidget_reparentToPage();
void action_moveWidget_startWidgetDropEffect();
- void action_moveWidget_disconnectMouseEventHandlers();
+ void action_moveWidget_disconnectGestureHandlers();
void action_moveWidget_preventZoneAnimation();
- void action_moveScene_connectMouseEventHandlers();
+ void action_moveWidget_deleteWidgetSnap();
+ void action_moveScene_connectGestureHandlers();
void action_moveScene_moveToNearestPage();
- void action_moveScene_disconnectMouseEventHandlers();
- void action_sceneMenu_showMenu();
+ void action_moveScene_disconnectGestureHandlers();
void action_addPage_addPage();
void action_removePage_removePage();
void action_toggleConnection_toggleConnection();
void action_idle_setupTitle();
void action_idle_cleanupTitle();
-
- void waitInput_onMousePressed(
- QGraphicsItem *watched, QGraphicsSceneMouseEvent *event, bool &filtered);
- void widgetInteraction_onMouseMoved(
- QGraphicsItem *watched, QGraphicsSceneMouseEvent *event, bool &filtered);
- void widgetInteraction_onMouseReleased(
- QGraphicsItem *watched, QGraphicsSceneMouseEvent *event, bool &filtered);
- void sceneInteraction_onMouseMoved(
- QGraphicsItem *watched, QGraphicsSceneMouseEvent *event, bool &filtered);
- void sceneInteraction_onMouseReleased(
- QGraphicsItem *watched, QGraphicsSceneMouseEvent *event, bool &filtered);
- void moveWidget_onMouseMoved(
- QGraphicsItem *watched, QGraphicsSceneMouseEvent *event, bool &filtered);
- void moveWidget_onMouseReleased(
- QGraphicsItem *watched, QGraphicsSceneMouseEvent *event, bool &filtered);
- void moveScene_onMouseMoved(
- QGraphicsItem *watched, QGraphicsSceneMouseEvent *event, bool &filtered);
- void moveScene_onMouseReleased(
- QGraphicsItem *watched, QGraphicsSceneMouseEvent *event, bool &filtered);
-
- void widgetInteraction_onTapAndHoldTimeout();
- void sceneInteraction_onTapAndHoldTimeout();
+
+ void onPageTapAndHoldFinished(QGestureEvent *event);
+ void onPagePanStarted(QGestureEvent *event);
+ void onPagePanUpdated(QGestureEvent *event);
+ void onPagePanFinished(QGestureEvent *event);
+ void onWidgetTapStarted(HsWidgetHost *widget);
+ void onWidgetTapAndHoldFinished(QGestureEvent *event, HsWidgetHost *widget);
+ void onWidgetMoveUpdated(const QPointF &scenePos, HsWidgetHost *widget);
+ void onWidgetMoveFinished(const QPointF &scenePos, HsWidgetHost *widget);
void onTitleChanged(QString title);
- void onAddContentActionTriggered();
+ void onAddContentFromContextMenuActionTriggered();
+ void onAddContentFromOptionsMenuActionTriggered();
bool openTaskSwitcher();
void zoneAnimationFinished();
void pageChangeAnimationFinished();
- void onSceneMenuTriggered(HbAction *action);
void onRemovePageConfirmationOk();
- void onSceneMenuAboutToClose();
+ void onVerticalSnapLineTimerTimeout();
+ void onHorizontalSnapLineTimerTimeout();
+ void onActivePageChanged();
private:
HbAction *mNavigationAction;
- HsIdleWidget *mUiWidget;
-
- QTimer mTimer;
-
- QPointF mTouchScenePos;
+ HsIdleWidget *mUiWidget;
HsTitleResolver *mTitleResolver;
QPropertyAnimation *mZoneAnimation;
bool mAllowZoneAnimation;
QPropertyAnimation *mPageChangeAnimation;
HbContinuousFeedback *mContinuousFeedback;
- bool mTrashBinFeedbackAlreadyPlayed;
- // TODO: remove
- bool mParallaxEnabled;
- bool mPageWallpaperEnabled;
-
+ bool mTrashBinFeedbackAlreadyPlayed;
+ QPointF mPageHotSpot;
+ QPointF mWidgetHotSpot;
+ QPointF mWidgetHotSpotOffset;
qreal mDeltaX;
QPointer<HbMenu> mSceneMenu;
+ HsWidgetPositioningOnWidgetMove::Result mSnapResult;
+ HsWidgetPositioningOnWidgetMove::Result mPreviousSnapResult;
+ qreal mSnapBorderGap;
+ QTimer mVerticalSnapLineTimer;
+ QTimer mHorizontalSnapLineTimer;
#ifdef Q_OS_SYMBIAN
XQSettingsManager *mSettingsMgr;
#endif