1 /* |
1 /* |
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2009 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 #include <QtGui> |
21 #include <QtGui> |
|
22 #include "ChromeItem.h" |
19 #include "ChromeSnippet.h" |
23 #include "ChromeSnippet.h" |
|
24 #include "ChromeWidget.h" |
20 |
25 |
21 namespace GVA { |
26 namespace GVA { |
22 class LinearFlowSnippet; |
27 class LinearFlowSnippet; |
23 } |
28 } |
24 |
29 |
25 namespace GVA { |
30 namespace GVA { |
|
31 class WRT::WrtBrowserContainer; |
26 |
32 |
27 class MostVisitedPagesWidget : public QGraphicsWidget |
33 class MostVisitedPagesWidget : public ChromeItem |
28 { |
34 { |
29 Q_OBJECT |
35 Q_OBJECT |
30 public : |
36 public : |
31 //construction and destruction |
37 //construction and destruction |
32 MostVisitedPagesWidget(ChromeSnippet* snippet,QGraphicsWidget* parent); |
38 MostVisitedPagesWidget(ChromeSnippet* snippet, ChromeWidget* chrome); |
33 ~MostVisitedPagesWidget(); |
39 ~MostVisitedPagesWidget(); |
34 |
40 |
35 void open(); |
41 void open(); |
36 |
42 |
37 void updatePos(QPointF pos, qreal &toolBarHeight); |
43 void updatePos(QPointF pos, qreal &toolBarHeight); |
38 void resize(const QSize &size); |
44 void resize(const QSize &size); |
39 void displayModeChanged(QString& newMode); |
45 void displayModeChanged(QString& newMode); |
40 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); |
46 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); |
41 void setCenterIndex(QString displayMode); |
47 void setCenterIndex(QString displayMode); |
42 void updateMVGeometry(); |
48 void updateMVGeometry(); |
43 void updateMVStore(QWebPage *page); |
49 void updateMVStore(WRT::WrtBrowserContainer *page); |
44 |
50 |
45 Q_SIGNALS: |
51 Q_SIGNALS: |
46 void closeComplete(); |
52 void closeComplete(); |
47 |
53 |
48 protected: |
54 protected: |
51 public slots: |
57 public slots: |
52 void close(bool hide=true); |
58 void close(bool hide=true); |
53 void okTriggered(int index); |
59 void okTriggered(int index); |
54 void closeAnimationCompleted(); |
60 void closeAnimationCompleted(); |
55 void onLoadFinished(const bool ok); |
61 void onLoadFinished(const bool ok); |
56 |
62 void clearMVStore(); |
57 private : |
63 private : |
58 MostVisitedPageStore* m_mostVisitedPageStore; |
64 MostVisitedPageStore* m_mostVisitedPageStore; |
59 QGraphicsWidget* m_parent; |
65 QGraphicsWidget* m_parent; |
|
66 ChromeWidget * m_chrome; |
60 GVA::LinearFlowSnippet *m_flowInterface; |
67 GVA::LinearFlowSnippet *m_flowInterface; |
61 int m_selectIndex; |
68 int m_selectIndex; |
62 ChromeSnippet* m_snippet; |
|
63 bool m_hideOnClose; |
69 bool m_hideOnClose; |
64 }; |
70 }; |
65 } |
71 } |