BPS C++ API  2.24.4
bpsreportelement.h
Go to the documentation of this file.
1 
4 #ifndef BPSREPORTELEMENT_H
5 #define BPSREPORTELEMENT_H
6 
7 #include "bpspropertyobject.h"
8 #include <QMetaType>
9 #include <QPointF>
10 
11 class QGraphicsItem;
12 
79 {
80  Q_OBJECT
82 
83 public:
84 
88  enum Type {
98  TypePixmap
99  };
100 
106  BpsReportElement(Type aType, QObject* aParent = nullptr);
107 
114  BpsReportElement(const BpsReportElement& aElement, QObject* aParent = nullptr, bool aCopyChilds = true);
115 
116  virtual ~BpsReportElement();
117 
123 
130  BpsReportElement* childElement(const QString& aName) const;
131 
137  void insertChild(int aIndex, BpsReportElement* aChild);
138 
142  Type type() const;
143 
148  Type typeByName(const QString& aTypeName) const;
149 
153  QString typeName() const;
154 
165 
176  QGraphicsItem* createGraphicsItem(int aResolution, const QPointF& aOffset) const;
177 
187 
195 
201 
207 
215  void setResolution(int aResolution);
216 
221  int resolution() const;
222 
228  void setOffset(const QPointF& aOffset);
229 
234  QPointF offset() const;
235 
236 public slots:
245  virtual bool setProperty(const char* aName, const QVariant& aValue);
246 
247 protected:
248 
255  virtual BpsPropertyObject* xmlCreateObject(const QString& aTagName, int aLevel) const;
256 
262  virtual QString xmlTagName(int aLevel) const;
263 
264 }; // BpsReportElement
265 
266 Q_DECLARE_METATYPE(BpsReportElement*)
267 
268 #endif // BPSREPORTELEMENT_H
#define BPSCORE_EXPORT
Declare class to be an import from the shared library.
Definition: bpscore_global.h:22
#define BPS_PRIVATE(Class)
Declare pointer to private object in a public class.
Definition: bpsglobals.h:102
Public include file for BpsPropertyObject class.
This class is a generic editable object.
Definition: bpspropertyobject.h:21
This class represents a BPS report element.
Definition: bpsreportelement.h:79
void insertChild(int aIndex, BpsReportElement *aChild)
Insert a child at the specified position in the list.
BpsReportElement * childElement(const QString &aName) const
Get the named child element.
QGraphicsItem * graphicsItem() const
Get a pointer to the internal graphics item.
BpsReportElement * lastChild() const
Get last child element.
BpsReportElement * parentElement() const
Get the parent element.
BpsReportElement(const BpsReportElement &aElement, QObject *aParent=nullptr, bool aCopyChilds=true)
Copy-constructor for BpsReportElement.
QGraphicsItem * createGraphicsItem(int aResolution, const QPointF &aOffset) const
Creates a graphics item for external use.
QString typeName() const
QPointF offset() const
Get the current drawing offset.
QLineF handleLine() const
Get the line where the handles should be placed on for single selection.
Type type() const
void setOffset(const QPointF &aOffset)
Set the drawing offset in millimeters.
int resolution() const
Get current drawing resolution.
virtual bool setProperty(const char *aName, const QVariant &aValue)
Set the value of a named property.
QRectF handleRect() const
Get the rectangle where the sizing handles should be placed on.
BpsReportElement(Type aType, QObject *aParent=nullptr)
Constructor for BpsReportElement.
Type typeByName(const QString &aTypeName) const
BpsReportElement * firstChild() const
Get first child element.
virtual QString xmlTagName(int aLevel) const
Define a XML tag for the element of the level.
Type
Element type enumeration.
Definition: bpsreportelement.h:88
@ TypeRectangle
Rectangle item element.
Definition: bpsreportelement.h:95
@ TypeSection
Section element.
Definition: bpsreportelement.h:91
@ TypeRichtext
Rich text item element.
Definition: bpsreportelement.h:93
@ TypeReport
Report element, top level.
Definition: bpsreportelement.h:90
@ TypeSimpletext
Simple text item element.
Definition: bpsreportelement.h:92
@ TypeBarcode
Bar code item element.
Definition: bpsreportelement.h:97
@ TypeEllipse
Ellipse item element.
Definition: bpsreportelement.h:96
@ TypeUnknown
The type in unknown. Used to signal errors.
Definition: bpsreportelement.h:89
@ TypeLine
Line item element.
Definition: bpsreportelement.h:94
void setResolution(int aResolution)
Sets the resolution as number of points per inch.
virtual BpsPropertyObject * xmlCreateObject(const QString &aTagName, int aLevel) const
Create a new object while processing loadXml().