| Home · All Namespaces · All Classes |
#include <desktopview.h>


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 () |
The desktop view draws a background for the desktop and manages layouts related to the desktop.
Definition at line 50 of file desktopview.h.
| DesktopView::DesktopView | ( | Desktop * | desktop | ) |
Constructs a DesktopView.
| 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();
}

| 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;
}
| 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());
}
}

| 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();
}

| void DesktopView::update | ( | ) | [virtual] |
Asks the desktop to be redrawn
Implements MDesktopInterface.
Definition at line 281 of file desktopview.cpp.
{
MWidgetView::update();
}
| Copyright © 2010 Nokia Corporation | Generated on Thu Nov 4 2010 18:20:42 Doxygen 1.7.1 |
MeeGo Touch |