1 | /* |
2 | This program is free software; you can redistribute it and/or |
3 | modify it under the terms of the GNU General Public License |
4 | as published by the Free Software Foundation; either version 2 |
5 | of the License, or (at your option) any later version. |
6 | |
7 | This program is distributed in the hope that it will be useful, |
8 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
10 | GNU General Public License for more details. |
11 | |
12 | You should have received a copy of the GNU General Public License |
13 | along with this program; if not, write to the Free Software |
14 | Foundation, Inc., 51 Franklin Street, Fifth Floor, |
15 | Boston, MA 02110-1301, USA. |
16 | |
17 | --- |
18 | Copyright (C) 2012 Martin Kuettler <martin.kuettler@gmail.com> |
19 | */ |
20 | |
21 | #ifndef ACTIONBAR_H |
22 | #define ACTIONBAR_H |
23 | |
24 | #include <QGraphicsObject> |
25 | |
26 | #include <KIcon> |
27 | |
28 | class Worksheet; |
29 | class WorksheetEntry; |
30 | class WorksheetToolButton; |
31 | |
32 | class ActionBar : public QGraphicsObject |
33 | { |
34 | Q_OBJECT |
35 | public: |
36 | ActionBar(WorksheetEntry* parent); |
37 | ~ActionBar(); |
38 | |
39 | WorksheetToolButton* addButton(const KIcon& icon, QString toolTip, |
40 | QObject* receiver = 0, |
41 | const char* method = 0); |
42 | void addSpace(); |
43 | |
44 | WorksheetEntry* parentEntry(); |
45 | |
46 | QRectF boundingRect() const; |
47 | void paint(QPainter*, const QStyleOptionGraphicsItem*, QWidget*); |
48 | |
49 | public slots: |
50 | void updatePosition(); |
51 | |
52 | private: |
53 | Worksheet* worksheet(); |
54 | |
55 | private: |
56 | Q_PROPERTY(qreal opacity READ opacity WRITE setOpacity); |
57 | QList<WorksheetToolButton*> m_buttons; |
58 | qreal m_pos; |
59 | qreal m_height; |
60 | }; |
61 | |
62 | #endif // ACTIONBAR_H |
63 | |