0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-23 16:22:58 +03:00
LimeReport/limereport/lrfactoryinitializer.cpp

558 lines
24 KiB
C++
Raw Normal View History

2017-06-12 13:11:00 +03:00
#include "bands/lrdataband.h"
#include "bands/lrgroupbands.h"
#include "bands/lrpagefooter.h"
#include "bands/lrpageheader.h"
#include "bands/lrreportfooter.h"
#include "bands/lrreportheader.h"
2017-06-12 13:11:00 +03:00
#include "bands/lrsubdetailband.h"
#include "bands/lrtearoffband.h"
#include "items/lrtextitem.h"
2017-06-13 13:03:38 +03:00
#ifdef HAVE_ZINT
2017-06-12 13:11:00 +03:00
#include "items/lrbarcodeitem.h"
2017-06-13 13:03:38 +03:00
#endif
#include "items/lrchartitem.h"
2017-06-12 13:11:00 +03:00
#include "items/lrhorizontallayout.h"
#include "items/lrimageitem.h"
#include "items/lrshapeitem.h"
#include "lrdesignelementsfactory.h"
2020-03-18 13:34:11 +03:00
#ifdef HAVE_SVG
#include "items/lrsvgitem.h"
#include "objectinspector/propertyItems/lrsvgpropitem.h"
#endif
2017-11-27 23:14:05 +03:00
#ifdef HAVE_REPORT_DESIGNER
#include "items/lralignpropitem.h"
#include "items/lrsubitemparentpropitem.h"
2017-06-12 13:11:00 +03:00
#include "objectinspector/lrobjectpropitem.h"
#include "objectinspector/propertyItems/lrboolpropitem.h"
#include "objectinspector/propertyItems/lrcolorpropitem.h"
#include "objectinspector/propertyItems/lrcontentpropitem.h"
#include "objectinspector/propertyItems/lrdatasourcepropitem.h"
#include "objectinspector/propertyItems/lrenumpropitem.h"
#include "objectinspector/propertyItems/lrflagspropitem.h"
#include "objectinspector/propertyItems/lrfontpropitem.h"
#include "objectinspector/propertyItems/lrgroupfieldpropitem.h"
#include "objectinspector/propertyItems/lrimagepropitem.h"
#include "objectinspector/propertyItems/lrintpropitem.h"
#include "objectinspector/propertyItems/lrqrealpropitem.h"
#include "objectinspector/propertyItems/lrrectproptem.h"
#include "objectinspector/propertyItems/lrstringpropitem.h"
2017-11-27 23:14:05 +03:00
#endif
2017-06-12 13:11:00 +03:00
#include "exporters/lrpdfexporter.h"
#include "lrexporterintf.h"
#include "lrexportersfactory.h"
2017-06-12 13:11:00 +03:00
#include "serializators/lrxmlbasetypesserializators.h"
#include "serializators/lrxmlqrectserializator.h"
#include "serializators/lrxmlserializatorsfactory.h"
void initResources()
{
2017-06-12 13:11:00 +03:00
Q_INIT_RESOURCE(report);
2017-11-27 23:14:05 +03:00
#ifdef HAVE_REPORT_DESIGNER
2017-06-12 13:11:00 +03:00
Q_INIT_RESOURCE(lobjectinspector);
Q_INIT_RESOURCE(lrdatabrowser);
Q_INIT_RESOURCE(items);
Q_INIT_RESOURCE(lrscriptbrowser);
2017-11-27 23:14:05 +03:00
Q_INIT_RESOURCE(translationeditor);
#endif
#ifdef ENABLE_DIALOG_DESIGNER
2018-01-23 21:48:12 +03:00
Q_INIT_RESOURCE(dialogdesigner);
2017-11-27 23:14:05 +03:00
#endif
2017-06-12 13:11:00 +03:00
}
namespace LimeReport {
2017-06-12 13:11:00 +03:00
BaseDesignIntf* createDataBand(QObject* owner, LimeReport::BaseDesignIntf* parent)
{
return new LimeReport::DataBand(owner, parent);
2017-06-12 13:11:00 +03:00
}
BaseDesignIntf* createHeaderDataBand(QObject* owner, LimeReport::BaseDesignIntf* parent)
{
return new LimeReport::DataHeaderBand(owner, parent);
2017-06-12 13:11:00 +03:00
}
BaseDesignIntf* createFooterDataBand(QObject* owner, LimeReport::BaseDesignIntf* parent)
{
return new LimeReport::DataFooterBand(owner, parent);
2017-06-12 13:11:00 +03:00
}
BaseDesignIntf* createGroupHeaderBand(QObject* owner, LimeReport::BaseDesignIntf* parent)
{
return new LimeReport::GroupBandHeader(owner, parent);
2017-06-12 13:11:00 +03:00
}
BaseDesignIntf* createGroupFooterBand(QObject* owner, LimeReport::BaseDesignIntf* parent)
{
return new LimeReport::GroupBandFooter(owner, parent);
2017-06-12 13:11:00 +03:00
}
BaseDesignIntf* createPageHeaderBand(QObject* owner, LimeReport::BaseDesignIntf* parent)
{
return new LimeReport::PageHeader(owner, parent);
2017-06-12 13:11:00 +03:00
}
BaseDesignIntf* createPageFooterBand(QObject* owner, LimeReport::BaseDesignIntf* parent)
{
return new LimeReport::PageFooter(owner, parent);
2017-06-12 13:11:00 +03:00
}
BaseDesignIntf* createSubDetailBand(QObject* owner, LimeReport::BaseDesignIntf* parent)
{
return new LimeReport::SubDetailBand(owner, parent);
2017-06-12 13:11:00 +03:00
}
BaseDesignIntf* createSubDetailHeaderBand(QObject* owner, LimeReport::BaseDesignIntf* parent)
{
return new LimeReport::SubDetailHeaderBand(owner, parent);
2017-06-12 13:11:00 +03:00
}
BaseDesignIntf* createSubDetailFooterBand(QObject* owner, LimeReport::BaseDesignIntf* parent)
{
return new LimeReport::SubDetailFooterBand(owner, parent);
2017-06-12 13:11:00 +03:00
}
BaseDesignIntf* createTearOffBand(QObject* owner, LimeReport::BaseDesignIntf* parent)
{
return new LimeReport::TearOffBand(owner, parent);
2017-06-12 13:11:00 +03:00
}
BaseDesignIntf* createTextItem(QObject* owner, LimeReport::BaseDesignIntf* parent)
{
return new LimeReport::TextItem(owner, parent);
2017-06-12 13:11:00 +03:00
}
#ifdef HAVE_ZINT
BaseDesignIntf* createBarcodeItem(QObject* owner, LimeReport::BaseDesignIntf* parent)
{
return new BarcodeItem(owner, parent);
2017-06-12 13:11:00 +03:00
}
#endif
2017-06-12 13:11:00 +03:00
2020-03-18 13:34:11 +03:00
#ifdef HAVE_SVG
BaseDesignIntf* createSVGItem(QObject* owner, LimeReport::BaseDesignIntf* parent)
{
return new SVGItem(owner, parent);
2020-03-18 13:34:11 +03:00
}
#endif
BaseDesignIntf* createHLayout(QObject* owner, LimeReport::BaseDesignIntf* parent)
2017-06-12 13:11:00 +03:00
{
return new HorizontalLayout(owner, parent);
}
BaseDesignIntf* createImageItem(QObject* owner, LimeReport::BaseDesignIntf* parent)
{
return new ImageItem(owner, parent);
2017-06-12 13:11:00 +03:00
}
BaseDesignIntf* createShapeItem(QObject* owner, LimeReport::BaseDesignIntf* parent)
{
return new ShapeItem(owner, parent);
2017-06-12 13:11:00 +03:00
}
BaseDesignIntf* createChartItem(QObject* owner, LimeReport::BaseDesignIntf* parent)
{
return new ChartItem(owner, parent);
2017-11-27 23:14:05 +03:00
}
void initReportItems()
{
2017-06-12 13:11:00 +03:00
initResources();
DesignElementsFactory::instance().registerCreator(
"TextItem", LimeReport::ItemAttribs(QObject::tr("Text Item"), "TextItem"), createTextItem);
2017-06-12 13:11:00 +03:00
#ifdef HAVE_ZINT
DesignElementsFactory::instance().registerCreator(
"BarcodeItem", LimeReport::ItemAttribs(QObject::tr("Barcode Item"), "Item"),
createBarcodeItem);
2017-06-12 13:11:00 +03:00
#endif
2020-03-18 13:34:11 +03:00
2017-06-12 13:11:00 +03:00
DesignElementsFactory::instance().registerCreator(
"HLayout", LimeReport::ItemAttribs(QObject::tr("HLayout"), LimeReport::Const::bandTAG),
createHLayout);
2017-06-12 13:11:00 +03:00
DesignElementsFactory::instance().registerCreator(
"ImageItem", LimeReport::ItemAttribs(QObject::tr("Image Item"), "Item"), createImageItem);
2020-03-18 13:34:11 +03:00
#ifdef HAVE_SVG
DesignElementsFactory::instance().registerCreator(
"SVGItem", LimeReport::ItemAttribs(QObject::tr("SVG Item"), "Item"), createSVGItem);
2020-03-18 13:34:11 +03:00
#endif
2017-06-12 13:11:00 +03:00
DesignElementsFactory::instance().registerCreator(
"ShapeItem", LimeReport::ItemAttribs(QObject::tr("Shape Item"), "Item"), createShapeItem);
2017-11-27 23:14:05 +03:00
DesignElementsFactory::instance().registerCreator(
"ChartItem", LimeReport::ItemAttribs(QObject::tr("Chart Item"), "Item"), createChartItem);
2017-06-12 13:11:00 +03:00
DesignElementsFactory::instance().registerCreator(
"Data", LimeReport::ItemAttribs(QObject::tr("Data"), LimeReport::Const::bandTAG),
createDataBand);
2017-06-12 13:11:00 +03:00
DesignElementsFactory::instance().registerCreator(
"DataHeader",
LimeReport::ItemAttribs(QObject::tr("DataHeader"), LimeReport::Const::bandTAG),
createHeaderDataBand);
2017-06-12 13:11:00 +03:00
DesignElementsFactory::instance().registerCreator(
"DataFooter",
LimeReport::ItemAttribs(QObject::tr("DataFooter"), LimeReport::Const::bandTAG),
createFooterDataBand);
2017-06-12 13:11:00 +03:00
DesignElementsFactory::instance().registerCreator(
"GroupHeader",
LimeReport::ItemAttribs(QObject::tr("GroupHeader"), LimeReport::Const::bandTAG),
createGroupHeaderBand);
2017-06-12 13:11:00 +03:00
DesignElementsFactory::instance().registerCreator(
"GroupFooter",
LimeReport::ItemAttribs(QObject::tr("GroupFooter"), LimeReport::Const::bandTAG),
createGroupFooterBand);
2017-06-12 13:11:00 +03:00
DesignElementsFactory::instance().registerCreator(
"PageFooter",
LimeReport::ItemAttribs(QObject::tr("Page Footer"), LimeReport::Const::bandTAG),
createPageFooterBand);
2017-06-12 13:11:00 +03:00
DesignElementsFactory::instance().registerCreator(
"PageHeader",
LimeReport::ItemAttribs(QObject::tr("Page Header"), LimeReport::Const::bandTAG),
createPageHeaderBand);
2017-06-12 13:11:00 +03:00
DesignElementsFactory::instance().registerCreator(
"SubDetail", LimeReport::ItemAttribs(QObject::tr("SubDetail"), LimeReport::Const::bandTAG),
createSubDetailBand);
2017-06-12 13:11:00 +03:00
DesignElementsFactory::instance().registerCreator(
"SubDetailHeader",
LimeReport::ItemAttribs(QObject::tr("SubDetailHeader"), LimeReport::Const::bandTAG),
createSubDetailHeaderBand);
2017-06-12 13:11:00 +03:00
DesignElementsFactory::instance().registerCreator(
"SubDetailFooter",
LimeReport::ItemAttribs(QObject::tr("SubDetailFooter"), LimeReport::Const::bandTAG),
createSubDetailFooterBand);
2017-06-12 13:11:00 +03:00
DesignElementsFactory::instance().registerCreator(
"TearOffBand",
LimeReport::ItemAttribs(QObject::tr("Tear-off Band"), LimeReport::Const::bandTAG),
createTearOffBand);
2017-06-12 13:11:00 +03:00
}
2017-11-27 23:14:05 +03:00
#ifdef HAVE_REPORT_DESIGNER
ObjectPropItem* createBoolPropItem(QObject* object,
LimeReport::ObjectPropItem::ObjectsList* objects,
const QString& name, const QString& displayName,
const QVariant& data, LimeReport::ObjectPropItem* parent,
bool readonly)
2017-06-12 13:11:00 +03:00
{
return new LimeReport::BoolPropItem(object, objects, name, displayName, data, parent, readonly);
}
ObjectPropItem* createColorPropItem(QObject* object,
LimeReport::ObjectPropItem::ObjectsList* objects,
const QString& name, const QString& displayName,
const QVariant& data, LimeReport::ObjectPropItem* parent,
bool readonly)
2017-06-12 13:11:00 +03:00
{
return new ColorPropItem(object, objects, name, displayName, data, parent, readonly);
}
ObjectPropItem* createContentPropItem(QObject* object,
LimeReport::ObjectPropItem::ObjectsList* objects,
const QString& name, const QString& displayName,
const QVariant& data, LimeReport::ObjectPropItem* parent,
bool readonly)
2017-06-12 13:11:00 +03:00
{
return new ContentPropItem(object, objects, name, displayName, data, parent, readonly);
}
ObjectPropItem* createDatasourcePropItem(QObject* object,
LimeReport::ObjectPropItem::ObjectsList* objects,
const QString& name, const QString& displayName,
const QVariant& data, LimeReport::ObjectPropItem* parent,
bool readonly)
2017-06-12 13:11:00 +03:00
{
return new LimeReport::DatasourcePropItem(object, objects, name, displayName, data, parent,
readonly);
2017-06-12 13:11:00 +03:00
}
ObjectPropItem* createFieldPropItem(QObject* object,
LimeReport::ObjectPropItem::ObjectsList* objects,
const QString& name, const QString& displayName,
const QVariant& data, LimeReport::ObjectPropItem* parent,
bool readonly)
{
return new LimeReport::FieldPropItem(object, objects, name, displayName, data, parent,
readonly);
2017-06-12 13:11:00 +03:00
}
ObjectPropItem* createEnumPropItem(QObject* object,
LimeReport::ObjectPropItem::ObjectsList* objects,
const QString& name, const QString& displayName,
const QVariant& data, LimeReport::ObjectPropItem* parent,
bool readonly)
2017-06-12 13:11:00 +03:00
{
return new LimeReport::EnumPropItem(object, objects, name, displayName, data, parent, readonly);
}
ObjectPropItem* createFlagsPropItem(QObject* object,
LimeReport::ObjectPropItem::ObjectsList* objects,
const QString& name, const QString& displayName,
const QVariant& data, LimeReport::ObjectPropItem* parent,
bool readonly)
2017-06-12 13:11:00 +03:00
{
return new LimeReport::FlagsPropItem(object, objects, name, displayName, data, parent,
readonly);
2017-06-12 13:11:00 +03:00
}
ObjectPropItem* createFontPropItem(QObject* object,
LimeReport::ObjectPropItem::ObjectsList* objects,
const QString& name, const QString& displayName,
const QVariant& data, LimeReport::ObjectPropItem* parent,
bool readonly)
2017-06-12 13:11:00 +03:00
{
return new LimeReport::FontPropItem(object, objects, name, displayName, data, parent, readonly);
}
ObjectPropItem* createGroupFieldPropItem(QObject* object,
LimeReport::ObjectPropItem::ObjectsList* objects,
const QString& name, const QString& displayName,
const QVariant& data, LimeReport::ObjectPropItem* parent,
bool readonly)
{
return new LimeReport::GroupFieldPropItem(object, objects, name, displayName, data, parent,
readonly);
2017-06-12 13:11:00 +03:00
}
ObjectPropItem* createImagePropItem(QObject* object,
LimeReport::ObjectPropItem::ObjectsList* objects,
const QString& name, const QString& displayName,
const QVariant& data, LimeReport::ObjectPropItem* parent,
bool readonly)
2017-06-12 13:11:00 +03:00
{
return new LimeReport::ImagePropItem(object, objects, name, displayName, data, parent,
readonly);
2017-06-12 13:11:00 +03:00
}
2020-03-18 13:34:11 +03:00
#ifdef HAVE_SVG
ObjectPropItem* createSVGPropItem(QObject* object, LimeReport::ObjectPropItem::ObjectsList* objects,
const QString& name, const QString& displayName,
const QVariant& data, LimeReport::ObjectPropItem* parent,
bool readonly)
2020-03-18 13:34:11 +03:00
{
return new LimeReport::SvgPropItem(object, objects, name, displayName, data, parent, readonly);
}
#endif
ObjectPropItem* createIntPropItem(QObject* object, LimeReport::ObjectPropItem::ObjectsList* objects,
const QString& name, const QString& displayName,
const QVariant& data, LimeReport::ObjectPropItem* parent,
bool readonly)
2017-06-12 13:11:00 +03:00
{
return new LimeReport::IntPropItem(object, objects, name, displayName, data, parent, readonly);
}
ObjectPropItem* createQRealPropItem(QObject* object,
LimeReport::ObjectPropItem::ObjectsList* objects,
const QString& name, const QString& displayName,
const QVariant& data, LimeReport::ObjectPropItem* parent,
bool readonly)
2017-06-12 13:11:00 +03:00
{
return new LimeReport::QRealPropItem(object, objects, name, displayName, data, parent,
readonly);
2017-06-12 13:11:00 +03:00
}
ObjectPropItem* createReqtItem(QObject* object, LimeReport::ObjectPropItem::ObjectsList* objects,
const QString& name, const QString& displayName,
const QVariant& data, LimeReport::ObjectPropItem* parent,
bool readonly)
{
2017-06-12 13:11:00 +03:00
return new LimeReport::RectPropItem(object, objects, name, displayName, data, parent, readonly);
}
ObjectPropItem* createReqtMMItem(QObject* object, LimeReport::ObjectPropItem::ObjectsList* objects,
const QString& name, const QString& displayName,
const QVariant& data, LimeReport::ObjectPropItem* parent,
bool readonly)
{
return new LimeReport::RectUnitPropItem(object, objects, name, displayName, data, parent,
readonly);
2017-06-12 13:11:00 +03:00
}
ObjectPropItem* createStringPropItem(QObject* object,
LimeReport::ObjectPropItem::ObjectsList* objects,
const QString& name, const QString& displayName,
const QVariant& data, LimeReport::ObjectPropItem* parent,
bool readonly)
2017-06-12 13:11:00 +03:00
{
return new LimeReport::StringPropItem(object, objects, name, displayName, data, parent,
readonly);
2017-06-12 13:11:00 +03:00
}
ObjectPropItem* createAlignItem(QObject* object, LimeReport::ObjectPropItem::ObjectsList* objects,
const QString& name, const QString& displayName,
const QVariant& data, LimeReport::ObjectPropItem* parent,
bool readonly)
{
return new LimeReport::AlignmentPropItem(object, objects, name, displayName, data, parent,
readonly);
2017-06-12 13:11:00 +03:00
}
ObjectPropItem* createLocationPropItem(QObject* object,
LimeReport::ObjectPropItem::ObjectsList* objects,
const QString& name, const QString& displayName,
const QVariant& data, LimeReport::ObjectPropItem* parent,
bool readonly)
2017-06-12 13:11:00 +03:00
{
return new LimeReport::ItemLocationPropItem(object, objects, name, displayName, data, parent,
readonly);
2017-06-12 13:11:00 +03:00
}
void initObjectInspectorProperties()
{
ObjectPropFactory::instance().registerCreator(LimeReport::APropIdent("bool", ""),
QObject::tr("bool"), createBoolPropItem);
ObjectPropFactory::instance().registerCreator(LimeReport::APropIdent("QColor", ""),
QObject::tr("QColor"), createColorPropItem);
2017-06-12 13:11:00 +03:00
ObjectPropFactory::instance().registerCreator(
LimeReport::APropIdent("content", "LimeReport::TextItem"), QObject::tr("content"),
createContentPropItem);
2017-06-12 13:11:00 +03:00
ObjectPropFactory::instance().registerCreator(
LimeReport::APropIdent("datasource", "LimeReport::DataBandDesignIntf"),
QObject::tr("datasource"), createDatasourcePropItem);
2017-06-12 13:11:00 +03:00
ObjectPropFactory::instance().registerCreator(
LimeReport::APropIdent("datasource", "LimeReport::ImageItem"), QObject::tr("datasource"),
createDatasourcePropItem);
2017-06-12 13:11:00 +03:00
ObjectPropFactory::instance().registerCreator(
LimeReport::APropIdent("field", "LimeReport::ImageItem"), QObject::tr("field"),
createFieldPropItem);
2017-06-12 13:11:00 +03:00
ObjectPropFactory::instance().registerCreator(
LimeReport::APropIdent("datasource", "LimeReport::SVGItem"), QObject::tr("datasource"),
createDatasourcePropItem);
2020-03-18 13:34:11 +03:00
ObjectPropFactory::instance().registerCreator(
LimeReport::APropIdent("field", "LimeReport::SVGItem"), QObject::tr("field"),
createFieldPropItem);
ObjectPropFactory::instance().registerCreator(LimeReport::APropIdent("enum", ""),
QObject::tr("enum"), createEnumPropItem);
ObjectPropFactory::instance().registerCreator(LimeReport::APropIdent("flags", ""),
QObject::tr("flags"), createFlagsPropItem);
ObjectPropFactory::instance().registerCreator(LimeReport::APropIdent("QFont", ""),
QObject::tr("QFont"), createFontPropItem);
2020-03-18 13:34:11 +03:00
ObjectPropFactory::instance().registerCreator(
LimeReport::APropIdent("groupFieldName", "LimeReport::GroupBandHeader"),
QObject::tr("field"), createGroupFieldPropItem);
ObjectPropFactory::instance().registerCreator(LimeReport::APropIdent("QImage", ""),
QObject::tr("QImage"), createImagePropItem);
2020-03-18 13:34:11 +03:00
#ifdef HAVE_SVG
ObjectPropFactory::instance().registerCreator(
LimeReport::APropIdent("image", "LimeReport::SVGItem"), QObject::tr("image"),
createSVGPropItem);
2020-03-18 13:34:11 +03:00
#endif
ObjectPropFactory::instance().registerCreator(LimeReport::APropIdent("int", ""),
QObject::tr("int"), createIntPropItem);
ObjectPropFactory::instance().registerCreator(LimeReport::APropIdent("qreal", ""),
QObject::tr("qreal"), createQRealPropItem);
ObjectPropFactory::instance().registerCreator(LimeReport::APropIdent("double", ""),
QObject::tr("qreal"), createQRealPropItem);
ObjectPropFactory::instance().registerCreator(LimeReport::APropIdent("QRect", ""),
QObject::tr("QRect"), createReqtItem);
ObjectPropFactory::instance().registerCreator(LimeReport::APropIdent("QRectF", ""),
QObject::tr("QRectF"), createReqtItem);
2017-06-12 13:11:00 +03:00
ObjectPropFactory::instance().registerCreator(
LimeReport::APropIdent("geometry", "LimeReport::BaseDesignIntf"), QObject::tr("geometry"),
createReqtMMItem);
ObjectPropFactory::instance().registerCreator(LimeReport::APropIdent("QString", ""),
QObject::tr("QString"), createStringPropItem);
2017-06-12 13:11:00 +03:00
ObjectPropFactory::instance().registerCreator(
LimeReport::APropIdent("alignment", "LimeReport::TextItem"), QObject::tr("alignment"),
createAlignItem);
2017-06-12 13:11:00 +03:00
ObjectPropFactory::instance().registerCreator(
LimeReport::APropIdent("itemLocation", "LimeReport::ItemDesignIntf"),
QObject::tr("itemLocation"), createLocationPropItem);
2017-06-12 13:11:00 +03:00
}
2017-11-27 23:14:05 +03:00
#endif
SerializatorIntf* createIntSerializator(QDomDocument* doc, QDomElement* node)
{
return new LimeReport::XmlIntSerializator(doc, node);
2017-06-12 13:11:00 +03:00
}
SerializatorIntf* createQRealSerializator(QDomDocument* doc, QDomElement* node)
{
return new LimeReport::XmlQRealSerializator(doc, node);
2017-06-12 13:11:00 +03:00
}
SerializatorIntf* createQStringSerializator(QDomDocument* doc, QDomElement* node)
{
return new LimeReport::XmlQStringSerializator(doc, node);
2017-06-12 13:11:00 +03:00
}
SerializatorIntf* createEnumAndFlagsSerializator(QDomDocument* doc, QDomElement* node)
{
return new LimeReport::XmlEnumAndFlagsSerializator(doc, node);
2017-06-12 13:11:00 +03:00
}
SerializatorIntf* createBoolSerializator(QDomDocument* doc, QDomElement* node)
{
return new LimeReport::XmlBoolSerializator(doc, node);
2017-06-12 13:11:00 +03:00
}
SerializatorIntf* createFontSerializator(QDomDocument* doc, QDomElement* node)
{
return new LimeReport::XmlFontSerializator(doc, node);
2017-06-12 13:11:00 +03:00
}
SerializatorIntf* createQSizeFSerializator(QDomDocument* doc, QDomElement* node)
{
return new LimeReport::XmlQSizeFSerializator(doc, node);
2017-06-12 13:11:00 +03:00
}
SerializatorIntf* createQImageSerializator(QDomDocument* doc, QDomElement* node)
{
return new LimeReport::XmlQImageSerializator(doc, node);
2017-06-12 13:11:00 +03:00
}
SerializatorIntf* createQColorSerializator(QDomDocument* doc, QDomElement* node)
{
return new LimeReport::XmlColorSerializator(doc, node);
2017-06-12 13:11:00 +03:00
}
SerializatorIntf* createQByteArraySerializator(QDomDocument* doc, QDomElement* node)
{
return new LimeReport::XmlQByteArraySerializator(doc, node);
2017-06-12 13:11:00 +03:00
}
SerializatorIntf* createQVariantSerializator(QDomDocument* doc, QDomElement* node)
{
return new LimeReport::XmlQVariantSerializator(doc, node);
2017-06-12 13:11:00 +03:00
}
SerializatorIntf* createQRectSerializator(QDomDocument* doc, QDomElement* node)
{
return new LimeReport::XMLQRectSerializator(doc, node);
2017-06-12 13:11:00 +03:00
}
void initSerializators()
{
XMLAbstractSerializatorFactory::instance().registerCreator("QString",
createQStringSerializator);
2017-06-12 13:11:00 +03:00
XMLAbstractSerializatorFactory::instance().registerCreator("int", createIntSerializator);
XMLAbstractSerializatorFactory::instance().registerCreator("enumAndFlags",
createEnumAndFlagsSerializator);
2017-06-12 13:11:00 +03:00
XMLAbstractSerializatorFactory::instance().registerCreator("bool", createBoolSerializator);
XMLAbstractSerializatorFactory::instance().registerCreator("QFont", createFontSerializator);
XMLAbstractSerializatorFactory::instance().registerCreator("QSizeF", createQSizeFSerializator);
XMLAbstractSerializatorFactory::instance().registerCreator("QImage", createQImageSerializator);
XMLAbstractSerializatorFactory::instance().registerCreator("qreal", createQRealSerializator);
XMLAbstractSerializatorFactory::instance().registerCreator("double", createQRealSerializator);
XMLAbstractSerializatorFactory::instance().registerCreator("QColor", createQColorSerializator);
XMLAbstractSerializatorFactory::instance().registerCreator("QByteArray",
createQByteArraySerializator);
XMLAbstractSerializatorFactory::instance().registerCreator("QVariant",
createQVariantSerializator);
2017-06-12 13:11:00 +03:00
XMLAbstractSerializatorFactory::instance().registerCreator("QRect", createQRectSerializator);
XMLAbstractSerializatorFactory::instance().registerCreator("QRectF", createQRectSerializator);
}
LimeReport::ReportExporterInterface* createPDFExporter(ReportEnginePrivate* parent)
{
return new LimeReport::PDFExporter(parent);
}
void initExporters()
{
ExportersFactory::instance().registerCreator(
"PDF", LimeReport::ExporterAttribs(QObject::tr("Export to PDF"), "PDFExporter"),
createPDFExporter);
}
} // namespace LimeReport