File indexing completed on 2024-04-21 04:41:50
0001 /* This file is part of the KDE project 0002 * Copyright (C) 2007-2008 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 KREPORTITEMLINE_H 0019 #define KREPORTITEMLINE_H 0020 0021 #include "KReportItemBase.h" 0022 #include "kreport_export.h" 0023 0024 class QDomNode; 0025 0026 namespace Scripting 0027 { 0028 class Line; 0029 } 0030 0031 /** 0032 */ 0033 class KReportItemLine : public KReportItemBase 0034 { 0035 Q_OBJECT 0036 public: 0037 KReportItemLine(); 0038 explicit KReportItemLine(const QDomNode & element); 0039 ~KReportItemLine() override; 0040 0041 QString typeName() const override; 0042 int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, 0043 const QVariant &data, KReportScriptHandler *script) override; 0044 0045 void setUnit(const KReportUnit &u) override; 0046 0047 QPointF startPosition() const; 0048 void setStartPosition(const QPointF &ptPos); 0049 QPointF endPosition() const; 0050 void setEndPosition(const QPointF &ptPos); 0051 0052 protected: 0053 KProperty *m_lineColor; 0054 KProperty *m_lineWeight; 0055 KProperty *m_lineStyle; 0056 0057 KReportLineStyle lineStyle() const; 0058 qreal weight() const; 0059 void setWeight(qreal w); 0060 0061 private: 0062 KProperty *m_start; 0063 KProperty *m_end; 0064 0065 void createProperties() override; 0066 0067 friend class Scripting::Line; 0068 }; 0069 0070 #endif