KReport

KReportScriptImage.h
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#ifndef SCRIPTINGKRSCRIPTIMAGE_H
19#define SCRIPTINGKRSCRIPTIMAGE_H
20
21#include <QObject>
22#include <QPointF>
23#include <QSizeF>
24
25class KReportItemImage;
26
27namespace Scripting
28{
29
30 /**
31 @brief Image item script interface
32
33 The user facing interface for scripting report image items
34 */
35class Image : public QObject
36{
38public:
39 explicit Image(KReportItemImage *);
40
41 ~Image() override;
42public Q_SLOTS:
43
44
45 /**
46 * Get the position of the barcode
47 * @return position in points
48 */
49 QPointF position() const;
50
51
52 /**
53 * Sets the position of the barcode in points
54 * @param Position
55 */
56 void setPosition(const QPointF&);
57
58 /**
59 * Get the size of the barcode
60 * @return size in points
61 */
62 QSizeF size() const;
63
64 /**
65 * Set the size of the barcode in points
66 * @param Size
67 */
68 void setSize(const QSizeF&);
69
70 /**
71 * Get the resize mode for the image
72 * @return resizeMode Clip or Stretch
73 */
74 QString resizeMode() const;
75
76 /**
77 * Sets the resize mode for the image
78 * @param ResizeMode "Stretch" or "Clip" default is to clip
79 */
80 void setResizeMode(const QString &);
81
82 /**
83 * Sets the data for the static image
84 * the data should be base64 encoded
85 * @param RawImageData
86 */
87 void setInlineImage(const QByteArray&);
88
89 /**
90 * Get the data from a file (expected to be an image)
91 * the returned data will be base64 encoded
92 * @param path location of file
93 */
94 void loadFromFile(const QVariant &path);
95
96private:
97 KReportItemImage *m_image;
98
99};
100
101}
102
103#endif
Image item script interface.
void setResizeMode(const QString &)
Sets the resize mode for the image.
QPointF position() const
Get the position of the barcode.
QString resizeMode() const
Get the resize mode for the image.
void loadFromFile(const QVariant &path)
Get the data from a file (expected to be an image) the returned data will be base64 encoded.
void setSize(const QSizeF &)
Set the size of the barcode in points.
void setInlineImage(const QByteArray &)
Sets the data for the static image the data should be base64 encoded.
QSizeF size() const
Get the size of the barcode.
void setPosition(const QPointF &)
Sets the position of the barcode in points.
Field item script interface.
Q_OBJECTQ_OBJECT
Q_SLOTSQ_SLOTS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 13 2024 11:50:02 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.