Home · All Namespaces · All Classes |
00001 /*************************************************************************** 00002 ** 00003 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 00004 ** All rights reserved. 00005 ** Contact: Nokia Corporation (directui@nokia.com) 00006 ** 00007 ** This file is part of mhome. 00008 ** 00009 ** If you have questions regarding the use of this file, please contact 00010 ** Nokia at directui@nokia.com. 00011 ** 00012 ** This library is free software; you can redistribute it and/or 00013 ** modify it under the terms of the GNU Lesser General Public 00014 ** License version 2.1 as published by the Free Software Foundation 00015 ** and appearing in the file LICENSE.LGPL included in the packaging 00016 ** of this file. 00017 ** 00018 ****************************************************************************/ 00019 #ifndef SWITCHERVIEWBASE_H 00020 #define SWITCHERVIEWBASE_H 00021 00022 #include <MWidgetView> 00023 #include "switchermodel.h" 00024 #include "switcherbasestyle.h" 00025 00026 class Switcher; 00027 class MLayout; 00028 class MPannableViewport; 00029 class QGraphicsLinearLayout; 00030 class TransformLayoutAnimation; 00031 class QPropertyAnimation; 00032 00036 class SwitcherViewBase : public MWidgetView 00037 { 00038 Q_OBJECT 00039 M_VIEW(SwitcherModel, SwitcherBaseStyle) 00040 00041 public: 00047 SwitcherViewBase(Switcher *controller); 00048 00052 virtual ~SwitcherViewBase(); 00053 00060 bool event(QEvent *e); 00062 00063 protected: 00067 virtual void setupModel(); 00068 00075 virtual void pinchGestureEvent(QGestureEvent *event, QPinchGesture* gesture); 00076 00080 virtual bool sceneEventFilter(QGraphicsItem *watched, QEvent *event); 00082 00084 virtual void applySwitcherMode(); 00085 00090 void removeButtonsFromLayout(); 00091 00093 int buttonIndex(const SwitcherButton* button) const; 00094 00096 void calculateNearestButtonAt(const QPointF ¢erPoint); 00097 00099 virtual void startBounceAnimation(); 00100 00102 void setInwardBounceAnimation(bool i); 00103 00106 virtual void pinchBegin(const QPointF ¢erPoint); 00107 00110 virtual void pinchUpdate(float scaleFactor); 00111 00113 virtual void pinchEnd(); 00114 00117 void setViewportPhysicsEnabled(bool enabled); 00118 00120 Switcher *controller; 00121 00123 QGraphicsLinearLayout *mainLayout; 00124 00126 MWidget* pannedWidget; 00127 00129 MLayout* pannedLayout; 00130 00132 int pinchedButtonPosition; 00133 00135 TransformLayoutAnimation *layoutAnimation; 00136 00138 bool overpinch; 00139 00141 QPropertyAnimation *bounceAnimation; 00142 00144 SwitcherModel::Mode pinchGestureTargetMode; 00145 00147 MPannableViewport *viewport; 00148 00150 bool animating; 00151 00152 protected slots: 00154 virtual void updateData(const QList<const char *>& modifications); 00156 00158 virtual void endTransition(); 00159 00161 virtual void endBounce(); 00162 00164 virtual void applyPinchGestureTargetMode(); 00165 00167 void runOverviewBounceAnimation(); 00168 00170 virtual void updateAnimationStatus(); 00171 00172 signals: 00174 void animationStateChanged(bool animating); 00175 }; 00176 00177 #endif
Copyright © 2011 Nokia Corporation | Generated on Thu Jul 7 2011 22:14:50 Doxygen 1.7.1 |
MeeGo Touch |