File indexing completed on 2024-05-12 04:43:20
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 SCRIPTINGKRSCRIPTBARCODE_H 0019 #define SCRIPTINGKRSCRIPTBARCODE_H 0020 0021 #include <QObject> 0022 0023 #include "KReportItemBarcode.h" 0024 0025 namespace Scripting 0026 { 0027 0028 /** 0029 */ 0030 class Barcode : public QObject 0031 { 0032 Q_OBJECT 0033 public: 0034 explicit Barcode(KReportItemBarcode *f); 0035 0036 ~Barcode() override; 0037 0038 public Q_SLOTS: 0039 0040 0041 /** 0042 * Get the position of the barcode 0043 * @return position in points 0044 */ 0045 QPointF position() const; 0046 0047 /** 0048 * Sets the position of the barcode in points 0049 * @param Position 0050 */ 0051 void setPosition(const QPointF&); 0052 0053 /** 0054 * Get the size of the barcode 0055 * @return size in points 0056 */ 0057 QSizeF size() const; 0058 0059 /** 0060 * Set the size of the barcode in points 0061 * @param Size 0062 */ 0063 void setSize(const QSizeF&); 0064 0065 /** 0066 * Get the horizontal alignment 0067 * Qt::AlignLeft Left 0068 * Qt::AlignHCenter Center 0069 * Qt::AlignRight Right 0070 * @return alignment 0071 */ 0072 Qt::Alignment horizontalAlignment() const; 0073 0074 /** 0075 * Sets the horizontal alignment 0076 * @param Alignemnt 0077 */ 0078 void setHorizonalAlignment(Qt::Alignment value); 0079 0080 0081 /** 0082 * @return the data source for the element 0083 * The source can be a column name or a valid script expression if prefixed with a '='. 0084 */ 0085 QString source() const; 0086 0087 0088 /** 0089 * Sets the data source for the element. 0090 * @see source() 0091 */ 0092 void setSource(const QString &s); 0093 0094 0095 /** 0096 * Get the barcode format 0097 * @return format as string 0098 */ 0099 QString format() const; 0100 0101 /** 0102 * Set the barcode format 0103 * @param format 0104 */ 0105 void setFormat(const QString&); 0106 0107 0108 private: 0109 KReportItemBarcode *m_barcode; 0110 }; 0111 0112 } 0113 0114 #endif