Home · All Namespaces · All Classes
Public Member Functions

DesktopView Class Reference

#include <desktopview.h>

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

List of all members.

Public Member Functions

 DesktopView (Desktop *desktop)
virtual ~DesktopView ()
virtual void drawBackground (QPainter *painter, const QStyleOptionGraphicsItem *option) const
 REIMPLEMENTATION
virtual void update ()
virtual M::OrientationAngle orientationAngle ()

Detailed Description

The desktop view draws a background for the desktop and manages layouts related to the desktop.

Definition at line 50 of file desktopview.h.


Constructor & Destructor Documentation

DesktopView::DesktopView ( Desktop desktop  ) 

Constructs a DesktopView.

Parameters:
desktop the Desktop controller to be used

Definition at line 105 of file desktopview.cpp.

                                         :
    MWidgetView(desktop),
    homeWindowMonitor(new HomeWindowMonitor),
    switcher(new Switcher),
    switcherWindow(new MSceneWindow),
    switcherHasContent(false),
    launcherDataStore(NULL),
    launcher(new Launcher),
    launcherWindow(new MSceneWindow),
    launcherVisible(false),
    quickLaunchBar(new QuickLaunchBar),
    quickLaunchBarWindow(new MOverlay),
    backgroundExtensionArea(new MApplicationExtensionArea("com.meego.core.MDesktopBackgroundExtensionInterface/1.0"))
{
    // Add the switcher into a scene window
    switcher->setObjectName("OverviewSwitcher");
    QGraphicsLinearLayout *windowLayout = new QGraphicsLinearLayout();
    windowLayout->setContentsMargins(0, 0, 0, 0);
    switcherWindow->setLayout(windowLayout);
    switcherWindow->setObjectName("SwitcherWindow");
    windowLayout->addItem(switcher);
    MainWindow::instance()->sceneManager()->appearSceneWindowNow(switcherWindow);

    // Create the launcher data store
    launcherDataStore = createLauncherDataStore();

    // Create application package monitor
    packageMonitorListener = new ApplicationPackageMonitorListener();

    // Create a quick launch bar and put it in a scene window
    quickLaunchBar->setLauncherDataStore(launcherDataStore);
    quickLaunchBar->setApplicationPackageMonitorListener(packageMonitorListener);
    connect(quickLaunchBar, SIGNAL(toggleLauncherButtonClicked()), this, SLOT(toggleLauncher()));
    windowLayout = new QGraphicsLinearLayout();
    windowLayout->setContentsMargins(0, 0, 0, 0);
    windowLayout->addItem(quickLaunchBar);
    quickLaunchBarWindow->setLayout(windowLayout);
    quickLaunchBarWindow->setObjectName("QuickLaunchBarOverlay");
    MainWindow::instance()->sceneManager()->appearSceneWindowNow(quickLaunchBarWindow);

    // Add the launcher into a scene window
    launcher->setLauncherDataStore(launcherDataStore);
    launcher->setApplicationPackageMonitorListener(packageMonitorListener);
    connect(qApp, SIGNAL(focusToLauncherAppRequested(const QString &)), this, SLOT(showLauncherAndFocusToButton(const QString &)));
    connect(homeWindowMonitor.data(), SIGNAL(fullscreenWindowOnTopOfOwnWindow()), SLOT(hideLauncher()));
    connect(switcher, SIGNAL(windowListUpdated(const QList<WindowInfo> &)), this, SLOT(setSwitcherHasContent(const QList<WindowInfo> &)));
    windowLayout = new QGraphicsLinearLayout();
    windowLayout->setContentsMargins(0, 0, 0, 0);
    launcherWindow->setLayout(windowLayout);
    launcherWindow->setObjectName("LauncherWindow");
    windowLayout->addItem(launcher);

    // Register the launcher window into the scene manager to make sure launcher page styling works in both orientations
    MainWindow::instance()->sceneManager()->appearSceneWindowNow(launcherWindow);
    MainWindow::instance()->sceneManager()->disappearSceneWindowNow(launcherWindow);

#ifdef BENCHMARKS_ON
    connect(MApplication::instance(), SIGNAL(startBenchmarking()), this, SLOT(startBenchmarking()));
    connect(MApplication::instance(), SIGNAL(stopBenchmarking()), this, SLOT(stopBenchmarking()));
#endif

    // Connect the desktop background extension signals
    connect(backgroundExtensionArea, SIGNAL(extensionInstantiated(MApplicationExtensionInterface*)),
            this, SLOT(addExtension(MApplicationExtensionInterface*)));
    connect(backgroundExtensionArea, SIGNAL(extensionRemoved(MApplicationExtensionInterface*)),
            this, SLOT(removeExtension(MApplicationExtensionInterface*)));
    backgroundExtensionArea->setInProcessFilter(QRegExp("/meegotouchhome-plaindesktopbackgroundextension.desktop$"));
    backgroundExtensionArea->setOutOfProcessFilter(QRegExp("$^"));
    backgroundExtensionArea->init();

    setSceneWindowOrder();
}

Here is the call graph for this function:

DesktopView::~DesktopView (  )  [virtual]

Destroys the DesktopView.

Definition at line 178 of file desktopview.cpp.

{
    delete switcherWindow;
    delete launcherWindow;
    delete quickLaunchBarWindow;
    delete backgroundExtensionArea;
    delete launcherDataStore;
    delete packageMonitorListener;
}


Member Function Documentation

void DesktopView::drawBackground ( QPainter *  painter,
const QStyleOptionGraphicsItem *  option 
) const [virtual]

REIMPLEMENTATION

Definition at line 210 of file desktopview.cpp.

{
    foreach (MDesktopBackgroundExtensionInterface *backgroundExtension, backgroundExtensions) {
        backgroundExtension->drawBackground(painter, boundingRect());
    }
}

Here is the call graph for this function:

M::OrientationAngle DesktopView::orientationAngle (  )  [virtual]

Returns the current orientation angle of the desktop

Implements MDesktopInterface.

Definition at line 286 of file desktopview.cpp.

{
    return MainWindow::instance()->sceneManager()->orientationAngle();
}

Here is the call graph for this function:

void DesktopView::update (  )  [virtual]

Asks the desktop to be redrawn

Implements MDesktopInterface.

Definition at line 281 of file desktopview.cpp.


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