diff -r bf4420e9fa4d -r 2e16851ffecd ginebra2/ViewStack.h --- a/ginebra2/ViewStack.h Fri Jun 11 16:23:26 2010 +0100 +++ b/ginebra2/ViewStack.h Thu Jul 22 16:30:16 2010 +0100 @@ -1,32 +1,46 @@ /* * Copyright (c) 2010 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". +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU Lesser General Public License as published by +* the Free Software Foundation, version 2.1 of the License. * -* Initial Contributors: -* Nokia Corporation - initial contribution. +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU Lesser General Public License for more details. * -* Contributors: +* You should have received a copy of the GNU Lesser General Public License +* along with this program. If not, +* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". * -* Description: +* Description: * */ - #ifndef VIEWSTACK_H #define VIEWSTACK_H -#include -#include "ViewController.h" +#include +#include "wrtbrowsercontainer.h" + +namespace GVA { class ViewController; class ChromeView; +class ChromeWidget; -namespace GVA { - +/*! \ingroup JavascriptAPI + * \brief This class is responsible for switching the main content window from one view to another. + * + * Javascript object name: "ViewStack". + * + * Example javascript code to switch the current content view from the Web view to the Bookmarks view: + * \code + * ViewStack.switchView("BookmarkHistoryView", "WebView"); + * \endcode + */ class ViewStack : public QObject { Q_OBJECT @@ -35,29 +49,26 @@ static ViewStack* getSingleton(); ViewController *getViewController() { return m_viewController;} void setViewController(ViewController *value) { m_viewController = value; } - + void setChromeWidget(ChromeWidget *value) { m_chrome = value; } + public slots: void switchView(const QString &to, const QString &from); + void creatingPage(WRT::WrtBrowserContainer*); private: void fromWindowView(const QString &to); - void fromGoAnywhereView(const QString &to); void fromWebView(const QString &to); void fromBookmarkHistoryView(const QString &to); void fromBookmarkTreeView(const QString &to); void fromSettingsView(const QString &to); void toWindowView(); - void toGoAnywhereView(); void toWebView(); void toBookmarkHistoryView(); void toBookmarkView(); - void initWindowView(); - void initSettingsView(); void toSettingsView(); private slots: void loadHistoryItem(int item); - void goBackFromGoAnywhereView(); void goBackFromWindowView(); void goBackFromRecentUrlView(); void goBackFromBookmarkView(); @@ -67,23 +78,14 @@ signals: void activateBookmark(); - void deActivateBookmark(); - void activateHistory(); - void deActivateHistory(); - void activateBookMarkHistory(); - void deActivateBookMarkHistory(); void activateWindowView(); void deActivateWindowView(); - void activateWebView(); - void deActivateWebView(); - void activateSettingsView(); - void deActivateSettingsView(); - void currentViewChanged(); void pageChanged(int); private: ViewController *m_viewController; // Not owned + ChromeWidget *m_chrome; // Not owned }; } // end of namespace