File indexing completed on 2024-05-12 04:43:22
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 SCRIPTINGKRSCRIPTLINE_H 0019 #define SCRIPTINGKRSCRIPTLINE_H 0020 0021 #include <QObject> 0022 #include <QPointF> 0023 #include <QColor> 0024 0025 class KReportItemLine; 0026 0027 namespace Scripting 0028 { 0029 0030 /** 0031 @brief Line item script interface 0032 0033 The user facing interface for scripting report line items 0034 */ 0035 class Line : public QObject 0036 { 0037 Q_OBJECT 0038 public: 0039 explicit Line(KReportItemLine *); 0040 0041 ~Line() override; 0042 0043 public Q_SLOTS: 0044 /** 0045 * Return the start position of the line 0046 * @return start position 0047 */ 0048 QPointF startPosition() const; 0049 0050 /** 0051 * Set the start position of the line 0052 * @param startPosition 0053 */ 0054 void setStartPosition(const QPointF& startPosition); 0055 0056 /** 0057 * Return the end position of the line 0058 * @return end position 0059 */ 0060 QPointF endPosition() const; 0061 0062 /** 0063 * Set the end position of the line 0064 * @param endPosition 0065 */ 0066 void setEndPosition(const QPointF& endPosition); 0067 0068 /** 0069 * Return the color of the linelineColor 0070 * @return line color 0071 */ 0072 QColor lineColor() const; 0073 0074 /** 0075 * Sets the line color 0076 * @param lineColor 0077 */ 0078 void setLineColor(const QColor& lineColor); 0079 0080 /** 0081 * Return the weight (width) of the line 0082 * @return Weight 0083 */ 0084 int lineWeight() const; 0085 0086 /** 0087 * Set the weight (width) of the line 0088 * @param weight 0089 */ 0090 void setLineWeight(int const weight); 0091 0092 /** 0093 * Return the line style. Valid values are those from Qt::PenStyle (0-5) 0094 * @return Style 0095 */ 0096 int lineStyle() const; 0097 0098 /** 0099 * Set the style of the line 0100 * @param style From Qt::PenStyle (0-5) 0101 */ 0102 void setLineStyle(int style); 0103 0104 private: 0105 KReportItemLine *m_line; 0106 0107 }; 0108 0109 } 0110 0111 #endif