File indexing completed on 2024-05-12 04:43:22
0001 /* This file is part of the KDE project 0002 * Copyright (C) 2007-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 #include "KReportScriptLine.h" 0019 #include "KReportItemLine.h" 0020 0021 #include <KProperty> 0022 0023 namespace Scripting 0024 { 0025 0026 Line::Line(KReportItemLine* l) 0027 { 0028 m_line = l; 0029 } 0030 0031 Line::~Line() 0032 { 0033 } 0034 0035 QColor Line::lineColor() const 0036 { 0037 return m_line->m_lineColor->value().value<QColor>(); 0038 } 0039 0040 void Line::setLineColor(const QColor& color) 0041 { 0042 m_line->m_lineColor->setValue(color); 0043 } 0044 0045 int Line::lineWeight() const 0046 { 0047 return m_line->m_lineWeight->value().toInt(); 0048 } 0049 0050 void Line::setLineWeight(int weight) 0051 { 0052 m_line->m_lineWeight->setValue(weight); 0053 } 0054 0055 int Line::lineStyle() const 0056 { 0057 return m_line->m_lineStyle->value().toInt(); 0058 } 0059 0060 void Line::setLineStyle(int style) 0061 { 0062 if (style < 0 || style > 5) { 0063 style = 1; 0064 } 0065 m_line->m_lineStyle->setValue(style); 0066 } 0067 0068 QPointF Line::startPosition() const 0069 { 0070 return m_line->startPosition(); 0071 } 0072 0073 void Line::setStartPosition(const QPointF& startPosition) 0074 { 0075 m_line->setStartPosition(startPosition); 0076 } 0077 0078 QPointF Line::endPosition() const 0079 { 0080 return m_line->endPosition(); 0081 } 0082 0083 void Line::setEndPosition(const QPointF& endPosition) 0084 { 0085 m_line->setEndPosition(endPosition); 0086 } 0087 0088 }