|
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_TOOLBARSNIPPET_H |
|
22 #define __GINEBRA_TOOLBARSNIPPET_H |
|
23 |
|
24 |
|
25 #include <QtGui> |
|
26 #include "ActionButtonSnippet.h" |
|
27 #include "Toolbar.h" |
|
28 #include "WebChromeContainerSnippet.h" |
|
29 |
|
30 namespace GVA { |
|
31 |
|
32 |
|
33 /* \brief This is the base class for all toolbar snippets. |
|
34 * |
|
35 * This is the base class for all toolbar snippets. It maintains a list of all actions associated |
|
36 * with the toolbar (populated by the specific derived class). It connects all the actioins |
|
37 * to the associated view. It also sets the images for the different states of the button for each |
|
38 * of the buttons. |
|
39 */ |
|
40 |
|
41 class ToolbarSnippet : public WebChromeContainerSnippet |
|
42 { |
|
43 Q_OBJECT |
|
44 public: |
|
45 ToolbarSnippet(const QString& elementId, ChromeWidget * chrome, const QWebElement & element); |
|
46 virtual ~ToolbarSnippet(); |
|
47 |
|
48 private Q_SLOTS: |
|
49 virtual void onChromeComplete(); |
|
50 |
|
51 protected: |
|
52 virtual void setAction(ChromeSnippet * s); |
|
53 |
|
54 /// Reimplemented from WebChromeContainerSnippet |
|
55 virtual void updateOwnerArea(); |
|
56 virtual void updateSize(QSize); |
|
57 |
|
58 /// Utilities |
|
59 int getIndex(ChromeSnippet * s ); |
|
60 int getIndex(int actionId ); |
|
61 ActionButtonSnippet * getActionButtonSnippet( int actionId); |
|
62 |
|
63 /// Details of all actions in the toolbar |
|
64 QList<ToolbarActions_t*> m_actionInfo; |
|
65 /// View the toolbar is associated with |
|
66 QString m_type; |
|
67 |
|
68 }; |
|
69 |
|
70 } // end of namespace GVA |
|
71 |
|
72 #endif // __GINEBRA_TOOLBARSNIPPET_H |