KReport

KReportScriptLine.cpp
1/* This file is part of the KDE project
2 * Copyright (C) 2007-2010 by Adam Pigg (adam@piggz.co.uk)
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
23namespace Scripting
24{
25
26Line::Line(KReportItemLine* l)
27{
28 m_line = l;
29}
30
31Line::~Line()
32{
33}
34
36{
37 return m_line->m_lineColor->value().value<QColor>();
38}
39
40void Line::setLineColor(const QColor& color)
41{
42 m_line->m_lineColor->setValue(color);
43}
44
46{
47 return m_line->m_lineWeight->value().toInt();
48}
49
50void Line::setLineWeight(int weight)
51{
52 m_line->m_lineWeight->setValue(weight);
53}
54
55int Line::lineStyle() const
56{
57 return m_line->m_lineStyle->value().toInt();
58}
59
60void 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
73void Line::setStartPosition(const QPointF& startPosition)
74{
75 m_line->setStartPosition(startPosition);
76}
77
79{
80 return m_line->endPosition();
81}
82
83void Line::setEndPosition(const QPointF& endPosition)
84{
85 m_line->setEndPosition(endPosition);
86}
87
88}
QVariant value() const
bool setValue(const QVariant &value, ValueOptions options=ValueOptions())
void setEndPosition(const QPointF &endPosition)
Set the end position of the line.
void setLineStyle(int style)
Set the style of the line.
QPointF startPosition() const
Return the start position of the line.
int lineWeight() const
Return the weight (width) of the line.
QColor lineColor() const
Return the color of the linelineColor.
QPointF endPosition() const
Return the end position of the line.
void setLineWeight(int const weight)
Set the weight (width) of the line.
int lineStyle() const
Return the line style.
void setLineColor(const QColor &lineColor)
Sets the line color.
void setStartPosition(const QPointF &startPosition)
Set the start position of the line.
Field item script interface.
int toInt(bool *ok) const const
T value() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:12:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.