2
* Copyright 2007 by Aaron Seigo <aseigo@kde.org>
3
* Copyright 2008 by Marco Martin <notmart@gmail.com>
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU Library General Public License as
7
* published by the Free Software Foundation; either version 2, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details
15
* You should have received a copy of the GNU Library General Public
16
* License along with this program; if not, write to the
17
* Free Software Foundation, Inc.,
18
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
#ifndef PLASMA_INTERNALTOOLBOX_P_H
22
#define PLASMA_INTERNALTOOLBOX_P_H
24
#include <QGraphicsWidget>
26
#include <Plasma/Plasma>
27
#include <Plasma/Containment>
28
#include <Plasma/AbstractToolBox>
37
class InternalToolBoxPrivate;
39
class InternalToolBox : public Plasma::AbstractToolBox
42
Q_INTERFACES(QGraphicsItem)
55
explicit InternalToolBox(Plasma::Containment *parent);
56
explicit InternalToolBox(QObject *parent = 0, const QVariantList &args = QVariantList());
60
* create a toolbox tool from the given action
61
* @p action the action to associate hte tool with
63
void addTool(QAction *action);
65
* remove the tool associated with this action
67
void removeTool(QAction *action);
70
void setSize(const int newSize);
71
QSize iconSize() const;
72
void setIconSize(const QSize newSize);
73
bool isShowing() const;
74
void setShowing(const bool show);
76
virtual QGraphicsWidget *toolParent();
78
virtual void setCorner(const Corner corner);
79
virtual Corner corner() const;
81
bool isMovable() const;
82
void setIsMovable(bool movable);
84
virtual QSize fullWidth() const;
85
virtual QSize fullHeight() const;
86
virtual QSize cornerSize() const;
87
virtual void updateToolBox() {}
89
void setIconic(bool iconic);
92
virtual void showToolBox() = 0;
93
virtual void hideToolBox() = 0;
95
QList<QAction *> actions() const;
98
void save(KConfigGroup &cg) const;
99
void restore(const KConfigGroup &containmentGroup);
103
Plasma::Containment *containment();
104
QPoint toolPosition(int toolHeight);
106
void mousePressEvent(QGraphicsSceneMouseEvent *event);
107
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
108
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
111
virtual void toolTriggered(bool);
112
void actionDestroyed(QObject *object);
113
void immutabilityChanged(Plasma::ImmutabilityType immutability);
116
InternalToolBoxPrivate *d;
121
#endif // PLASMA_INTERNALTOOLBOX_P_H