1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
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 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __GOANYWHEREVIEW_H__ |
|
20 #define __GOANYWHEREVIEW_H__ |
|
21 |
|
22 #include "controllableviewimpl.h" |
|
23 |
|
24 #include <QLabel> |
|
25 #include <QTimer> |
|
26 #include <QWidget> |
|
27 #include <QTabWidget> |
|
28 |
|
29 class QAction; |
|
30 class QWidget; |
|
31 class QScrollArea; |
|
32 |
|
33 namespace WRT { |
|
34 |
|
35 class WrtPage; |
|
36 class WrtPageManager; |
|
37 class GoAnywhereViewPrivate; |
|
38 class GoAnywhereWidget; |
|
39 |
|
40 class BWF_EXPORT GoAnywhereView : public ControllableViewQWidgetBase |
|
41 { |
|
42 friend class GoAnywhereWidget; |
|
43 Q_OBJECT |
|
44 public: |
|
45 GoAnywhereView(WrtPageManager* mgr, QWidget* parent,const QString& aType); |
|
46 ~GoAnywhereView(); |
|
47 |
|
48 QAction* getActionBack(); |
|
49 void setPageInfo(const QUrl& linkUrl, const QUrl& imageUrl); |
|
50 void showAnimation(bool show); |
|
51 void setAnimateDirection(const QString& direction); |
|
52 void setAnimateDuration(int millisecond); |
|
53 void addView(ControllableView* view); |
|
54 QRect centralRect() const; |
|
55 QImage currentSlide(); |
|
56 static ControllableView *createNew(QWidget *parent); |
|
57 static const QString Type() { return "goAnywhereView"; } |
|
58 bool eventFilter(QObject* receiver, QEvent* event); |
|
59 |
|
60 signals: |
|
61 void ok(int ret); |
|
62 void goAnywhereIsReady(); |
|
63 void goAnywhereViewChanged(QString viewId); |
|
64 |
|
65 void saveBookmarkBtnClicked(); |
|
66 void viewImageBtnClicked(); |
|
67 void sendPageBtnClicked(); |
|
68 void pageSettingBtnClicked(); |
|
69 |
|
70 private slots: |
|
71 void back(); |
|
72 void tabChanged(int index); |
|
73 |
|
74 private: |
|
75 void init(); |
|
76 |
|
77 public: // Pure Virtual from ControllableView |
|
78 QString title(); |
|
79 bool isActive(); |
|
80 QList<QAction*> getContext(); |
|
81 WrtPageManager* wrtPageManager(); |
|
82 QString type() const{ return Type(); } |
|
83 |
|
84 public slots: // Pure Virtual from ControllableView |
|
85 void activate(); |
|
86 void deactivate(); |
|
87 |
|
88 protected: |
|
89 QWidget* qWidget() const; |
|
90 GoAnywhereViewPrivate * const d; |
|
91 }; |
|
92 |
|
93 class GoAnywhereWidget: public QTabWidget |
|
94 { |
|
95 Q_OBJECT |
|
96 |
|
97 public: |
|
98 GoAnywhereWidget(QWidget *parent, GoAnywhereView *view); |
|
99 |
|
100 protected: |
|
101 // void paintEvent(QPaintEvent* event); |
|
102 // void resizeEvent(QResizeEvent* event); |
|
103 |
|
104 private: |
|
105 GoAnywhereView *m_view; |
|
106 QScrollArea* m_scrollArea; |
|
107 QWidget* m_inWidgt; |
|
108 QLabel* m_pageTileLabel; |
|
109 QLabel* m_pageUrlLabel; |
|
110 }; |
|
111 } |
|
112 #endif // __GOANYWHEREVIEW_H__ |
|