File indexing completed on 2024-05-19 04:44:31

0001 /* This file is part of the KDE project
0002  * Copyright (C) 2009-2010 by Adam Pigg (adam@piggz.co.uk)
0003  *
0004  * This library is free software; you can redistribute it and/or
0005  * modify it under the terms of the GNU Lesser General Public
0006  * License as published by the Free Software Foundation; either
0007  * version 2.1 of the License, or (at your option) any later version.
0008  *
0009  * This library is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0012  * Lesser General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU Lesser General Public
0015  * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
0016  */
0017 
0018 #ifndef KREPORTDESIGNERITEMCHECK_H
0019 #define KREPORTDESIGNERITEMCHECK_H
0020 
0021 #include "KReportDesignerItemRectBase.h"
0022 #include "KReportItemCheck.h"
0023 
0024 #include <KPropertySet>
0025 #include <QGraphicsRectItem>
0026 
0027 const int KREPORT_ITEM_CHECK_DEFAULT_WIDTH = 15;
0028 const int KREPORT_ITEM_CHECK_DEFAULT_HEIGHT = 15;
0029 
0030 class KReportDesignerItemCheckBox : public KReportItemCheckBox, public KReportDesignerItemRectBase
0031 {
0032     Q_OBJECT
0033 public:
0034     KReportDesignerItemCheckBox(KReportDesigner *designer, QGraphicsScene *scene,
0035                                 const QPointF &pos);
0036     KReportDesignerItemCheckBox(const QDomNode &element, KReportDesigner *designer,
0037                                 QGraphicsScene *scene);
0038 
0039     ~KReportDesignerItemCheckBox() override;
0040 
0041     void buildXML(QDomDocument *doc, QDomElement *parent) override;
0042 
0043     void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = nullptr) override;
0044 
0045     KReportDesignerItemCheckBox* clone() override;
0046 
0047 private:
0048     void init(QGraphicsScene *scene);
0049 
0050 private Q_SLOTS:
0051     void slotPropertyChanged(KPropertySet &, KProperty &);
0052 };
0053 
0054 #endif // KREPORTDESIGNERITEMCHECK_H