2007-03-12 14:50:30 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2007 by Siraj Razick siraj@kdemail.net
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Library General Public License version 2 as
|
|
|
|
* published by the Free Software Foundation
|
|
|
|
*
|
|
|
|
* 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 CHECKBOX_H
|
|
|
|
#define CHECKBOX_H
|
|
|
|
|
2007-04-22 11:35:04 +02:00
|
|
|
#include <QtCore/QObject>
|
|
|
|
#include <QtGui/QGraphicsItem>
|
2007-03-12 14:50:30 +01:00
|
|
|
|
|
|
|
#include <kdemacros.h>
|
|
|
|
|
|
|
|
#include "datavisualization.h"
|
|
|
|
|
|
|
|
//TODO
|
|
|
|
//Please Document this class
|
|
|
|
|
|
|
|
namespace Plasma
|
|
|
|
{
|
|
|
|
|
2007-05-20 18:25:07 +02:00
|
|
|
/**
|
|
|
|
* Class that emulates a QCheckBox inside plasma
|
|
|
|
*/
|
2007-03-12 14:50:30 +01:00
|
|
|
class KDE_EXPORT CheckBox : public DataVisualization,public QGraphicsItem
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
|
|
|
|
CheckBox(QGraphicsItem *parent = 0);
|
2007-03-13 01:32:17 +01:00
|
|
|
virtual ~CheckBox();
|
2007-03-12 14:50:30 +01:00
|
|
|
|
|
|
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
|
|
|
|
QRectF boundingRect() const;
|
|
|
|
void setText(const QString&) ;
|
2007-03-13 08:46:12 +01:00
|
|
|
QString text() const;
|
|
|
|
QSize size() const;
|
|
|
|
int height() const;
|
|
|
|
int width() const;
|
|
|
|
void setSize(const QSize &size);
|
2007-03-12 14:50:30 +01:00
|
|
|
void setWidth(int width);
|
|
|
|
void setHeight(int height);
|
|
|
|
void setMaximumWidth(int maxwidth);
|
|
|
|
Qt::CheckState CheckState();
|
|
|
|
void setCheckState(Qt::CheckState state);
|
|
|
|
|
|
|
|
|
2007-04-22 11:35:04 +02:00
|
|
|
public Q_SLOTS:
|
2007-05-22 04:49:54 +02:00
|
|
|
void updated(const QString&, const DataEngine::Data&);
|
2007-04-22 11:35:04 +02:00
|
|
|
Q_SIGNALS:
|
2007-03-12 14:50:30 +01:00
|
|
|
void clicked();
|
|
|
|
protected:
|
|
|
|
//bool isDown();
|
|
|
|
void mousePressEvent ( QGraphicsSceneMouseEvent * event );
|
|
|
|
void mouseReleaseEvent ( QGraphicsSceneMouseEvent * event );
|
|
|
|
void mouseMoveEvent (QGraphicsSceneMouseEvent * event);
|
|
|
|
void hoverMoveEvent ( QGraphicsSceneHoverEvent * event );
|
|
|
|
void hoverLeaveEvent ( QGraphicsSceneHoverEvent * event );
|
|
|
|
void hoverEnterEvent ( QGraphicsSceneHoverEvent * event );
|
|
|
|
private:
|
|
|
|
class Private ;
|
|
|
|
Private * const d;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Plasma
|
|
|
|
|
|
|
|
#endif
|