Home · All Namespaces · All Classes
Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes

SwitcherViewBase Class Reference

#include <switcherviewbase.h>

Inheritance diagram for SwitcherViewBase:
Inheritance graph
[legend]
Collaboration diagram for SwitcherViewBase:
Collaboration graph
[legend]

List of all members.

Signals

void animationStateChanged (bool animating)

Public Member Functions

 SwitcherViewBase (Switcher *controller)
virtual ~SwitcherViewBase ()
bool event (QEvent *e)

Protected Slots

virtual void updateData (const QList< const char * > &modifications)
 REIMPLEMENTATION
virtual void endTransition ()
 
virtual void endBounce ()
virtual void applyPinchGestureTargetMode ()
void runOverviewBounceAnimation ()
virtual void updateAnimationStatus ()

Protected Member Functions

virtual void setupModel ()
 
virtual void pinchGestureEvent (QGestureEvent *event, QPinchGesture *gesture)
virtual bool sceneEventFilter (QGraphicsItem *watched, QEvent *event)
virtual void applySwitcherMode ()
 
void removeButtonsFromLayout ()
int buttonIndex (const SwitcherButton *button) const
void calculateNearestButtonAt (const QPointF &centerPoint)
 Calculates which switcher button is nearest to point centerPoint.
virtual void startBounceAnimation ()
void setInwardBounceAnimation (bool i)
virtual void pinchBegin (const QPointF &centerPoint)
virtual void pinchUpdate (float scaleFactor)
virtual void pinchEnd ()
void setViewportPhysicsEnabled (bool enabled)

Protected Attributes

Switchercontroller
QGraphicsLinearLayout * mainLayout
MWidget * pannedWidget
MLayout * pannedLayout
int pinchedButtonPosition
TransformLayoutAnimationlayoutAnimation
bool overpinch
QPropertyAnimation * bounceAnimation
SwitcherModel::Mode pinchGestureTargetMode
MPannableViewport * viewport
bool animating

Detailed Description

The switcher view draws a background for the switcher.


Constructor & Destructor Documentation

SwitcherViewBase::SwitcherViewBase ( Switcher controller  ) 

Constructs a SwitcherViewBase.

Parameters:
container the Switcher controller to be used
SwitcherViewBase::~SwitcherViewBase (  )  [virtual]

Destroys the SwitcherViewBase.


Member Function Documentation

void SwitcherViewBase::animationStateChanged ( bool  animating  )  [signal]

Sent when switcher starts or stops animating

void SwitcherViewBase::applyPinchGestureTargetMode (  )  [protected, virtual, slot]

Sets the switcher mode according to current pinch gesture target

Reimplemented in SwitcherView.

void SwitcherViewBase::applySwitcherMode (  )  [protected, virtual]

Selects the layout policy and sets up switcher mode dependent signals

Reimplemented in SwitcherView.

int SwitcherViewBase::buttonIndex ( const SwitcherButton button  )  const [protected]

Returns the index of a SwitcherButton in the model or -1, if not found

void SwitcherViewBase::calculateNearestButtonAt ( const QPointF &  centerPoint  )  [protected]

Calculates which switcher button is nearest to point centerPoint.

void SwitcherViewBase::endBounce (  )  [protected, virtual, slot]

Ends the bounce effect

void SwitcherViewBase::endTransition (  )  [protected, virtual, slot]

Ends the transition between switcher modes

bool SwitcherViewBase::event ( QEvent *  e  ) 

REIMPLEMENTATION Re-implented event handler. Needed to enable gestures.

Parameters:
e event to be handled
Returns:
true if event was accepted, otherwise false
void SwitcherViewBase::pinchBegin ( const QPointF &  centerPoint  )  [protected, virtual]

Called when the pinch gesture starts

Parameters:
centerPoint the center point of the pinch gesture
void SwitcherViewBase::pinchEnd (  )  [protected, virtual]

Called when the pinch gesture ends

void SwitcherViewBase::pinchGestureEvent ( QGestureEvent *  event,
QPinchGesture *  gesture 
) [protected, virtual]

Re-implemented to handle the mode switch

Parameters:
event Gesture event class for general event handling.
gesture Pinch gesture class. Contains all pinch specific information
void SwitcherViewBase::pinchUpdate ( float  scaleFactor  )  [protected, virtual]

Called to update the scale factor during the pinch gesture

Parameters:
scaleFactor the updated scale factor
void SwitcherViewBase::removeButtonsFromLayout (  )  [protected]

Remove all buttons from layout and set parents to NULL Parents are set to NULL to avoid double deletion as buttons are QSharedPointer's in model

void SwitcherViewBase::runOverviewBounceAnimation (  )  [protected, slot]

Runs the bounce animation if currently in overview mode

bool SwitcherViewBase::sceneEventFilter ( QGraphicsItem *  watched,
QEvent *  event 
) [protected, virtual]

Filters QGraphicsSceneMouseMove events from SwitcherButtons.

void SwitcherViewBase::setInwardBounceAnimation ( bool  i  )  [protected]

Sets the direction of the bounce animation

void SwitcherViewBase::setupModel (  )  [protected, virtual]

REIMPLEMENTATION Re-implemented here to get an update when the model is set

void SwitcherViewBase::setViewportPhysicsEnabled ( bool  enabled  )  [protected]

Enables or disables the physics of the viewports under this widget, to prevent unwanted movement

Parameters:
enabled the enabled or disabled state to set
void SwitcherViewBase::startBounceAnimation (  )  [protected, virtual]

Starts the bounce animation

void SwitcherViewBase::updateAnimationStatus (  )  [protected, virtual, slot]

Updates the animation status and sends animationStateChanged signal if status changed

void SwitcherViewBase::updateData ( const QList< const char * > &  modifications  )  [protected, virtual, slot]

REIMPLEMENTATION

Reimplemented in SwitcherView.


Member Data Documentation

bool SwitcherViewBase::animating [protected]

True if switcher is currently animating

QPropertyAnimation* SwitcherViewBase::bounceAnimation [protected]

Animation for the bounce when going to overview mode and when overpinching

The switcher controller

Layout animation for animating switcher buttons

QGraphicsLinearLayout* SwitcherViewBase::mainLayout [protected]

Layouts

bool SwitcherViewBase::overpinch [protected]

True if the pinch direction is to the mode we're already in

MLayout* SwitcherViewBase::pannedLayout [protected]

Layout for the panned widget

MWidget* SwitcherViewBase::pannedWidget [protected]

The widget that will contain all of the switcher buttons

The button being currently pinched

The target mode for pinch gesture

MPannableViewport* SwitcherViewBase::viewport [protected]

The viewport that shows the switcher buttons


The documentation for this class was generated from the following files:

Copyright © 2011 Nokia Corporation Generated on Thu Jul 7 2011 22:14:51
Doxygen 1.7.1
MeeGo Touch