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

SwitcherView Class Reference

#include <switcherview.h>

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

List of all members.

Public Member Functions

 SwitcherView (Switcher *controller)
virtual ~SwitcherView ()

Protected Slots

virtual void updateData (const QList< const char * > &modifications)
 
virtual void applyPinchGestureTargetMode ()

Protected Member Functions

virtual void applySwitcherMode ()
 REIMPLEMENTATION

Detailed Description

The switcher view draws a background for the switcher.

Definition at line 36 of file switcherview.h.


Constructor & Destructor Documentation

SwitcherView::SwitcherView ( Switcher controller  ) 

Constructs a SwitcherView.

Parameters:
container the Switcher controller to be used

Definition at line 47 of file switcherview.cpp.

                                             :
        SwitcherViewBase(switcher), pagedViewport(new PagedViewport), overviewStyle(0)
{
    viewport = pagedViewport;
    // Fixes NB#186716, Disable the viewport initially so that does not cause unwated screen updates
    // when trying to pan an empty switcher. The disabling of the panning must be
    // prior to the event connections as disabling will cause the vp to emit 'panningStopped'
    // and our slot might not have the view available at that time yet.
    viewport->setEnabled(false);
    connect(pagedViewport, SIGNAL(pageChanged(int)), this, SLOT(updateFocusedButton(int)));
    connect(pagedViewport, SIGNAL(panningStopped()), this, SLOT(panningStopped()));
    connect(MainWindow::instance()->sceneManager(), SIGNAL(orientationChanged(M::Orientation)), this, SLOT(updateButtons()));

    // We have custom values for this view port in the style
    viewport->setObjectName("SwitcherViewport");
    mainLayout->addItem(viewport);

    layoutAnimation = new TransformLayoutAnimation(pannedLayout);
    layoutAnimation->setObjectName("SwitcherLayoutAnimation");
    connect(layoutAnimation, SIGNAL(willFinish()), this, SLOT(endTransition()));
    connect(layoutAnimation, SIGNAL(finished()), this, SLOT(runOverviewBounceAnimation()));

    overviewPolicy = new MGridLayoutPolicy(pannedLayout);
    overviewPolicy->setObjectName("OverviewPolicy");

    detailPolicy = new MLinearLayoutPolicy(pannedLayout, Qt::Horizontal);
    detailPolicy->setObjectName("DetailviewPolicy");

    viewport->setAutoRange(false);
    viewport->setWidget(pannedWidget);

    viewport->positionIndicator()->setObjectName("SwitcherOverviewPageIndicator");
    focusedSwitcherButton = 0;
    pinchedButtonPosition = -1;
}

Here is the call graph for this function:

SwitcherView::~SwitcherView (  )  [virtual]

Destroys the SwitcherView.

Definition at line 83 of file switcherview.cpp.

{
    if(overviewStyle) {
        MTheme::releaseStyle(overviewStyle);
    }
}


Member Function Documentation

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

Sets the switcher mode according to current pinch gesture target

Reimplemented from SwitcherViewBase.

Definition at line 329 of file switcherview.cpp.

Here is the call graph for this function:

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

REIMPLEMENTATION

Reimplemented from SwitcherViewBase.

Definition at line 99 of file switcherview.cpp.

{
    if (model()->switcherMode() == SwitcherModel::Detailview) {
        pannedLayout->setPolicy(detailPolicy);
    } else {
        pannedLayout->setPolicy(overviewPolicy);
    }

    SwitcherViewBase::applySwitcherMode();

    updateButtonModesAndPageCount();
}

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

REIMPLEMENTATION

Reimplemented from SwitcherViewBase.

Definition at line 112 of file switcherview.cpp.

{
    SwitcherViewBase::updateData(modifications);
    const char *member;
    foreach(member, modifications) {
        if (member == SwitcherModel::Buttons) {
            updateButtons();
        } else if (member == SwitcherModel::TopmostWindow) {
            repositionSwitcher();
        }
    }
}


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

Copyright © 2010 Nokia Corporation Generated on Thu Nov 4 2010 18:20:42
Doxygen 1.7.1
MeeGo Touch