2008-11-04 00:08:39 +01: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_DESKTOPTOOLBOX_P_H
|
|
|
|
#define PLASMA_DESKTOPTOOLBOX_P_H
|
|
|
|
|
|
|
|
#include <QGraphicsItem>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QTime>
|
|
|
|
|
2008-11-04 03:39:56 +01:00
|
|
|
#include <kicon.h>
|
2008-11-04 00:08:39 +01:00
|
|
|
|
2009-10-20 16:14:53 +02:00
|
|
|
#include <private/internaltoolbox_p.h>
|
2008-11-04 00:08:39 +01:00
|
|
|
|
|
|
|
#include "animator.h"
|
|
|
|
|
|
|
|
namespace Plasma
|
|
|
|
{
|
|
|
|
|
|
|
|
class Widget;
|
|
|
|
class EmptyGraphicsItem;
|
|
|
|
class DesktopToolBoxPrivate;
|
|
|
|
|
2009-10-20 16:14:53 +02:00
|
|
|
class DesktopToolBox : public InternalToolBox
|
2008-11-04 00:08:39 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2008-11-14 08:28:02 +01:00
|
|
|
explicit DesktopToolBox(Containment *parent = 0);
|
2008-11-04 00:08:39 +01:00
|
|
|
~DesktopToolBox();
|
|
|
|
QRectF boundingRect() const;
|
|
|
|
QPainterPath shape() const;
|
|
|
|
|
|
|
|
void showToolBox();
|
|
|
|
void hideToolBox();
|
|
|
|
|
2009-07-28 05:19:33 +02:00
|
|
|
QSize cornerSize() const;
|
|
|
|
QSize fullWidth() const;
|
|
|
|
QSize fullHeight() const;
|
|
|
|
|
2010-01-04 07:41:43 +01:00
|
|
|
QGraphicsWidget *toolParent();
|
|
|
|
|
2009-10-07 20:32:15 +02:00
|
|
|
public Q_SLOTS:
|
|
|
|
void toolTipAboutToShow();
|
|
|
|
void toolTipHidden();
|
|
|
|
|
2008-11-04 00:08:39 +01:00
|
|
|
protected:
|
|
|
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
|
|
|
void hoverEnterEvent(QGraphicsSceneHoverEvent *event);
|
|
|
|
void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
|
|
|
|
|
2010-01-04 07:41:43 +01:00
|
|
|
protected Q_SLOTS:
|
2008-11-04 00:08:39 +01:00
|
|
|
void animateHighlight(qreal progress);
|
2009-07-28 05:19:33 +02:00
|
|
|
void updateTheming();
|
2009-01-28 14:38:57 +01:00
|
|
|
void toolTriggered(bool);
|
2010-01-04 07:41:43 +01:00
|
|
|
void hideToolBacker();
|
2008-11-04 00:08:39 +01:00
|
|
|
/**
|
|
|
|
* show/hide the toolbox
|
|
|
|
*/
|
|
|
|
void toggle();
|
|
|
|
private:
|
|
|
|
DesktopToolBoxPrivate *d;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // Plasma namespace
|
|
|
|
#endif // multiple inclusion guard
|
|
|
|
|