1 /* |
1 /* |
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
4 * |
9 * Initial Contributors: |
5 * This program is free software: you can redistribute it and/or modify |
10 * Nokia Corporation - initial contribution. |
6 * it under the terms of the GNU Lesser General Public License as published by |
|
7 * the Free Software Foundation, version 2.1 of the License. |
11 * |
8 * |
12 * Contributors: |
9 * This program is distributed in the hope that it will be useful, |
|
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 * GNU Lesser General Public License for more details. |
13 * |
13 * |
14 * Description: |
14 * You should have received a copy of the GNU Lesser General Public License |
|
15 * along with this program. If not, |
|
16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". |
|
17 * |
|
18 * Description: |
15 * |
19 * |
16 */ |
20 */ |
17 |
|
18 |
21 |
19 #include <QMap> |
22 #include <QMap> |
20 |
23 |
21 #include "controllableviewimpl.h" |
24 #include "controllableviewimpl.h" |
22 |
25 |
54 ControllableViewBase *view(const QString &name) { return m_viewMap[name]; } |
57 ControllableViewBase *view(const QString &name) { return m_viewMap[name]; } |
55 |
58 |
56 ControllableViewBase *currentView(); |
59 ControllableViewBase *currentView(); |
57 |
60 |
58 void viewChanged(); |
61 void viewChanged(); |
59 |
62 |
60 public slots: |
63 public slots: |
61 // Returns the currently visible view as a javascript-usable object. |
64 // Returns the currently visible view as a javascript-usable object. |
62 QObject *current() { |
65 QObject *current() { |
63 return static_cast<QObject *>(m_current.value()->jsObject()); |
66 return static_cast<QObject *>(m_current.value()->jsObject()); |
64 } |
67 } |
65 |
68 |
66 // Show the view named 'name'. |
69 // Show the view named 'name'. |
67 void showView(const QString &name); |
70 void showView(const QString &name); |
68 |
71 |
69 // Freeze the current view. |
72 // Freeze the current view. |
70 void freezeView(); |
73 void freezeView(); |
71 |
74 |
72 // Unfreeze the current view. |
75 // Unfreeze the current view. |
73 void unfreezeView(); |
76 void unfreezeView(); |
74 |
77 |
75 // Deprecated, use showView(). |
78 // Deprecated, use showView(). |
76 void showContent(const QString &type) { showView(type); } |
79 void showContent(const QString &type) { showView(type); } |
77 |
80 |
78 void dump(); |
81 void dump(); |
79 |
82 |
80 signals: |
83 signals: |
81 // Sent when the current view is about to change. |
84 // Sent when the current view is about to change. |
82 void currentViewChanging(); |
85 void currentViewChanging(); |
83 |
86 |
84 // Sent when the current view has changed. |
87 // Sent when the current view has changed. |
85 void currentViewChanged(); |
88 void currentViewChanged(); |
86 |
89 |
87 // Not for javascript use. |
90 // Not for javascript use. |
88 void javaScriptWindowObjectCleared(QWebPage *); |
91 void javaScriptWindowObjectCleared(QWebPage *); |
89 |
92 |
90 private: |
93 private: |
91 typedef QMap<QString, ControllableViewBase *> ViewMap; |
94 typedef QMap<QString, ControllableViewBase *> ViewMap; |