2009-12-27 23:16:11 +01:00
|
|
|
/*
|
|
|
|
Copyright (C) 2009 Adenilson Cavalcanti <adenilson.silva@idnt.org.br>
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This library 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
|
|
|
|
Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2010-04-15 20:51:26 +02:00
|
|
|
#ifndef PLASMA_WIDGETSNAPSHOT_P_H
|
|
|
|
#define PLASMA_WIDGETSNAPSHOT_P_H
|
2009-11-13 02:20:51 +01:00
|
|
|
|
|
|
|
#include <QGraphicsWidget>
|
|
|
|
|
|
|
|
namespace Plasma
|
|
|
|
{
|
|
|
|
|
2010-04-15 20:51:26 +02:00
|
|
|
class WidgetSnapShot : public QGraphicsWidget
|
2009-11-13 02:20:51 +01:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
2010-01-04 10:17:49 +01:00
|
|
|
Q_PROPERTY(QGraphicsWidget *target READ target WRITE setTarget)
|
2009-11-13 02:20:51 +01:00
|
|
|
|
|
|
|
public:
|
2010-04-15 20:51:26 +02:00
|
|
|
explicit WidgetSnapShot(QGraphicsItem *parent = 0);
|
|
|
|
virtual ~WidgetSnapShot();
|
2009-11-13 02:20:51 +01:00
|
|
|
|
2010-04-15 20:51:26 +02:00
|
|
|
virtual void setTarget(QGraphicsWidget *target);
|
2010-01-04 10:17:49 +01:00
|
|
|
QGraphicsWidget *target() const;
|
2009-11-13 02:20:51 +01:00
|
|
|
|
2010-04-15 20:51:26 +02:00
|
|
|
virtual void paint(QPainter *painter,
|
|
|
|
const QStyleOptionGraphicsItem *option,
|
2009-11-13 02:20:51 +01:00
|
|
|
QWidget *widget);
|
|
|
|
|
2010-04-15 20:51:26 +02:00
|
|
|
bool isIconBigger() const;
|
|
|
|
|
|
|
|
QPixmap snapShot() const;
|
2010-02-22 22:58:21 +01:00
|
|
|
|
2009-11-13 02:20:51 +01:00
|
|
|
private:
|
2010-01-05 19:23:59 +01:00
|
|
|
void paintSubChildren(QPainter *painter,
|
|
|
|
const QStyleOptionGraphicsItem *option,
|
|
|
|
QGraphicsItem *target);
|
2010-04-15 20:51:26 +02:00
|
|
|
|
2010-02-22 22:58:21 +01:00
|
|
|
bool m_iconBig;
|
2010-01-05 19:55:45 +01:00
|
|
|
int stack;
|
2010-04-15 20:51:26 +02:00
|
|
|
QPixmap m_snapShot;
|
2010-01-04 10:17:49 +01:00
|
|
|
QGraphicsWidget *m_target;
|
2009-11-13 02:20:51 +01:00
|
|
|
};
|
|
|
|
|
2010-04-15 20:51:26 +02:00
|
|
|
} // namespace Plasma
|
2009-11-13 02:20:51 +01:00
|
|
|
|
2010-04-15 20:51:26 +02:00
|
|
|
#endif // PLASMA_WIDGETSNAPSHOT_P_H
|