2008-04-14 15:05:49 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2007 by Aaron Seigo <aseigo@kde.org>
|
|
|
|
* Copyright 2008 by Marco Martin <notmart@gmail.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Library General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this program; if not, write to the
|
|
|
|
* Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PLASMA_PANELTOOLBOX_P_H
|
|
|
|
#define PLASMA_PANELTOOLBOX_P_H
|
|
|
|
|
|
|
|
#include <QGraphicsItem>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QTime>
|
|
|
|
|
|
|
|
#include <KIcon>
|
|
|
|
|
|
|
|
#include <plasma/toolbox_p.h>
|
|
|
|
|
2008-04-25 05:23:31 +02:00
|
|
|
#include "animator.h"
|
2008-04-14 15:05:49 +02:00
|
|
|
|
|
|
|
namespace Plasma
|
|
|
|
{
|
|
|
|
|
|
|
|
class Widget;
|
|
|
|
class EmptyGraphicsItem;
|
2008-07-01 20:56:43 +02:00
|
|
|
class PanelToolBoxPrivate;
|
2008-04-14 15:05:49 +02:00
|
|
|
|
2008-05-24 14:25:56 +02:00
|
|
|
class PanelToolBox : public ToolBox
|
2008-04-14 15:05:49 +02:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2008-05-24 14:25:56 +02:00
|
|
|
explicit PanelToolBox(QGraphicsItem *parent = 0);
|
|
|
|
~PanelToolBox();
|
2008-04-20 16:23:37 +02:00
|
|
|
QRectF boundingRect() const;
|
2008-04-14 15:05:49 +02:00
|
|
|
QPainterPath shape() const;
|
|
|
|
|
2008-05-24 14:25:56 +02:00
|
|
|
void showToolBox();
|
|
|
|
void hideToolBox();
|
2008-04-14 15:05:49 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
|
|
|
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
|
|
|
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
void animate(qreal progress);
|
|
|
|
void toolMoved(QGraphicsItem*);
|
2008-07-04 18:47:01 +02:00
|
|
|
void toggle();
|
|
|
|
|
2008-04-14 15:05:49 +02:00
|
|
|
private:
|
2008-07-01 20:56:43 +02:00
|
|
|
PanelToolBoxPrivate *d;
|
2008-04-14 15:05:49 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // Plasma namespace
|
|
|
|
#endif // multiple inclusion guard
|
|
|
|
|