KReport

KReportScriptLine.cpp
1 /* This file is part of the KDE project
2  * Copyright (C) 2007-2010 by Adam Pigg ([email protected])
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #include "KReportScriptLine.h"
19 #include "KReportItemLine.h"
20 
21 #include <KProperty>
22 
23 namespace Scripting
24 {
25 
26 Line::Line(KReportItemLine* l)
27 {
28  m_line = l;
29 }
30 
31 Line::~Line()
32 {
33 }
34 
36 {
37  return m_line->m_lineColor->value().value<QColor>();
38 }
39 
40 void Line::setLineColor(const QColor& color)
41 {
42  m_line->m_lineColor->setValue(color);
43 }
44 
45 int Line::lineWeight() const
46 {
47  return m_line->m_lineWeight->value().toInt();
48 }
49 
50 void Line::setLineWeight(int weight)
51 {
52  m_line->m_lineWeight->setValue(weight);
53 }
54 
55 int Line::lineStyle() const
56 {
57  return m_line->m_lineStyle->value().toInt();
58 }
59 
60 void Line::setLineStyle(int style)
61 {
62  if (style < 0 || style > 5) {
63  style = 1;
64  }
65  m_line->m_lineStyle->setValue(style);
66 }
67 
69 {
70  return m_line->startPosition();
71 }
72 
74 {
75  m_line->setStartPosition(startPosition);
76 }
77 
79 {
80  return m_line->endPosition();
81 }
82 
84 {
85  m_line->setEndPosition(endPosition);
86 }
87 
88 }
void setLineWeight(int const weight)
Set the weight (width) of the line.
void setEndPosition(const QPointF &endPosition)
Set the end position of the line.
QPointF endPosition() const
Return the end position of the line.
QColor lineColor() const
Return the color of the linelineColor.
void setStartPosition(const QPointF &startPosition)
Set the start position of the line.
QPointF startPosition() const
Return the start position of the line.
void setLineStyle(int style)
Set the style of the line.
void setLineColor(const QColor &lineColor)
Sets the line color.
int lineStyle() const
Return the line style.
Field item script interface.
int lineWeight() const
Return the weight (width) of the line.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Dec 6 2021 22:58:31 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.