|
1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * |
|
5 * This program is free software: you can redistribute it and/or modify |
|
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. |
|
8 * |
|
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 * |
|
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: |
|
19 * |
|
20 */ |
|
21 #ifndef __GINEBRA_TITLEURLCONTAINERSNIPPET_H |
|
22 #define __GINEBRA_TITLEURLCONTAINERSNIPPET_H |
|
23 |
|
24 #include <QtGui> |
|
25 #include "ChromeSnippet.h" |
|
26 #include "NativeChromeItem.h" |
|
27 |
|
28 namespace GVA { |
|
29 |
|
30 |
|
31 class ChromeWidget; |
|
32 class GUrlSearchItem; |
|
33 class ActionButton; |
|
34 |
|
35 /* \brief This is the container widget for title-url combo snippet |
|
36 * |
|
37 * |
|
38 */ |
|
39 class TitleUrlContainerItem : public NativeChromeItem |
|
40 { |
|
41 Q_OBJECT |
|
42 public: |
|
43 TitleUrlContainerItem(ChromeSnippet * snippet, ChromeWidget * chrome, QGraphicsItem * parent = 0); |
|
44 virtual ~TitleUrlContainerItem(); |
|
45 |
|
46 /// The URL of the web page. |
|
47 QString url() const; |
|
48 |
|
49 protected: |
|
50 virtual void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget); |
|
51 virtual void resizeEvent(QGraphicsSceneResizeEvent * event); |
|
52 |
|
53 private Q_SLOTS: |
|
54 void onChromeResize(); |
|
55 void changeLayout(bool editMode); |
|
56 |
|
57 private: |
|
58 void setProperties(); |
|
59 |
|
60 private: |
|
61 ChromeWidget * m_chrome; |
|
62 QGraphicsWidget * m_viewPort; |
|
63 ActionButton * m_backStepButton; |
|
64 GUrlSearchItem * m_urlTileWidget; |
|
65 QGraphicsPixmapItem * m_dividerImage; |
|
66 // painting support |
|
67 QPen m_pen; |
|
68 QLinearGradient m_grad; |
|
69 }; |
|
70 |
|
71 |
|
72 /* \brief This is the container snippet for title-url combo |
|
73 * |
|
74 * |
|
75 */ |
|
76 class TitleUrlContainerSnippet : public ChromeSnippet |
|
77 { |
|
78 Q_OBJECT |
|
79 public: |
|
80 TitleUrlContainerSnippet(const QString & elementId, ChromeWidget * chrome, |
|
81 QGraphicsWidget * widget, const QWebElement & element); |
|
82 virtual ~TitleUrlContainerSnippet(); |
|
83 |
|
84 static TitleUrlContainerSnippet * instance(const QString& elementId, ChromeWidget * chrome, const QWebElement & element); |
|
85 |
|
86 /// The URL of the web page. |
|
87 QString url() const; |
|
88 Q_PROPERTY(QString url READ url) |
|
89 }; |
|
90 |
|
91 } // end of namespace GVA |
|
92 |
|
93 #endif // __GINEBRA_TITLEURLCONTAINERSNIPPET_H |