1 /* This file is part of the KDE project
2  * Copyright (C) 2007-2008 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 "KReportScriptBarcode.h"
19 
20 #include <KProperty>
21 #include <QSizeF>
22 #include <QPointF>
23 
24 namespace Scripting
25 {
26 
Barcode(KReportItemBarcode * b)27 Barcode::Barcode(KReportItemBarcode *b)
28 {
29     m_barcode = b;
30 }
31 
~Barcode()32 Barcode::~Barcode()
33 {
34 }
35 
position() const36 QPointF Barcode::position() const
37 {
38     return m_barcode->position();
39 }
40 
setPosition(const QPointF & p)41 void Barcode::setPosition(const QPointF& p)
42 {
43     m_barcode->setPosition(p);
44 }
45 
size() const46 QSizeF Barcode::size() const
47 {
48     return m_barcode->size();
49 }
50 
setSize(const QSizeF & s)51 void Barcode::setSize(const QSizeF& s)
52 {
53     m_barcode->setSize(s);
54 }
55 
horizontalAlignment() const56 Qt::Alignment Barcode::horizontalAlignment() const
57 {
58     return m_barcode->horizontalAlignment();
59 }
60 
setHorizonalAlignment(Qt::Alignment value)61 void Barcode::setHorizonalAlignment(Qt::Alignment value)
62 {
63     m_barcode->setHorizontalAlignment(value);
64 }
65 
source() const66 QString Barcode::source() const
67 {
68     return m_barcode->itemDataSource();
69 }
70 
setSource(const QString & s)71 void Barcode::setSource(const QString& s)
72 {
73     m_barcode->setItemDataSource(s);
74 }
75 
format() const76 QString Barcode::format() const
77 {
78     return m_barcode->m_format->value().toString();
79 }
80 
setFormat(const QString & s)81 void Barcode::setFormat(const QString& s)
82 {
83     m_barcode->m_format->setValue(s);
84 }
85 }
86