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 KREPORTITEMBRCODE_H
0019 #define KREPORTITEMBRCODE_H
0020 
0021 #include "KReportItemBase.h"
0022 
0023 class QDomNode;
0024 
0025 namespace Scripting
0026 {
0027 class Barcode;
0028 }
0029 
0030 /**
0031 */
0032 class KReportItemBarcode : public KReportItemBase
0033 {
0034 Q_OBJECT
0035 public:
0036     KReportItemBarcode();
0037     explicit KReportItemBarcode(const QDomNode &element);
0038     ~KReportItemBarcode() override;
0039 
0040     QString typeName() const override;
0041     int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KReportScriptHandler *script) override;
0042 
0043 protected:
0044     KProperty * m_horizontalAlignment;
0045     KProperty * m_format;
0046     KProperty * m_maxLength;
0047     KProperty* m_itemValue;
0048 
0049 
0050     Qt::Alignment horizontalAlignment() const;
0051     void setHorizontalAlignment(Qt::Alignment value);
0052     int maxLength() const;
0053     void setMaxLength(int i);
0054     QString format() const;
0055     void setFormat(const QString&);
0056 
0057     // all these values are in inches and
0058     // are for internal use only
0059     qreal m_minWidthData;
0060     qreal m_minWidthTotal;
0061     qreal m_minHeight;
0062 
0063 private:
0064     void createProperties() override;
0065 
0066     friend class Scripting::Barcode;
0067 };
0068 
0069 #endif