diff -r f00a6757af32 -r 5f0182e07bfb homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmainwindow.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/homescreenapp/stateplugins/hsapplibrarystateplugin/src/hsmainwindow.cpp Tue Aug 31 15:06:34 2010 +0300 @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Menu view. + * + */ + +#include +#include +#include +#include "hsmainwindow.h" +#include "hsmenuview.h" + + +/*! + Constructor + */ + + + +/* + * A word about HsMainWindow class. + * This is not an utility class. It was designed to isolate HbMainWindow connected code, so + * it can be substitued in MT for application library. Unfortunately it seems to be the best + * way to cope with HbMainWindow problem in MT. + */ + + +HsMainWindow::HsMainWindow() +{ +} + +/*! + Destructor + */ +HsMainWindow::~HsMainWindow() +{ +} + +/*! + Add the \menuView to first instance of HbMainWindow registered in HbInstance. + \param view View to be added to HbMainWindow. +*/ +void HsMainWindow::setCurrentView(HbView *view) +{ + HbMainWindow *const hbW( + HbInstance::instance()->allMainWindows().value(0)); + + if (!hbW->views().contains(view)) { + hbW->addView(view); + } + bool animate = !hbW->isObscured(); + hbW->setCurrentView(view, animate); +}