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