diff --git a/autotests/PluginsTest.cpp b/autotests/PluginsTest.cpp index effdd4b3..07127ed3 100644 --- a/autotests/PluginsTest.cpp +++ b/autotests/PluginsTest.cpp @@ -1,145 +1,145 @@ /* This file is part of the KDE project * Copyright (C) 2015 Jarosław Staniek * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #include "PluginsTest.h" -#include -#include +#include +#include #include #include #include #include #include #include QTEST_GUILESS_MAIN(PluginsTest) void PluginsTest::initTestCase() { //QCoreApplication::setLibraryPaths(QStringList() << QDir::currentPath()); } void PluginsTest::listPlugins() { - KoReportPluginManager* manager = KoReportPluginManager::self(); + KReportPluginManager* manager = KReportPluginManager::self(); QStringList pluginIds = manager->pluginIds(); qDebug() << pluginIds; QCOMPARE(pluginIds.toSet().count(), pluginIds.count()); foreach(const QString &pluginId, pluginIds) { qDebug() << "Checking" << pluginId; QVERIFY2(!pluginId.isEmpty(), "Plugin id not empty"); - KoReportPluginInterface* iface = manager->plugin(pluginId); + KReportPluginInterface* iface = manager->plugin(pluginId); QVERIFY2(iface, "Plugin interface"); const KReportPluginMetaData *metaData = manager->pluginMetaData(pluginId); //! @todo info->priority() QVERIFY2(metaData, "Plugin metadata"); QCOMPARE(metaData, iface->metaData()); QVERIFY2(metaData->isValid(), "Plugin is valid"); QVERIFY(!metaData->id().isEmpty()); QCOMPARE(metaData->id(), pluginId); QVERIFY(!metaData->name().isEmpty()); QVERIFY(!metaData->description().isEmpty()); QVERIFY(!metaData->iconName().isEmpty()); QVERIFY(!metaData->authors().isEmpty()); QVERIFY(!metaData->version().isEmpty()); QVERIFY(!metaData->website().isEmpty()); QVERIFY(!metaData->license().isEmpty()); QVERIFY(!metaData->serviceTypes().isEmpty()); QCOMPARE(metaData->isStatic(), metaData->fileName().isEmpty()); } } //! Compares @a actual and @a expected set, fails when not equal //! On failure, all elements are displayed. #define QCOMPARE_SET(type, actual, expected) \ do { \ if (actual == expected) { \ break; \ } \ QTest::qFail(#actual " != " #expected, __FILE__, __LINE__); \ QList actualList = actual.toList(); \ QList expectedList = expected.toList(); \ qSort(actualList); \ qSort(expectedList); \ QList::ConstIterator actualListIt = actualList.constBegin(); \ QList::ConstIterator expectedListIt = expectedList.constBegin(); \ const int count = qMax(actualList.count(), expectedList.count()); \ int i = 0; \ bool stop; \ forever { \ stop = true; \ QByteArray sign = "!="; \ QString v1; \ if (actualListIt == actualList.constEnd()) { \ v1 = ""; \ } \ else { \ v1 = QVariant(*actualListIt).toString(); \ stop = false; \ } \ QString v2; \ if (expectedListIt == expectedList.constEnd()) { \ v2 = ""; \ } \ else { \ v2 = QVariant(*expectedListIt).toString(); \ stop = false; \ if (actualListIt != actualList.constEnd()) { \ if (*actualListIt == *expectedListIt) { \ sign = "=="; \ } \ } \ } \ if (stop) { \ break; \ } \ qDebug() << qPrintable(QString::fromLatin1("Actual/expected item %1 of %2: %3 %4 %5") \ .arg(i + 1).arg(count).arg(v1).arg(sign.constData()).arg(v2)); \ if (actualListIt != actualList.constEnd()) { \ ++actualListIt; \ } \ if (expectedListIt != expectedList.constEnd()) { \ ++expectedListIt; \ } \ ++i; \ } \ return; \ } while (0) void PluginsTest::checkBuiltInPlugins() { - KoReportPluginManager* manager = KoReportPluginManager::self(); + KReportPluginManager* manager = KReportPluginManager::self(); QStringList pluginIds = manager->pluginIds(); QCOMPARE(pluginIds.toSet().count(), pluginIds.count()); QSet builtInPlugins( QSet() << "org.kde.kreport.checkbox" << "org.kde.kreport.field" << "org.kde.kreport.image" << "org.kde.kreport.label" << "org.kde.kreport.text"); QSet foundBuiltInPlugins; foreach(const QString &pluginId, pluginIds) { - KoReportPluginInterface* iface = manager->plugin(pluginId); + KReportPluginInterface* iface = manager->plugin(pluginId); QVERIFY(iface); if (iface->metaData()->isBuiltIn()) { foundBuiltInPlugins.insert(pluginId); } } QCOMPARE_SET(QString, builtInPlugins, foundBuiltInPlugins); } diff --git a/autotests/format/FormatTest.cpp b/autotests/format/FormatTest.cpp index 01761b40..fb4f9279 100644 --- a/autotests/format/FormatTest.cpp +++ b/autotests/format/FormatTest.cpp @@ -1,222 +1,222 @@ /* This file is part of the KDE project * Copyright (C) 2012 Dag Andersen * Copyright (C) 2015 Jarosław Staniek * * QFUZZYCOMPARE() from marble/tests/TestUtils.h: * Copyright (C) 2013 Dennis Nienhüser * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #include "FormatTest.h" #include "KReportTestUtils.h" -#include "KoReportPreRenderer.h" -#include "KoReportDesigner.h" +#include "KReportPreRenderer.h" +#include "KReportDesigner.h" #include "KReportLabelElement.h" -#include "krreportdata.h" -#include "reportpageoptions.h" -#include "reportsectiondetail.h" -#include "reportsection.h" -#include "krpos.h" -#include "krsize.h" -#include "KoReportDesignerItemLine.h" -#include "KoReportItemLine.h" -#include "KoReportDesignerItemRectBase.h" +#include "KReportDocument.h" +#include "KReportPageOptions.h" +#include "KReportDesignerSectionDetail.h" +#include "KReportSection.h" +#include "KReportPosition.h" +#include "KReportSize.h" +#include "KReportDesignerItemLine.h" +#include "KReportItemLine.h" +#include "KReportDesignerItemRectBase.h" #include "KReportUnit.h" #include #include #include #include #include #include #include #include #include QTEST_MAIN(FormatTest) static bool openDesignFile(KReportDesign *design, QString *errorMessage) { const QString dir(QFile::decodeName(FILES_DATA_DIR)); const QString fname(QLatin1String(QTest::currentTestFunction()) + QLatin1String(".kreport")); QFile file(dir + QDir::separator() + fname); bool ok = file.open(QFile::ReadOnly | QFile::Text); if (!ok) { *errorMessage = QString::fromLatin1("Could not open file %1: ").arg(file.fileName()) + file.errorString(); return false; } QString content = file.readAll(); if (file.error() != QFileDevice::NoError) { *errorMessage = QString::fromLatin1("Error reading file %1: ").arg(file.fileName()) + file.errorString(); return false; } KReportDesignReadingStatus status; if (!design->setContent(content, &status)) { QString message; QDebug(&message) << status; *errorMessage = QLatin1String("Failed to load content. ") + message; return false; } errorMessage->clear(); return true; } void FormatTest::testPageLayout() { KReportDesign design; QString errorMessage; if (!openDesignFile(&design, &errorMessage)) { QFAIL(qPrintable(errorMessage)); } const QPageLayout pageLayout = design.pageLayout(); QVERIFY(pageLayout.isValid()); QCOMPARE(pageLayout.pageSize().id(), QPageSize::A5); QCOMPARE(pageLayout.pageSize().sizePoints(), QPageSize(QPageSize::A5).sizePoints()); QCOMPARE(pageLayout.orientation(), QPageLayout::Portrait); QCOMPARE(pageLayout.margins(QPageLayout::Millimeter), QMarginsF(30.0, 20.0, 40.0, 15.0)); //! @todo move this renderer test to a separate place #if 0 - KoReportDesigner designer; + KReportDesigner designer; QCOMPARE(designer.propertySet()->property("page-size").value().toString(), QLatin1String("A5")); QCOMPARE(designer.propertySet()->property("margin-bottom").value().toDouble(), KReportUnit::parseValue("1.5cm")); QCOMPARE(designer.propertySet()->property("margin-top").value().toDouble(), KReportUnit::parseValue("2.0cm")); QCOMPARE(designer.propertySet()->property("margin-left").value().toDouble(), KReportUnit::parseValue("3.0cm")); QCOMPARE(designer.propertySet()->property("margin-right").value().toDouble(), KReportUnit::parseValue("4.0cm")); - KoReportPreRenderer renderer( designer.document() ); + KReportPreRenderer renderer( designer.document() ); renderer.generate(); ReportPageOptions opt = renderer.reportData()->pageOptions(); QCOMPARE(opt.getPageSize(), QString("A5")); QScreen *srn = QApplication::screens().at(0); const qreal dpiY = srn->logicalDotsPerInchY(); qDebug() << opt.getMarginBottom() << INCH_TO_POINT(opt.getMarginBottom()) << KReportDpi::dpiY() << dpiY << KReportUnit::parseValue("1.5cm"); QFUZZYCOMPARE(INCH_TO_POINT(opt.getMarginBottom()) / KReportDpi::dpiY(), KReportUnit::parseValue("1.5cm"), 0.2); QFUZZYCOMPARE(INCH_TO_POINT(opt.getMarginTop()) / KReportDpi::dpiY(), KReportUnit::parseValue("2.0cm"), 0.2); QFUZZYCOMPARE(INCH_TO_POINT(opt.getMarginLeft()) / KReportDpi::dpiX(), KReportUnit::parseValue("3.0cm"), 0.2); QFUZZYCOMPARE(INCH_TO_POINT(opt.getMarginRight()) / KReportDpi::dpiX(), KReportUnit::parseValue("4.0cm"), 0.3); #endif } void FormatTest::testLineElement() { #if 0 // todo KReportDesign design; QString errorMessage; if (!openDesignFile(&design, &errorMessage)) { QFAIL(qPrintable(errorMessage)); } #endif //! @todo move this renderer test to a separate place #if 0 - KoReportDesigner designer; + KReportDesigner designer; ReportSectionDetail *ds = designer.detailSection(); ReportSection *sec = ds->detailSection(); - KoReportItemLine *l = dynamic_cast(sec->items().first()); + KReportItemLine *l = dynamic_cast(sec->items().first()); QVERIFY(l != 0); QCOMPARE(l->Z, 1.5); - KRPos start = l->startPosition(); - KRPos end = l->endPosition(); + KReportPosition start = l->startPosition(); + KReportPosition end = l->endPosition(); QCOMPARE(start.toPoint(), QPointF(KReportUnit::parseValue("1.5cm"), KReportUnit::parseValue("0.5cm"))); QCOMPARE(end.toPoint(), QPointF(KReportUnit::parseValue("4.5cm"), KReportUnit::parseValue("2.5cm"))); - KoReportPreRenderer renderer( designer.document() ); + KReportPreRenderer renderer( designer.document() ); renderer.generate(); - l = dynamic_cast(renderer.reportData()->object("line1")); + l = dynamic_cast(renderer.reportData()->object("line1")); QVERIFY(l != 0); QCOMPARE(l->Z, 1.5); start = l->startPosition(); end = l->endPosition(); QCOMPARE(start.toPoint(), QPointF(KReportUnit::parseValue("1.5cm"), KReportUnit::parseValue("0.5cm"))); QCOMPARE(end.toPoint(), QPointF(KReportUnit::parseValue("4.5cm"), KReportUnit::parseValue("2.5cm"))); #endif } void FormatTest::testLabelElement() { KReportDesign design; QString errorMessage; if (!openDesignFile(&design, &errorMessage)) { QFAIL(qPrintable(errorMessage)); } QCOMPARE(design.title(), QLatin1String("Label Element Test Report")); QVERIFY(design.hasSection(KReportSection::Detail)); KReportSection detailSection = design.section(KReportSection::Detail); QCOMPARE(detailSection.type(), KReportSection::Detail); QCOMPARE(detailSection.height(), CM_TO_POINT(5.0)); QCOMPARE(detailSection.backgroundColor(), QColor("#eeeeee")); QList elements = detailSection.elements(); QCOMPARE(elements.count(), 1); KReportElement element = elements.first(); QCOMPARE(element.name(), QLatin1String("label1")); KReportLabelElement label1(elements.first()); QCOMPARE(label1.text(), "Label"); QCOMPARE(label1.z(), 2.5); const QRectF rect(CM_TO_POINT(1.5), CM_TO_POINT(0.5), CM_TO_POINT(4.5), CM_TO_POINT(0.75)); QCOMPARE(label1.rect(), rect); QCOMPARE(label1.backgroundColor(), QColor("#dddddd")); QCOMPARE(label1.foregroundColor(), QColor("#101010")); QCOMPARE(label1.backgroundOpacity(), 0.9); QCOMPARE(label1.alignment(), Qt::AlignRight | Qt::AlignBottom); QCOMPARE(label1.font().capitalization(), QFont::AllLowercase); QCOMPARE(label1.font().bold(), true); QCOMPARE(label1.font().weight(), 99); QCOMPARE(label1.font().italic(), true); QCOMPARE(label1.font().fixedPitch(), true); QCOMPARE(label1.font().family(), "Ubuntu"); QCOMPARE(label1.font().kerning(), true); QCOMPARE(label1.font().underline(), true); QCOMPARE(label1.font().strikeOut(), true); QCOMPARE(label1.font().pointSizeF(), 9.0); QCOMPARE(label1.font().letterSpacing(), 110.0); QCOMPARE(label1.font().letterSpacingType(), QFont::PercentageSpacing); QCOMPARE(label1.borderStyle().width(), 1.0); QCOMPARE(label1.borderStyle().color(), QColor("#400000")); QCOMPARE(label1.borderStyle().penStyle(), Qt::DashLine); //! @todo move this renderer test to a separate place #if 0 - KoReportDesigner designer;//, doc.documentElement()); + KReportDesigner designer;//, doc.documentElement()); ReportSectionDetail *ds = designer.detailSection(); ReportSection *sec = ds->detailSection(); QVERIFY(sec->items().count() == 1); - KoReportDesignerItemRectBase *rect = dynamic_cast(sec->items().first()); + KReportDesignerItemRectBase *rect = dynamic_cast(sec->items().first()); QVERIFY(rect != 0); QRectF expected( QPointF(KReportUnit::parseValue("1.5cm"), KReportUnit::parseValue("0.5cm")), QSizeF(KReportUnit::parseValue("4.5cm"), KReportUnit::parseValue("0.75cm"))); QCOMPARE(rect->pointRect(), expected); - KoReportPreRenderer renderer( designer.document() ); + KReportPreRenderer renderer( designer.document() ); renderer.generate(); - KoReportItemBase *item = dynamic_cast(renderer.reportData()->object("label1")); + KReportItemBase *item = dynamic_cast(renderer.reportData()->object("label1")); QVERIFY(item != 0); - KRPos pos = item->position(); - KRSize size = item->size(); + KReportPosition pos = item->position(); + KReportSize size = item->size(); QCOMPARE(pos.toPoint().x(), KReportUnit::parseValue("1.5cm")); QCOMPARE(pos.toPoint().y(), KReportUnit::parseValue("0.5cm")); QCOMPARE(size.toPoint(), QSizeF(KReportUnit::parseValue("4.5cm"), KReportUnit::parseValue("0.75cm"))); QCOMPARE(size.toPoint(), QSizeF(KReportUnit::parseValue("4.5cm"), KReportUnit::parseValue("0.75cm"))); #endif } diff --git a/autotests/headers/CMakeLists.txt b/autotests/headers/CMakeLists.txt index 368f83e2..47980bf3 100644 --- a/autotests/headers/CMakeLists.txt +++ b/autotests/headers/CMakeLists.txt @@ -1,73 +1,73 @@ # Generated by generate_HeadersTest.sh # prefix: kreport # link_libs: KReport # subdirs: . # # WARNING! All changes made in this file will be lost! # # Test if all the installed headers can be included individually. # This is a compile-time test. # add_custom_target(headers_test echo "headers_test: Creating HeadersTest files in ${CMAKE_CURRENT_SOURCE_DIR} with builddir=${CMAKE_BINARY_DIR}, prefix=kreport, linking to libs [KReport], searching in subdirs [.]...") add_custom_command( TARGET headers_test COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/generate_HeadersTest.sh ${CMAKE_BINARY_DIR} KReport kreport . WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) add_executable( HeadersTest HeadersTest.cpp - KoReportASyncItemBase_HeaderTest.cpp - KoReportData_HeaderTest.cpp - KoReportDesigner_HeaderTest.cpp - KoReportDesignerItemBase_HeaderTest.cpp - KoReportDesignerItemRectBase_HeaderTest.cpp - KoReportItemBase_HeaderTest.cpp - KoReportItemLine_HeaderTest.cpp - KoReportPage_HeaderTest.cpp - KoReportPluginInterface_HeaderTest.cpp - KoReportPluginManager_HeaderTest.cpp - KoReportPreRenderer_HeaderTest.cpp - KoReportRendererBase_HeaderTest.cpp + KReportAsyncItemBase_HeaderTest.cpp + KReportData_HeaderTest.cpp KReportDesign_HeaderTest.cpp + KReportDesigner_HeaderTest.cpp + KReportDesignerItemBase_HeaderTest.cpp + KReportDesignerItemRectBase_HeaderTest.cpp + KReportDesignerSection_HeaderTest.cpp + KReportDesignerSectionDetail_HeaderTest.cpp + KReportDesignerSectionDetailGroup_HeaderTest.cpp + KReportDocument_HeaderTest.cpp KReportDpi_HeaderTest.cpp KReportElement_HeaderTest.cpp - kreportgrouptracker_HeaderTest.cpp + KReportGroupTracker_HeaderTest.cpp + KReportItemBase_HeaderTest.cpp + KReportItemLine_HeaderTest.cpp KReportLabelElement_HeaderTest.cpp KReportLineStyle_HeaderTest.cpp + KReportPage_HeaderTest.cpp KReportPageFormat_HeaderTest.cpp + KReportPageOptions_HeaderTest.cpp + KReportPluginInterface_HeaderTest.cpp + KReportPluginManager_HeaderTest.cpp KReportPluginMetaData_HeaderTest.cpp + KReportPosition_HeaderTest.cpp + KReportPreRenderer_HeaderTest.cpp + KReportRendererBase_HeaderTest.cpp + KReportRenderObjects_HeaderTest.cpp + KReportScriptConstants_HeaderTest.cpp + KReportScriptDraw_HeaderTest.cpp + KReportScriptHandler_HeaderTest.cpp KReportSection_HeaderTest.cpp + KReportSectionData_HeaderTest.cpp + KReportSize_HeaderTest.cpp KReportUnit_HeaderTest.cpp KReportUtils_HeaderTest.cpp KReportView_HeaderTest.cpp KReportZoomHandler_HeaderTest.cpp KReportZoomMode_HeaderTest.cpp - krpos_HeaderTest.cpp - krreportdata_HeaderTest.cpp - krscriptconstants_HeaderTest.cpp - krscriptdraw_HeaderTest.cpp - krscripthandler_HeaderTest.cpp - krsectiondata_HeaderTest.cpp - krsize_HeaderTest.cpp - renderobjects_HeaderTest.cpp - reportpageoptions_HeaderTest.cpp - reportsection_HeaderTest.cpp - reportsectiondetail_HeaderTest.cpp - reportsectiondetailgroup_HeaderTest.cpp config-kreport.h_HeaderTest.cpp KReportElement.h_HeaderTest.cpp kreport_export.h_HeaderTest.cpp KReportLabelElement.h_HeaderTest.cpp KReportLineStyle.h_HeaderTest.cpp KReportSection.h_HeaderTest.cpp kreport_version.h_HeaderTest.cpp ) target_link_libraries( HeadersTest KReport ) diff --git a/autotests/headers/KReportAsyncItemBase_HeaderTest.cpp b/autotests/headers/KReportAsyncItemBase_HeaderTest.cpp new file mode 100644 index 00000000..e4f59a71 --- /dev/null +++ b/autotests/headers/KReportAsyncItemBase_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportData_HeaderTest.cpp b/autotests/headers/KReportData_HeaderTest.cpp new file mode 100644 index 00000000..5f4e7674 --- /dev/null +++ b/autotests/headers/KReportData_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportDesignerItemBase_HeaderTest.cpp b/autotests/headers/KReportDesignerItemBase_HeaderTest.cpp new file mode 100644 index 00000000..cdc80eff --- /dev/null +++ b/autotests/headers/KReportDesignerItemBase_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportDesignerItemRectBase_HeaderTest.cpp b/autotests/headers/KReportDesignerItemRectBase_HeaderTest.cpp new file mode 100644 index 00000000..ceb2f361 --- /dev/null +++ b/autotests/headers/KReportDesignerItemRectBase_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportDesignerSectionDetailGroup_HeaderTest.cpp b/autotests/headers/KReportDesignerSectionDetailGroup_HeaderTest.cpp new file mode 100644 index 00000000..8a0483c2 --- /dev/null +++ b/autotests/headers/KReportDesignerSectionDetailGroup_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportDesignerSectionDetail_HeaderTest.cpp b/autotests/headers/KReportDesignerSectionDetail_HeaderTest.cpp new file mode 100644 index 00000000..74baa31e --- /dev/null +++ b/autotests/headers/KReportDesignerSectionDetail_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportDesignerSection_HeaderTest.cpp b/autotests/headers/KReportDesignerSection_HeaderTest.cpp new file mode 100644 index 00000000..dde98de1 --- /dev/null +++ b/autotests/headers/KReportDesignerSection_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportDesigner_HeaderTest.cpp b/autotests/headers/KReportDesigner_HeaderTest.cpp new file mode 100644 index 00000000..f01e028d --- /dev/null +++ b/autotests/headers/KReportDesigner_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportDocument_HeaderTest.cpp b/autotests/headers/KReportDocument_HeaderTest.cpp new file mode 100644 index 00000000..3adf2e8d --- /dev/null +++ b/autotests/headers/KReportDocument_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportGroupTracker_HeaderTest.cpp b/autotests/headers/KReportGroupTracker_HeaderTest.cpp new file mode 100644 index 00000000..afe6a198 --- /dev/null +++ b/autotests/headers/KReportGroupTracker_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportItemBase_HeaderTest.cpp b/autotests/headers/KReportItemBase_HeaderTest.cpp new file mode 100644 index 00000000..db13503b --- /dev/null +++ b/autotests/headers/KReportItemBase_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportItemLine_HeaderTest.cpp b/autotests/headers/KReportItemLine_HeaderTest.cpp new file mode 100644 index 00000000..29e6b93b --- /dev/null +++ b/autotests/headers/KReportItemLine_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportPageOptions_HeaderTest.cpp b/autotests/headers/KReportPageOptions_HeaderTest.cpp new file mode 100644 index 00000000..2e338fec --- /dev/null +++ b/autotests/headers/KReportPageOptions_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportPage_HeaderTest.cpp b/autotests/headers/KReportPage_HeaderTest.cpp new file mode 100644 index 00000000..e5438a6d --- /dev/null +++ b/autotests/headers/KReportPage_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportPluginInterface_HeaderTest.cpp b/autotests/headers/KReportPluginInterface_HeaderTest.cpp new file mode 100644 index 00000000..8e430ab0 --- /dev/null +++ b/autotests/headers/KReportPluginInterface_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportPluginManager_HeaderTest.cpp b/autotests/headers/KReportPluginManager_HeaderTest.cpp new file mode 100644 index 00000000..faaa8aa0 --- /dev/null +++ b/autotests/headers/KReportPluginManager_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportPosition_HeaderTest.cpp b/autotests/headers/KReportPosition_HeaderTest.cpp new file mode 100644 index 00000000..da28fbcd --- /dev/null +++ b/autotests/headers/KReportPosition_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportPreRenderer_HeaderTest.cpp b/autotests/headers/KReportPreRenderer_HeaderTest.cpp new file mode 100644 index 00000000..76ae89cb --- /dev/null +++ b/autotests/headers/KReportPreRenderer_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportRenderObjects_HeaderTest.cpp b/autotests/headers/KReportRenderObjects_HeaderTest.cpp new file mode 100644 index 00000000..4a93fca3 --- /dev/null +++ b/autotests/headers/KReportRenderObjects_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportRendererBase_HeaderTest.cpp b/autotests/headers/KReportRendererBase_HeaderTest.cpp new file mode 100644 index 00000000..9803b558 --- /dev/null +++ b/autotests/headers/KReportRendererBase_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportSchemaData_HeaderTest.cpp b/autotests/headers/KReportSchemaData_HeaderTest.cpp new file mode 100644 index 00000000..79291d75 --- /dev/null +++ b/autotests/headers/KReportSchemaData_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportScriptConstants_HeaderTest.cpp b/autotests/headers/KReportScriptConstants_HeaderTest.cpp new file mode 100644 index 00000000..d509707f --- /dev/null +++ b/autotests/headers/KReportScriptConstants_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportScriptDraw_HeaderTest.cpp b/autotests/headers/KReportScriptDraw_HeaderTest.cpp new file mode 100644 index 00000000..5c7b10fb --- /dev/null +++ b/autotests/headers/KReportScriptDraw_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportScriptHandler_HeaderTest.cpp b/autotests/headers/KReportScriptHandler_HeaderTest.cpp new file mode 100644 index 00000000..7c24bd28 --- /dev/null +++ b/autotests/headers/KReportScriptHandler_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportSectionData_HeaderTest.cpp b/autotests/headers/KReportSectionData_HeaderTest.cpp new file mode 100644 index 00000000..5c723a9a --- /dev/null +++ b/autotests/headers/KReportSectionData_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportSectionDetailGroup_HeaderTest.cpp b/autotests/headers/KReportSectionDetailGroup_HeaderTest.cpp new file mode 100644 index 00000000..733369f0 --- /dev/null +++ b/autotests/headers/KReportSectionDetailGroup_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportSectionDetail_HeaderTest.cpp b/autotests/headers/KReportSectionDetail_HeaderTest.cpp new file mode 100644 index 00000000..923ace44 --- /dev/null +++ b/autotests/headers/KReportSectionDetail_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KReportSize_HeaderTest.cpp b/autotests/headers/KReportSize_HeaderTest.cpp new file mode 100644 index 00000000..b8f43888 --- /dev/null +++ b/autotests/headers/KReportSize_HeaderTest.cpp @@ -0,0 +1 @@ +#include diff --git a/autotests/headers/KoDpi.h_HeaderTest.cpp b/autotests/headers/KoDpi.h_HeaderTest.cpp deleted file mode 100644 index 4351c907..00000000 --- a/autotests/headers/KoDpi.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoDpi_HeaderTest.cpp b/autotests/headers/KoDpi_HeaderTest.cpp deleted file mode 100644 index 06660dd4..00000000 --- a/autotests/headers/KoDpi_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoPageFormat.h_HeaderTest.cpp b/autotests/headers/KoPageFormat.h_HeaderTest.cpp deleted file mode 100644 index 159a8eae..00000000 --- a/autotests/headers/KoPageFormat.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoPageFormat_HeaderTest.cpp b/autotests/headers/KoPageFormat_HeaderTest.cpp deleted file mode 100644 index cfb27a5a..00000000 --- a/autotests/headers/KoPageFormat_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportASyncItemBase.h_HeaderTest.cpp b/autotests/headers/KoReportASyncItemBase.h_HeaderTest.cpp deleted file mode 100644 index b72d6cef..00000000 --- a/autotests/headers/KoReportASyncItemBase.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportASyncItemBase_HeaderTest.cpp b/autotests/headers/KoReportASyncItemBase_HeaderTest.cpp deleted file mode 100644 index 6f81dc8d..00000000 --- a/autotests/headers/KoReportASyncItemBase_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportData.h_HeaderTest.cpp b/autotests/headers/KoReportData.h_HeaderTest.cpp deleted file mode 100644 index 020ff9c1..00000000 --- a/autotests/headers/KoReportData.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportData_HeaderTest.cpp b/autotests/headers/KoReportData_HeaderTest.cpp deleted file mode 100644 index f2e3c77b..00000000 --- a/autotests/headers/KoReportData_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportDesigner.h_HeaderTest.cpp b/autotests/headers/KoReportDesigner.h_HeaderTest.cpp deleted file mode 100644 index c6b2eb6c..00000000 --- a/autotests/headers/KoReportDesigner.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportDesignerItemBase.h_HeaderTest.cpp b/autotests/headers/KoReportDesignerItemBase.h_HeaderTest.cpp deleted file mode 100644 index e320805e..00000000 --- a/autotests/headers/KoReportDesignerItemBase.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportDesignerItemBase_HeaderTest.cpp b/autotests/headers/KoReportDesignerItemBase_HeaderTest.cpp deleted file mode 100644 index 51fd0ba3..00000000 --- a/autotests/headers/KoReportDesignerItemBase_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportDesignerItemRectBase.h_HeaderTest.cpp b/autotests/headers/KoReportDesignerItemRectBase.h_HeaderTest.cpp deleted file mode 100644 index 8a42f88c..00000000 --- a/autotests/headers/KoReportDesignerItemRectBase.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportDesignerItemRectBase_HeaderTest.cpp b/autotests/headers/KoReportDesignerItemRectBase_HeaderTest.cpp deleted file mode 100644 index bcb78a98..00000000 --- a/autotests/headers/KoReportDesignerItemRectBase_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportDesigner_HeaderTest.cpp b/autotests/headers/KoReportDesigner_HeaderTest.cpp deleted file mode 100644 index 14aa56f8..00000000 --- a/autotests/headers/KoReportDesigner_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportItemBase.h_HeaderTest.cpp b/autotests/headers/KoReportItemBase.h_HeaderTest.cpp deleted file mode 100644 index 4fb96f35..00000000 --- a/autotests/headers/KoReportItemBase.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportItemBase_HeaderTest.cpp b/autotests/headers/KoReportItemBase_HeaderTest.cpp deleted file mode 100644 index d03e73af..00000000 --- a/autotests/headers/KoReportItemBase_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportItemLine.h_HeaderTest.cpp b/autotests/headers/KoReportItemLine.h_HeaderTest.cpp deleted file mode 100644 index 9ef6cc5f..00000000 --- a/autotests/headers/KoReportItemLine.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportItemLine_HeaderTest.cpp b/autotests/headers/KoReportItemLine_HeaderTest.cpp deleted file mode 100644 index 6d1f02e2..00000000 --- a/autotests/headers/KoReportItemLine_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportPage.h_HeaderTest.cpp b/autotests/headers/KoReportPage.h_HeaderTest.cpp deleted file mode 100644 index 97088532..00000000 --- a/autotests/headers/KoReportPage.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportPage_HeaderTest.cpp b/autotests/headers/KoReportPage_HeaderTest.cpp deleted file mode 100644 index 3b7f76ab..00000000 --- a/autotests/headers/KoReportPage_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportPluginInterface.h_HeaderTest.cpp b/autotests/headers/KoReportPluginInterface.h_HeaderTest.cpp deleted file mode 100644 index 9ddf979c..00000000 --- a/autotests/headers/KoReportPluginInterface.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportPluginInterface_HeaderTest.cpp b/autotests/headers/KoReportPluginInterface_HeaderTest.cpp deleted file mode 100644 index d7a41a82..00000000 --- a/autotests/headers/KoReportPluginInterface_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportPluginManager.h_HeaderTest.cpp b/autotests/headers/KoReportPluginManager.h_HeaderTest.cpp deleted file mode 100644 index 1cd36df0..00000000 --- a/autotests/headers/KoReportPluginManager.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportPluginManager_HeaderTest.cpp b/autotests/headers/KoReportPluginManager_HeaderTest.cpp deleted file mode 100644 index bbdd7930..00000000 --- a/autotests/headers/KoReportPluginManager_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportPreRenderer.h_HeaderTest.cpp b/autotests/headers/KoReportPreRenderer.h_HeaderTest.cpp deleted file mode 100644 index 70b8ad2a..00000000 --- a/autotests/headers/KoReportPreRenderer.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportPreRenderer_HeaderTest.cpp b/autotests/headers/KoReportPreRenderer_HeaderTest.cpp deleted file mode 100644 index 4ece0f78..00000000 --- a/autotests/headers/KoReportPreRenderer_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportRendererBase.h_HeaderTest.cpp b/autotests/headers/KoReportRendererBase.h_HeaderTest.cpp deleted file mode 100644 index f74d69a8..00000000 --- a/autotests/headers/KoReportRendererBase.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoReportRendererBase_HeaderTest.cpp b/autotests/headers/KoReportRendererBase_HeaderTest.cpp deleted file mode 100644 index 10fe20e5..00000000 --- a/autotests/headers/KoReportRendererBase_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoRuler.h_HeaderTest.cpp b/autotests/headers/KoRuler.h_HeaderTest.cpp deleted file mode 100644 index cf21f063..00000000 --- a/autotests/headers/KoRuler.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoRuler_HeaderTest.cpp b/autotests/headers/KoRuler_HeaderTest.cpp deleted file mode 100644 index 795fa2ae..00000000 --- a/autotests/headers/KoRuler_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoUnit.h_HeaderTest.cpp b/autotests/headers/KoUnit.h_HeaderTest.cpp deleted file mode 100644 index db957d3d..00000000 --- a/autotests/headers/KoUnit.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoUnit_HeaderTest.cpp b/autotests/headers/KoUnit_HeaderTest.cpp deleted file mode 100644 index 11f5bc99..00000000 --- a/autotests/headers/KoUnit_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoViewConverter.h_HeaderTest.cpp b/autotests/headers/KoViewConverter.h_HeaderTest.cpp deleted file mode 100644 index 41169384..00000000 --- a/autotests/headers/KoViewConverter.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoViewConverter_HeaderTest.cpp b/autotests/headers/KoViewConverter_HeaderTest.cpp deleted file mode 100644 index dce3cd22..00000000 --- a/autotests/headers/KoViewConverter_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoZoomHandler.h_HeaderTest.cpp b/autotests/headers/KoZoomHandler.h_HeaderTest.cpp deleted file mode 100644 index 525657d4..00000000 --- a/autotests/headers/KoZoomHandler.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoZoomHandler_HeaderTest.cpp b/autotests/headers/KoZoomHandler_HeaderTest.cpp deleted file mode 100644 index eb1d4fa2..00000000 --- a/autotests/headers/KoZoomHandler_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoZoomMode.h_HeaderTest.cpp b/autotests/headers/KoZoomMode.h_HeaderTest.cpp deleted file mode 100644 index 5ae13896..00000000 --- a/autotests/headers/KoZoomMode.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/KoZoomMode_HeaderTest.cpp b/autotests/headers/KoZoomMode_HeaderTest.cpp deleted file mode 100644 index 446628fe..00000000 --- a/autotests/headers/KoZoomMode_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/kreportgrouptracker.h_HeaderTest.cpp b/autotests/headers/kreportgrouptracker.h_HeaderTest.cpp deleted file mode 100644 index bf6eac2f..00000000 --- a/autotests/headers/kreportgrouptracker.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/kreportgrouptracker_HeaderTest.cpp b/autotests/headers/kreportgrouptracker_HeaderTest.cpp deleted file mode 100644 index 667df42b..00000000 --- a/autotests/headers/kreportgrouptracker_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/krpos.h_HeaderTest.cpp b/autotests/headers/krpos.h_HeaderTest.cpp deleted file mode 100644 index 910401f1..00000000 --- a/autotests/headers/krpos.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/krpos_HeaderTest.cpp b/autotests/headers/krpos_HeaderTest.cpp deleted file mode 100644 index 6d0129e7..00000000 --- a/autotests/headers/krpos_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/krreportdata.h_HeaderTest.cpp b/autotests/headers/krreportdata.h_HeaderTest.cpp deleted file mode 100644 index c6b05dbb..00000000 --- a/autotests/headers/krreportdata.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/krreportdata_HeaderTest.cpp b/autotests/headers/krreportdata_HeaderTest.cpp deleted file mode 100644 index 088da794..00000000 --- a/autotests/headers/krreportdata_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/krscriptconstants.h_HeaderTest.cpp b/autotests/headers/krscriptconstants.h_HeaderTest.cpp deleted file mode 100644 index 21c7ae5c..00000000 --- a/autotests/headers/krscriptconstants.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/krscriptconstants_HeaderTest.cpp b/autotests/headers/krscriptconstants_HeaderTest.cpp deleted file mode 100644 index d0d76763..00000000 --- a/autotests/headers/krscriptconstants_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/krscriptdraw.h_HeaderTest.cpp b/autotests/headers/krscriptdraw.h_HeaderTest.cpp deleted file mode 100644 index d4cdba2f..00000000 --- a/autotests/headers/krscriptdraw.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/krscriptdraw_HeaderTest.cpp b/autotests/headers/krscriptdraw_HeaderTest.cpp deleted file mode 100644 index 89e590df..00000000 --- a/autotests/headers/krscriptdraw_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/krscripthandler.h_HeaderTest.cpp b/autotests/headers/krscripthandler.h_HeaderTest.cpp deleted file mode 100644 index 393e55b0..00000000 --- a/autotests/headers/krscripthandler.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/krscripthandler_HeaderTest.cpp b/autotests/headers/krscripthandler_HeaderTest.cpp deleted file mode 100644 index fe7c95a3..00000000 --- a/autotests/headers/krscripthandler_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/krsectiondata.h_HeaderTest.cpp b/autotests/headers/krsectiondata.h_HeaderTest.cpp deleted file mode 100644 index 2f9ad1c3..00000000 --- a/autotests/headers/krsectiondata.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/krsectiondata_HeaderTest.cpp b/autotests/headers/krsectiondata_HeaderTest.cpp deleted file mode 100644 index d282539a..00000000 --- a/autotests/headers/krsectiondata_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/krsize.h_HeaderTest.cpp b/autotests/headers/krsize.h_HeaderTest.cpp deleted file mode 100644 index b3b399ec..00000000 --- a/autotests/headers/krsize.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/krsize_HeaderTest.cpp b/autotests/headers/krsize_HeaderTest.cpp deleted file mode 100644 index 6f7ec51c..00000000 --- a/autotests/headers/krsize_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/renderobjects.h_HeaderTest.cpp b/autotests/headers/renderobjects.h_HeaderTest.cpp deleted file mode 100644 index 901d0b4e..00000000 --- a/autotests/headers/renderobjects.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/renderobjects_HeaderTest.cpp b/autotests/headers/renderobjects_HeaderTest.cpp deleted file mode 100644 index f26f14d1..00000000 --- a/autotests/headers/renderobjects_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/reportpageoptions.h_HeaderTest.cpp b/autotests/headers/reportpageoptions.h_HeaderTest.cpp deleted file mode 100644 index b0a2a2b7..00000000 --- a/autotests/headers/reportpageoptions.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/reportpageoptions_HeaderTest.cpp b/autotests/headers/reportpageoptions_HeaderTest.cpp deleted file mode 100644 index 2c21471a..00000000 --- a/autotests/headers/reportpageoptions_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/reportsection.h_HeaderTest.cpp b/autotests/headers/reportsection.h_HeaderTest.cpp deleted file mode 100644 index f08ddf56..00000000 --- a/autotests/headers/reportsection.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/reportsection_HeaderTest.cpp b/autotests/headers/reportsection_HeaderTest.cpp deleted file mode 100644 index 2445e28d..00000000 --- a/autotests/headers/reportsection_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/reportsectiondetail.h_HeaderTest.cpp b/autotests/headers/reportsectiondetail.h_HeaderTest.cpp deleted file mode 100644 index 2ac499cf..00000000 --- a/autotests/headers/reportsectiondetail.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/reportsectiondetail_HeaderTest.cpp b/autotests/headers/reportsectiondetail_HeaderTest.cpp deleted file mode 100644 index b6092e17..00000000 --- a/autotests/headers/reportsectiondetail_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/reportsectiondetailgroup.h_HeaderTest.cpp b/autotests/headers/reportsectiondetailgroup.h_HeaderTest.cpp deleted file mode 100644 index 24891f9a..00000000 --- a/autotests/headers/reportsectiondetailgroup.h_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/autotests/headers/reportsectiondetailgroup_HeaderTest.cpp b/autotests/headers/reportsectiondetailgroup_HeaderTest.cpp deleted file mode 100644 index 342bfade..00000000 --- a/autotests/headers/reportsectiondetailgroup_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 89569fca..5288a635 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,19 +1,19 @@ find_package(Qt5Widgets REQUIRED) find_package(KF5WidgetsAddons) find_package(KF5GuiAddons) remove_definitions( -DQT_NO_KEYWORDS -DQT_NO_SIGNALS_SLOTS_KEYWORDS -DQT_NO_CAST_FROM_ASCII ) -add_definitions(-DKREPORTEXAMPLE_DATA_DIR="${CMAKE_CURRENT_SOURCE_DIR}") +add_definitions(-DKREPORTEXAMPLE_DATA_DIR="\\"${CMAKE_CURRENT_SOURCE_DIR}\\"") set(kreportexample_SRCS main.cpp window.cpp designerwindow.cpp KReportExampleData.cpp ) add_executable(kreportexample ${kreportexample_SRCS}) target_link_libraries(kreportexample Qt5::Widgets KReport) diff --git a/examples/KReportExampleData.h b/examples/KReportExampleData.h index eff82d7d..bf9fe9b6 100644 --- a/examples/KReportExampleData.h +++ b/examples/KReportExampleData.h @@ -1,69 +1,69 @@ /* This file is part of the KDE project Copyright (C) 2015 by Adam Pigg (adam@piggz.co.uk) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KREPORTEXAMPLEDATA_H #define KREPORTEXAMPLEDATA_H -#include +#include #include #include #include -class KReportExampleData : public KoReportData +class KReportExampleData : public KReportData { public: KReportExampleData(); ~KReportExampleData(); virtual QVariant value(const QString& field) const; virtual QVariant value(unsigned int) const; virtual QStringList fieldNames() const; virtual QStringList fieldKeys() const; virtual int fieldNumber(const QString& field) const; virtual qint64 recordCount() const; virtual qint64 at() const; virtual bool moveLast(); virtual bool moveFirst(); virtual bool movePrevious(); virtual bool moveNext(); virtual bool close(); virtual bool open(); virtual QStringList scriptList() const; virtual QString scriptCode(const QString &script) const; private: struct Data { int id; QString devName; QString project; QString country; QString mobile; float lat; float lon; QString code; bool projectLead; }; QList m_testData; QStringList m_fieldNames; int m_currentRecord; }; #endif // KREPORTEXAMPLEDATA_H diff --git a/examples/designerwindow.cpp b/examples/designerwindow.cpp index 55a07714..ee489bf2 100644 --- a/examples/designerwindow.cpp +++ b/examples/designerwindow.cpp @@ -1,96 +1,96 @@ /* This file is part of the KDE project Copyright (C) 2015 by Adam Pigg This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "designerwindow.h" #include "KReportExampleData.h" -#include +#include #include #include #include #include #include DesignerWindow::DesignerWindow() { m_scrollArea = new QScrollArea(this); setCentralWidget(m_scrollArea); - m_reportDesigner = new KoReportDesigner(this); + m_reportDesigner = new KReportDesigner(this); m_scrollArea->setWidget(m_reportDesigner); m_mainToolbar = addToolBar(tr("Main")); m_itemToolbar = addToolBar(tr("Items")); QList designerActions = m_reportDesigner->designerActions(); foreach(QAction* action, designerActions) { m_mainToolbar->addAction(action); } QActionGroup *group = new QActionGroup(this); - QList itemActions = KoReportDesigner::itemActions(group); + QList itemActions = KReportDesigner::itemActions(group); foreach(QAction* action, itemActions) { m_itemToolbar->addAction(action); } m_reportDesigner->plugItemActions(itemActions); connect(m_reportDesigner, SIGNAL(itemInserted(QString)), this, SLOT(slotItemInserted(QString))); // Set up the property editor m_propertyDock = new QDockWidget(tr("Property Editor"), this); m_propertyEditor = new KPropertyEditorView(this); m_propertyDock->setWidget(m_propertyEditor); addDockWidget(Qt::RightDockWidgetArea, m_propertyDock); m_propertyEditor->changeSet(m_reportDesigner->propertySet()); connect(m_reportDesigner, SIGNAL(propertySetChanged()), this, SLOT(slotDesignerPropertySetChanged())); connect(m_reportDesigner, SIGNAL(dirty()), this, SLOT(designDirty())); m_reportDesigner->setReportData(new KReportExampleData()); } DesignerWindow::~DesignerWindow() { } void DesignerWindow::slotItemInserted(const QString &itemId) { QList itemActions = m_itemToolbar->actions(); foreach(QAction* action, itemActions) { if (action->objectName() == itemId) { action->setChecked(false); } } } void DesignerWindow::slotDesignerPropertySetChanged() { m_propertyEditor->changeSet(m_reportDesigner->itemPropertySet()); } void DesignerWindow::designDirty() { emit designChanged(m_reportDesigner->document()); } diff --git a/examples/designerwindow.h b/examples/designerwindow.h index f92418f9..98c4bd33 100644 --- a/examples/designerwindow.h +++ b/examples/designerwindow.h @@ -1,61 +1,61 @@ /* This file is part of the KDE project Copyright (C) 2015 by Adam Pigg This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef DESIGNERWINDOW_H #define DESIGNERWINDOW_H #include #include #include #include class QScrollArea; -class KoReportDesigner; +class KReportDesigner; /*! @short KReportExample application's design window */ class DesignerWindow : public QMainWindow { Q_OBJECT public: DesignerWindow(); ~DesignerWindow(); Q_SIGNALS: void designChanged(const QDomElement&); private Q_SLOTS: void slotItemInserted(const QString &itemId); void slotDesignerPropertySetChanged(); void designDirty(); private: QScrollArea * m_scrollArea; - KoReportDesigner *m_reportDesigner; + KReportDesigner *m_reportDesigner; KPropertySet *m_propertySet; QToolBar *m_mainToolbar; QToolBar *m_itemToolbar; QDockWidget *m_propertyDock; KPropertyEditorView *m_propertyEditor; }; #endif // DESIGNERWINDOW_H diff --git a/examples/window.cpp b/examples/window.cpp index 2fff31e7..abe4fb6c 100644 --- a/examples/window.cpp +++ b/examples/window.cpp @@ -1,103 +1,103 @@ /* This file is part of the KDE project Copyright (C) 2015 Jarosław Staniek This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "window.h" -#include +#include #include #include #include #include #include -#include -#include +#include +#include Window::Window() : QMainWindow() { createMenus(); m_reportView = new KReportView(this); setCentralWidget(m_reportView); #if 0 if (loadDocument()) { - m_preRenderer = new KoReportPreRenderer(m_document.documentElement()); + m_preRenderer = new KReportPreRenderer(m_document.documentElement()); if (!m_preRenderer->isValid()) { return; } } #endif m_testData = new KReportExampleData(); - KoReportPluginManager* manager = KoReportPluginManager::self(); + KReportPluginManager* manager = KReportPluginManager::self(); //! @todo Q_UNUSED(manager); } Window::~Window() { } bool Window::loadDocument() { qDebug() << KREPORTEXAMPLE_DATA_DIR; QFile file(QLatin1String(KREPORTEXAMPLE_DATA_DIR) + "/report.xml"); if (!file.open(QIODevice::ReadOnly)) { return false; } QString errorMsg; int errorLine; int errorColumn; if (!m_document.setContent(&file, &errorMsg, &errorLine, &errorColumn)) { qWarning() << "Error reading XML from" << file.fileName() << "Message:" << errorMsg << "Line:" << errorLine << "Column:" << errorColumn; return false; } return true; } void Window::createMenus() { m_fileMenu = menuBar()->addMenu(tr("&File")); m_exitAction = new QAction(tr("E&xit"), this); m_exitAction->setShortcuts(QKeySequence::Quit); connect(m_exitAction, SIGNAL(triggered()), qApp, SLOT(quit())); m_fileMenu->addAction(m_exitAction); } void Window::showDesign(const QDomElement &design) { qDebug() << "Show design"; - KoReportPreRenderer preRenderer(design); + KReportPreRenderer preRenderer(design); if (!preRenderer.isValid()) { return; } preRenderer.setSourceData(m_testData); preRenderer.setName("example_report"); m_reportView->setDocument(preRenderer.generate()); m_reportView->moveToFirstPage(); } diff --git a/examples/window.h b/examples/window.h index efcbe39a..07ed1bd2 100644 --- a/examples/window.h +++ b/examples/window.h @@ -1,59 +1,59 @@ /* This file is part of the KDE project Copyright (C) 2015 Jarosław Staniek This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KREPORTEXAMPLE_WINDOW_H #define KREPORTEXAMPLE_WINDOW_H #include "KReportExampleData.h" #include #include #include -#include -#include -#include +#include +#include +#include /*! @short KReportExample application's main window */ class Window : public QMainWindow { Q_OBJECT public: Window(); virtual ~Window(); public Q_SLOTS: void showDesign(const QDomElement &design); private: void createMenus(); bool loadDocument(); QMenu *m_fileMenu; QAction *m_exitAction; KReportView *m_reportView; QDomDocument m_document; int m_currentPage; KReportExampleData *m_testData; }; #endif diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b5f20e80..d7fb5214 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,339 +1,338 @@ # Options simple_option(KREPORT_SCRIPTING "Scripting support using JavaScript language" ON) configure_file(config-kreport.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kreport.h) if(KREPORT_SCRIPTING) find_package(Qt5Qml REQUIRED) set(SCRIPTING_LIBS Qt5::Qml) endif() add_subdirectory(plugins) add_subdirectory(pics) set(kreport_LIB_SRCS common/kreport_debug.cpp common/kreportplugin_debug.cpp - common/krpos.cpp - common/krsize.cpp - common/KoReportItemBase.cpp - common/KoReportASyncItemBase.cpp - common/krsectiondata.cpp - common/labelsizeinfo.cpp - common/reportpageoptions.cpp - common/krreportdata.cpp - common/krdetailsectiondata.cpp - common/KoReportPluginInterface.cpp - common/KoReportItemLine.cpp - common/renderobjects.cpp - common/KoReportPluginManager.cpp + common/KReportPosition.cpp + common/KReportSize.cpp + common/KReportItemBase.cpp + common/KReportAsyncItemBase.cpp + common/KReportSectionData.cpp + common/KReportLabelSizeInfo.cpp + common/KReportPageOptions.cpp + common/KReportDocument.cpp + common/KReportDetailSectionData.cpp + common/KReportPluginInterface.cpp + common/KReportItemLine.cpp + common/KReportRenderObjects.cpp + common/KReportPluginManager.cpp common/KReportJsonTrader_p.cpp common/KReportPluginMetaData.cpp - common/KoReportData.cpp + common/KReportData.cpp common/KReportUtils.cpp common/KReportPageFormat.cpp common/KReportUnit.cpp common/KReportDesign.cpp common/KReportDesign_p.cpp common/KReportLineStyle.cpp common/KReportElement.cpp ${PROJECT_BINARY_DIR}/src/KReportElement_sdc.cpp common/KReportSection.cpp - renderer/KoReportPrintRenderer.cpp - renderer/KoReportPreRenderer.cpp - renderer/KoReportASyncItemManager.cpp - renderer/KoReportScreenRenderer.cpp - renderer/KoReportHTMLTableRenderer.cpp - renderer/KoReportHTMLCSSRenderer.cpp - #TODO renderer/KoReportKSpreadRenderer.cpp - #TODO renderer/KoReportODTRenderer.cpp - #TODO renderer/KoOdtFrameReportRenderer.cpp - renderer/KoReportRendererBase.cpp - renderer/KoReportPage.cpp + renderer/KReportPrintRenderer_p.cpp + renderer/KReportPreRenderer.cpp + renderer/KReportAsyncItemManager_p.cpp + renderer/KReportScreenRenderer_p.cpp + renderer/KReportHTMLTableRenderer_p.cpp + renderer/KReportHTMLCSSRenderer_p.cpp + #TODO renderer/KReportKSpreadRenderer.cpp + #TODO renderer/KReportODTRenderer.cpp + #TODO renderer/KOdtFrameReportRenderer.cpp + renderer/KReportRendererBase.cpp + renderer/KReportPage.cpp renderer/KReportView.cpp - renderer/KReportOneRecordData.cpp - - wrtembed/detailgroupsectiondialog.cpp - wrtembed/KoReportDesignerItemBase.cpp - wrtembed/KoReportDesignerItemRectBase.cpp - wrtembed/KoReportDesignerItemLine.cpp - wrtembed/reportsection.cpp - wrtembed/reportsectiondetailgroup.cpp - wrtembed/reportsectiondetail.cpp - wrtembed/reportscene.cpp - wrtembed/reportsceneview.cpp - wrtembed/KoReportDesigner.cpp - wrtembed/reportpropertiesbutton.cpp - wrtembed/sectioneditor.cpp + renderer/KReportOneRecordData_p.cpp + + wrtembed/KReportDetailGroupSectionDialog.cpp + wrtembed/KReportDesignerItemBase.cpp + wrtembed/KReportDesignerItemRectBase.cpp + wrtembed/KReportDesignerItemLine.cpp + wrtembed/KReportDesignerSection.cpp + wrtembed/KReportDesignerSectionDetailGroup.cpp + wrtembed/KReportDesignerSectionDetail.cpp + wrtembed/KReportDesignerScene.cpp + wrtembed/KReportDesignerView.cpp + wrtembed/KReportDesigner.cpp + wrtembed/KReportPropertiesButton.cpp + wrtembed/KReportSectionEditor.cpp wrtembed/KReportDpi.cpp wrtembed/KReportRuler.cpp wrtembed/KReportZoomHandler.cpp wrtembed/KReportZoomMode.cpp - items/label/KoReportItemLabel.cpp - items/label/KoReportDesignerItemLabel.cpp - items/label/KoReportLabelPlugin.cpp - items/label/BoundedTextItem.cpp + items/label/KReportItemLabel.cpp + items/label/KReportDesignerItemLabel.cpp + items/label/KReportLabelPlugin.cpp + items/label/KReportBoundedTextItem.cpp items/label/KReportLabelElement.cpp - items/check/KoReportItemCheck.cpp - items/check/KoReportDesignerItemCheck.cpp - items/check/KoReportCheckPlugin.cpp + items/check/KReportItemCheck.cpp + items/check/KReportDesignerItemCheckBox.cpp + items/check/KReportCheckBoxPlugin.cpp - items/field/KoReportItemField.cpp - items/field/KoReportDesignerItemField.cpp - items/field/KoReportFieldPlugin.cpp + items/field/KReportItemField.cpp + items/field/KReportDesignerItemField.cpp + items/field/KReportFieldPlugin.cpp - items/image/KoReportItemImage.cpp - items/image/KoReportDesignerItemImage.cpp - items/image/KoReportImagePlugin.cpp + items/image/KReportItemImage.cpp + items/image/KReportDesignerItemImage.cpp + items/image/KReportImagePlugin.cpp - items/text/KoReportItemText.cpp - items/text/KoReportDesignerItemText.cpp - items/text/KoReportTextPlugin.cpp + items/text/KReportItemText.cpp + items/text/KReportDesignerItemText.cpp + items/text/KReportTextPlugin.cpp ) if(KREPORT_SCRIPTING) list(APPEND kreport_LIB_SRCS - renderer/scripting/krscripthandler.cpp - renderer/scripting/krscriptconstants.cpp - renderer/scripting/krscriptdebug.cpp - renderer/scripting/krscriptdraw.cpp - renderer/scripting/krscriptreport.cpp - renderer/scripting/krscriptsection.cpp - renderer/scripting/krscriptline.cpp + renderer/scripting/KReportScriptHandler.cpp + renderer/scripting/KReportScriptConstants.cpp + renderer/scripting/KReportScriptDebug.cpp + renderer/scripting/KReportScriptDraw.cpp + renderer/scripting/KReportScriptReport.cpp + renderer/scripting/KReportScriptSection.cpp + renderer/scripting/KReportScriptLine.cpp #renderer/odtframe/KoOdtFrameReportDocument.cpp #renderer/odtframe/KoOdtFrameReportCheckBox.cpp #renderer/odtframe/KoOdtFrameReportImage.cpp #renderer/odtframe/KoOdtFrameReportTextBox.cpp #renderer/odtframe/KoOdtFrameReportLine.cpp #renderer/odtframe/KoOdtFrameReportPicture.cpp #renderer/odtframe/KoOdtFrameReportPrimitive.cpp #renderer/ods/KoSimpleOdsDocument.cpp #renderer/ods/KoSimpleOdsSheet.cpp #renderer/ods/KoSimpleOdsCell.cpp - items/label/krscriptlabel.cpp - items/check/KoReportScriptCheck.cpp - items/field/krscriptfield.cpp - items/image/krscriptimage.cpp - items/text/krscripttext.cpp + items/label/KReportScriptLabel.cpp + items/check/KReportScriptCheck.cpp + items/field/KReportScriptField.cpp + items/image/KReportScriptImage.cpp + items/text/KReportScriptText.cpp ) endif() qt5_wrap_ui(kreport_LIB_SRCS - wrtembed/detailgroupsectiondialog.ui - wrtembed/sectioneditor.ui + wrtembed/KReportDetailGroupSectionDialog.ui + wrtembed/KReportSectionEditor.ui ) qt_wrap_cpp(KReport kreport_LIB_SRCS - renderer/scripting/kreportgrouptracker.h + renderer/scripting/KReportGroupTracker.h ) ecm_create_qm_loader(kreport_LIB_SRCS kreport_qt) add_library(KReport SHARED ${kreport_LIB_SRCS}) kdb_create_shared_data_classes( kreport_GENERATED_SHARED_DATA_CLASS_HEADERS # output variable with list of headers NO_PREFIX # subdirectory in which the headers should be generated common/KReportLineStyle.shared.h common/KReportElement.shared.h common/KReportSection.shared.h items/label/KReportLabelElement.shared.h ) kdb_remove_extensions( kreport_GENERATED_SHARED_DATA_CLASS_BASENAMES ${kreport_GENERATED_SHARED_DATA_CLASS_HEADERS} ) generate_export_header(KReport) #qt5_use_modules(KReport Widgets Xml PrintSupport) set(kreport_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/kreport ${CMAKE_CURRENT_BINARY_DIR}/kreport/common ${CMAKE_CURRENT_BINARY_DIR}/kreport/wrtembed ${CMAKE_CURRENT_BINARY_DIR}/kreport/renderer ${CMAKE_CURRENT_BINARY_DIR}/kreport/renderer/scripting ${CMAKE_CURRENT_SOURCE_DIR}/common ${CMAKE_CURRENT_SOURCE_DIR}/wrtembed ${CMAKE_CURRENT_SOURCE_DIR}/renderer ${CMAKE_CURRENT_SOURCE_DIR}/renderer/scripting ) target_include_directories(KReport PUBLIC "$" INTERFACE "$" PRIVATE common renderer renderer/scripting wrtembed ) target_link_libraries(KReport PUBLIC Qt5::PrintSupport Qt5::Xml KF5::CoreAddons KProperty PRIVATE KF5::WidgetsAddons KF5::ConfigGui # KStandardShortcut ${SCRIPTING_LIBS} #KF5::KIOCore #KF5::KIOFileWidgets #KF5::KIOWidgets #KF5::KIONTLM ) set_target_properties(KReport PROPERTIES VERSION 1.0 SOVERSION 1.0.0 EXPORT_NAME KReport ) ecm_setup_version(${KREPORT_VERSION} VARIABLE_PREFIX KREPORT VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kreport_version.h" PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KReportConfigVersion.cmake" ) install(TARGETS KReport EXPORT KReportTargets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS}) # Create a Config.cmake and a ConfigVersion.cmake file and install them set(CMAKECONFIG_INSTALL_DIR "${CMAKECONFIG_INSTALL_PREFIX}/KReport") ecm_configure_package_config_file( "${CMAKE_CURRENT_SOURCE_DIR}/KReportConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/KReportConfig.cmake" INSTALL_DESTINATION "${CMAKECONFIG_INSTALL_DIR}" ) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/KReportConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/KReportConfigVersion.cmake" DESTINATION "${CMAKECONFIG_INSTALL_DIR}" COMPONENT Devel) install(EXPORT KReportTargets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE KReportTargets.cmake) ecm_generate_pri_file( BASE_NAME KReport LIB_NAME KReport DEPS "widgets" FILENAME_VAR PRI_FILENAME INCLUDE_INSTALL_DIR ${INCLUDE_INSTALL_DIR}/KReport ) install(FILES ${PRI_FILENAME} DESTINATION ${ECM_MKSPECS_INSTALL_DIR}) kcoreaddons_desktop_to_json(KReport items/check/check.desktop) kcoreaddons_desktop_to_json(KReport items/field/field.desktop) kcoreaddons_desktop_to_json(KReport items/image/image.desktop) kcoreaddons_desktop_to_json(KReport items/label/label.desktop) kcoreaddons_desktop_to_json(KReport items/text/text.desktop) -#TODO -#install(FILES koreport_itemplugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR}) +install(FILES kreport_elementplugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR}) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/kreport_version.h" DESTINATION "${INCLUDE_INSTALL_DIR}" COMPONENT Devel) ecm_generate_headers(kreport_FORWARDING_HEADERS REQUIRED_HEADERS kreport_HEADERS ORIGINAL CAMELCASE RELATIVE common HEADER_NAMES KReportPageFormat - KoReportData - KoReportItemBase - KoReportItemLine + KReportData + KReportItemBase + KReportItemLine KReportPluginMetaData - KoReportPluginManager - KoReportPluginInterface + KReportPluginManager + KReportPluginInterface KReportUnit KReportUtils KReportDesign - krsize - krpos - krreportdata - krsectiondata - reportpageoptions - renderobjects - KoReportASyncItemBase + KReportSize + KReportPosition + KReportDocument + KReportSectionData + KReportPageOptions + KReportRenderObjects + KReportAsyncItemBase ) ecm_generate_headers(kreport_FORWARDING_HEADERS REQUIRED_HEADERS kreport_HEADERS ORIGINAL CAMELCASE RELATIVE renderer HEADER_NAMES - KoReportPage - KoReportRendererBase - KoReportPreRenderer + KReportPage + KReportRendererBase + KReportPreRenderer KReportView ) ecm_generate_headers(kreport_FORWARDING_HEADERS REQUIRED_HEADERS kreport_HEADERS ORIGINAL CAMELCASE RELATIVE renderer/scripting HEADER_NAMES - krscripthandler - krscriptdraw - krscriptconstants - kreportgrouptracker + KReportScriptHandler + KReportScriptDraw + KReportScriptConstants + KReportGroupTracker ) ecm_generate_headers(kreport_FORWARDING_HEADERS REQUIRED_HEADERS kreport_HEADERS ORIGINAL CAMELCASE RELATIVE wrtembed HEADER_NAMES KReportZoomMode - reportsectiondetail - reportsection + KReportDesignerSectionDetail + KReportDesignerSection KReportDpi KReportZoomHandler - KoReportDesignerItemBase - reportsectiondetailgroup - KoReportDesignerItemRectBase - KoReportDesigner + KReportDesignerItemBase + KReportDesignerSectionDetailGroup + KReportDesignerItemRectBase + KReportDesigner ) ecm_generate_headers(kreport_FORWARDING_HEADERS_FROM_BUILDDIR REQUIRED_HEADERS kreport_HEADERS_FROM_BUILDDIR ORIGINAL CAMELCASE SOURCE_DIR ${PROJECT_BINARY_DIR}/src HEADER_NAMES ${kreport_GENERATED_SHARED_DATA_CLASS_BASENAMES} ) install( FILES ${kreport_HEADERS} ${kreport_HEADERS_FROM_BUILDDIR} DESTINATION ${INCLUDE_INSTALL_DIR}/KReport COMPONENT Devel ) install( FILES ${kreport_FORWARDING_HEADERS} ${kreport_FORWARDING_HEADERS_FROM_BUILDDIR} ${PROJECT_BINARY_DIR}/src/kreport_export.h ${PROJECT_BINARY_DIR}/src/config-kreport.h DESTINATION ${INCLUDE_INSTALL_DIR}/KReport COMPONENT Devel ) enable_testing() diff --git a/src/common/KoReportASyncItemBase.cpp b/src/common/KReportAsyncItemBase.cpp similarity index 96% rename from src/common/KoReportASyncItemBase.cpp rename to src/common/KReportAsyncItemBase.cpp index 077589d9..1a02034a 100644 --- a/src/common/KoReportASyncItemBase.cpp +++ b/src/common/KReportAsyncItemBase.cpp @@ -1,20 +1,20 @@ /* This file is part of the KDE project Copyright (C) 2011 Adam Pigg This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "KoReportASyncItemBase.h" +#include "KReportAsyncItemBase.h" diff --git a/src/common/KoReportASyncItemBase.h b/src/common/KReportAsyncItemBase.h similarity index 78% rename from src/common/KoReportASyncItemBase.h rename to src/common/KReportAsyncItemBase.h index 746fd765..7ce8d61b 100644 --- a/src/common/KoReportASyncItemBase.h +++ b/src/common/KReportAsyncItemBase.h @@ -1,35 +1,35 @@ /* This file is part of the KDE project Copyright (C) 2011 Adam Pigg This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef KOREPORTASYNCITEMBASE_H -#define KOREPORTASYNCITEMBASE_H +#ifndef KREPORTASYNCITEMBASE_H +#define KREPORTASYNCITEMBASE_H -#include "KoReportItemBase.h" +#include "KReportItemBase.h" -class KREPORT_EXPORT KoReportASyncItemBase : public KoReportItemBase +class KREPORT_EXPORT KReportAsyncItemBase : public KReportItemBase { Q_OBJECT public: - virtual int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KRScriptHandler *script) = 0; + virtual int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KReportScriptHandler *script) = 0; Q_SIGNALS: void finishedRendering(); }; -#endif // KOREPORTASYNCITEMBASE_H +#endif // KREPORTASYNCITEMBASE_H diff --git a/src/common/KoReportData.cpp b/src/common/KReportData.cpp similarity index 66% rename from src/common/KoReportData.cpp rename to src/common/KReportData.cpp index f3c8b660..8f38f4c3 100644 --- a/src/common/KoReportData.cpp +++ b/src/common/KReportData.cpp @@ -1,79 +1,79 @@ /* This file is part of the KDE project * Copyright (C) 2007-2010 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#include "KoReportData.h" +#include "KReportData.h" #include -KoReportData::~KoReportData() +KReportData::~KReportData() { } -KoReportData::SortedField::SortedField() +KReportData::SortedField::SortedField() : order(Qt::AscendingOrder) { } -QStringList KoReportData::fieldKeys() const +QStringList KReportData::fieldKeys() const { return fieldNames(); } -QString KoReportData::sourceName() const +QString KReportData::sourceName() const { return QString(); } -void KoReportData::setSorting(const QList &sorting) +void KReportData::setSorting(const QList &sorting) { Q_UNUSED(sorting); } -void KoReportData::addExpression(const QString &field, const QVariant &value, char relation) +void KReportData::addExpression(const QString &field, const QVariant &value, char relation) { Q_UNUSED(field); Q_UNUSED(value); Q_UNUSED(relation); } #ifdef KREPORT_SCRIPTING -QStringList KoReportData::scriptList() const +QStringList KReportData::scriptList() const { return QStringList(); } -QString KoReportData::scriptCode(const QString &script) const +QString KReportData::scriptCode(const QString &script) const { Q_UNUSED(script); return QString(); } #endif -QStringList KoReportData::dataSources() const +QStringList KReportData::dataSources() const { return QStringList(); } -QStringList KoReportData::dataSourceNames() const +QStringList KReportData::dataSourceNames() const { return dataSources(); } -KoReportData* KoReportData::data(const QString &source) +KReportData* KReportData::data(const QString &source) { Q_UNUSED(source); return 0; } diff --git a/src/common/KoReportData.h b/src/common/KReportData.h similarity index 95% rename from src/common/KoReportData.h rename to src/common/KReportData.h index 6bd79436..69a895e8 100644 --- a/src/common/KoReportData.h +++ b/src/common/KReportData.h @@ -1,120 +1,120 @@ /* This file is part of the KDE project * Copyright (C) 2007-2010 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#ifndef __KOREPORTDATA_H__ -#define __KOREPORTDATA_H__ +#ifndef KREPORTDATA_H +#define KREPORTDATA_H #include #include #include "kreport_export.h" #include "config-kreport.h" /** */ -class KREPORT_EXPORT KoReportData +class KREPORT_EXPORT KReportData { public: - virtual ~KoReportData(); + virtual ~KReportData(); //! Describes sorting for single field /*! By default the order is ascending. */ class KREPORT_EXPORT SortedField { public: SortedField(); QString field; Qt::SortOrder order; }; //! Open the dataset virtual bool open() = 0; //! Close the dataset virtual bool close() = 0; //! Move to the next record virtual bool moveNext() = 0; //! Move to the previous record virtual bool movePrevious() = 0; //! Move to the first record virtual bool moveFirst() = 0; //! Move to the last record virtual bool moveLast() = 0; //! Return the current position in the dataset virtual qint64 at() const = 0; //! Return the total number of records virtual qint64 recordCount() const = 0; //! Return the index number of the field given by nane field virtual int fieldNumber(const QString &field) const = 0; //! Return the list of field names virtual QStringList fieldNames() const = 0; //! Return the list of field keys. Returns fieldNames() by default virtual QStringList fieldKeys() const; //! Return the value of the field at the given position for the current record virtual QVariant value(unsigned int) const = 0; //! Return the value of the field fir the given name for the current record virtual QVariant value(const QString &field) const = 0; //! Return the name of this source virtual QString sourceName() const; //! Sets the sorting for the data //! Should be called before open() so that the data source can be edited accordingly //! Default impl does nothing virtual void setSorting(const QList &sorting); //! Adds an expression to the data source virtual void addExpression(const QString &field, const QVariant &value, char relation = '='); //! Utility Functions //! @todo These are probably eligable to be moved into a new class #ifdef KREPORT_SCRIPTING //! Allow the reportdata implementation to return a list of possible scripts virtual QStringList scriptList() const; //! Allow the reportdata implementation to return some script code based on a specific script name //! as set in the report virtual QString scriptCode(const QString& script) const; #endif //! Return a list of data sources possible for advanced controls virtual QStringList dataSources() const; //! Return a list of data source names possible for advanced controls. //! Returns dataSources() by default virtual QStringList dataSourceNames() const; //! Allow a driver to create a new instance with a new data source //! source is a driver specific identifier //! Owner of the returned pointer is the caller - virtual KoReportData* data(const QString &source); + virtual KReportData* data(const QString &source); }; #endif diff --git a/src/common/KReportDesign.cpp b/src/common/KReportDesign.cpp index 1c561648..dd0f41ac 100644 --- a/src/common/KReportDesign.cpp +++ b/src/common/KReportDesign.cpp @@ -1,185 +1,185 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC * Copyright (C) 2007-2010 by Adam Pigg * Copyright (C) 2011-2015 Jarosław Staniek * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #include "KReportDesign.h" #include "KReportDesign_p.h" #include "KReportElement.h" #include "KReportUnit.h" #include "KReportUtils.h" -#include "KoReportPluginManager.h" -#include "KoReportPluginInterface.h" +#include "KReportPluginManager.h" +#include "KReportPluginInterface.h" #include #include #include #include KReportDesignReadingStatus::KReportDesignReadingStatus() : lineNumber(-1), columnNumber(-1) { } bool KReportDesignReadingStatus::isError() const { return lineNumber >= 0; } QDebug operator<<(QDebug dbg, const KReportDesignReadingStatus& status) { if (status.isError()) { dbg.nospace() << qPrintable( QString::fromLatin1("KReportDesignReadingStatus: errorMessage=\"%1\" " "errorDetails=\"%2\" line=%3 column=%4") .arg(status.errorMessage).arg(status.errorDetails) .arg(status.lineNumber).arg(status.columnNumber)); } else { dbg.nospace() << "KReportDesignReadingStatus: OK"; } return dbg.space(); } //----------------------------------- KReportDesign::KReportDesign() : d(new Private(this)) { } KReportDesign::~KReportDesign() { delete d; } bool KReportDesign::setContent(const QString &text, KReportDesignReadingStatus *status) { QDomDocument doc; if (!doc.setContent(text, status ? &status->errorDetails : 0, status ? &status->lineNumber : 0, status ? &status->columnNumber : 0)) { if (status) { status->errorMessage = KReportDesign::tr("Could not parse XML document."); } return false; } return d->processDocument(doc, status); } QString KReportDesign::toString(int indent) const { Q_UNUSED(indent); //! @todo return QString(); } QPageLayout KReportDesign::pageLayout() const { return d->pageLayout; } QString KReportDesign::title() const { return d->title; } void KReportDesign::setTitle(const QString &title) { d->title = title; } void KReportDesign::setPageLayout(const QPageLayout &pageLayout) { d->pageLayout = pageLayout; d->pageLayout.setUnits(QPageLayout::Point); } KReportElement KReportDesign::createElement(const QString &typeName, QString *errorMessage) { QDomElement el; KReportDesignReadingStatus status; - KoReportPluginInterface* plugin = d->findPlugin(typeName, el, &status); + KReportPluginInterface* plugin = d->findPlugin(typeName, el, &status); if (!plugin) { if (errorMessage) { *errorMessage = status.errorMessage; } return KReportElement(); } return plugin->createElement(); } bool KReportDesign::hasSection(KReportSection::Type type) const { const int index = type - 1; if (0 <= index && index < d->sections.length()) { return d->sections[index]; } return false; } KReportSection KReportDesign::section(KReportSection::Type type) const { const int index = type - 1; if (0 <= index && index < d->sections.length()) { KReportSection *section = d->sections[index]; if (section) { return *section; } } return KReportSection(); } void KReportDesign::addSection(const KReportSection §ion) { const int index = section.type() - 1; if (0 <= index && index < d->sections.length()) { if (d->sections[index]) { *d->sections[index] = section; } else { d->sections[index] = new KReportSection(section); } } } // static QPageLayout KReportDesign::defaultPageLayout() { QPageLayout layout = KReportDesignGlobal::self()->defaultPageLayout; if (!layout.pageSize().isValid()) { if (!QPrinterInfo::defaultPrinter().isNull()) { layout.setPageSize(QPrinterInfo::defaultPrinter().defaultPageSize()); } else { layout.setPageSize(QPageSize(DEFAULT_PAGE_SIZE)); } } return layout; } // static void KReportDesign::setDefaultPageLayout(const QPageLayout &pageLayout) { KReportDesignGlobal::self()->defaultPageLayout = pageLayout; KReportDesignGlobal::self()->defaultPageLayout.setUnits(QPageLayout::Point); } #ifdef KREPORT_SCRIPTING QString KReportDesign::script() const { return d->script; } #endif diff --git a/src/common/KReportDesign_p.cpp b/src/common/KReportDesign_p.cpp index 46737d15..746b5165 100644 --- a/src/common/KReportDesign_p.cpp +++ b/src/common/KReportDesign_p.cpp @@ -1,461 +1,461 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC * Copyright (C) 2007-2010 by Adam Pigg * Copyright (C) 2011-2015 Jarosław Staniek * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #include "KReportDesign_p.h" #include "KReportElement.h" #include "KReportUtils.h" -#include "KoReportPluginManager.h" -#include "KoReportPluginInterface.h" +#include "KReportPluginManager.h" +#include "KReportPluginInterface.h" #include #include #include #include KReportDesign::Private::Private(KReportDesign *design) : q(design) , showGrid(DEFAULT_SHOW_GRID) , snapToGrid(DEFAULT_SNAP_TO_GRID) , gridDivisions(DEFAULT_GRID_DIVISIONS) , pageUnit(DEFAULT_UNIT) , sections(KReportSection::Detail) { memset(static_cast(sections.data()), 0, sizeof(void*) * sections.length()); pageLayout.setUnits(QPageLayout::Point); // initializate because of https://bugreports.qt.io/browse/QTBUG-47551 } KReportDesign::Private::~Private() { qDeleteAll(sections); } KReportDesignGlobal::KReportDesignGlobal() : defaultSectionHeight(CM_TO_POINT(2.0)) , defaultSectionBackgroundColor(Qt::white) { defaultPageLayout.setUnits(QPageLayout::Point); defaultPageLayout.setMargins(QMarginsF(DEFAULT_PAGE_MARGIN, DEFAULT_PAGE_MARGIN, DEFAULT_PAGE_MARGIN, DEFAULT_PAGE_MARGIN)); defaultPageLayout.setMode(QPageLayout::StandardMode); defaultPageLayout.setOrientation(DEFAULT_PAGE_ORIENTATION); } KReportSection::Type KReportDesignGlobal::sectionType(const QString& typeName) { initSectionTypes(); return sectionTypesForName.value(typeName); // returns InvalidType for invalid name } QString KReportDesignGlobal::sectionTypeName(KReportSection::Type sectionType) { initSectionTypes(); return sectionTypeNames.value(sectionType); } void KReportDesignGlobal::initSectionTypes() { if (!sectionTypesForName.isEmpty()) { return; } for (const SectionTypeInfo *info = sectionTypes; info->name; ++info) { sectionTypesForName.insert(QString::fromLatin1(info->name), info->type); sectionTypeNames.insert(info->type, QString::fromLatin1(info->name)); } } const KReportDesignGlobal::SectionTypeInfo KReportDesignGlobal::sectionTypes[] = { { KReportSection::InvalidType, "" }, { KReportSection::PageHeaderAny, "header-page-any" }, { KReportSection::PageHeaderEven, "header-page-even" }, { KReportSection::PageHeaderOdd, "header-page-odd" }, { KReportSection::PageHeaderFirst, "header-page-first" }, { KReportSection::PageHeaderLast, "header-page-last" }, { KReportSection::PageFooterAny, "footer-page-any" }, { KReportSection::PageFooterEven, "footer-page-even" }, { KReportSection::PageFooterOdd, "footer-page-odd" }, { KReportSection::PageFooterFirst, "footer-page-first" }, { KReportSection::PageFooterLast, "footer-page-last" }, { KReportSection::ReportHeader, "header-report" }, { KReportSection::ReportFooter, "footer-report" }, { KReportSection::GroupHeader, "group-header" }, { KReportSection::GroupFooter, "group-footer" }, { KReportSection::Detail, "detail" }, { KReportSection::InvalidType, 0 } }; Q_GLOBAL_STATIC(KReportDesignGlobal, s_global) //static KReportDesignGlobal* KReportDesignGlobal::self() { return s_global; } static void setStatus(KReportDesignReadingStatus *status, const QString& details, const QDomNode &node) { if (status) { status->errorDetails = details; status->lineNumber = node.lineNumber() == -1 ? 0 /* mark error */ : node.lineNumber(); status->columnNumber = node.columnNumber() == -1 ? 0 /* mark error */ : node.columnNumber(); } } static bool checkElement(const QDomNode &node, KReportDesignReadingStatus *status) { if (node.isElement()) { return true; } setStatus(status, QString::fromLatin1("Element expected inside of <%1>") .arg(node.parentNode().toElement().tagName()), node); return false; } static void setNoAttributeStatus(const QDomElement &el, const char *attrName, KReportDesignReadingStatus *status) { setStatus(status, QString::fromLatin1("Attribute \"%1\" expected inside of <%1>") .arg(QLatin1String(attrName)).arg(el.tagName()), el); } #if 0 // TODO unused for now static bool checkAttribute(const QDomElement &el, const char *attrName, KReportDesignReadingStatus *status) { if (el.hasAttribute(QLatin1String(attrName))) { return true; } setNoAttributeStatus(el, attrName, status); return false; } #endif KReportSection KReportDesign::Private::processSectionElement(const QDomElement &el, KReportDesignReadingStatus *status) { const QString sectionTypeName = KReportUtils::attr(el, "report:section-type", QString()); KReportSection::Type sectionType = s_global->sectionType(sectionTypeName); if (sectionType == KReportSection::InvalidType) { setStatus(status, QString::fromLatin1("Invalid value of report:section-type=\"%1\" in element <%2>") .arg(sectionTypeName).arg(el.tagName()), el); return KReportSection(); } KReportSection section; section.setType(sectionType); qreal height = KReportUtils::attr(el, "svg:height", -1.0); if (height >= 0.0) { section.setHeight(height); } section.setBackgroundColor(QColor(KReportUtils::attr(el, "fo:background-color", QString()))); for (QDomNode node = el.firstChild(); !node.isNull(); node = node.nextSibling()) { if (!checkElement(node, status)) { return KReportSection(); } KReportElement element = processSectionElementChild(node.toElement(), status); if (status->isError()) { return KReportSection(); } section.addElement(element); } return section; } -KoReportPluginInterface* KReportDesign::Private::findPlugin(const QString &typeName, +KReportPluginInterface* KReportDesign::Private::findPlugin(const QString &typeName, const QDomElement &el, KReportDesignReadingStatus *status) { - KoReportPluginInterface* plugin = KoReportPluginManager::self()->plugin(typeName); + KReportPluginInterface* plugin = KReportPluginManager::self()->plugin(typeName); if (!plugin) { setStatus(status, QString::fromLatin1("No such plugin \"%1\"").arg(typeName), el); return 0; } return plugin; } KReportElement KReportDesign::Private::processSectionElementChild(const QDomElement &el, KReportDesignReadingStatus *status) { const QByteArray name = el.tagName().toLatin1(); const char* elNamespace = "report:"; if (!name.startsWith(elNamespace)) { unexpectedElement(el, status); return KReportElement(); } const QByteArray reportElementName = name.mid(qstrlen(elNamespace)); qDebug() << "Found Report Element:" << reportElementName; - KoReportPluginInterface *plugin = findPlugin(QLatin1String(reportElementName), el, status); + KReportPluginInterface *plugin = findPlugin(QLatin1String(reportElementName), el, status); if (!plugin) { return KReportElement(); } KReportElement element = plugin->createElement(); if (!plugin->loadElement(&element, el, status)) { return KReportElement(); } element.setName(KReportUtils::attr(el, "report:name", QString())); if (element.name().isEmpty()) { setNoAttributeStatus(el, "report:name", status); return KReportElement(); } return element; } bool KReportDesign::Private::processGroupElement(const QDomElement &el, KReportDesignReadingStatus *status) { Q_UNUSED(el); Q_UNUSED(status); //! @todo return true; } //! The report:detail element contains a single report:section child of type 'detail' //! and 0 or more report:group children. bool KReportDesign::Private::processDetailElement(const QDomElement &el, KReportDesignReadingStatus *status) { QDomElement sectionEl; for (QDomNode node = el.firstChild(); !node.isNull(); node = node.nextSibling()) { if (!checkElement(node, status)) { return false; } QDomElement childEl = node.toElement(); const QByteArray name = childEl.tagName().toLatin1(); if (name == "report:section") { if (!sectionEl.isNull()) { return false; } KReportSection section = processSectionElement(childEl, status); if (status->isError()) { return false; } if (section.type() != KReportSection::Detail) { setStatus(status, QString::fromLatin1("Only section of type \"detail\" allowed in "), el); return false; } q->addSection(section); } else if (name == "report:group") { if (!processGroupElement(childEl, status)) { return false; } } else { unexpectedElement(childEl, status); return false; } } // finally make sure we have one report:section (void)requiredChildElement(el, "report:section", status); if (status->isError()) { return false; } return true; } /*!
        
         *.. (up to 12 sections)
          
             // any number of groups
              *.. (group-header, group-footer)
            
          
        
     
 */
 bool KReportDesign::Private::processBodyElementChild(const QDomElement &el,
                                                      KReportDesignReadingStatus *status)
 {
     const QByteArray name = el.tagName().toLatin1();
     //kreportDebug() << name;
     if (name == "report:section") {
         KReportSection section = processSectionElement(el, status);
         if (status->isError()) {
             return false;
         }
         if (q->hasSection(section.type())) {
             setStatus(status, QString::fromLatin1("Could not add two sections of type \"%1\" "
                                                   "to the same report design")
                                 .arg(s_global->sectionTypeName(section.type())), el);
             return false;
         }
         if (section.type() == KReportSection::Detail) {
             setStatus(status,
                 QString::fromLatin1("Section of type \"detail\" not allowed in "), el);
             return false;
         }
         q->addSection(section);
 #if 0 //TODO
-        if (section(KRSectionData::sectionTypeFromString(sectiontype)) == 0) {
-            insertSection(KRSectionData::sectionTypeFromString(sectiontype));
-            section(KRSectionData::sectionTypeFromString(sectiontype))->initFromXML(sec);
+        if (section(KReportSectionData::sectionTypeFromString(sectiontype)) == 0) {
+            insertSection(KReportSectionData::sectionTypeFromString(sectiontype));
+            section(KReportSectionData::sectionTypeFromString(sectiontype))->initFromXML(sec);
         }
 #endif
     } else if (name == "report:detail") {
         if (!processDetailElement(el, status)) {
             return false;
         }
 #if 0 //TODO
         ReportSectionDetail * rsd = new ReportSectionDetail(this);
         rsd->initFromXML(&sec);
         setDetail(rsd);
 #endif
     }
     return true;
 }
 
 /* NOTE: don't translate these extremely detailed messages. */
 //! @todo Load page options
 bool KReportDesign::Private::processContentElementChild(const QDomElement &el,
                                                         KReportDesignReadingStatus *status)
 {
     const QByteArray name = el.tagName().toLatin1();
     QPageLayout defaultPageLayout = KReportDesign::defaultPageLayout();
     //kreportDebug() << name;
     if (name == "report:title") {
         title = el.text();
 #ifdef KREPORT_SCRIPTING
     } else if (name == "report:script") {
         script = el.firstChildElement().text();
         originalInterpreter = KReportUtils::attr(el, "report:script-interpreter", QString());
 #endif
     } else if (name == "report:grid") {
         showGrid = KReportUtils::attr(el, "report:grid-visible", DEFAULT_SHOW_GRID);
         snapToGrid = KReportUtils::attr(el, "report:grid-snap", DEFAULT_SNAP_TO_GRID);
         gridDivisions = KReportUtils::attr(el, "report:grid-divisions", DEFAULT_GRID_DIVISIONS);
         const QString pageUnitString = KReportUtils::attr(el, "report:page-unit", QString());
         bool found;
         pageUnit = KReportUnit::fromSymbol(pageUnitString, &found);
         if (!found) {
             pageUnit = DEFAULT_UNIT;
             if (!pageUnitString.isEmpty()) {
                 qWarning() << "Invalid page unit" << pageUnitString << "specified in" << name
                            << "element, defaulting to" << pageUnit.symbol();
             }
         }
     }
     else if (name == "report:page-style") { // see https://git.reviewboard.kde.org/r/115314
         const QByteArray pagetype = el.text().toLatin1();
         if (pagetype == "predefined") {
             pageLayout.setPageSize(
                         KReportUtils::pageSize(KReportUtils::attr(el, "report:page-size",
                                                QPageSize(DEFAULT_PAGE_SIZE).key())));
         } else if (pagetype.isEmpty() || pagetype == "custom") {
             QSizeF size(KReportUtils::attr(el, "fo:page-width", -1.0),
                         KReportUtils::attr(el, "fo:page-height", -1.0));
             if (size.isValid()) {
                 pageLayout.setPageSize(QPageSize(size, QPageSize::Point));
             } else {
                 pageLayout.setPageSize(defaultPageLayout.pageSize());
             }
         } else if (pagetype == "label") {
             //! @todo?
             pageLayout.setPageSize(defaultPageLayout.pageSize());
         }
         QMarginsF margins(KReportUtils::attr(el, "fo:margin-left", defaultPageLayout.margins().left()),
                  KReportUtils::attr(el, "fo:margin-top", defaultPageLayout.margins().top()),
                  KReportUtils::attr(el, "fo:margin-right", defaultPageLayout.margins().right()),
                  KReportUtils::attr(el, "fo:margin-bottom", defaultPageLayout.margins().bottom()));
         bool b = pageLayout.setMargins(margins);
         if (!b) {
             qWarning() << "Failed to set page margins to" << margins;
         }
         const QString s = KReportUtils::attr(el, "report:print-orientation", QString());
         if (s == QLatin1String("portrait")) {
             pageLayout.setOrientation(QPageLayout::Portrait);
         } else if (s == QLatin1String("landscape")) {
             pageLayout.setOrientation(QPageLayout::Landscape);
         }
         else {
             pageLayout.setOrientation(defaultPageLayout.orientation());
         }
     } else if (name == "report:body") {
         for (QDomNode node = el.firstChild(); !node.isNull(); node = node.nextSibling()) {
             if (!checkElement(node, status)) {
                 return false;
             }
             if (!processBodyElementChild(node.toElement(), status)) {
                 return false;
             }
         }
     }
     return true;
 }
 
 void KReportDesign::Private::unexpectedElement(const QDomElement &element,
                                                KReportDesignReadingStatus *status) const
 {
     setStatus(status, QString::fromLatin1("Unexpected child element <%1> found in <%2>")
           .arg(element.tagName()).arg(element.parentNode().toElement().tagName()), element);
 }
 
 QDomElement KReportDesign::Private::requiredChildElement(const QDomElement &parent,
                                                          const char* childElementName,
                                                          KReportDesignReadingStatus *status) const
 {
     const QDomElement result = parent.firstChildElement(QLatin1String(childElementName));
     if (result.isNull()) {
         setStatus(status, QString::fromLatin1("Child element <%1> not found in <%2>")
               .arg(QLatin1String(childElementName)).arg(parent.tagName()), parent);
     }
     return result;
 }
 
 /* NOTE: don't translate these extremely detailed messages. */
 bool KReportDesign::Private::processDocument(const QDomDocument &doc,
                                              KReportDesignReadingStatus *status)
 {
     const QDomElement rootEl = doc.documentElement();
     const QLatin1String rootElName("kexireport"); // legacy name kept for compatibility
     if (doc.doctype().name() != rootElName) {
         setStatus(status, QString::fromLatin1("Document type should be \"%1\"").arg(rootElName), rootEl);
         return false;
     }
     if (rootEl.tagName() != rootElName) {
         setStatus(status, QString::fromLatin1("Root element should be <%1>").arg(rootElName), rootEl);
         return false;
     }
     const QDomElement contentEl = requiredChildElement(rootEl, "report:content", status);
     if (status->isError()) {
         return false;
     }
     //! @todo check namespaces as in:
     //! 
 
 //    deleteDetail();
 
     for (QDomNode node = contentEl.firstChild(); !node.isNull(); node = node.nextSibling()) {
         if (!checkElement(node, status)) {
             return false;
         }
         if (!processContentElementChild(node.toElement(), status)) {
             return false;
         }
     }
 
     if (status) {
         status->lineNumber = -1;
         status->columnNumber = -1;
         status->errorMessage.clear();
         status->errorDetails.clear();
     }
     return true;
 }
diff --git a/src/common/KReportDesign_p.h b/src/common/KReportDesign_p.h
index 2390aef8..ffcc13b5 100644
--- a/src/common/KReportDesign_p.h
+++ b/src/common/KReportDesign_p.h
@@ -1,129 +1,129 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC 
  * Copyright (C) 2007-2010 by Adam Pigg 
  * Copyright (C) 2011-2015 Jarosław Staniek 
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
 #ifndef KREPORTDESIGN_P_H
 #define KREPORTDESIGN_P_H
 
 #include "KReportDesign.h"
 #include "KReportUnit.h"
 
 #include 
 #include 
 #include 
 
 class QDomDocument;
 class QDomElement;
-class KoReportPluginInterface;
+class KReportPluginInterface;
 
 static const bool DEFAULT_SHOW_GRID = true;
 static const bool DEFAULT_SNAP_TO_GRID = true;
 static const int DEFAULT_GRID_DIVISIONS = 4;
 static const KReportUnit DEFAULT_UNIT = KReportUnit(KReportUnit::Centimeter);
 static const int DEFAULT_PAGE_MARGIN = CM_TO_POINT(1.0);
 static const QPageSize::PageSizeId DEFAULT_PAGE_SIZE = QPageSize::A4;
 static const QPageLayout::Orientation DEFAULT_PAGE_ORIENTATION = QPageLayout::Landscape;
 
 class KReportDesign::Private
 {
 public:
     explicit Private(KReportDesign *design);
 
     ~Private();
 
     QDomElement requiredChildElement(const QDomElement &parent,
                                      const char* childElementName,
                                      KReportDesignReadingStatus *status) const;
 
     void unexpectedElement(const QDomElement &element,
                            KReportDesignReadingStatus *status) const;
 
     //! Processes document @a doc and sets status @a status
     bool processDocument(const QDomDocument &doc, KReportDesignReadingStatus *status);
 
     //! Processes @a el, a child of /report:content element and sets status @a status
     bool processContentElementChild(const QDomElement &el, KReportDesignReadingStatus *status);
 
     //! Processes @a el, a child of /report:content/report:body element and sets status @a status
     bool processBodyElementChild(const QDomElement &el, KReportDesignReadingStatus *status);
 
     //! Processes @a el, a /report:content/report:body/report:section element and sets status @a status
     KReportSection processSectionElement(const QDomElement &el, KReportDesignReadingStatus *status);
 
     //! Processes @a el,
     //! a child of /report:content/report:body/report:section element
     //! or a child of /report:content/report:body/report:detail/report:section element
     //! and sets status @a status.
     //! It is probably the lowest level in hierarchy and @a el refers to a single report element.
     KReportElement processSectionElementChild(const QDomElement &el, KReportDesignReadingStatus *status);
 
     //! Processes @a el, a child of /report:content/report:body/report:detail element and sets status @a status
     bool processDetailElement(const QDomElement &el, KReportDesignReadingStatus *status);
 
     //! Processes @a el, a /report:content/report:body/report:detail/report:group element and sets status @a status
     bool processGroupElement(const QDomElement &el, KReportDesignReadingStatus *status);
 
-    KoReportPluginInterface* findPlugin(const QString &typeName, const QDomElement &el,
+    KReportPluginInterface* findPlugin(const QString &typeName, const QDomElement &el,
                                         KReportDesignReadingStatus *status);
 
     KReportDesign * const q;
 
     // Visual settings only
     bool showGrid;
     bool snapToGrid;
     int gridDivisions;
     KReportUnit pageUnit;
     // END OF: Visual settings only
     QString title;
     QPageLayout pageLayout;
     QVarLengthArray sections;
 #ifdef KREPORT_SCRIPTING
     QString script;
     QString originalInterpreter; //!< used for backward-compatibility to save the original
 #endif
 };
 
 class KReportDesignGlobal
 {
 public:
     KReportDesignGlobal();
 
     static KReportDesignGlobal* self();
 
     struct SectionTypeInfo {
         KReportSection::Type type;
         const char *name;
     };
 
     KReportSection::Type sectionType(const QString& typeName);
 
     QString sectionTypeName(KReportSection::Type sectionType);
 
     QPageLayout defaultPageLayout;
     qreal defaultSectionHeight;
     QColor defaultSectionBackgroundColor;
 
 private:
     void initSectionTypes();
 
     static const SectionTypeInfo sectionTypes[];
     QHash sectionTypesForName;
     QHash sectionTypeNames;
 };
 
 #endif
diff --git a/src/common/krdetailsectiondata.cpp b/src/common/KReportDetailSectionData.cpp
similarity index 78%
rename from src/common/krdetailsectiondata.cpp
rename to src/common/KReportDetailSectionData.cpp
index 6a34bb40..590dbd4a 100644
--- a/src/common/krdetailsectiondata.cpp
+++ b/src/common/KReportDetailSectionData.cpp
@@ -1,123 +1,123 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "krdetailsectiondata.h"
-#include "krsectiondata.h"
-#include "krreportdata.h"
+#include "KReportDetailSectionData.h"
+#include "KReportSectionData.h"
+#include "KReportDocument.h"
 
 #include "kreport_debug.h"
 #include 
 
-KRDetailSectionData::KRDetailSectionData(QObject *parent)
+KReportDetailSectionData::KReportDetailSectionData(QObject *parent)
  : QObject(parent)
 {
     m_pageBreak = BreakNone;
     m_detailSection = 0;
     m_valid = true;
 }
 
-KRDetailSectionData::KRDetailSectionData(const QDomElement &elemSource, KoReportReportData *report)
+KReportDetailSectionData::KReportDetailSectionData(const QDomElement &elemSource, KReportDocument *report)
  : QObject(report)
 {
     m_pageBreak = BreakNone;
     m_detailSection = 0;
     m_valid = false;
     //kreportDebug() << elemSource.tagName();
     if (elemSource.tagName() != QLatin1String("report:detail")) {
         return;
     }
 
     QDomNodeList sections = elemSource.childNodes();
 
     for (int nodeCounter = 0; nodeCounter < sections.count(); nodeCounter++) {
         QDomElement elemThis = sections.item(nodeCounter).toElement();
 
         if (elemThis.tagName() == QLatin1String("report:group")) {
-            ORDetailGroupSectionData * dgsd = new ORDetailGroupSectionData();
+            KReportDetailGroupSectionData * dgsd = new KReportDetailGroupSectionData();
 
             if ( elemThis.hasAttribute( QLatin1String("report:group-column") ) ) {
                 dgsd->m_column = elemThis.attribute( QLatin1String("report:group-column") );
             }
 
             if ( elemThis.hasAttribute( QLatin1String("report:group-page-break") ) ) {
                 QString s = elemThis.attribute( QLatin1String("report:group-page-break") );
                 if ( s == QLatin1String("after-footer") ) {
-                    dgsd->m_pagebreak = ORDetailGroupSectionData::BreakAfterGroupFooter;
+                    dgsd->m_pagebreak = KReportDetailGroupSectionData::BreakAfterGroupFooter;
                 } else if ( s == QLatin1String("before-header") ) {
-                    dgsd->m_pagebreak = ORDetailGroupSectionData::BreakBeforeGroupHeader;
+                    dgsd->m_pagebreak = KReportDetailGroupSectionData::BreakBeforeGroupHeader;
                 } else {
-                    dgsd->m_pagebreak = ORDetailGroupSectionData::BreakNone;
+                    dgsd->m_pagebreak = KReportDetailGroupSectionData::BreakNone;
                 }
             }
 
             if (elemThis.attribute(QLatin1String("report:group-sort"), QLatin1String("ascending")) == QLatin1String("ascending")) {
                 dgsd->m_sort = Qt::AscendingOrder;
             } else {
                 dgsd->m_sort = Qt::DescendingOrder;
             }
             
             for ( QDomElement e = elemThis.firstChildElement( QLatin1String("report:section") ); ! e.isNull(); e = e.nextSiblingElement( QLatin1String("report:section") ) ) {
                 QString s = e.attribute( QLatin1String("report:section-type") );
                 if ( s == QLatin1String("group-header") ) {
-                    KRSectionData * sd = new KRSectionData(e, report);
+                    KReportSectionData * sd = new KReportSectionData(e, report);
                     if (sd->isValid()) {
                         dgsd->m_groupHeader = sd;
                     } else {
                         delete sd;
                     }
                 } else if ( s == QLatin1String("group-footer") ) {
-                    KRSectionData * sd = new KRSectionData(e, report);
+                    KReportSectionData * sd = new KReportSectionData(e, report);
                     if (sd->isValid()) {
                         dgsd->m_groupFooter = sd;
                     } else {
                         delete sd;
                     }
                 }
             }
             m_groupList.append(dgsd);
-            KoReportData::SortedField s;
+            KReportData::SortedField s;
             s.field = dgsd->m_column;
             s.order = dgsd->m_sort;
             m_sortedFields.append(s);
 	    
         } else if (elemThis.tagName() == QLatin1String("report:section") && elemThis.attribute(QLatin1String("report:section-type")) == QLatin1String("detail")) {
-            KRSectionData * sd = new KRSectionData(elemThis, report);
+            KReportSectionData * sd = new KReportSectionData(elemThis, report);
             if (sd->isValid()) {
                 m_detailSection = sd;
             } else
                 delete sd;
         } else {
             kreportWarning() << "While parsing detail section encountered an unknown element: " << elemThis.tagName();
         }
     }
     
     m_valid = true;
 }
 
-KRDetailSectionData::~KRDetailSectionData()
+KReportDetailSectionData::~KReportDetailSectionData()
 {
 }
 
-ORDetailGroupSectionData::ORDetailGroupSectionData()
+KReportDetailGroupSectionData::KReportDetailGroupSectionData()
 {
     m_pagebreak = BreakNone;
     m_sort = Qt::AscendingOrder;
     m_groupHeader = 0;
     m_groupFooter = 0;
 }
 
diff --git a/src/common/krdetailsectiondata.h b/src/common/KReportDetailSectionData.h
similarity index 65%
rename from src/common/krdetailsectiondata.h
rename to src/common/KReportDetailSectionData.h
index 15e84f47..1eec84d9 100644
--- a/src/common/krdetailsectiondata.h
+++ b/src/common/KReportDetailSectionData.h
@@ -1,83 +1,83 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#ifndef KRDETAILSECTIONDATA_H
-#define KRDETAILSECTIONDATA_H
+#ifndef KREPORTDETAILSECTIONDATA_H
+#define KREPORTDETAILSECTIONDATA_H
 
 #include 
 
-#include "KoReportData.h"
+#include "KReportData.h"
 
-class KRSectionData;
-class ORDetailGroupSectionData;
-class KoReportReportData;
+class KReportSectionData;
+class KReportDetailGroupSectionData;
+class KReportDocument;
 
 class QDomElement;
 
 /**
 */
-class KRDetailSectionData : public QObject
+class KReportDetailSectionData : public QObject
 {
     Q_OBJECT
 public:
-    explicit KRDetailSectionData(QObject *parent = 0);
-    KRDetailSectionData(const QDomElement &elemSource, KoReportReportData *report);
-    ~KRDetailSectionData();
+    explicit KReportDetailSectionData(QObject *parent = 0);
+    KReportDetailSectionData(const QDomElement &elemSource, KReportDocument *report);
+    ~KReportDetailSectionData();
 
     enum PageBreak {
         BreakNone = 0,
         BreakAtEnd = 1
     };
 
     QString m_name;
     int m_pageBreak;
-    QList m_sortedFields;
+    QList m_sortedFields;
 
-    KRSectionData * m_detailSection;
+    KReportSectionData * m_detailSection;
 
-    QList m_groupList;
+    QList m_groupList;
 
     bool isValid() const {
         return m_valid;
     }
 
 private:
     bool m_valid;
 };
 
-class ORDetailGroupSectionData
+class KReportDetailGroupSectionData
 {
 public:
-    ORDetailGroupSectionData();
+    KReportDetailGroupSectionData();
 
     enum PageBreak {
         BreakNone = 0,
         BreakAfterGroupFooter = 1,
         BreakBeforeGroupHeader = 2
     };
 
     //QString name;
     QString m_column;
     PageBreak m_pagebreak;
     Qt::SortOrder m_sort;
 
-    KRSectionData *m_groupHeader;
-    KRSectionData *m_groupFooter;
+    KReportSectionData *m_groupHeader;
+    KReportSectionData *m_groupFooter;
 };
 
 #endif
diff --git a/src/common/krreportdata.cpp b/src/common/KReportDocument.cpp
similarity index 74%
rename from src/common/krreportdata.cpp
rename to src/common/KReportDocument.cpp
index 5750e6c6..af97903f 100644
--- a/src/common/krreportdata.cpp
+++ b/src/common/KReportDocument.cpp
@@ -1,305 +1,305 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "krreportdata.h"
+#include "KReportDocument.h"
 #include "KReportUnit.h"
-#include "krdetailsectiondata.h"
-#include "KoReportItemBase.h"
+#include "KReportDetailSectionData.h"
+#include "KReportItemBase.h"
 
 #include 
 #include 
 #include 
 #include "kreport_debug.h"
 
-void KoReportReportData::init()
+void KReportDocument::init()
 {
     m_pageHeaderFirst = m_pageHeaderOdd = m_pageHeaderEven = m_pageHeaderLast = m_pageHeaderAny = 0;
     m_pageFooterFirst = m_pageFooterOdd = m_pageFooterEven = m_pageFooterLast = m_pageFooterAny = 0;
     m_reportHeader = m_reportFooter = 0;
 }
 
-KoReportReportData::KoReportReportData(QObject *parent)
+KReportDocument::KReportDocument(QObject *parent)
         : QObject(parent)
         , m_detailSection(0)
 {
     init();
     m_valid = true;
 }
 
-KoReportReportData::KoReportReportData(const QDomElement & elemSource, QObject *parent)
+KReportDocument::KReportDocument(const QDomElement & elemSource, QObject *parent)
         : QObject(parent)
         , m_detailSection(0)
 {
     m_valid = false;
     init();
     //kreportDebug();
     if (elemSource.tagName() != QLatin1String("report:content")) {
         kreportWarning() << "QDomElement is not  tag"
                    << elemSource.text();
         return;
     }
         QScreen *srn = QApplication::screens().at(0);
 
     const qreal dpiX = srn->logicalDotsPerInchX();
     const qreal dpiY = srn->logicalDotsPerInchY();
 
 
     QDomNodeList sections = elemSource.childNodes();
     for (int nodeCounter = 0; nodeCounter < sections.count(); nodeCounter++) {
         QDomElement elemThis = sections.item(nodeCounter).toElement();
         if (elemThis.tagName() == QLatin1String("report:title")) {
             m_title = elemThis.text();
 #ifdef KREPORT_SCRIPTING
         } else if (elemThis.tagName() == QLatin1String("report:script")) {
             m_script = elemThis.text();
             m_interpreter = elemThis.attribute(QLatin1String("report:script-interpreter"));
 #endif
         } else if (elemThis.tagName() == QLatin1String("report:page-style")) {
             QString pagetype = elemThis.firstChild().nodeValue();
 
             if (pagetype == QLatin1String("predefined")) {
                 page.setPageSize(elemThis.attribute(QLatin1String("report:page-size"), QLatin1String("A4")));
             } else if (pagetype == QLatin1String("custom")) {
                 page.setCustomWidth(POINT_TO_INCH(KReportUnit::parseValue(elemThis.attribute(QLatin1String("report:custom-page-width"), QString()))) * dpiX);
                 page.setCustomHeight(POINT_TO_INCH(KReportUnit::parseValue(elemThis.attribute(QLatin1String("report:custom-page-height"), QString()))) * dpiY);
                 page.setPageSize(QLatin1String("Custom"));
             } else if (pagetype == QLatin1String("label")) {
                 page.setLabelType(elemThis.firstChild().nodeValue());
             }
             //! @todo add config for default margins or add within templates support
             page.setMarginBottom(POINT_TO_INCH(KReportUnit::parseValue(elemThis.attribute(QLatin1String("fo:margin-bottom"), QLatin1String("1.0cm")))) * dpiY);
             page.setMarginTop(POINT_TO_INCH(KReportUnit::parseValue(elemThis.attribute(QLatin1String("fo:margin-top"), QLatin1String("1.0cm")))) * dpiY);
             page.setMarginLeft(POINT_TO_INCH(KReportUnit::parseValue(elemThis.attribute(QLatin1String("fo:margin-left"), QLatin1String("1.0cm")))) * dpiX);
             page.setMarginRight(POINT_TO_INCH(KReportUnit::parseValue(elemThis.attribute(QLatin1String("fo:margin-right"), QLatin1String("1.0cm")))) * dpiX);
 
             page.setPortrait(elemThis.attribute(QLatin1String("report:print-orientation"), QLatin1String("portrait")) == QLatin1String("portrait"));
 
         } else if (elemThis.tagName() == QLatin1String("report:body")) {
             QDomNodeList sectionlist = elemThis.childNodes();
             QDomNode sec;
 
             for (int s = 0; s < sectionlist.count(); ++s) {
                 sec = sectionlist.item(s);
                 if (sec.isElement()) {
                     QString sn = sec.nodeName().toLower();
                     //kreportDebug() << sn;
                     if (sn == QLatin1String("report:section")) {
-                        KRSectionData * sd = new KRSectionData(sec.toElement(), this);
+                        KReportSectionData * sd = new KReportSectionData(sec.toElement(), this);
                         if (!sd->isValid()) {
                             kreportDebug() << "Invalid section";
                             delete sd;
                         } else {
                             //kreportDebug() << "Adding section of type " << sd->type();
                             switch (sd->type()) {
-                            case KRSectionData::PageHeaderFirst:
+                            case KReportSectionData::PageHeaderFirst:
                                 m_pageHeaderFirst = sd;
                                 break;
-                            case KRSectionData::PageHeaderOdd:
+                            case KReportSectionData::PageHeaderOdd:
                                 m_pageHeaderOdd = sd;
                                 break;
-                            case KRSectionData::PageHeaderEven:
+                            case KReportSectionData::PageHeaderEven:
                                 m_pageHeaderEven = sd;
                                 break;
-                            case KRSectionData::PageHeaderLast:
+                            case KReportSectionData::PageHeaderLast:
                                 m_pageHeaderLast = sd;
                                 break;
-                            case KRSectionData::PageHeaderAny:
+                            case KReportSectionData::PageHeaderAny:
                                 m_pageHeaderAny = sd;
                                 break;
-                            case KRSectionData::ReportHeader:
+                            case KReportSectionData::ReportHeader:
                                 m_reportHeader = sd;
                                 break;
-                            case KRSectionData::ReportFooter:
+                            case KReportSectionData::ReportFooter:
                                 m_reportFooter = sd;
                                 break;
-                            case KRSectionData::PageFooterFirst:
+                            case KReportSectionData::PageFooterFirst:
                                 m_pageFooterFirst = sd;
                                 break;
-                            case KRSectionData::PageFooterOdd:
+                            case KReportSectionData::PageFooterOdd:
                                 m_pageFooterOdd = sd;
                                 break;
-                            case KRSectionData::PageFooterEven:
+                            case KReportSectionData::PageFooterEven:
                                 m_pageFooterEven = sd;
                                 break;
-                            case KRSectionData::PageFooterLast:
+                            case KReportSectionData::PageFooterLast:
                                 m_pageFooterLast = sd;
                                 break;
-                            case KRSectionData::PageFooterAny:
+                            case KReportSectionData::PageFooterAny:
                                 m_pageFooterAny = sd;
                                 break;
                             default:
                                 ;
                             }
                         }
 
                     } else if (sn == QLatin1String("report:detail")) {
-                        KRDetailSectionData * dsd = new KRDetailSectionData(sec.toElement(), this);
+                        KReportDetailSectionData * dsd = new KReportDetailSectionData(sec.toElement(), this);
 
                         if (dsd->isValid()) {
                             m_detailSection = dsd;
                         } else {
                             kreportDebug() << "Invalid detail section";
                             delete dsd;
                         }
                     }
                 } else {
                     kreportWarning() << "Encountered an unknown Element: "  << elemThis.tagName();
                 }
             }
         }
 
         m_valid = true;
     }
 }
 
 
-KoReportReportData::~KoReportReportData()
+KReportDocument::~KReportDocument()
 {
 }
 
-QList KoReportReportData::objects() const
+QList KReportDocument::objects() const
 {
-    QList obs;
-    for (int i = 1; i <= KRSectionData::PageFooterAny; i++) {
-        KRSectionData *sec = section((KRSectionData::Section)i);
+    QList obs;
+    for (int i = 1; i <= KReportSectionData::PageFooterAny; i++) {
+        KReportSectionData *sec = section((KReportSectionData::Section)i);
         if (sec) {
             obs << sec->objects();
         }
     }
 
     if (m_detailSection) {
         //kreportDebug() << "Number of groups: " << m_detailSection->m_groupList.count();
-        foreach(ORDetailGroupSectionData* g, m_detailSection->m_groupList) {
+        foreach(KReportDetailGroupSectionData* g, m_detailSection->m_groupList) {
             if (g->m_groupHeader) {
                 obs << g->m_groupHeader->objects();
             }
             if (g->m_groupFooter) {
                 obs << g->m_groupFooter->objects();
             }
         }
         if (m_detailSection->m_detailSection)
             obs << m_detailSection->m_detailSection->objects();
     }
 
     /*kreportDebug() << "Object List:";
-    foreach(KoReportItemBase* o, obs) {
+    foreach(KReportItemBase* o, obs) {
         kreportDebug() << o->entityName();
     }*/
     return obs;
 }
 
-KoReportItemBase* KoReportReportData::object(const QString& n) const
+KReportItemBase* KReportDocument::object(const QString& n) const
 {
-    QList obs = objects();
+    QList obs = objects();
 
-    foreach(KoReportItemBase* o, obs) {
+    foreach(KReportItemBase* o, obs) {
         if (o->entityName() == n) {
             return o;
         }
     }
     return 0;
 }
 
-QList KoReportReportData::sections() const
+QList KReportDocument::sections() const
 {
-    QList secs;
+    QList secs;
     for (int i = 0; i < 12 ; ++i) {
-        KRSectionData *sec = section((KRSectionData::Section)(i + 1));
+        KReportSectionData *sec = section((KReportSectionData::Section)(i + 1));
         if (sec) {
             secs << sec;
         }
     }
 
     if (m_detailSection) {
         //kreportDebug() << "Number of groups: " << m_detailSection->m_groupList.count();
-        foreach(ORDetailGroupSectionData* g, m_detailSection->m_groupList) {
+        foreach(KReportDetailGroupSectionData* g, m_detailSection->m_groupList) {
             if (g->m_groupHeader) {
                 secs << g->m_groupHeader;
             }
             if (g->m_groupFooter) {
                 secs << g->m_groupFooter;
             }
         }
         if (m_detailSection->m_detailSection)
             secs << m_detailSection->m_detailSection;
     }
 
     return secs;
 }
 
-KRSectionData* KoReportReportData::section(const QString& sn) const
+KReportSectionData* KReportDocument::section(const QString& sn) const
 {
-    QList secs = sections();
+    QList secs = sections();
 
-    foreach(KRSectionData *sec, secs) {
+    foreach(KReportSectionData *sec, secs) {
         if (sec->name() == sn) {
             return sec;
         }
     }
     return 0;
 }
 
-KRSectionData* KoReportReportData::section(KRSectionData::Section s) const
+KReportSectionData* KReportDocument::section(KReportSectionData::Section s) const
 {
-    KRSectionData *sec;
+    KReportSectionData *sec;
     switch (s) {
-    case KRSectionData::PageHeaderAny:
+    case KReportSectionData::PageHeaderAny:
         sec = m_pageHeaderAny;
         break;
-    case KRSectionData::PageHeaderEven:
+    case KReportSectionData::PageHeaderEven:
         sec = m_pageHeaderEven;
         break;
-    case KRSectionData::PageHeaderOdd:
+    case KReportSectionData::PageHeaderOdd:
         sec = m_pageHeaderOdd;
         break;
-    case KRSectionData::PageHeaderFirst:
+    case KReportSectionData::PageHeaderFirst:
         sec = m_pageHeaderFirst;
         break;
-    case KRSectionData::PageHeaderLast:
+    case KReportSectionData::PageHeaderLast:
         sec = m_pageHeaderLast;
         break;
-    case KRSectionData::PageFooterAny:
+    case KReportSectionData::PageFooterAny:
         sec = m_pageFooterAny;
         break;
-    case KRSectionData::PageFooterEven:
+    case KReportSectionData::PageFooterEven:
         sec = m_pageFooterEven;
         break;
-    case KRSectionData::PageFooterOdd:
+    case KReportSectionData::PageFooterOdd:
         sec = m_pageFooterOdd;
         break;
-    case KRSectionData::PageFooterFirst:
+    case KReportSectionData::PageFooterFirst:
         sec = m_pageFooterFirst;
         break;
-    case KRSectionData::PageFooterLast:
+    case KReportSectionData::PageFooterLast:
         sec = m_pageFooterLast;
         break;
-    case KRSectionData::ReportHeader:
+    case KReportSectionData::ReportHeader:
         sec = m_reportHeader;
         break;
-    case KRSectionData::ReportFooter:
+    case KReportSectionData::ReportFooter:
         sec = m_reportFooter;
         break;
     default:
         sec = 0;
     }
     return sec;
 }
 
-ReportPageOptions KoReportReportData::pageOptions() const
+KReportPageOptions KReportDocument::pageOptions() const
 {
     return page;
 }
diff --git a/src/common/krreportdata.h b/src/common/KReportDocument.h
similarity index 59%
rename from src/common/krreportdata.h
rename to src/common/KReportDocument.h
index d25c421e..25fcb021 100644
--- a/src/common/krreportdata.h
+++ b/src/common/KReportDocument.h
@@ -1,146 +1,146 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#ifndef KRREPORTDATA_H
-#define KRREPORTDATA_H
+#ifndef KREPORTSCHEMADATA_H
+#define KREPORTSCHEMADATA_H
 
 #include "config-kreport.h"
 #include "kreport_export.h"
-#include "krsectiondata.h"
-#include "reportpageoptions.h"
+#include "KReportSectionData.h"
+#include "KReportPageOptions.h"
 
-class KRDetailSectionData;
+class KReportDetailSectionData;
 
 #ifdef KREPORT_SCRIPTING
 namespace Scripting
 {
 class Report;
 }
 #endif
 
 /**
 */
-class KREPORT_EXPORT KoReportReportData : public QObject
+class KREPORT_EXPORT KReportDocument : public QObject
 {
     Q_OBJECT
 
 public:
-    explicit KoReportReportData(const QDomElement & elemSource, QObject *parent = 0);
-    explicit KoReportReportData(QObject *parent = 0);
-    ~KoReportReportData();
+    explicit KReportDocument(const QDomElement & elemSource, QObject *parent = 0);
+    explicit KReportDocument(QObject *parent = 0);
+    ~KReportDocument();
 
     bool isValid() const {
         return m_valid;
     }
 
     /**
     \return a list of all objects in the report
     */
-    QList objects() const;
+    QList objects() const;
 
     /**
     \return a report object given its name
     */
-    KoReportItemBase* object(const QString&) const;
+    KReportItemBase* object(const QString&) const;
 
     /**
     \return all the sections, including groups and detail
     */
-    QList sections() const;
+    QList sections() const;
 
     /**
     \return a sectiondata given a section enum
     */
-    KRSectionData* section(KRSectionData::Section) const;
+    KReportSectionData* section(KReportSectionData::Section) const;
 
     /**
     \return a sectiondata given its name
     */
-    KRSectionData* section(const QString&) const;
+    KReportSectionData* section(const QString&) const;
 
     QString query() const {
         return m_query;
     }
 #ifdef KREPORT_SCRIPTING
     QString script() const {
         return m_script;
     };
     QString interpreter() const {
         return m_interpreter;
     }
 #endif
 
     bool externalData() const {
         return m_externalData;
     }
 
-    KRDetailSectionData* detail() const {
+    KReportDetailSectionData* detail() const {
         return m_detailSection;
     }
 
     void setName(const QString&n) {
         m_name = n;
     }
     QString name() const {
         return m_name;
     }
 
-    ReportPageOptions pageOptions() const;
+    KReportPageOptions pageOptions() const;
 
 protected:
     QString m_title;
     QString m_name;
     QString m_query;
 #ifdef KREPORT_SCRIPTING
     QString m_script;
     QString m_interpreter;
 #endif
     bool m_externalData;
 
-    ReportPageOptions page;
+    KReportPageOptions page;
 
-    KRSectionData * m_pageHeaderFirst;
-    KRSectionData * m_pageHeaderOdd;
-    KRSectionData * m_pageHeaderEven;
-    KRSectionData * m_pageHeaderLast;
-    KRSectionData * m_pageHeaderAny;
+    KReportSectionData * m_pageHeaderFirst;
+    KReportSectionData * m_pageHeaderOdd;
+    KReportSectionData * m_pageHeaderEven;
+    KReportSectionData * m_pageHeaderLast;
+    KReportSectionData * m_pageHeaderAny;
 
-    KRSectionData * m_reportHeader;
-    KRSectionData * m_reportFooter;
+    KReportSectionData * m_reportHeader;
+    KReportSectionData * m_reportFooter;
 
-    KRSectionData * m_pageFooterFirst;
-    KRSectionData * m_pageFooterOdd;
-    KRSectionData * m_pageFooterEven;
-    KRSectionData * m_pageFooterLast;
-    KRSectionData * m_pageFooterAny;
+    KReportSectionData * m_pageFooterFirst;
+    KReportSectionData * m_pageFooterOdd;
+    KReportSectionData * m_pageFooterEven;
+    KReportSectionData * m_pageFooterLast;
+    KReportSectionData * m_pageFooterAny;
 
-    KRDetailSectionData* m_detailSection;
+    KReportDetailSectionData* m_detailSection;
 
 private:
     bool m_valid;
     void init();
 
-    friend class KoReportPreRendererPrivate;
-    friend class KoReportPreRenderer;
+    friend class KReportPreRendererPrivate;
+    friend class KReportPreRenderer;
 #ifdef KREPORT_SCRIPTING
-    friend class KRScriptHandler;
+    friend class KReportScriptHandler;
     friend class Scripting::Report;
 #endif
 };
 
 #endif
diff --git a/src/common/KoReportItemBase.cpp b/src/common/KReportItemBase.cpp
similarity index 58%
rename from src/common/KoReportItemBase.cpp
rename to src/common/KReportItemBase.cpp
index 7d37882d..2cfdc275 100644
--- a/src/common/KoReportItemBase.cpp
+++ b/src/common/KReportItemBase.cpp
@@ -1,119 +1,119 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "KoReportItemBase.h"
+#include "KReportItemBase.h"
 
-#include "krpos.h"
-#include "krsize.h"
+#include "KReportPosition.h"
+#include "KReportSize.h"
 #include "KReportUtils.h"
 #include 
 
-KoReportItemBase::KoReportItemBase()
+KReportItemBase::KReportItemBase()
 {
     Z = 0;
     m_name = new KProperty("name", QString(), tr("Name"), tr("Object Name"));
     m_name->setAutoSync(0);
 }
 
-KoReportItemBase::~KoReportItemBase() { }
+KReportItemBase::~KReportItemBase() { }
 
-void KoReportItemBase::addDefaultProperties()
+void KReportItemBase::addDefaultProperties()
 {
     m_set->addProperty(m_name);
     m_set->addProperty(m_pos.property());
     m_set->addProperty(m_size.property());
 }
 
-bool KoReportItemBase::parseReportTextStyleData(const QDomElement & elemSource, KRTextStyleData *ts)
+bool KReportItemBase::parseReportTextStyleData(const QDomElement & elemSource, KRTextStyleData *ts)
 {
     return KReportUtils::parseReportTextStyleData(elemSource, ts);
 }
 
-bool KoReportItemBase::parseReportLineStyleData(const QDomElement & elemSource, KRLineStyleData *ls)
+bool KReportItemBase::parseReportLineStyleData(const QDomElement & elemSource, KReportLineStyle *ls)
 {
     return KReportUtils::parseReportLineStyleData(elemSource, ls);
 }
 
 
-bool KoReportItemBase::parseReportRect(const QDomElement & elemSource, KRPos *pos, KRSize *size)
+bool KReportItemBase::parseReportRect(const QDomElement & elemSource, KReportPosition *pos, KReportSize *size)
 {
     return KReportUtils::parseReportRect(elemSource, pos, size);
 }
 
-void KoReportItemBase::setUnit(const KReportUnit& u)
+void KReportItemBase::setUnit(const KReportUnit& u)
 {
     m_pos.setUnit(u);
     m_size.setUnit(u);
 }
 
-int KoReportItemBase::renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset,
-                                       const QVariant &data, KRScriptHandler* script)
+int KReportItemBase::renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset,
+                                       const QVariant &data, KReportScriptHandler* script)
 {
     Q_UNUSED(page)
     Q_UNUSED(section)
     Q_UNUSED(offset)
     Q_UNUSED(data)
     Q_UNUSED(script)
     return 0;
 }
 
-int KoReportItemBase::renderReportData(OROPage *page, OROSection *section, const QPointF &offset,
-                                       KoReportData *data, KRScriptHandler* script)
+int KReportItemBase::renderReportData(OROPage *page, OROSection *section, const QPointF &offset,
+                                       KReportData *data, KReportScriptHandler* script)
 {
     Q_UNUSED(page)
     Q_UNUSED(section)
     Q_UNUSED(offset)
     Q_UNUSED(data)
     Q_UNUSED(script)
     return 0;
 }
 
-QString KoReportItemBase::itemDataSource() const
+QString KReportItemBase::itemDataSource() const
 {
     return QString();
 }
 
-KPropertySet* KoReportItemBase::propertySet() const
+KPropertySet* KReportItemBase::propertySet() const
 {
  return m_set;
 }
 
-bool KoReportItemBase::supportsSubQuery() const
+bool KReportItemBase::supportsSubQuery() const
 {
     return false;
 }
 
-QString KoReportItemBase::entityName() const
+QString KReportItemBase::entityName() const
 {
     return m_name->value().toString();
 }
 
-void KoReportItemBase::setEntityName(const QString& n)
+void KReportItemBase::setEntityName(const QString& n)
 {
     m_name->setValue(n);
 }
 
-KRPos KoReportItemBase::position() const
+KReportPosition KReportItemBase::position() const
 {
     return m_pos;
 }
 
-KRSize KoReportItemBase::size() const
+KReportSize KReportItemBase::size() const
 {
     return m_size;
 }
 
diff --git a/src/common/KoReportItemBase.h b/src/common/KReportItemBase.h
similarity index 78%
rename from src/common/KoReportItemBase.h
rename to src/common/KReportItemBase.h
index 67fb28a3..1fc4c3e2 100644
--- a/src/common/KoReportItemBase.h
+++ b/src/common/KReportItemBase.h
@@ -1,136 +1,138 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2010 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#ifndef KOREPORTITEMBASE_H
-#define KOREPORTITEMBASE_H
+#ifndef KREPORTITEMBASE_H
+#define KREPORTITEMBASE_H
 
 #include "config-kreport.h"
 #include "kreport_export.h"
-#include "krpos.h"
-#include "krsize.h"
+#include "KReportPosition.h"
+#include "KReportSize.h"
 
 #include 
 #include 
 #include 
 
 class OROPage;
 class OROSection;
-class KRSize;
-class KoReportData;
+class KReportSize;
+class KReportData;
+class KReportLineStyle;
 
 #ifdef KREPORT_SCRIPTING
-class KRScriptHandler;
+class KReportScriptHandler;
 #else
-#define KRScriptHandler void
+#define KReportScriptHandler void
 #endif
 
 class KProperty;
 class KPropertySet;
 
 class QDomElement;
 
 class KRTextStyleData
 {
 public:
     QFont font;
     Qt::Alignment alignment;
     QColor backgroundColor;
     QColor foregroundColor;
     int backgroundOpacity;
 
 };
 
-class KRLineStyleData
+/*
+class KReportLineStyle
 {
 public:
     int weight;
     QColor lineColor;
     Qt::PenStyle style;
 };
-
+*/
 
 /**
 */
-class KREPORT_EXPORT KoReportItemBase : public QObject
+class KREPORT_EXPORT KReportItemBase : public QObject
 {
     Q_OBJECT
 public:
 
-    KoReportItemBase();
-    virtual ~KoReportItemBase();
+    KReportItemBase();
+    virtual ~KReportItemBase();
 
     /**
     @brief Return the item type as a string.  Required by all items
     @return Item type
     */
     virtual QString typeName() const = 0;
 
     /**
     @brief Render the item into a primitive which is used by the second stage renderer
     @return the height required by the object
     */
-    virtual int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KRScriptHandler *script);
+    virtual int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KReportScriptHandler *script);
 
     /**
     @brief Render a complex item that uses a sub query as a data source
     @return the height required by the object
     */
-    virtual int renderReportData(OROPage *page, OROSection *section, const QPointF &offset, KoReportData *data, KRScriptHandler *script);
+    virtual int renderReportData(OROPage *page, OROSection *section, const QPointF &offset, KReportData *data, KReportScriptHandler *script);
 
     /**
     @brief Override if the item supports a simple data source, such as a field
     @return The field name or expression for the data source
     */
     virtual QString itemDataSource() const;
 
     /**
     @brief Override if the item uses a sub query and linked fields, such as a chart or sub-report
     @return True if uses a sub query
     */
     virtual bool supportsSubQuery() const;
 
     KPropertySet* propertySet() const;
 
     void setEntityName(const QString& n);
     QString entityName() const;
 
     virtual void setUnit(const KReportUnit& u);
 
-    KRPos position() const;
-    KRSize size() const;
+    KReportPosition position() const;
+    KReportSize size() const;
 
     qreal Z;
 protected:
     KPropertySet *m_set;
     KProperty *m_name;
-    KRPos m_pos;
-    KRSize m_size;
+    KReportPosition m_pos;
+    KReportSize m_size;
 
     QString m_oldName;
 
     void addDefaultProperties();
 
     virtual void createProperties() = 0;
 
-    static bool parseReportRect(const QDomElement &, KRPos *pos, KRSize *size);
+    static bool parseReportRect(const QDomElement &, KReportPosition *pos, KReportSize *size);
     static bool parseReportTextStyleData(const QDomElement &, KRTextStyleData*);
-    static bool parseReportLineStyleData(const QDomElement &, KRLineStyleData*);
+    static bool parseReportLineStyleData(const QDomElement &, KReportLineStyle*);
 
 
 };
 
 #endif
diff --git a/src/common/KoReportItemLine.cpp b/src/common/KReportItemLine.cpp
similarity index 75%
rename from src/common/KoReportItemLine.cpp
rename to src/common/KReportItemLine.cpp
index 90616195..76a22afe 100644
--- a/src/common/KoReportItemLine.cpp
+++ b/src/common/KReportItemLine.cpp
@@ -1,153 +1,154 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "KoReportItemLine.h"
-#include "renderobjects.h"
+#include "KReportItemLine.h"
+#include "KReportRenderObjects.h"
 #include "kreport_debug.h"
 
 #include 
 
 #include 
 
-KoReportItemLine::KoReportItemLine()
+KReportItemLine::KReportItemLine()
 {
     createProperties();
 }
 
-KoReportItemLine::KoReportItemLine(const QDomNode & element)
+KReportItemLine::KReportItemLine(const QDomNode & element)
 {
     createProperties();
     QDomNodeList nl = element.childNodes();
     QString n;
     QDomNode node;
     QPointF _s, _e;
 
     m_name->setValue(element.toElement().attribute(QLatin1String("report:name")));
     Z = element.toElement().attribute(QLatin1String("report:z-index")).toDouble();
 
     _s.setX(KReportUnit::parseValue(element.toElement().attribute(QLatin1String("svg:x1"), QLatin1String("1cm"))));
     _s.setY(KReportUnit::parseValue(element.toElement().attribute(QLatin1String("svg:y1"), QLatin1String("1cm"))));
     _e.setX(KReportUnit::parseValue(element.toElement().attribute(QLatin1String("svg:x2"), QLatin1String("1cm"))));
     _e.setY(KReportUnit::parseValue(element.toElement().attribute(QLatin1String("svg:y2"), QLatin1String("2cm"))));
     m_start.setPointPos(_s);
     m_end.setPointPos(_e);
 
     for (int i = 0; i < nl.count(); i++) {
         node = nl.item(i);
         n = node.nodeName();
 
         if (n == QLatin1String("report:line-style")) {
-            KRLineStyleData ls;
+            KReportLineStyle ls;
             if (parseReportLineStyleData(node.toElement(), &ls)) {
-                m_lineWeight->setValue(ls.weight);
-                m_lineColor->setValue(ls.lineColor);
-                m_lineStyle->setValue(int(ls.style));
+                m_lineWeight->setValue(ls.width());
+                m_lineColor->setValue(ls.color());
+                m_lineStyle->setValue(int(ls.penStyle()));
             }
         } else {
             kreportWarning() << "while parsing line element encountered unknow element: " << n;
         }
     }
 }
 
-KoReportItemLine::~KoReportItemLine()
+KReportItemLine::~KReportItemLine()
 {
     delete m_set;
 }
 
-void KoReportItemLine::createProperties()
+void KReportItemLine::createProperties()
 {
     m_set = new KPropertySet(0, QLatin1String("Line"));
 
     m_lineWeight = new KProperty("line-weight", 1, tr("Line Weight"));
     m_lineColor = new KProperty("line-color", QColor(Qt::black), tr("Line Color"));
     m_lineStyle = new KProperty("line-style", (int)Qt::SolidLine, tr("Line Style"), tr("Line Style"), KProperty::LineStyle);
     m_start.setName(QLatin1String("Start"));
     m_end.setName(QLatin1String("End"));
 
     m_set->addProperty(m_name);
     m_set->addProperty(m_start.property());
     m_set->addProperty(m_end.property());
     m_set->addProperty(m_lineWeight);
     m_set->addProperty(m_lineColor);
     m_set->addProperty(m_lineStyle);
 }
 
-KRLineStyleData KoReportItemLine::lineStyle()
+KReportLineStyle KReportItemLine::lineStyle() const
 {
-    KRLineStyleData ls;
-    ls.weight = m_lineWeight->value().toInt();
-    ls.lineColor = m_lineColor->value().value();
-    ls.style = (Qt::PenStyle)m_lineStyle->value().toInt();
+    KReportLineStyle ls;
+    ls.setWidth(m_lineWeight->value().toInt());
+    ls.setColor(m_lineColor->value().value());
+    ls.setPenStyle((Qt::PenStyle)m_lineStyle->value().toInt());
     return ls;
 }
 
-unsigned int KoReportItemLine::weight() const
+int KReportItemLine::weight() const
 {
     return m_lineWeight->value().toInt();
 }
-void KoReportItemLine::setWeight(int w)
+
+void KReportItemLine::setWeight(int w)
 {
     m_lineWeight->setValue(w);
 }
 
-QString KoReportItemLine::typeName() const
+QString KReportItemLine::typeName() const
 {
     return QLatin1String("line");
 }
 
-int KoReportItemLine::renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset,
-                                       const QVariant &data, KRScriptHandler *script)
+int KReportItemLine::renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset,
+                                       const QVariant &data, KReportScriptHandler *script)
 {
     Q_UNUSED(script)
     Q_UNUSED(data)
 
     OROLine * ln = new OROLine();
     QPointF s = m_start.toScene();
     QPointF e = m_end.toScene();
 
     s += offset;
     e += offset;
 
     ln->setStartPoint(s);
     ln->setEndPoint(e);
     ln->setLineStyle(lineStyle());
     if (page) page->addPrimitive(ln);
 
     OROLine *l2 = dynamic_cast(ln->clone());
     l2->setStartPoint(m_start.toPoint());
     l2->setEndPoint(m_end.toPoint());
     if (section) section->addPrimitive(l2);
 
     return 0;
 }
 
-void KoReportItemLine::setUnit(const KReportUnit &u)
+void KReportItemLine::setUnit(const KReportUnit &u)
 {
     m_start.setUnit(u);
     m_end.setUnit(u);
 }
 
-KRPos KoReportItemLine::startPosition() const
+KReportPosition KReportItemLine::startPosition() const
 {
     return m_start;
 }
 
-KRPos KoReportItemLine::endPosition() const
+KReportPosition KReportItemLine::endPosition() const
 {
     return m_end;
 }
 
diff --git a/src/common/KoReportItemLine.h b/src/common/KReportItemLine.h
similarity index 69%
rename from src/common/KoReportItemLine.h
rename to src/common/KReportItemLine.h
index aac4ad4e..7a3c7363 100644
--- a/src/common/KoReportItemLine.h
+++ b/src/common/KReportItemLine.h
@@ -1,67 +1,67 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#ifndef KOREPORTITEMLINE_H
-#define KOREPORTITEMLINE_H
+#ifndef KREPORTITEMLINE_H
+#define KREPORTITEMLINE_H
 
-#include "KoReportItemBase.h"
-#include "krpos.h"
+#include "KReportItemBase.h"
+#include "KReportPosition.h"
 #include "kreport_export.h"
 
 class QDomNode;
 
 namespace Scripting
 {
 class Line;
 }
 
 /**
 */
-class KREPORT_EXPORT  KoReportItemLine : public KoReportItemBase
+class KREPORT_EXPORT  KReportItemLine : public KReportItemBase
 {
 Q_OBJECT
 public:
-    KoReportItemLine();
-    explicit KoReportItemLine(const QDomNode & element);
-    ~KoReportItemLine();
+    KReportItemLine();
+    explicit KReportItemLine(const QDomNode & element);
+    ~KReportItemLine();
 
     virtual QString typeName() const;
-    virtual int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KRScriptHandler *script);
+    virtual int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KReportScriptHandler *script);
 
     virtual void setUnit(const KReportUnit&);
 
-    KRPos startPosition() const;
-    KRPos endPosition() const;
+    KReportPosition startPosition() const;
+    KReportPosition endPosition() const;
 
 protected:
-    KRPos m_start;
-    KRPos m_end;
+    KReportPosition m_start;
+    KReportPosition m_end;
     KProperty *m_lineColor;
     KProperty *m_lineWeight;
     KProperty *m_lineStyle;
 
-    KRLineStyleData lineStyle();
-    unsigned int weight() const;
+    KReportLineStyle lineStyle() const;
+    int weight() const;
     void setWeight(int w);
 
 private:
     virtual void createProperties();
 
     friend class Scripting::Line;
 };
 
 #endif
diff --git a/src/common/labelsizeinfo.cpp b/src/common/KReportLabelSizeInfo.cpp
similarity index 62%
rename from src/common/labelsizeinfo.cpp
rename to src/common/KReportLabelSizeInfo.cpp
index 811fc122..39077db5 100644
--- a/src/common/labelsizeinfo.cpp
+++ b/src/common/KReportLabelSizeInfo.cpp
@@ -1,141 +1,141 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "labelsizeinfo.h"
+#include "KReportLabelSizeInfo.h"
 
-static LabelSizeInfo s_labels[] = {
+static KReportLabelSizeInfo s_labels[] = {
 //"LABEL_NAME","Paper Size","COLUMNS","ROWS","WIDTH","HEIGHT","STARTXOFFSET","STARTYOFFSET","HORIZONTALGAP","VERTICALGAP"
-    LabelSizeInfo("Avery 5263", "Letter", 2, 5, 400, 200, 25, 50, 0, 0),
-    LabelSizeInfo("Avery 5264", "Letter", 2, 3, 400, 333, 25, 75, 0, 0),
-    LabelSizeInfo("Avery 8460", "Letter", 3, 10, 262, 100, 32, 50, 0, 0),
-    LabelSizeInfo("CILS ALP1-9200-1", "Letter", 3, 7, 200, 100, 62, 62, 81, 50),
-    LabelSizeInfo()               // Null Label Size
+    KReportLabelSizeInfo("Avery 5263", "Letter", 2, 5, 400, 200, 25, 50, 0, 0),
+    KReportLabelSizeInfo("Avery 5264", "Letter", 2, 3, 400, 333, 25, 75, 0, 0),
+    KReportLabelSizeInfo("Avery 8460", "Letter", 3, 10, 262, 100, 32, 50, 0, 0),
+    KReportLabelSizeInfo("CILS ALP1-9200-1", "Letter", 3, 7, 200, 100, 62, 62, 81, 50),
+    KReportLabelSizeInfo()               // Null Label Size
 };
 
-LabelSizeInfo LabelSizeInfo::find(const QString & name)
+KReportLabelSizeInfo KReportLabelSizeInfo::find(const QString & name)
 {
     int i = 0;
     while (!s_labels[i].isNull() && s_labels[i].m_name != name)
         i++;
     return s_labels[i];
 }
 
-QStringList LabelSizeInfo::labelNames()
+QStringList KReportLabelSizeInfo::labelNames()
 {
     QStringList l;
     for (int i = 0; !s_labels[i].isNull(); i++)
         l.append(s_labels[i].m_name);
     return l;
 }
 
-LabelSizeInfo::LabelSizeInfo(const char *n, const char *p, int c,
+KReportLabelSizeInfo::KReportLabelSizeInfo(const char *n, const char *p, int c,
                              int r, int w, int h, int sx, int sy, int xg,
                              int yg)
 {
     m_name = QLatin1String(n);
     m_paper = QLatin1String(p);
 
     m_columns = c;
     m_rows = r;
 
     m_width = w;
     m_height = h;
 
     m_startx = sx;
     m_starty = sy;
 
     m_xgap = xg;
     m_ygap = yg;
 
     m_null = false;
 }
 
-LabelSizeInfo::LabelSizeInfo()
+KReportLabelSizeInfo::KReportLabelSizeInfo()
 {
     m_columns = 0;
     m_rows = 0;
 
     m_width = 0;
     m_height = 0;
 
     m_startx = 0;
     m_starty = 0;
 
     m_xgap = 0;
     m_ygap = 0;
 
     m_null = true;
 }
 
-LabelSizeInfo::~LabelSizeInfo()
+KReportLabelSizeInfo::~KReportLabelSizeInfo()
 {
 }
 
-QString LabelSizeInfo::name() const
+QString KReportLabelSizeInfo::name() const
 {
     return m_name;
 }
 
-QString LabelSizeInfo::paper() const
+QString KReportLabelSizeInfo::paper() const
 {
     return m_paper;
 }
 
-int LabelSizeInfo::columns() const
+int KReportLabelSizeInfo::columns() const
 {
     return m_columns;
 }
-int LabelSizeInfo::rows() const
+int KReportLabelSizeInfo::rows() const
 {
     return m_rows;
 }
 
-int LabelSizeInfo::width() const
+int KReportLabelSizeInfo::width() const
 {
     return m_width;
 }
 
-int LabelSizeInfo::height() const
+int KReportLabelSizeInfo::height() const
 {
     return m_height;
 }
 
-int LabelSizeInfo::startX() const
+int KReportLabelSizeInfo::startX() const
 {
     return m_startx;
 }
 
-int LabelSizeInfo::startY() const
+int KReportLabelSizeInfo::startY() const
 {
     return m_starty;
 }
 
-int LabelSizeInfo::xGap() const
+int KReportLabelSizeInfo::xGap() const
 {
     return m_xgap;
 }
 
-int LabelSizeInfo::yGap() const
+int KReportLabelSizeInfo::yGap() const
 {
     return m_ygap;
 }
 
-bool LabelSizeInfo::isNull() const
+bool KReportLabelSizeInfo::isNull() const
 {
     return m_null;
 }
diff --git a/src/common/labelsizeinfo.h b/src/common/KReportLabelSizeInfo.h
similarity index 84%
rename from src/common/labelsizeinfo.h
rename to src/common/KReportLabelSizeInfo.h
index f2279c24..45d0037d 100644
--- a/src/common/labelsizeinfo.h
+++ b/src/common/KReportLabelSizeInfo.h
@@ -1,70 +1,70 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
 #ifndef __LABELSIZEINFO_H__
 #define __LABELSIZEINFO_H__
 
 #include 
 
-class LabelSizeInfo
+class KReportLabelSizeInfo
 {
 public:
-    LabelSizeInfo(const char *n, const char *p, int c, int r, int w, int h, int sx, int sy, int xg, int yg);
-    LabelSizeInfo();
-    virtual ~LabelSizeInfo();
+    KReportLabelSizeInfo(const char *n, const char *p, int c, int r, int w, int h, int sx, int sy, int xg, int yg);
+    KReportLabelSizeInfo();
+    virtual ~KReportLabelSizeInfo();
 
     QString name() const;
     QString paper() const;
 
     int columns() const;
     int rows() const;
 
     int width() const;
     int height() const;
 
     int startX() const;
     int startY() const;
 
     int xGap() const;
     int yGap() const;
 
     bool isNull() const;
 
-    static LabelSizeInfo find(const QString &);
+    static KReportLabelSizeInfo find(const QString &);
     static QStringList labelNames();
 
 protected:
     QString m_name;
     QString m_paper;
 
     int m_columns;
     int m_rows;
 
     int m_width;
     int m_height;
 
     int m_startx;
     int m_starty;
 
     int m_xgap;
     int m_ygap;
 
     bool m_null;
 };
 
 #endif
diff --git a/src/common/reportpageoptions.cpp b/src/common/KReportPageOptions.cpp
similarity index 76%
rename from src/common/reportpageoptions.cpp
rename to src/common/KReportPageOptions.cpp
index d0814ee1..bc8d0985 100644
--- a/src/common/reportpageoptions.cpp
+++ b/src/common/KReportPageOptions.cpp
@@ -1,237 +1,237 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "reportpageoptions.h"
-#include "common/KReportPageFormat.h"
+#include "KReportPageOptions.h"
+#include "KReportPageFormat.h"
 #include "KReportUnit.h"
 #include 
 #include 
 
-ReportPageOptions::ReportPageOptions()
+KReportPageOptions::KReportPageOptions()
         : QObject(), m_pageSize(QLatin1String("Letter"))
 {
     m_marginTop = m_marginBottom = 1.0;
     m_marginLeft = m_marginRight = 1.0;
 
     m_orientation = Portrait;
 
     m_customWidth = 8.5;
     m_customHeight = 11.0;
 }
 
-ReportPageOptions::ReportPageOptions(const ReportPageOptions & rpo)
+KReportPageOptions::KReportPageOptions(const KReportPageOptions & rpo)
         : QObject()
 {
     m_marginTop = rpo.m_marginTop;
     m_marginBottom = rpo.m_marginBottom;
     m_marginLeft = rpo.m_marginLeft;
     m_marginRight = rpo.m_marginRight;
 
     m_pageSize = rpo.m_pageSize;
     m_customWidth = rpo.m_customWidth;
     m_customHeight = rpo.m_customHeight;
 
     m_orientation = rpo.m_orientation;
 
     m_labelType = rpo.m_labelType;
 }
 
-ReportPageOptions & ReportPageOptions::operator=(const ReportPageOptions & rpo)
+KReportPageOptions & KReportPageOptions::operator=(const KReportPageOptions & rpo)
 {
     m_marginTop = rpo.m_marginTop;
     m_marginBottom = rpo.m_marginBottom;
     m_marginLeft = rpo.m_marginLeft;
     m_marginRight = rpo.m_marginRight;
 
     m_pageSize = rpo.m_pageSize;
     m_customWidth = rpo.m_customWidth;
     m_customHeight = rpo.m_customHeight;
 
     m_orientation = rpo.m_orientation;
 
     m_labelType = rpo.m_labelType;
 
     return *this;
 }
 
-qreal ReportPageOptions::getMarginTop()
+qreal KReportPageOptions::getMarginTop()
 {
     return m_marginTop;
 }
 
-void ReportPageOptions::setMarginTop(qreal v)
+void KReportPageOptions::setMarginTop(qreal v)
 {
     if (m_marginTop == v)
         return;
 
     m_marginTop = v;
     emit pageOptionsChanged();
 }
 
-qreal ReportPageOptions::getMarginBottom()
+qreal KReportPageOptions::getMarginBottom()
 {
     return m_marginBottom;
 }
 
-void ReportPageOptions::setMarginBottom(qreal v)
+void KReportPageOptions::setMarginBottom(qreal v)
 {
     if (m_marginBottom == v)
         return;
 
     m_marginBottom = v;
     emit pageOptionsChanged();
 }
 
-qreal ReportPageOptions::getMarginLeft()
+qreal KReportPageOptions::getMarginLeft()
 {
     return m_marginLeft;
 }
 
-void ReportPageOptions::setMarginLeft(qreal v)
+void KReportPageOptions::setMarginLeft(qreal v)
 {
     if (m_marginLeft == v)
         return;
 
     m_marginLeft = v;
     emit pageOptionsChanged();
 }
 
-qreal ReportPageOptions::getMarginRight()
+qreal KReportPageOptions::getMarginRight()
 {
     return m_marginRight;
 }
 
-void ReportPageOptions::setMarginRight(qreal v)
+void KReportPageOptions::setMarginRight(qreal v)
 {
     if (m_marginRight == v)
         return;
 
     m_marginRight = v;
     emit pageOptionsChanged();
 }
 
-const QString & ReportPageOptions::getPageSize()
+const QString & KReportPageOptions::getPageSize()
 {
     return m_pageSize;
 }
-void ReportPageOptions::setPageSize(const QString & s)
+void KReportPageOptions::setPageSize(const QString & s)
 {
     if (m_pageSize == s)
         return;
 
     m_pageSize = s;
     emit pageOptionsChanged();
 }
-qreal ReportPageOptions::getCustomWidth()
+qreal KReportPageOptions::getCustomWidth()
 {
     return m_customWidth;
 }
-void ReportPageOptions::setCustomWidth(qreal v)
+void KReportPageOptions::setCustomWidth(qreal v)
 {
     if (m_customWidth == v)
         return;
 
     m_customWidth = v;
     emit pageOptionsChanged();
 }
-qreal ReportPageOptions::getCustomHeight()
+qreal KReportPageOptions::getCustomHeight()
 {
     return m_customHeight;
 }
-void ReportPageOptions::setCustomHeight(qreal v)
+void KReportPageOptions::setCustomHeight(qreal v)
 {
     if (m_customHeight == v)
         return;
 
     m_customHeight = v;
     emit pageOptionsChanged();
 }
 
-ReportPageOptions::PageOrientation ReportPageOptions::getOrientation()
+KReportPageOptions::PageOrientation KReportPageOptions::getOrientation()
 {
     return m_orientation;
 }
 
-bool ReportPageOptions::isPortrait()
+bool KReportPageOptions::isPortrait()
 {
     return (m_orientation == Portrait);
 }
 
-void ReportPageOptions::setOrientation(PageOrientation o)
+void KReportPageOptions::setOrientation(PageOrientation o)
 {
     if (m_orientation == o)
         return;
 
     m_orientation = o;
     emit pageOptionsChanged();
 }
-void ReportPageOptions::setPortrait(bool yes)
+void KReportPageOptions::setPortrait(bool yes)
 {
     setOrientation((yes ? Portrait : Landscape));
 }
 
-const QString & ReportPageOptions::getLabelType()
+const QString & KReportPageOptions::getLabelType()
 {
     return m_labelType;
 }
-void ReportPageOptions::setLabelType(const QString & type)
+void KReportPageOptions::setLabelType(const QString & type)
 {
     if (m_labelType == type)
         return;
 
     m_labelType = type;
     emit pageOptionsChanged();
 }
 
 //Convenience functions that return the page width/height in pixels based on the DPI
-qreal ReportPageOptions::widthPx()
+qreal KReportPageOptions::widthPx()
 {
     int pageWidth;
 
     if (isPortrait()) {
         pageWidth = KReportPageFormat::width(KReportPageFormat::formatFromString(getPageSize()), KReportPageFormat::Portrait);
     } else {
         pageWidth = KReportPageFormat::width(KReportPageFormat::formatFromString(getPageSize()), KReportPageFormat::Landscape);
     }
 
     KReportUnit pageUnit(KReportUnit::Millimeter);
     QScreen *srn = QApplication::screens().at(0);
 
     pageWidth = KReportUnit::toInch(pageUnit.fromUserValue(pageWidth)) * srn->logicalDotsPerInchX();
 
     return pageWidth;
 }
 
-qreal ReportPageOptions::heightPx()
+qreal KReportPageOptions::heightPx()
 {
     int pageHeight;
 
     if (isPortrait()) {
         pageHeight = KReportPageFormat::height(KReportPageFormat::formatFromString(getPageSize()), KReportPageFormat::Portrait);
     } else {
         pageHeight = KReportPageFormat::height(KReportPageFormat::formatFromString(getPageSize()), KReportPageFormat::Landscape);
     }
 
     KReportUnit pageUnit(KReportUnit::Millimeter);
     QScreen *srn = QApplication::screens().at(0);
 
     pageHeight = KReportUnit::toInch(pageUnit.fromUserValue(pageHeight)) * srn->logicalDotsPerInchY();
 
     return pageHeight;
 }
 
diff --git a/src/common/reportpageoptions.h b/src/common/KReportPageOptions.h
similarity index 88%
rename from src/common/reportpageoptions.h
rename to src/common/KReportPageOptions.h
index f38d0ade..79e2c684 100644
--- a/src/common/reportpageoptions.h
+++ b/src/common/KReportPageOptions.h
@@ -1,86 +1,86 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#ifndef __REPORTPAGEOPTIONS_H__
-#define __REPORTPAGEOPTIONS_H__
+#ifndef KREPORTPAGEOPTIONS_H
+#define KREPORTPAGEOPTIONS_H
 
 #include 
 #include 
 
 #include "kreport_export.h"
 
-class KREPORT_EXPORT ReportPageOptions : public QObject
+class KREPORT_EXPORT KReportPageOptions : public QObject
 {
     Q_OBJECT
 public:
-    ReportPageOptions();
-    ReportPageOptions(const ReportPageOptions &);
+    KReportPageOptions();
+    KReportPageOptions(const KReportPageOptions &);
 
-    ReportPageOptions & operator=(const ReportPageOptions &);
+    KReportPageOptions & operator=(const KReportPageOptions &);
 
     enum PageOrientation {
         Landscape = 0, // essentially false
         Portrait = 1   // and true
     };
 
     qreal getMarginTop();
     void setMarginTop(qreal v);
     qreal getMarginBottom();
     void setMarginBottom(qreal v);
     qreal getMarginLeft();
     void setMarginLeft(qreal v);
     qreal getMarginRight();
     void setMarginRight(qreal v);
 
     qreal widthPx();
     qreal heightPx();
 
     const QString & getPageSize();
     void setPageSize(const QString & s);
     qreal getCustomWidth();
     void setCustomWidth(qreal v);
     qreal getCustomHeight();
     void setCustomHeight(qreal v);
 
     PageOrientation getOrientation();
     bool isPortrait();
     void setOrientation(PageOrientation o);
     void setPortrait(bool yes);
 
     void setLabelType(const QString &);
     const QString & getLabelType();
 
 Q_SIGNALS:
     void pageOptionsChanged();
 
 private:
     qreal m_marginTop;
     qreal m_marginBottom;
     qreal m_marginLeft;
     qreal m_marginRight;
 
     QString m_pageSize;
     qreal m_customWidth;
     qreal m_customHeight;
 
     PageOrientation m_orientation;
 
     QString m_labelType;
 };
 
 #endif
diff --git a/src/common/KoReportPluginInterface.cpp b/src/common/KReportPluginInterface.cpp
similarity index 80%
rename from src/common/KoReportPluginInterface.cpp
rename to src/common/KReportPluginInterface.cpp
index 82b112a3..aff8e87c 100644
--- a/src/common/KoReportPluginInterface.cpp
+++ b/src/common/KReportPluginInterface.cpp
@@ -1,73 +1,73 @@
 /* This file is part of the KDE project
    Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
    Copyright (C) 2015 Jarosław Staniek 
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
 */
 
-#include "KoReportPluginInterface.h"
+#include "KReportPluginInterface.h"
 #include "KReportPluginMetaData.h"
 #include "KReportUtils.h"
 #include "kreport_debug.h"
 
 #include 
 
-class KoReportPluginInterface::Private
+class KReportPluginInterface::Private
 {
 public:
     Private() : metaData(0) {}
     ~Private() {}
 
     const KReportPluginMetaData *metaData;
 };
 
 // ---
 
-KoReportPluginInterface::KoReportPluginInterface(QObject* parent, const QVariantList& args)
+KReportPluginInterface::KReportPluginInterface(QObject* parent, const QVariantList& args)
  : QObject(parent), d(new Private)
 {
     Q_UNUSED(args);
 }
 
-KoReportPluginInterface::~KoReportPluginInterface()
+KReportPluginInterface::~KReportPluginInterface()
 {
     delete d;
 }
 
-const KReportPluginMetaData* KoReportPluginInterface::metaData() const
+const KReportPluginMetaData* KReportPluginInterface::metaData() const
 {
     return d->metaData;
 }
 
-void KoReportPluginInterface::setMetaData(KReportPluginMetaData* metaData)
+void KReportPluginInterface::setMetaData(KReportPluginMetaData* metaData)
 {
     d->metaData = metaData;
 }
 
-bool KoReportPluginInterface::loadElement(KReportElement *el, const QDomElement &dom, KReportDesignReadingStatus *status)
+bool KReportPluginInterface::loadElement(KReportElement *el, const QDomElement &dom, KReportDesignReadingStatus *status)
 {
     Q_ASSERT(el);
     Q_UNUSED(status);
     el->setName(KReportUtils::attr(dom, "report:name", QString()));
     el->setRect(KReportUtils::readRectAttributes(dom, el->rect()));
     el->setZ(KReportUtils::attr(dom, "report:z-index", el->z()));
 
     const QDomElement textStyleDom = dom.firstChildElement(QLatin1String("report:text-style"));
     el->setForegroundColor(KReportUtils::attr(textStyleDom, "fo:foreground-color", el->foregroundColor()));
     el->setBackgroundColor(KReportUtils::attr(textStyleDom, "fo:background-color", el->backgroundColor()));
     el->setBackgroundOpacity(KReportUtils::attrPercent(textStyleDom, "fo:background-opacity", el->backgroundOpacity()));
     return true;
 }
diff --git a/src/common/KoReportPluginInterface.h b/src/common/KReportPluginInterface.h
similarity index 84%
rename from src/common/KoReportPluginInterface.h
rename to src/common/KReportPluginInterface.h
index a9fe72de..25e463ba 100644
--- a/src/common/KoReportPluginInterface.h
+++ b/src/common/KReportPluginInterface.h
@@ -1,80 +1,80 @@
 /* This file is part of the KDE project
    Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
    Copyright (C) 2015 Jarosław Staniek 
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
 */
 
 #ifndef KREPORTPLUGININTERFACE_H
 #define KREPORTPLUGININTERFACE_H
 
 #include "config-kreport.h"
 #include "kreport_export.h"
 #include "KReportElement.h"
 
 #include 
 
 class QGraphicsScene;
 class QDomNode;
 class QDomElement;
 class KReportPluginMetaData;
 class KReportDesignReadingStatus;
-class KoReportDesigner;
-class KoReportItemBase;
+class KReportDesigner;
+class KReportItemBase;
 
 //! Implementation of report plugin's entry point
 #define KREPORT_PLUGIN_FACTORY(class_name, name) \
     K_PLUGIN_FACTORY_WITH_JSON(class_name ## Factory, name, registerPlugin();)
 
 //! An interface for plugins delivering KReport elements
-class KREPORT_EXPORT KoReportPluginInterface : public QObject
+class KREPORT_EXPORT KReportPluginInterface : public QObject
 {
     Q_OBJECT
 public:
-    explicit KoReportPluginInterface(QObject *parent = 0,
+    explicit KReportPluginInterface(QObject *parent = 0,
                                      const QVariantList &args = QVariantList());
 
-    virtual ~KoReportPluginInterface();
+    virtual ~KReportPluginInterface();
 
-    virtual QObject* createDesignerInstance(KoReportDesigner *designer, QGraphicsScene * scene,
+    virtual QObject* createDesignerInstance(KReportDesigner *designer, QGraphicsScene * scene,
                                             const QPointF &pos) = 0;
 
-    virtual QObject* createDesignerInstance(const QDomNode &element, KoReportDesigner *designer,
+    virtual QObject* createDesignerInstance(const QDomNode &element, KReportDesigner *designer,
                                             QGraphicsScene *scene) = 0;
 
     virtual QObject* createRendererInstance(const QDomNode &element) = 0;
 
     virtual KReportElement createElement() { return KReportElement(); } //!< @todo remove {}
 
     virtual bool loadElement(KReportElement *el, const QDomElement &dom, KReportDesignReadingStatus *status);
 
 #ifdef KREPORT_SCRIPTING
-    virtual QObject* createScriptInstance(KoReportItemBase* item) = 0;
+    virtual QObject* createScriptInstance(KReportItemBase* item) = 0;
 #endif
 
     //! @return information about the plugin
     const KReportPluginMetaData* metaData() const;
 
 private:
     friend class KReportPluginEntry;
     void setMetaData(KReportPluginMetaData* metaData);
 
-    Q_DISABLE_COPY(KoReportPluginInterface)
+    Q_DISABLE_COPY(KReportPluginInterface)
     class Private;
     Private * const d;
 };
 
 #endif // KREPORTPLUGININTERFACE_H
diff --git a/src/common/KoReportPluginManager.cpp b/src/common/KReportPluginManager.cpp
similarity index 79%
rename from src/common/KoReportPluginManager.cpp
rename to src/common/KReportPluginManager.cpp
index a362d564..c491be22 100644
--- a/src/common/KoReportPluginManager.cpp
+++ b/src/common/KReportPluginManager.cpp
@@ -1,303 +1,303 @@
 /* This file is part of the KDE project
    Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
    Copyright (C) 2015 Jarosław Staniek 
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
 */
 
-#include "KoReportPluginManager.h"
-#include "KoReportPluginManagerPrivate.h"
+#include "KReportPluginManager.h"
+#include "KReportPluginManagerPrivate.h"
 #include "KReportPluginMetaData.h"
 #include "KReportJsonTrader_p.h"
 
 #include "kreport_debug.h"
 #include 
 
 //Include the static items
-#include "../items/label/KoReportLabelPlugin.h"
-#include "../items/check/KoReportCheckPlugin.h"
-#include "../items/field/KoReportFieldPlugin.h"
-#include "../items/image/KoReportImagePlugin.h"
-#include "../items/text/KoReportTextPlugin.h"
+#include "../items/label/KReportLabelPlugin.h"
+#include "../items/check/KReportCheckBoxPlugin.h"
+#include "../items/field/KReportFieldPlugin.h"
+#include "../items/image/KReportImagePlugin.h"
+#include "../items/text/KReportTextPlugin.h"
 
-KoReportPluginManager::Private::Private(KoReportPluginManager *qq)
+KReportPluginManager::Private::Private(KReportPluginManager *qq)
     : q(qq), m_parent(new QObject), m_findPlugins(true)
 {
     Q_UNUSED(q);
 }
 
 // ---
 
 KReportPluginEntry::KReportPluginEntry()
     : m_loader(0), m_interface(0), m_metaData(0)
 {
 }
 
-KReportPluginEntry::KReportPluginEntry(KoReportPluginInterface *staticInterface)
+KReportPluginEntry::KReportPluginEntry(KReportPluginInterface *staticInterface)
     : m_loader(0), m_interface(staticInterface), m_metaData(0)
 {
 }
 
 KReportPluginEntry::~KReportPluginEntry()
 {
     delete m_metaData;
     delete m_interface;
 }
 
-KoReportPluginInterface* KReportPluginEntry::plugin()
+KReportPluginInterface* KReportPluginEntry::plugin()
 {
     if (m_interface) {
         return m_interface;
     }
     if (!m_loader) {
         kreportWarning() << "No such plugin";
         return 0;
     }
     if (!m_loader->load()) {
         kreportWarning() << "Could not load plugin" << m_loader->fileName();
         return 0;
     }
     KPluginFactory *factory = qobject_cast(m_loader->instance());
     if (!factory) {
         kreportWarning() << "Could not create factory for plugin" << m_loader->fileName();
         return 0;
     }
-    m_interface = factory->create();
+    m_interface = factory->create();
     if (!m_interface) {
         kreportWarning() << "Could not create instance of plugin" << m_loader->fileName();
         return 0;
     }
     m_interface->setMetaData(m_metaData);
     return m_interface;
 }
 
 void KReportPluginEntry::setBuiltIn(bool set)
 {
     m_metaData->setBuiltIn(set);
 }
 
 void KReportPluginEntry::setStatic(bool set)
 {
     m_metaData->setStatic(set);
 }
 
 const KReportPluginMetaData *KReportPluginEntry::metaData() const
 {
     return m_metaData;
 }
 
 void KReportPluginEntry::setMetaData(KReportPluginMetaData *metaData)
 {
     delete m_metaData;
     m_metaData = metaData;
     if (m_interface) {
         m_interface->setMetaData(m_metaData);
     }
 }
 
 void KReportPluginEntry::setMetaData(const QJsonObject &metaData)
 {
     setMetaData(new KReportPluginMetaData(metaData));
 }
 
 void KReportPluginEntry::setMetaData(QPluginLoader *loader)
 {
     m_loader = loader;
     setMetaData(new KReportPluginMetaData(*m_loader));
 }
 
 // ---
 
-KoReportPluginManager::Private::~Private()
+KReportPluginManager::Private::~Private()
 {
     delete m_parent;
 }
 
 template
-void KoReportPluginManager::Private::addBuiltInPlugin(const QJsonObject &json)
+void KReportPluginManager::Private::addBuiltInPlugin(const QJsonObject &json)
 {
     KReportPluginEntry *entry = new KReportPluginEntry(new PluginClass(m_parent));
     QJsonObject j = json.value(QLatin1String("MetaData")).toObject();
     kreportDebug() << j;
     entry->setMetaData(j);
     entry->setBuiltIn(true);
     if (entry->metaData()->id().isEmpty()) {
         kreportWarning() << "Plugin" << entry->metaData()->name() << "has no identifier so won't be added to manager";
         delete entry;
         return;
     }
     entry->setStatic(true);
     m_plugins.insert(entry->metaData()->id(), entry);
     m_pluginsByLegacyName.insert(entry->metaData()->value(QLatin1String("X-KDE-PluginInfo-LegacyName"), entry->metaData()->id()), entry);
 }
 
 #if 0
 //! Typedef of plugin version matching the one exported by KEXI_EXPORT_PLUGIN.
 typedef quint32 (*plugin_version_t)();
 
 loadPlugin(KService::Ptr service)
 {
     if (service.isNull()) {
         kreportWarning() << "No service specified";
         return;
     }
     kreportDebug() << "library:" << service->library();
     QPluginLoader loader(service->library());
     QLibrary lib(loader.fileName());
     plugin_version_t plugin_version_function = (plugin_version_t)lib.resolve("plugin_version");
     if (!plugin_version_function) {
         kreportWarning() << "Plugin version not found for" << service->name();
         return;
     }
     quint32 foundVersion = plugin_version_function();
     kreportDebug() << "foundVersion:" << d->foundVersion;
     QPointer factory = loader.factory();
     if (!d->factory) {
         kreportWarning() << "Failed to create instance of factory for plugin" << ptr->name();
         return;
     }
     QString pluginName;
     if (!pluginNameProperty.isEmpty()) {
         pluginName = ptr->property(pluginNameProperty).toString();
     }
 
     if (!factory())
         return 0;
-    KoReportPluginInterface* plugin = factory()->create(parent);
+    KReportPluginInterface* plugin = factory()->create(parent);
     if (plugin) {
         plugin->setObjectName(pluginName());
     }
     return plugin;
 #endif
 
 #define KREPORT_ADD_BUILTIN_PLUGIN(name) \
     addBuiltInPlugin(KREPORT_STATIC_PLUGIN_METADATA(name))
 
-QMap* KoReportPluginManager::Private::plugins()
+QMap* KReportPluginManager::Private::plugins()
 {
     if (m_findPlugins) {
         findPlugins();
     }
     return &m_plugins;
 }
 
-QMap* KoReportPluginManager::Private::pluginsByLegacyName()
+QMap* KReportPluginManager::Private::pluginsByLegacyName()
 {
     if (m_findPlugins) {
         findPlugins();
     }
     return &m_pluginsByLegacyName;
 }
 
-void KoReportPluginManager::Private::findPlugins()
+void KReportPluginManager::Private::findPlugins()
 {
-    KREPORT_ADD_BUILTIN_PLUGIN(KoReportLabelPlugin);
-    KREPORT_ADD_BUILTIN_PLUGIN(KoReportCheckPlugin);
-    KREPORT_ADD_BUILTIN_PLUGIN(KoReportFieldPlugin);
-    KREPORT_ADD_BUILTIN_PLUGIN(KoReportImagePlugin);
-    KREPORT_ADD_BUILTIN_PLUGIN(KoReportTextPlugin);
+    KREPORT_ADD_BUILTIN_PLUGIN(KReportLabelPlugin);
+    KREPORT_ADD_BUILTIN_PLUGIN(KReportCheckBoxPlugin);
+    KREPORT_ADD_BUILTIN_PLUGIN(KReportFieldPlugin);
+    KREPORT_ADD_BUILTIN_PLUGIN(KReportImagePlugin);
+    KREPORT_ADD_BUILTIN_PLUGIN(KReportTextPlugin);
 
     //kreportDebug() << "Load all plugins";
     const QList offers = KReportJsonTrader::self()->query(QLatin1String("KReport/Element"));
     foreach(QPluginLoader *loader, offers) {
         //QJsonObject json = loader->metaData();
         //kreportDebug() << json;
         //! @todo check version
         KReportPluginEntry *entry = new KReportPluginEntry;
         entry->setMetaData(loader);
         m_plugins.insert(entry->metaData()->id(), entry);
         if (entry->metaData()->id().startsWith(QLatin1String("org.kde.kreport"))) {
             m_pluginsByLegacyName.insert(entry->metaData()->value(QLatin1String("X-KDE-PluginInfo-LegacyName"), entry->metaData()->id()), entry);
         }
     }
     m_findPlugins = false;
 }
 
 // ---
 
-//! Class for access to KoReportPluginManager constructor
+//! Class for access to KReportPluginManager constructor
 class KReportPluginManagerSingleton
 {
 public:
-    KoReportPluginManager object;
+    KReportPluginManager object;
 };
 
 
-KoReportPluginManager::KoReportPluginManager()
+KReportPluginManager::KReportPluginManager()
     : d(new Private(this))
 {
 }
 
-KoReportPluginManager::~KoReportPluginManager()
+KReportPluginManager::~KReportPluginManager()
 {
     delete d;
 }
 
 Q_GLOBAL_STATIC(KReportPluginManagerSingleton, s_self)
 
-KoReportPluginManager* KoReportPluginManager::self()
+KReportPluginManager* KReportPluginManager::self()
 {
     return &s_self->object;
 }
 
-QStringList KoReportPluginManager::pluginIds() const
+QStringList KReportPluginManager::pluginIds() const
 {
     return d->plugins()->keys();
 }
 
-const KReportPluginMetaData *KoReportPluginManager::pluginMetaData(const QString& id) const
+const KReportPluginMetaData *KReportPluginManager::pluginMetaData(const QString& id) const
 {
     KReportPluginEntry *entry = d->plugins()->value(id);
     if (!entry) {
         return 0;
     }
     return entry->metaData();
 }
 
-KoReportPluginInterface* KoReportPluginManager::plugin(const QString& id) const
+KReportPluginInterface* KReportPluginManager::plugin(const QString& id) const
 {
     KReportPluginEntry *entry;
 
     entry = d->plugins()->value(id);
 
     if (!entry) {
         entry = d->pluginsByLegacyName()->value(id);
     }
 
     if (!entry) {
         return 0;
     }
     return entry->plugin();
 }
 
-QList KoReportPluginManager::actions()
+QList KReportPluginManager::actions()
 {
     const QMap *plugins = d->plugins();
     QList actList;
     foreach(KReportPluginEntry* plugin, *plugins) {
         const KReportPluginMetaData *metaData = plugin->metaData();
         if (metaData) {
             QAction *act = new QAction(QIcon::fromTheme(metaData->iconName()), metaData->name(), this);
             act->setObjectName(metaData->id());
             act->setCheckable(true);
 
             //Store the order priority in the user data field
             act->setData(metaData->priority());
             actList << act;
         }
     }
     return actList;
 }
diff --git a/src/common/KoReportPluginManager.h b/src/common/KReportPluginManager.h
similarity index 77%
rename from src/common/KoReportPluginManager.h
rename to src/common/KReportPluginManager.h
index b1f9b5f9..15c36d02 100644
--- a/src/common/KoReportPluginManager.h
+++ b/src/common/KReportPluginManager.h
@@ -1,64 +1,64 @@
 /* This file is part of the KDE project
    Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
    Copyright (C) 2015 Jarosław Staniek 
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
 */
 
-#ifndef KOREPORTPLUGINMANAGER_H
-#define KOREPORTPLUGINMANAGER_H
+#ifndef KREPORTPLUGINMANAGER_H
+#define KREPORTPLUGINMANAGER_H
 
 #include "config-kreport.h"
 #include "kreport_export.h"
 
 #include 
 #include 
 
 class KReportPluginMetaData;
-class KoReportPluginInterface;
+class KReportPluginInterface;
 
 class QStringList;
 class QAction;
 class QString;
 
-class KREPORT_EXPORT KoReportPluginManager : public QObject
+class KREPORT_EXPORT KReportPluginManager : public QObject
 {
     Q_OBJECT
     public:
-        static KoReportPluginManager* self();
+        static KReportPluginManager* self();
 
         QStringList pluginIds() const;
 
         const KReportPluginMetaData *pluginMetaData(const QString& id) const;
 
-        KoReportPluginInterface* plugin(const QString& id) const;
+        KReportPluginInterface* plugin(const QString& id) const;
 
         QList actions();
 
     private:
         // class for access to the constructor
         friend class KReportPluginManagerSingleton;
 
-        KoReportPluginManager();
+        KReportPluginManager();
 
-        ~KoReportPluginManager();
+        ~KReportPluginManager();
 
-        Q_DISABLE_COPY(KoReportPluginManager)
+        Q_DISABLE_COPY(KReportPluginManager)
         class Private;
         Private *const d;
 };
 
-#endif // KOREPORTPLUGINMANAGER_H
+#endif // KREPORTPLUGINMANAGER_H
diff --git a/src/common/KoReportPluginManagerPrivate.h b/src/common/KReportPluginManagerPrivate.h
similarity index 84%
rename from src/common/KoReportPluginManagerPrivate.h
rename to src/common/KReportPluginManagerPrivate.h
index 6787f129..8700993f 100644
--- a/src/common/KoReportPluginManagerPrivate.h
+++ b/src/common/KReportPluginManagerPrivate.h
@@ -1,93 +1,93 @@
 /* This file is part of the KDE project
    Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
    Copyright (C) 2015 Jarosław Staniek 
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
 */
 
-#ifndef KOREPORTPLUGINMANAGERP_H
-#define KOREPORTPLUGINMANAGERP_H
+#ifndef KREPORTPLUGINMANAGERP_H
+#define KREPORTPLUGINMANAGERP_H
 
 #include 
 #include 
 
 class QJsonObject;
-class KoReportPluginInterface;
-class KoReportPluginManager;
+class KReportPluginInterface;
+class KReportPluginManager;
 class KReportPluginMetaData;
 
 //! @internal A single entry for a built-in or dynamic item plugin
 class KReportPluginEntry
 {
 public:
     //! Used for dynamic plugins.
     KReportPluginEntry();
 
     //! Used for static plugins.
-    KReportPluginEntry(KoReportPluginInterface *staticInterface);
+    KReportPluginEntry(KReportPluginInterface *staticInterface);
 
     ~KReportPluginEntry();
 
-    KoReportPluginInterface* plugin();
+    KReportPluginInterface* plugin();
 
     void setBuiltIn(bool set);
 
     void setStatic(bool set);
 
     const KReportPluginMetaData *metaData() const;
 
     void setMetaData(const QJsonObject &metaData);
 
     void setMetaData(QPluginLoader *loader);
 
 private:
     void setMetaData(KReportPluginMetaData *metaData);
 
     QPluginLoader *m_loader;
 
-    KoReportPluginInterface *m_interface;
+    KReportPluginInterface *m_interface;
 
     //! Plugin info, owned.
     KReportPluginMetaData *m_metaData;
 };
 
 //! @internal
-class KoReportPluginManager::Private
+class KReportPluginManager::Private
 {
 public:
-    explicit Private(KoReportPluginManager *qq);
+    explicit Private(KReportPluginManager *qq);
     ~Private();
 
     QMap *plugins();
     QMap *pluginsByLegacyName();
 
     //! Add a built-in element plugins
     template
     void addBuiltInPlugin(const QJsonObject &json);
 
 private:
-    KoReportPluginManager *q;
+    KReportPluginManager *q;
     QObject *m_parent;
     bool m_findPlugins;
     void findPlugins();
 
     //! A map of name -> plugin instances
     QMap m_plugins;
     //! A map of legacy name -> plugin instances
     QMap m_pluginsByLegacyName;
 };
 
 #endif
diff --git a/src/common/KReportPluginMetaData.h b/src/common/KReportPluginMetaData.h
index fbea1106..0d6df8c5 100644
--- a/src/common/KReportPluginMetaData.h
+++ b/src/common/KReportPluginMetaData.h
@@ -1,63 +1,63 @@
 /* This file is part of the KDE project
    Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
    Copyright (C) 2015 Jarosław Staniek 
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
 */
 
-#ifndef KOREPORTPLUGININFO_H
-#define KOREPORTPLUGININFO_H
+#ifndef KREPORTPLUGININFO_H
+#define KREPORTPLUGININFO_H
 
 #include 
 
 #include "kreport_export.h"
 
 //! Information about a KReport plugin.
 class KREPORT_EXPORT KReportPluginMetaData : public KPluginMetaData
 {
 public:
     ~KReportPluginMetaData();
 
     //! @return internal name of the plugin, a shortcut of pluginId()
     QString id() const;
 
     //! @return priority of the plugin
     //! Useful for user interfaces such as tool boxes.
     int priority() const;
 
     //! @return true if this plugin is built-in, i.e. has been provided by the KReport
     //! framework itself, not by a plugin file.
     bool isBuiltIn() const;
 
     //! @return true if this plugin is static, i.e. is compiled-in.
     bool isStatic() const;
 
 protected:
     explicit KReportPluginMetaData(const QJsonObject &metaData);
     explicit KReportPluginMetaData(const QPluginLoader &loader);
 
     void setBuiltIn(bool set);
     void setStatic(bool set);
 
     friend class KReportPluginEntry;
 
 private:
     Q_DISABLE_COPY(KReportPluginMetaData)
     class Private;
     Private * const d;
 };
 
-#endif // KOREPORTPLUGININFO_H
+#endif // KREPORTPLUGININFO_H
diff --git a/src/common/krpos.cpp b/src/common/KReportPosition.cpp
similarity index 77%
rename from src/common/krpos.cpp
rename to src/common/KReportPosition.cpp
index ef98ed0b..4056a880 100644
--- a/src/common/krpos.cpp
+++ b/src/common/KReportPosition.cpp
@@ -1,105 +1,105 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  * Copyright (C) 2010 Jarosław Staniek 
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "krpos.h"
+#include "KReportPosition.h"
 
 #include 
 
 #include 
 #include 
 
-KRPos::KRPos(const KReportUnit& unit)
+KReportPosition::KReportPosition(const KReportUnit& unit)
 {
     m_unit = unit;
-    m_property = new KProperty("position", toScene(), QCoreApplication::translate("KRPos", "Position"));
+    m_property = new KProperty("position", toScene(), QCoreApplication::translate("KReportPosition", "Position"));
 }
 
-void KRPos::setName(const QString& name)
+void KReportPosition::setName(const QString& name)
 {
     m_property->setName(name.toLatin1());
     m_property->setCaption(name);
 }
 
-KRPos::~KRPos()
+KReportPosition::~KReportPosition()
 {
 }
 
-void KRPos::setScenePos(const QPointF& pos, UpdatePropertyFlag update)
+void KReportPosition::setScenePos(const QPointF& pos, UpdatePropertyFlag update)
 {
     QScreen *srn = QApplication::screens().at(0);
 
     const qreal x = INCH_TO_POINT(pos.x() / srn->logicalDotsPerInchX());
     const qreal y = INCH_TO_POINT(pos.y() / srn->logicalDotsPerInchY());
 
     m_pointPos.setX(x);
     m_pointPos.setY(y);
 
     if (update == UpdateProperty)
         m_property->setValue(toUnit());
 }
 
-void KRPos::setUnitPos(const QPointF& pos, UpdatePropertyFlag update)
+void KReportPosition::setUnitPos(const QPointF& pos, UpdatePropertyFlag update)
 {
     const qreal x = m_unit.fromUserValue(pos.x());
     const qreal y = m_unit.fromUserValue(pos.y());
 
     m_pointPos.setX(x);
     m_pointPos.setY(y);
 
     if (update == UpdateProperty)
         m_property->setValue(toUnit());
 }
 
-void KRPos::setPointPos(const QPointF& pos, UpdatePropertyFlag update)
+void KReportPosition::setPointPos(const QPointF& pos, UpdatePropertyFlag update)
 {
     m_pointPos.setX(pos.x());
     m_pointPos.setY(pos.y());
 
     if (update == UpdateProperty)
         m_property->setValue(toUnit());
 }
 
-void KRPos::setUnit(const KReportUnit& u)
+void KReportPosition::setUnit(const KReportUnit& u)
 {
     m_unit = u;
     m_property->setValue(toUnit());
 }
 
-QPointF KRPos::toPoint() const
+QPointF KReportPosition::toPoint() const
 {
     return m_pointPos;
 }
 
-QPointF KRPos::toScene() const
+QPointF KReportPosition::toScene() const
 {
     QScreen *srn = QApplication::screens().at(0);
 
     const qreal x = POINT_TO_INCH(m_pointPos.x()) * srn->logicalDotsPerInchX();
     const qreal y = POINT_TO_INCH(m_pointPos.y()) * srn->logicalDotsPerInchY();
 
     return QPointF(x, y);
 }
 
-QPointF KRPos::toUnit() const
+QPointF KReportPosition::toUnit() const
 {
     const qreal x = m_unit.toUserValue(m_pointPos.x());
     const qreal y = m_unit.toUserValue(m_pointPos.y());
 
     return QPointF(x, y);
 }
 
diff --git a/src/common/krpos.h b/src/common/KReportPosition.h
similarity index 91%
rename from src/common/krpos.h
rename to src/common/KReportPosition.h
index 23d1ce40..7f40869a 100644
--- a/src/common/krpos.h
+++ b/src/common/KReportPosition.h
@@ -1,61 +1,61 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  * Copyright (C) 2010 Jarosław Staniek 
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
 #ifndef KRPOS_H
 #define KRPOS_H
 
 #include 
 
 #include "kreport_export.h"
 #include "KReportUnit.h"
 
 class KProperty;
 
 /**
 */
-class KREPORT_EXPORT KRPos
+class KREPORT_EXPORT KReportPosition
 {
 public:
     enum UpdatePropertyFlag {
         UpdateProperty,
         DontUpdateProperty
     };
 
-    explicit KRPos(const KReportUnit& unit = KReportUnit(KReportUnit::Centimeter));
+    explicit KReportPosition(const KReportUnit& unit = KReportUnit(KReportUnit::Centimeter));
 
-    ~KRPos();
+    ~KReportPosition();
     QPointF toUnit() const;
     QPointF toPoint() const;
     QPointF toScene() const;
     void setScenePos(const QPointF&, UpdatePropertyFlag update = UpdateProperty);
     void setUnitPos(const QPointF&, UpdatePropertyFlag update = UpdateProperty);
     void setPointPos(const QPointF&, UpdatePropertyFlag update = UpdateProperty);
     void setUnit(const KReportUnit& unit);
     void setName(const QString& name);
     KReportUnit unit() const { return m_unit; }
 
     KProperty* property() const {
         return m_property;
     }
 private:
     QPointF m_pointPos;
     KReportUnit m_unit;
     KProperty* m_property;
 };
 
 #endif
diff --git a/src/common/renderobjects.cpp b/src/common/KReportRenderObjects.cpp
similarity index 96%
rename from src/common/renderobjects.cpp
rename to src/common/KReportRenderObjects.cpp
index ec6948c7..263c056f 100644
--- a/src/common/renderobjects.cpp
+++ b/src/common/KReportRenderObjects.cpp
@@ -1,513 +1,513 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
-#include "renderobjects.h"
+#include "KReportRenderObjects.h"
 
 #include "kreport_debug.h"
 
 //
 // ORODocument
 //
 ORODocument::ORODocument(const QString & pTitle)
         : m_title(pTitle)
 {
 }
 
 ORODocument::~ORODocument()
 {
     qDeleteAll(m_pages);
     m_pages.clear();
 
     qDeleteAll(m_sections);
     m_sections.clear();
 }
 
 void ORODocument::setTitle(const QString & pTitle)
 {
     m_title = pTitle;
 }
 
 OROPage* ORODocument::page(int pnum)
 {
     if (pnum >= 0 && pnum < m_pages.count()) {
         return m_pages.at(pnum);
     }
     return Q_NULLPTR;
 }
 
 void ORODocument::addPage(OROPage* p)
 {
     if (p == 0)
         return;
 
     // check that this page is not already in another document
 
     p->m_document = this;
     m_pages.append(p);
 }
 
 OROSection* ORODocument::section(int pnum)
 {
     return m_sections.at(pnum);
 }
 
 void ORODocument::addSection(OROSection* s)
 {
     if (s == 0)
         return;
 
     // check that this page is not already in another document
 
     s->m_document = this;
     m_sections.append(s);
 }
 
-void ORODocument::setPageOptions(const ReportPageOptions & options)
+void ORODocument::setPageOptions(const KReportPageOptions & options)
 {
     m_pageOptions = options;
 }
 
 void ORODocument::notifyChange(int pageNo)
 {
     emit(updated(pageNo));
 }
 
 //
 // OROPage
 //
 OROPage::OROPage(ORODocument * pDocument)
         : m_document(pDocument)
 {
 
 }
 
 OROPage::~OROPage()
 {
     if (m_document) {
         m_document->m_pages.removeOne(this);
         m_document = 0;
     }
 
     qDeleteAll(m_primitives);
     m_primitives.clear();
 }
 
 int OROPage::page() const
 {
     if (m_document) {
         for (int i = 0; i < m_document->m_pages.size(); i++) {
             if (m_document->m_pages.at(i) == this)
                 return i;
         }
     }
     return -1;
 }
 
 OROPrimitive* OROPage::primitive(int idx)
 {
     return m_primitives.at(idx);
 }
 
 void OROPage::addPrimitive(OROPrimitive* p, bool atBeginning, bool notify)
 {
     //kreportDebug() << "Adding primitive" << p->type() << "to page" << page();
     if (p == 0)
         return;
 
     // check that this primitve is not already in another page
 
     p->m_page = this;
     if (atBeginning) {
         m_primitives.prepend(p);
     } else {
         m_primitives.append(p);
     }
 
     if (notify) {
         document()->notifyChange(page());
     }
 }
 
 //
 // OROSection
 //
 OROSection::OROSection(ORODocument * pDocument)
         : m_document(pDocument)
 {
     m_height = 0;
     m_backgroundColor = Qt::white;
 }
 
 OROSection::~OROSection()
 {
     if (m_document) {
         m_document->m_sections.removeOne(this);
         m_document = 0;
     }
 
     qDeleteAll(m_primitives);
     m_primitives.clear();
 }
 
 OROPrimitive* OROSection::primitive(int idx)
 {
     return m_primitives.at(idx);
 }
 
 void OROSection::addPrimitive(OROPrimitive* p)
 {
     if (p == 0)
         return;
 
     m_primitives.append(p);
 }
 
 void OROSection::setHeight(int h)
 {
     m_height = h;
 }
 
 int OROSection::height()
 {
     return m_height;
 }
 
 void OROSection::setBackgroundColor(const QColor &c)
 {
     m_backgroundColor = c;
 }
 
 QColor OROSection::backgroundColor()
 {
     return m_backgroundColor;
 }
 
 void OROSection::sortPrimatives(Sort s)
 {
     if (s == SortX) {
         qSort(m_primitives.begin(), m_primitives.end(), xLessThan);
     }
 }
 
 bool OROSection::xLessThan(OROPrimitive* s1, OROPrimitive* s2)
 {
     return s1->position().x() < s2->position().x();
 }
 
 //
 // OROPrimitive
 //
 OROPrimitive::OROPrimitive(int pType)
         : m_type(pType)
 {
     m_page = 0;
 }
 
 OROPrimitive::~OROPrimitive()
 {
    if (m_page) {
         m_page->m_primitives.removeAt(m_page->m_primitives.indexOf(this));
         m_page = 0;
     }
 }
 
 void OROPrimitive::setPosition(const QPointF & p)
 {
     m_position = p;
 }
 
 void OROPrimitive::setSize(const QSizeF & s)
 {
     m_size = s;
 }
 
 //
 // OROTextBox
 //
 const int OROTextBox::TextBox = 1;
 OROTextBox::OROTextBox()
         : OROPrimitive(OROTextBox::TextBox)
 {
     m_flags = 0;
 
-    m_lineStyle.lineColor = Qt::black;
-    m_lineStyle.weight = 0;
-    m_lineStyle.style = Qt::NoPen;
+    m_lineStyle.setColor(Qt::black);
+    m_lineStyle.setWidth(0);
+    m_lineStyle.setPenStyle(Qt::NoPen);
 
     m_requiresPostProcessing = false;
 
     m_wordWrap = false;
     m_canGrow = false;
 }
 
 OROTextBox::~OROTextBox()
 {
 }
 
 void OROTextBox::setText(const QString & s)
 {
     m_text = s;
 }
 
 void OROTextBox::setTextStyle(const KRTextStyleData & ts)
 {
     m_textStyle = ts;
 }
 
-void OROTextBox::setLineStyle(const KRLineStyleData & ls)
+void OROTextBox::setLineStyle(const KReportLineStyle & ls)
 {
     m_lineStyle = ls;
 }
 
 void OROTextBox::setFont(const QFont & f)
 {
     m_textStyle.font = f;
 }
 
 void OROTextBox::setFlags(int f)
 {
     m_flags = f;
 }
 
 OROPrimitive* OROTextBox::clone()
 {
     OROTextBox *theClone = new OROTextBox();
     theClone->setSize(m_size);
     theClone->setPosition(m_position);
     theClone->setText(m_text);
     theClone->setTextStyle(m_textStyle);
     theClone->setLineStyle(m_lineStyle);
     theClone->setFlags(m_alignment);
     return theClone;
 }
 
 
 //
 // OROLine
 //
 const int OROLine::Line = 2;
 
 OROLine::OROLine()
         : OROPrimitive(OROLine::Line)
 {
 
 }
 
 OROLine::~OROLine()
 {
 }
 
 void OROLine::setStartPoint(const QPointF & p)
 {
     setPosition(p);
 }
 
 void OROLine::setEndPoint(const QPointF & p)
 {
     m_endPoint = p;
 }
 
-void OROLine::setLineStyle(const KRLineStyleData& ls)
+void OROLine::setLineStyle(const KReportLineStyle& ls)
 {
     m_lineStyle = ls;
 }
 
 
 OROPrimitive* OROLine::clone()
 {
     OROLine *theClone = new OROLine();
     theClone->setStartPoint(m_position);
     theClone->setEndPoint(m_endPoint);
     theClone->setLineStyle(m_lineStyle);
     return theClone;
 }
 
 //
 // OROImage
 //
 const int OROImage::Image = 3;
 
 OROImage::OROImage()
         : OROPrimitive(OROImage::Image)
 {
     m_scaled = false;
     m_transformFlags = Qt::FastTransformation;
     m_aspectFlags = Qt::IgnoreAspectRatio;
 }
 
 OROImage::~OROImage()
 {
 }
 
 void OROImage::setImage(const QImage & img)
 {
     m_image = img;
 }
 
 void OROImage::setScaled(bool b)
 {
     m_scaled = b;
 }
 
 void OROImage::setTransformationMode(int tm)
 {
     m_transformFlags = tm;
 }
 
 void OROImage::setAspectRatioMode(int arm)
 {
     m_aspectFlags = arm;
 }
 
 OROPrimitive* OROImage::clone()
 {
     OROImage *theClone = new OROImage();
     theClone->setSize(m_size);
     theClone->setPosition(m_position);
     theClone->setImage(m_image);
     theClone->setScaled(m_scaled);
     theClone->setTransformationMode(m_transformFlags);
     theClone->setAspectRatioMode(m_aspectFlags);
     return theClone;
 }
 
 //
 // OROPicture
 //
 const int OROPicture::Picture = 6;
 
 OROPicture::OROPicture()
         : OROPrimitive(OROPicture::Picture)
 {
 
 }
 
 OROPicture::~OROPicture()
 {
 }
 
 OROPrimitive* OROPicture::clone()
 {
     OROPicture *theClone = new OROPicture();
     theClone->setSize(m_size);
     theClone->setPosition(m_position);
     theClone->setPicture(m_picture);
     return theClone;
 }
 
 //
 // ORORect
 //
 const int ORORect::Rect = 4;
 
 ORORect::ORORect()
         : OROPrimitive(ORORect::Rect)
 {
 }
 
 ORORect::~ORORect()
 {
 }
 
 void ORORect::setRect(const QRectF & r)
 {
     setPosition(r.topLeft());
     setSize(r.size());
 }
 
 void ORORect::setPen(const QPen & p)
 {
     m_pen = p;
 }
 
 void ORORect::setBrush(const QBrush & b)
 {
     m_brush = b;
 }
 
 OROPrimitive* ORORect::clone()
 {
     ORORect *theClone = new ORORect();
     theClone->setSize(m_size);
     theClone->setPosition(m_position);
     theClone->setPen(m_pen);
     theClone->setBrush(m_brush);
     return theClone;
 }
 //
 // OROEllipse
 //
 const int OROEllipse::Ellipse = 5;
 
 OROEllipse::OROEllipse()
         : OROPrimitive(OROEllipse::Ellipse)
 {
 }
 
 OROEllipse::~OROEllipse()
 {
 }
 
 void OROEllipse::setRect(const QRectF & r)
 {
     setPosition(r.topLeft());
     setSize(r.size());
 }
 
 void OROEllipse::setPen(const QPen & p)
 {
     m_pen = p;
 }
 
 void OROEllipse::setBrush(const QBrush & b)
 {
     m_brush = b;
 }
 
 OROPrimitive* OROEllipse::clone()
 {
     OROEllipse *theClone = new OROEllipse();
     theClone->setSize(m_size);
     theClone->setPosition(m_position);
     theClone->setPen(m_pen);
     theClone->setBrush(m_brush);
     return theClone;
 }
 
 const int OROCheck::Check = 7;
 
 OROCheck::OROCheck()
         : OROPrimitive(OROCheck::Check)
 {
 
 }
 
 OROCheck::~OROCheck()
 {
 
 }
 
 OROPrimitive* OROCheck::clone()
 {
     OROCheck *theClone = new OROCheck();
     theClone->setSize(m_size);
     theClone->setPosition(m_position);
     theClone->setLineStyle(m_lineStyle);
     theClone->setForegroundColor(m_fgColor);
     theClone->setValue(m_value);
     return theClone;
 }
diff --git a/src/common/renderobjects.h b/src/common/KReportRenderObjects.h
similarity index 91%
rename from src/common/renderobjects.h
rename to src/common/KReportRenderObjects.h
index 44ab144d..2966219a 100644
--- a/src/common/renderobjects.h
+++ b/src/common/KReportRenderObjects.h
@@ -1,485 +1,487 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
-#ifndef __RENDEROBJECTS_H__
-#define __RENDEROBJECTS_H__
+#ifndef KREPORTRENDEROBJECTS_H
+#define KREPORTRENDEROBJECTS_H
 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 
-#include "reportpageoptions.h"
-#include "krreportdata.h"
-#include "KoReportItemBase.h"
+#include "KReportPageOptions.h"
+#include "KReportData.h"
+#include "KReportItemBase.h"
+#include "KReportSectionData.h"
+#include "KReportLineStyle.h"
 
 class ORODocument;
 class OROPage;
 class OROPrimitive;
 class OROTextBox;
 class OROLine;
 class OROImage;
 class OROSection;
 
 //
 // ORODocument
 // This object is a single document containing one or more OROPage elements
 //
 class KREPORT_EXPORT ORODocument : public QObject
 {
     Q_OBJECT
 
     friend class OROPage;
     friend class OROSection;
 
 public:
     explicit ORODocument(const QString & = QString());
     ~ORODocument();
 
     QString title() const {
         return m_title;
     };
     void setTitle(const QString &);
 
     int pages() const {
         return m_pages.count();
     };
     OROPage* page(int);
     void addPage(OROPage*);
 
     int sections() const {
         return m_sections.count();
     };
     OROSection* section(int);
     void addSection(OROSection*);
 
-    void setPageOptions(const ReportPageOptions &);
-    ReportPageOptions pageOptions() const {
+    void setPageOptions(const KReportPageOptions &);
+    KReportPageOptions pageOptions() const {
         return m_pageOptions;
     };
 
     void notifyChange(int pageNo);
 
 protected:
     QString m_title;
     QList m_pages;
     QList m_sections;
-    ReportPageOptions m_pageOptions;
+    KReportPageOptions m_pageOptions;
 
 Q_SIGNALS:
     void updated(int pageNo);
 };
 
 //
 // OROPage
 // This object is a single page in a document and may contain zero or more
 // OROPrimitive objects all of which represent some form of mark to made on
 // a page.
 //
 class KREPORT_EXPORT OROPage
 {
     friend class ORODocument;
     friend class OROPrimitive;
 
 public:
     explicit OROPage(ORODocument * = 0);
     ~OROPage();
 
     ORODocument* document() const {
         return m_document;
     };
     int page() const; // returns this pages current page number
 
     int primitives() const {
         return m_primitives.count();
     };
     OROPrimitive* primitive(int);
     void addPrimitive(OROPrimitive*, bool atBeginning = false, bool notify = false);
 
 protected:
     ORODocument * m_document;
     QList m_primitives;
 };
 //
 // OROSection
 // This object is a single row in a document and may contain zero or more
 // OROPrimitives
 //
 class KREPORT_EXPORT OROSection
 {
     friend class ORODocument;
     friend class OROPrimitive;
 
 public:
     enum Sort {
         SortX = 1,
         SortY,
         SortZ
     };
 
     explicit OROSection(ORODocument * = 0);
     ~OROSection();
 
     void setHeight(int);
     int height();
 
     void setBackgroundColor(const QColor&L);
     QColor backgroundColor();
 
     ORODocument* document() const {
         return m_document;
     };
 
-    void setType(KRSectionData::Section t) {
+    void setType(KReportSectionData::Section t) {
         m_type = t;
     }
-    KRSectionData::Section type() {
+    KReportSectionData::Section type() {
         return m_type;
     }
 
     int primitives() const {
         return m_primitives.count();
     };
     OROPrimitive* primitive(int);
     void addPrimitive(OROPrimitive*);
 
     void sortPrimatives(Sort);
 protected:
     ORODocument * m_document;
     QList m_primitives;
     long m_row;
     int m_height;
-    KRSectionData::Section m_type;
+    KReportSectionData::Section m_type;
     QColor m_backgroundColor;
 
 private:
     static bool xLessThan(OROPrimitive* s1, OROPrimitive* s2);
 };
 
 
 //
 // OROPrimitive
 // This object represents the basic primitive with a position and type.
 // Other primitives are subclasses with a defined type and any additional
 // information they require to define that primitive.
 //
 class KREPORT_EXPORT OROPrimitive
 {
     friend class OROPage;
 
 public:
     virtual ~OROPrimitive();
 
     // Returns the type of the primitive which should be
     // set by the subclass
     int type() const {
         return m_type;
     };
     OROPage * page() const {
         return m_page;
     };
 
     QPointF position() const {
         return m_position;
     };
     void setPosition(const QPointF &);
     QSizeF size() const { return m_size; }
     void setSize(const QSizeF &s);
 
     virtual OROPrimitive* clone() = 0;
 
 protected:
     OROPrimitive(int);
 
     OROPage * m_page;
     int m_type;
     QPointF m_position;
     QSizeF m_size;
 };
 
 //
 // OROTextBox
 // This is a text box primitive it defines a box region and text that will
 // be rendered inside that region. It also contains information for font
 // and positioning of the text.
 //
 class KREPORT_EXPORT OROTextBox : public OROPrimitive
 {
 public:
     OROTextBox();
     virtual ~OROTextBox();
 
     QString text() const {
         return m_text;
     };
     void setText(const QString &);
 
     KRTextStyleData textStyle() const {
         return m_textStyle;
     }
     void setTextStyle(const KRTextStyleData&);
 
-    KRLineStyleData lineStyle() const {
+    KReportLineStyle lineStyle() const {
         return m_lineStyle;
     }
-    void setLineStyle(const KRLineStyleData&);
+    void setLineStyle(const KReportLineStyle&);
 
     void setFont(const QFont &);
 
     int flags() const {
         return m_flags;
     };
     void setFlags(int);
 
     static const int TextBox;
 
     virtual OROPrimitive* clone();
 
     bool requiresPostProcessing(){return m_requiresPostProcessing;}
     void setRequiresPostProcessing(bool pp = true){m_requiresPostProcessing = pp;}
 
     bool wordWrap() const {return m_wordWrap;}
     void setWordWrap(bool ww){m_wordWrap = ww;}
 
     bool canGrow() const {return m_canGrow;}
     void setCanGrow(bool cg){m_canGrow = cg;}
 
 protected:
     QString m_text;
     KRTextStyleData m_textStyle;
-    KRLineStyleData m_lineStyle;
+    KReportLineStyle m_lineStyle;
     Qt::Alignment m_alignment;
     int m_flags; // Qt::AlignmentFlag and Qt::TextFlag OR'd
     bool m_wordWrap;
     bool m_canGrow;
     bool m_requiresPostProcessing;
 };
 
 //
 // OROLine
 // This primitive defines a line with a width/weight.
 //
 class KREPORT_EXPORT OROLine : public OROPrimitive
 {
 public:
     OROLine();
     virtual ~OROLine();
 
     QPointF startPoint() const {
         return position();
     };
     void setStartPoint(const QPointF &);
 
     QPointF endPoint() const {
         return m_endPoint;
     };
     void setEndPoint(const QPointF &);
 
-    KRLineStyleData lineStyle() const {
+    KReportLineStyle lineStyle() const {
         return m_lineStyle;
     };
-    void setLineStyle(const KRLineStyleData&);
+    void setLineStyle(const KReportLineStyle&);
 
     static const int Line;
     virtual OROPrimitive* clone();
 protected:
     QPointF m_endPoint;
-    KRLineStyleData m_lineStyle;
+    KReportLineStyle m_lineStyle;
 };
 
 //
 // OROImage
 // This primitive defines an image
 //
 class KREPORT_EXPORT OROImage: public OROPrimitive
 {
 public:
     OROImage();
     virtual ~OROImage();
 
     QImage image() const {
         return m_image;
     };
     void setImage(const QImage &);
 
     bool scaled() const {
         return m_scaled;
     };
     void setScaled(bool);
 
     int transformationMode() const {
         return m_transformFlags;
     };
     void setTransformationMode(int);
 
     int aspectRatioMode() const {
         return m_aspectFlags;
     };
     void setAspectRatioMode(int);
 
     static const int Image;
     virtual OROPrimitive* clone();
 
 protected:
     QImage m_image;
     bool m_scaled;
     int m_transformFlags;
     int m_aspectFlags;
 };
 
 class KREPORT_EXPORT OROPicture: public OROPrimitive
 {
 public:
     OROPicture();
     virtual ~OROPicture();
 
     void setPicture(const QPicture& p) {
         m_picture = p;
     }
     QPicture* picture() {
         return &m_picture;
     };
 
     static const int Picture;
     virtual OROPrimitive* clone();
 protected:
     QPicture m_picture;
 
 };
 //
 // ORORect
 // This primitive defines a drawn rectangle
 //
 class KREPORT_EXPORT ORORect: public OROPrimitive
 {
 public:
     ORORect();
     virtual ~ORORect();
 
     QRectF rect() const {
         return QRectF(m_position, m_size);
     };
     void setRect(const QRectF &);
 
     QPen pen() const {
         return m_pen;
     };
     void setPen(const QPen &);
 
     QBrush brush() const {
         return m_brush;
     };
     void setBrush(const QBrush &);
 
     static const int Rect;
     virtual OROPrimitive* clone();
 protected:
     QPen m_pen;
     QBrush m_brush;
 };
 
 //
 // ORORect
 // This primitive defines a drawn rectangle
 //
 class KREPORT_EXPORT OROEllipse: public OROPrimitive
 {
 public:
     OROEllipse();
     virtual ~OROEllipse();
 
     QRectF rect() const {
         return QRectF(m_position, m_size);
     };
     void setRect(const QRectF &);
 
     QPen pen() const {
         return m_pen;
     };
     void setPen(const QPen &);
 
     QBrush brush() const {
         return m_brush;
     };
     void setBrush(const QBrush &);
 
     static const int Ellipse;
     virtual OROPrimitive* clone();
 
 protected:
     QSizeF m_size;
     QPen m_pen;
     QBrush m_brush;
 };
 
 class KREPORT_EXPORT OROCheck : public OROPrimitive
 {
 public:
     OROCheck();
     virtual ~OROCheck();
     virtual OROPrimitive* clone();
     static const int Check;
 
     void setCheckType(const QString& t) {
         if (t == QLatin1String("Cross") || t == QLatin1String("Tick") || t == QLatin1String("Dot")) {
             m_checkType = t;
         } else {
             m_checkType = QLatin1String("Cross");
         }
     }
 
     QString checkType() const {
         return m_checkType;
     };
 
     void setValue(bool v) {
         m_value = v;
     }
     bool value() const {
         return m_value;
     }
 
-    void setLineStyle(const KRLineStyleData& ls) {
+    void setLineStyle(const KReportLineStyle& ls) {
         m_lineStyle = ls;
     }
 
-    KRLineStyleData lineStyle() const {
+    KReportLineStyle lineStyle() const {
         return m_lineStyle;
     }
     void setForegroundColor(const QColor& fg) {
         m_fgColor = fg;
     }
     QColor foregroundColor() const {
         return m_fgColor;
     }
 
 protected:
     QSizeF m_size;
     QString m_checkType;
     bool m_value;
-    KRLineStyleData m_lineStyle;
+    KReportLineStyle m_lineStyle;
     QColor m_fgColor;
 
 
 };
 
 #endif // __RENDEROBJECTS_H__
diff --git a/src/common/KReportSection.cpp b/src/common/KReportSection.cpp
index 3348f271..6f0de886 100644
--- a/src/common/KReportSection.cpp
+++ b/src/common/KReportSection.cpp
@@ -1,219 +1,219 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  * Copyright (C) 2010-2015 Jarosław Staniek 
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
 #include "KReportSection.h"
 #include "KReportDesign_p.h"
 
-#include "krreportdata.h"
-#include "KoReportPluginInterface.h"
-#include "KoReportPluginManager.h"
-#include "KoReportItemLine.h"
+#include "KReportDocument.h"
+#include "KReportPluginInterface.h"
+#include "KReportPluginManager.h"
+#include "KReportItemLine.h"
 #include "kreport_debug.h"
 
 #if 0
-KReportSection::KReportSection(const QDomElement & elemSource, KoReportReportData* report)
+KReportSection::KReportSection(const QDomElement & elemSource, KReportReportData* report)
  : QObject(report)
 {
     setObjectName(elemSource.tagName());
 
     if (objectName() != QLatin1String("report:section")) {
         m_valid = false;
         return;
     }
 
     m_type = sectionTypeFromString(elemSource.attribute(QLatin1String("report:section-type")));
     if (m_type == KReportSection::None) {
         m_valid = false;
         return;
     }
     createProperties(elemSource);
 
     m_backgroundColor->setValue(QColor(elemSource.attribute(QLatin1String("fo:background-color"))));
 
-    KoReportPluginManager* manager = KoReportPluginManager::self();
+    KReportPluginManager* manager = KReportPluginManager::self();
 
     QDomNodeList section = elemSource.childNodes();
     for (int nodeCounter = 0; nodeCounter < section.count(); nodeCounter++) {
         QDomElement elemThis = section.item(nodeCounter).toElement();
         QString n = elemThis.tagName();
         if (n.startsWith(QLatin1String("report:"))) {
             QString reportItemName = n.mid(qstrlen("report:"));
             if (reportItemName == QLatin1String("line")) {
-                KoReportItemLine * line = new KoReportItemLine(elemThis);
+                KReportItemLine * line = new KReportItemLine(elemThis);
                 m_objects.append(line);
                 continue;
             }
-            KoReportPluginInterface *plugin = manager->plugin(reportItemName);
+            KReportPluginInterface *plugin = manager->plugin(reportItemName);
             if (plugin) {
                 QObject *obj = plugin->createRendererInstance(elemThis);
                 if (obj) {
-                    KoReportItemBase *krobj = dynamic_cast(obj);
+                    KReportItemBase *krobj = dynamic_cast(obj);
                     if (krobj) {
                         m_objects.append(krobj);
                     }
                     continue;
                 }
             }
         }
         kreportWarning() << "While parsing section encountered an unknown element: " << n;
     }
     qSort(m_objects.begin(), m_objects.end(), zLessThan);
     m_valid = true;
 }
-bool KReportSection::zLessThan(KoReportItemBase* s1, KoReportItemBase* s2)
+bool KReportSection::zLessThan(KReportItemBase* s1, KReportItemBase* s2)
 {
     return s1->Z < s2->Z;
 }
 
-bool KReportSection::xLessThan(KoReportItemBase* s1, KoReportItemBase* s2)
+bool KReportSection::xLessThan(KReportItemBase* s1, KReportItemBase* s2)
 {
     return s1->position().toPoint().x() < s2->position().toPoint().x();
 }
 
 #endif
 
 KReportSection::~KReportSection()
 {
 }
 
 #if 0
 void KReportSection::createProperties(const QDomElement & elemSource)
 {
     m_set = new KPropertySet(/*this*/0, QLatin1String("Section"));
 
     m_height = new KProperty("height", KReportUnit(KReportUnit::Centimeter).fromUserValue(2.0), tr("Height"));
     m_backgroundColor = new KProperty("background-color", QColor(Qt::white), tr("Background Color"));
     m_height->setOption("unit", QLatin1String("cm"));
     if (!elemSource.isNull())
         m_height->setValue(KReportUnit::parseValue(elemSource.attribute(QLatin1String("svg:height"), QLatin1String("2.0cm"))));
 
     m_set->addProperty(m_height);
     m_set->addProperty(m_backgroundColor);
 }
 
 QString KReportSection::name() const
 {
     return (objectName() + QLatin1Char('-') + sectionTypeString(m_type));
 }
 #endif
 
 qreal KReportSection::height() const
 {
     return d->height >= 0.0 ? d->height : KReportSection::defaultHeight();
 }
 
 QColor KReportSection::backgroundColor() const
 {
     return d->backgroundColor.isValid() ? d->backgroundColor : KReportSection::defaultBackgroundColor();
 }
 
 QList KReportSection::elements() const
 {
     return d->elements;
 }
 
 bool KReportSection::addElement(const KReportElement &element)
 {
     if (d->elementsSet.contains(element)) {
         kreportWarning() << "Section already contains element" << element;
         return false;
     }
     d->elements.append(element);
     d->elementsSet.insert(element);
     return true;
 }
 
 bool KReportSection::insertElement(int i, const KReportElement &element)
 {
     if (i < 0 || i > d->elements.count()) {
         kreportWarning() << "Could not insert element at index" << i << "into section";
         return false;
     }
     if (d->elementsSet.contains(element)) {
         kreportWarning() << "Section already contains element" << element;
         return false;
     }
     d->elements.insert(i, element);
     d->elementsSet.insert(element);
     return true;
 }
 
 bool KReportSection::removeElement(const KReportElement &element)
 {
     if (!d->elementsSet.remove(element)) {
         kreportWarning() << "Could not find element" << element << "in section";
         return false;
     }
     if (!d->elements.removeOne(element)) {
         kreportCritical() << "Could not find element" << element << "in section's list but found in section's set";
         return false;
     }
     return true;
 }
 
 bool KReportSection::removeElementAt(int i)
 {
     if (i < 0 || i > (d->elements.count() - 1)) {
         kreportWarning() << "Could not find element at index" << i << "in section";
         return false;
     }
     KReportElement e = d->elements.takeAt(i);
     if (!d->elementsSet.remove(e)) {
         kreportWarning() << "Could not find element" << e << "in section";
         return false;
     }
     return true;
 }
 
 KReportSection::Data* KReportSection::Data::clone() const
 {
     Data *data = new Data(*this);
     data->elements.clear();
     KReportElement eClone;
     foreach(const KReportElement &el, elements) {
         eClone = el.clone();
         data->elements.append(eClone);
         data->elementsSet.insert(eClone);
     }
     return data;
 }
 
 //static
 qreal KReportSection::defaultHeight()
 {
     return KReportDesignGlobal::self()->defaultSectionHeight;
 }
 
 //static
 void KReportSection::setDefaultHeight(qreal height)
 {
     KReportDesignGlobal::self()->defaultSectionHeight = height;
 }
 
 //static
 QColor KReportSection::defaultBackgroundColor()
 {
     return KReportDesignGlobal::self()->defaultSectionBackgroundColor;
 }
 
 //static
 void KReportSection::setDefaultBackgroundColor(const QColor &color)
 {
     KReportDesignGlobal::self()->defaultSectionBackgroundColor = color;
 }
diff --git a/src/common/krsectiondata.cpp b/src/common/KReportSectionData.cpp
similarity index 67%
rename from src/common/krsectiondata.cpp
rename to src/common/KReportSectionData.cpp
index 228758c6..525468b6 100644
--- a/src/common/krsectiondata.cpp
+++ b/src/common/KReportSectionData.cpp
@@ -1,220 +1,220 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  * Copyright (C) 2010 Jarosław Staniek 
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "krsectiondata.h"
+#include "KReportSectionData.h"
 
-#include "krreportdata.h"
+#include "KReportDocument.h"
 
-#include "KoReportPluginInterface.h"
-#include "KoReportPluginManager.h"
-#include "KoReportItemLine.h"
+#include "KReportPluginInterface.h"
+#include "KReportPluginManager.h"
+#include "KReportItemLine.h"
 #include "kreport_debug.h"
 
 #include 
 
 #include 
 
-KRSectionData::KRSectionData(QObject* parent)
+KReportSectionData::KReportSectionData(QObject* parent)
  : QObject(parent)
 {
     createProperties(QDomElement());
 }
 
-KRSectionData::KRSectionData(const QDomElement & elemSource, KoReportReportData* report)
+KReportSectionData::KReportSectionData(const QDomElement & elemSource, KReportDocument* report)
  : QObject(report)
 {
     setObjectName(elemSource.tagName());
 
     if (objectName() != QLatin1String("report:section")) {
         m_valid = false;
         return;
     }
 
     m_type = sectionTypeFromString(elemSource.attribute(QLatin1String("report:section-type")));
-    if (m_type == KRSectionData::None) {
+    if (m_type == KReportSectionData::None) {
         m_valid = false;
         return;
     }
     createProperties(elemSource);
 
     m_backgroundColor->setValue(QColor(elemSource.attribute(QLatin1String("fo:background-color"))));
 
-    KoReportPluginManager* manager = KoReportPluginManager::self();
+    KReportPluginManager* manager = KReportPluginManager::self();
 
     QDomNodeList section = elemSource.childNodes();
     for (int nodeCounter = 0; nodeCounter < section.count(); nodeCounter++) {
         QDomElement elemThis = section.item(nodeCounter).toElement();
         QString n = elemThis.tagName();
         if (n.startsWith(QLatin1String("report:"))) {
             QString reportItemName = n.mid(qstrlen("report:"));
             if (reportItemName == QLatin1String("line")) {
-                KoReportItemLine * line = new KoReportItemLine(elemThis);
+                KReportItemLine * line = new KReportItemLine(elemThis);
                 m_objects.append(line);
                 continue;
             }
-            KoReportPluginInterface *plugin = manager->plugin(reportItemName);
+            KReportPluginInterface *plugin = manager->plugin(reportItemName);
             if (plugin) {
                 QObject *obj = plugin->createRendererInstance(elemThis);
                 if (obj) {
-                    KoReportItemBase *krobj = dynamic_cast(obj);
+                    KReportItemBase *krobj = dynamic_cast(obj);
                     if (krobj) {
                         m_objects.append(krobj);
                     }
                     continue;
                 }
             }
         }
         kreportWarning() << "While parsing section encountered an unknown element: " << n;
     }
     qSort(m_objects.begin(), m_objects.end(), zLessThan);
     m_valid = true;
 }
 
-KRSectionData::~KRSectionData()
+KReportSectionData::~KReportSectionData()
 {
     delete m_set;
     qDeleteAll(m_objects);
 }
 
-bool KRSectionData::zLessThan(KoReportItemBase* s1, KoReportItemBase* s2)
+bool KReportSectionData::zLessThan(KReportItemBase* s1, KReportItemBase* s2)
 {
     return s1->Z < s2->Z;
 }
 
-bool KRSectionData::xLessThan(KoReportItemBase* s1, KoReportItemBase* s2)
+bool KReportSectionData::xLessThan(KReportItemBase* s1, KReportItemBase* s2)
 {
     return s1->position().toPoint().x() < s2->position().toPoint().x();
 }
 
-void KRSectionData::createProperties(const QDomElement & elemSource)
+void KReportSectionData::createProperties(const QDomElement & elemSource)
 {
     m_set = new KPropertySet(this, QLatin1String("Section"));
 
     m_height = new KProperty("height", KReportUnit(KReportUnit::Centimeter).fromUserValue(2.0), tr("Height"));
     m_backgroundColor = new KProperty("background-color", QColor(Qt::white), tr("Background Color"));
     m_height->setOption("unit", QLatin1String("cm"));
     if (!elemSource.isNull())
         m_height->setValue(KReportUnit::parseValue(elemSource.attribute(QLatin1String("svg:height"), QLatin1String("2.0cm"))));
 
     m_set->addProperty(m_height);
     m_set->addProperty(m_backgroundColor);
 }
 
-QString KRSectionData::name() const
+QString KReportSectionData::name() const
 {
     return (objectName() + QLatin1Char('-') + sectionTypeString(m_type));
 }
 
-QString KRSectionData::sectionTypeString(KRSectionData::Section s)
+QString KReportSectionData::sectionTypeString(KReportSectionData::Section s)
 {
 //! @todo use QMap
     QString sectiontype;
     switch (s) {
-    case KRSectionData::PageHeaderAny:
+    case KReportSectionData::PageHeaderAny:
         sectiontype = QLatin1String("header-page-any");
         break;
-    case KRSectionData::PageHeaderEven:
+    case KReportSectionData::PageHeaderEven:
         sectiontype = QLatin1String("header-page-even");
         break;
-    case KRSectionData::PageHeaderOdd:
+    case KReportSectionData::PageHeaderOdd:
         sectiontype = QLatin1String("header-page-odd");
         break;
-    case KRSectionData::PageHeaderFirst:
+    case KReportSectionData::PageHeaderFirst:
         sectiontype = QLatin1String("header-page-first");
         break;
-    case KRSectionData::PageHeaderLast:
+    case KReportSectionData::PageHeaderLast:
         sectiontype = QLatin1String("header-page-last");
         break;
-    case KRSectionData::PageFooterAny:
+    case KReportSectionData::PageFooterAny:
         sectiontype = QLatin1String("footer-page-any");
         break;
-    case KRSectionData::PageFooterEven:
+    case KReportSectionData::PageFooterEven:
         sectiontype = QLatin1String("footer-page-even");
         break;
-    case KRSectionData::PageFooterOdd:
+    case KReportSectionData::PageFooterOdd:
         sectiontype = QLatin1String("footer-page-odd");
         break;
-    case KRSectionData::PageFooterFirst:
+    case KReportSectionData::PageFooterFirst:
         sectiontype = QLatin1String("footer-page-first");
         break;
-    case KRSectionData::PageFooterLast:
+    case KReportSectionData::PageFooterLast:
         sectiontype = QLatin1String("footer-page-last");
         break;
-    case KRSectionData::ReportHeader:
+    case KReportSectionData::ReportHeader:
         sectiontype = QLatin1String("header-report");
         break;
-    case KRSectionData::ReportFooter:
+    case KReportSectionData::ReportFooter:
         sectiontype = QLatin1String("footer-report");
         break;
-    case KRSectionData::GroupHeader:
+    case KReportSectionData::GroupHeader:
         sectiontype = QLatin1String("group-header");
         break;
-    case KRSectionData::GroupFooter:
+    case KReportSectionData::GroupFooter:
         sectiontype = QLatin1String("group-footer");
         break;
-    case KRSectionData::Detail:
+    case KReportSectionData::Detail:
         sectiontype = QLatin1String("detail");
         break;
     default:
         ;
     }
 
     return sectiontype;
 }
 
-KRSectionData::Section KRSectionData::sectionTypeFromString(const QString& s)
+KReportSectionData::Section KReportSectionData::sectionTypeFromString(const QString& s)
 {
 //! @todo use QMap
-    KRSectionData::Section sec;
+    KReportSectionData::Section sec;
     //kreportDebug() << "Determining section type for " << s;
     if (s == QLatin1String("header-page-any"))
-        sec = KRSectionData::PageHeaderAny;
+        sec = KReportSectionData::PageHeaderAny;
     else if (s == QLatin1String("header-page-even"))
-        sec = KRSectionData::PageHeaderEven;
+        sec = KReportSectionData::PageHeaderEven;
     else if (s == QLatin1String("header-page-odd"))
-        sec = KRSectionData::PageHeaderOdd;
+        sec = KReportSectionData::PageHeaderOdd;
     else if (s == QLatin1String("header-page-first"))
-        sec = KRSectionData::PageHeaderFirst;
+        sec = KReportSectionData::PageHeaderFirst;
     else if (s == QLatin1String("header-page-last"))
-        sec = KRSectionData::PageHeaderLast;
+        sec = KReportSectionData::PageHeaderLast;
     else if (s == QLatin1String("header-report"))
-        sec = KRSectionData::ReportHeader;
+        sec = KReportSectionData::ReportHeader;
     else if (s == QLatin1String("footer-page-any"))
-        sec = KRSectionData::PageFooterAny;
+        sec = KReportSectionData::PageFooterAny;
     else if (s == QLatin1String("footer-page-even"))
-        sec = KRSectionData::PageFooterEven;
+        sec = KReportSectionData::PageFooterEven;
     else if (s == QLatin1String("footer-page-odd"))
-        sec = KRSectionData::PageFooterOdd;
+        sec = KReportSectionData::PageFooterOdd;
     else if (s == QLatin1String("footer-page-first"))
-        sec = KRSectionData::PageFooterFirst;
+        sec = KReportSectionData::PageFooterFirst;
     else if (s == QLatin1String("footer-page-last"))
-        sec = KRSectionData::PageFooterLast;
+        sec = KReportSectionData::PageFooterLast;
     else if (s == QLatin1String("footer-report"))
-        sec = KRSectionData::ReportFooter;
+        sec = KReportSectionData::ReportFooter;
     else if (s == QLatin1String("group-header"))
-        sec = KRSectionData::GroupHeader;
+        sec = KReportSectionData::GroupHeader;
     else if (s == QLatin1String("group-footer"))
-        sec = KRSectionData::GroupFooter;
+        sec = KReportSectionData::GroupFooter;
     else if (s == QLatin1String("detail"))
-        sec = KRSectionData::Detail;
+        sec = KReportSectionData::Detail;
     else
-        sec = KRSectionData::None;
+        sec = KReportSectionData::None;
 
     return sec;
 }
diff --git a/src/common/krsectiondata.h b/src/common/KReportSectionData.h
similarity index 75%
rename from src/common/krsectiondata.h
rename to src/common/KReportSectionData.h
index 435393c7..f136fefd 100644
--- a/src/common/krsectiondata.h
+++ b/src/common/KReportSectionData.h
@@ -1,119 +1,119 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  * Copyright (C) 2010 Jarosław Staniek 
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-//
-// KRSectionData is used to store the information about a specific
-// section.
-// A section has a name and optionally extra data. `name'
-// reportheader, reportfooter, pageheader, pagefooter, groupheader, groupfooter or detail.
-// In the case of pghead and pgfoot extra would contain the page
-// designation (firstpage, odd, even or lastpage).
-//
-#ifndef KRSECTIONDATA_H
-#define KRSECTIONDATA_H
+
+#ifndef KREPORTSECTIONDATA_H
+#define KREPORTSECTIONDATA_H
 
 #include 
 
 #include 
 
-class KoReportItemBase;
-class KoReportReportData;
-
+class KReportItemBase;
+class KReportDocument;
 class QDomElement;
 
 namespace Scripting
 {
 class Section;
 }
-class KRSectionData : public QObject
+
+//
+// KReportSectionData is used to store the information about a specific
+// section.
+// A section has a name and optionally extra data. `name'
+// reportheader, reportfooter, pageheader, pagefooter, groupheader, groupfooter or detail.
+// In the case of pghead and pgfoot extra would contain the page
+// designation (firstpage, odd, even or lastpage).
+class KReportSectionData : public QObject
 {
     Q_OBJECT
 public:
     enum Section {
         None = 0,
         PageHeaderFirst = 1,
         PageHeaderOdd,
         PageHeaderEven,
         PageHeaderLast,
         PageHeaderAny,
         ReportHeader,
         ReportFooter,
         PageFooterFirst,
         PageFooterOdd,
         PageFooterEven,
         PageFooterLast,
         PageFooterAny,
         GroupHeader,
         GroupFooter,
         Detail
     };
 
-    explicit KRSectionData(QObject* parent = 0);
-    KRSectionData(const QDomElement &, KoReportReportData* report);
-    ~KRSectionData();
+    explicit KReportSectionData(QObject* parent = 0);
+    KReportSectionData(const QDomElement &, KReportDocument* report);
+    ~KReportSectionData();
     KPropertySet* propertySet() const {
         return m_set;
     }
 
     bool isValid() const {
         return m_valid;
     }
 
     qreal height() const {
         return m_height->value().toDouble();
     }
 
-    QList objects() const {
+    QList objects() const {
         return m_objects;
     }
 
     QString name() const;
 
     QColor backgroundColor() const {
         return m_backgroundColor->value().value();
     }
 
     Section type() const {
         return m_type;
     }
 
-    static KRSectionData::Section sectionTypeFromString(const QString& s);
-    static QString sectionTypeString(KRSectionData::Section s);
+    static KReportSectionData::Section sectionTypeFromString(const QString& s);
+    static QString sectionTypeString(KReportSectionData::Section s);
 protected:
     KPropertySet *m_set;
     KProperty *m_height;
     KProperty *m_backgroundColor;
 
 private:
     void createProperties(const QDomElement & elemSource);
 
-    QList m_objects;
+    QList m_objects;
 
     Section m_type;
 
-    static bool zLessThan(KoReportItemBase* s1, KoReportItemBase* s2);
-    static bool xLessThan(KoReportItemBase* s1, KoReportItemBase* s2);
+    static bool zLessThan(KReportItemBase* s1, KReportItemBase* s2);
+    static bool xLessThan(KReportItemBase* s1, KReportItemBase* s2);
 
     bool m_valid;
 
     friend class Scripting::Section;
-    friend class ReportSection;
+    friend class KReportDesignerSection;
 };
 
 #endif
diff --git a/src/common/krsize.cpp b/src/common/KReportSize.cpp
similarity index 80%
rename from src/common/krsize.cpp
rename to src/common/KReportSize.cpp
index e50cef35..db0b3cc7 100644
--- a/src/common/krsize.cpp
+++ b/src/common/KReportSize.cpp
@@ -1,99 +1,99 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "krsize.h"
+#include "KReportSize.h"
 
 #include 
 
 #include 
 #include 
 
-KRSize::KRSize(const KReportUnit& unit)
+KReportSize::KReportSize(const KReportUnit& unit)
 {
     m_unit = unit;
-    m_property = new KProperty("size", toScene(), QCoreApplication::translate("KRSize", "Size"));
+    m_property = new KProperty("size", toScene(), QCoreApplication::translate("KReportSize", "Size"));
 }
 
 
-KRSize::~KRSize()
+KReportSize::~KReportSize()
 {
 }
 
-void KRSize::setSceneSize(const QSizeF& s, UpdatePropertyFlag update)
+void KReportSize::setSceneSize(const QSizeF& s, UpdatePropertyFlag update)
 {
     qreal w, h;
 
     QScreen *srn = QApplication::screens().at(0);
 
     w = INCH_TO_POINT(s.width() / srn->logicalDotsPerInchX());
     h = INCH_TO_POINT(s.height() / srn->logicalDotsPerInchY());
     m_pointSize.setWidth(w);
     m_pointSize.setHeight(h);
 
     if (update == UpdateProperty)
         m_property->setValue(toUnit());
 }
 
-void KRSize::setUnitSize(const QSizeF& s, UpdatePropertyFlag update)
+void KReportSize::setUnitSize(const QSizeF& s, UpdatePropertyFlag update)
 {
     qreal w, h;
     w = m_unit.fromUserValue(s.width());
     h = m_unit.fromUserValue(s.height());
     m_pointSize.setWidth(w);
     m_pointSize.setHeight(h);
 
     if (update == UpdateProperty)
         m_property->setValue(toUnit());
 }
 
-void KRSize::setPointSize(const QSizeF& s, UpdatePropertyFlag update)
+void KReportSize::setPointSize(const QSizeF& s, UpdatePropertyFlag update)
 {
     m_pointSize.setWidth(s.width());
     m_pointSize.setHeight(s.height());
 
     if (update == UpdateProperty)
         m_property->setValue(toUnit());
 }
 
-void KRSize::setUnit(KReportUnit u)
+void KReportSize::setUnit(KReportUnit u)
 {
     m_unit = u;
     m_property->setValue(toUnit());
 }
 
-QSizeF KRSize::toPoint() const
+QSizeF KReportSize::toPoint() const
 {
     return m_pointSize;
 }
 
-QSizeF KRSize::toScene() const
+QSizeF KReportSize::toScene() const
 {
     qreal w, h;
     QScreen *srn = QApplication::screens().at(0);
     w = POINT_TO_INCH(m_pointSize.width()) * srn->logicalDotsPerInchX();
     h = POINT_TO_INCH(m_pointSize.height()) * srn->logicalDotsPerInchY();
     return QSizeF(w, h);
 }
 
-QSizeF KRSize::toUnit() const
+QSizeF KReportSize::toUnit() const
 {
     qreal w, h;
     w = m_unit.toUserValue(m_pointSize.width());
     h = m_unit.toUserValue(m_pointSize.height());
 
     return QSizeF(w, h);
 }
diff --git a/src/common/krsize.h b/src/common/KReportSize.h
similarity index 88%
rename from src/common/krsize.h
rename to src/common/KReportSize.h
index 3894d07a..55e2446b 100644
--- a/src/common/krsize.h
+++ b/src/common/KReportSize.h
@@ -1,56 +1,56 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
-#ifndef KRSIZE_H
-#define KRSIZE_H
+#ifndef KREPORTSIZE_H
+#define KREPORTSIZE_H
 
 #include 
 
 #include "KReportUnit.h"
 #include "kreport_export.h"
 
 class KProperty;
 
 /**
 */
-class KREPORT_EXPORT KRSize
+class KREPORT_EXPORT KReportSize
 {
 public:
     enum UpdatePropertyFlag {
         UpdateProperty,
         DontUpdateProperty
     };
-    explicit KRSize(const KReportUnit& unit = KReportUnit(KReportUnit::Centimeter));
+    explicit KReportSize(const KReportUnit& unit = KReportUnit(KReportUnit::Centimeter));
 
-    ~KRSize();
+    ~KReportSize();
     QSizeF toUnit() const;
     QSizeF toPoint() const;
     QSizeF toScene() const;
     void setSceneSize(const QSizeF&, UpdatePropertyFlag update = UpdateProperty);
     void setUnitSize(const QSizeF&, UpdatePropertyFlag update = UpdateProperty);
     void setPointSize(const QSizeF&, UpdatePropertyFlag update = UpdateProperty);
     void setUnit(KReportUnit);
 
     KProperty* property() const {
         return m_property;
     }
 private:
     QSizeF m_pointSize;
     KReportUnit m_unit;
     KProperty* m_property;
 };
 
 #endif
diff --git a/src/common/KoReportStaticPluginInterface.h b/src/common/KReportStaticPluginInterface.h
similarity index 97%
rename from src/common/KoReportStaticPluginInterface.h
rename to src/common/KReportStaticPluginInterface.h
index 55150044..ec7df3c8 100644
--- a/src/common/KoReportStaticPluginInterface.h
+++ b/src/common/KReportStaticPluginInterface.h
@@ -1,35 +1,35 @@
 /* This file is part of the KDE project
    Copyright (C) 2015 Jarosław Staniek 
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
 */
 
 #ifndef KREPORTSTATICPLUGININTERFACE_H
 #define KREPORTSTATICPLUGININTERFACE_H
 
 #define QT_STATICPLUGIN
 
-#include "KoReportPluginInterface.h"
+#include "KReportPluginInterface.h"
 
 //! Declaration to put in all static plugin headers
 #define KREPORT_DECLARE_STATIC_PLUGIN(name) \
     extern const QStaticPlugin qt_static_plugin_ ## name ## Factory(); \
 
 //! Used by manager to access metadata
 #define KREPORT_STATIC_PLUGIN_METADATA(name) \
     qt_static_plugin_ ## name ## Factory().metaData()
 
 #endif // KREPORTSTATICPLUGININTERFACE_H
diff --git a/src/common/KReportUtils.cpp b/src/common/KReportUtils.cpp
index ff7be18d..027912a7 100644
--- a/src/common/KReportUtils.cpp
+++ b/src/common/KReportUtils.cpp
@@ -1,555 +1,556 @@
 /* This file is part of the KDE project
    Copyright (C) 2010-2015 Jarosław Staniek 
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  * Boston, MA 02110-1301, USA.
 */
 
 #include "KReportUtils.h"
 #include "KReportUnit.h"
-#include "krpos.h"
-#include "krsize.h"
-#include "KoReportItemBase.h"
+#include "KReportPosition.h"
+#include "KReportSize.h"
+#include "KReportItemBase.h"
+#include "KReportLineStyle.h"
 
 #include 
 
 #include 
 #include 
 
 #include 
 
 QString KReportUtils::attr(const QDomElement &el, const char *attrName,
                            const QString &defaultValue)
 {
     const QString val = el.attribute(QLatin1String(attrName));
     return val.isEmpty() ? defaultValue : val;
 }
 
 QByteArray KReportUtils::attr(const QDomElement &el, const char *attrName,
                            const QByteArray &defaultValue)
 {
     const QByteArray val = el.attribute(QLatin1String(attrName)).toLatin1();
     return val.isEmpty() ? defaultValue : val;
 }
 
 bool KReportUtils::attr(const QDomElement &el, const char *attrName, bool defaultValue)
 {
     const QString val = el.attribute(QLatin1String(attrName));
     return val.isEmpty() ? defaultValue : QVariant(val).toBool();
 }
 
 int KReportUtils::attr(const QDomElement &el, const char *attrName, int defaultValue)
 {
     const QString val = el.attribute(QLatin1String(attrName));
     if (val.isEmpty()) {
         return defaultValue;
     }
     bool ok;
     const int result = QVariant(val).toInt(&ok);
     return ok ? result : defaultValue;
 }
 
 qreal KReportUtils::attr(const QDomElement &el, const char *attrName, qreal defaultValue)
 {
     const QString val = el.attribute(QLatin1String(attrName));
     return KReportUnit::parseValue(val, defaultValue);
 }
 
 QColor KReportUtils::attr(const QDomElement &el, const char *attrName, const QColor &defaultValue)
 {
     const QString val = el.attribute(QLatin1String(attrName));
     if (val.isEmpty()) {
         return defaultValue;
     }
     return QColor(val);
 }
 
 qreal KReportUtils::attrPercent(const QDomElement& el, const char* attrName, qreal defaultValue)
 {
     QString str(el.attribute(QLatin1String(attrName)));
     if (str.isEmpty() || !str.endsWith(QLatin1Char('%'))) {
         return defaultValue;
     }
     str.chop(1);
     bool ok;
     const qreal result = QVariant(str).toReal(&ok) / 100.0;
     if (!ok) {
         return defaultValue;
     }
     return result;
 }
 
 Qt::PenStyle KReportUtils::penStyle(const QString& str, Qt::PenStyle defaultValue)
 {
     const QByteArray s(str.toLatin1());
     if (s == "nopen" || s == "none") {
         return Qt::NoPen;
     } else if (s == "solid") {
         return Qt::SolidLine;
     } else if (s == "dash" || s == "wave" /*we have nothing better for now*/) {
         return Qt::DashLine;
     } else if (s == "dot" || s == "dotted") {
         return Qt::DotLine;
     } else if (s == "dashdot" || s == "dot-dash") {
         return Qt::DashDotLine;
     } else if (s == "dashdotdot" || s == "dot-dot-dash") {
         return Qt::DashDotDotLine;
     } else {
         return defaultValue;
     }
 }
 
 Qt::Alignment KReportUtils::verticalAlignment(const QString &str, Qt::Alignment defaultValue)
 {
     const QByteArray s(str.toLatin1());
     if (s == "center") {
         return Qt::AlignVCenter;
     } else if (s == "top") {
         return Qt::AlignTop;
     } else if (s == "bottom") {
         return Qt::AlignBottom;
     } else {
         return defaultValue;
     }
 }
 
 Qt::Alignment KReportUtils::horizontalAlignment(const QString &str, Qt::Alignment defaultValue)
 {
     const QByteArray s(str.toLatin1());
     if (s == "center") {
         return Qt::AlignHCenter;
     } else if (s == "right") {
         return Qt::AlignRight;
     } else if (s == "left") {
         return Qt::AlignLeft;
     } else {
         return defaultValue;
     }
 }
 
 QString KReportUtils::verticalToString(Qt::Alignment alignment)
 {
     if (alignment.testFlag(Qt::AlignVCenter)) {
         return QLatin1String("center");
     } else if (alignment.testFlag(Qt::AlignTop)) {
         return QLatin1String("top");
     } else if (alignment.testFlag(Qt::AlignBottom)) {
         return QLatin1String("bottom");
     }
     return QString();
 }
 
 QString KReportUtils::horizontalToString(Qt::Alignment alignment)
 {
     if (alignment.testFlag(Qt::AlignHCenter)) {
         return QLatin1String("center");
     } else if (alignment.testFlag(Qt::AlignLeft)) {
         return QLatin1String("left");
     } else if (alignment.testFlag(Qt::AlignRight)) {
         return QLatin1String("right");
     }
     return QString();
 }
 
 QRectF KReportUtils::readRectAttributes(const QDomElement &el, const QRectF &defaultValue)
 {
     QRectF val;
     val.setX(attr(el, "svg:x", defaultValue.x()));
     val.setY(attr(el, "svg:y", defaultValue.y()));
     val.setWidth(attr(el, "svg:width", defaultValue.width()));
     val.setHeight(attr(el, "svg:height", defaultValue.height()));
     return val;
 }
 
 int KReportUtils::readPercent(const QDomElement& el, const char* name, int defaultPercentValue, bool *ok)
 {
     Q_ASSERT(name);
     QString percent(el.attribute(QLatin1String(name)));
     if (percent.isEmpty()) {
         if (ok)
             *ok = true;
         return defaultPercentValue;
     }
     if (!percent.endsWith(QLatin1Char('%'))) {
         if (ok)
             *ok = false;
         return 0;
     }
     percent.chop(1);
     if (ok)
         *ok = true;
     return percent.toInt(ok);
 }
 
 //! @return string representation of @a value, cuts of zeros; precision is set to 2
 static QString roundValueToString(qreal value)
 {
     QString s(QString::number(value, 'g', 2));
     if (s.endsWith(QLatin1String(".00")))
         return QString::number(qRound(value));
     return s;
 }
 
 //! Used by readFontAttributes()
 static QFont::Capitalization readFontCapitalization(const QByteArray& fontVariant, const QByteArray& textTransform)
 {
     if (fontVariant == "small-caps")
         return QFont::SmallCaps;
     if (textTransform == "uppercase")
         return QFont::AllUppercase;
     if (textTransform == "lowercase")
         return QFont::AllLowercase;
     if (textTransform == "capitalize")
         return QFont::Capitalize;
     // default, "normal"
     return QFont::MixedCase;
 }
 
 void KReportUtils::readFontAttributes(const QDomElement& el, QFont *font)
 {
     Q_ASSERT(font);
     const QFont::Capitalization cap = readFontCapitalization(
         attr(el, "fo:font-variant", QByteArray()), attr(el, "fo:text-transform", QByteArray()));
     font->setCapitalization(cap);
 
     // weight
     const QByteArray fontWeight(attr(el, "fo:font-weight", QByteArray()));
     int weight = -1;
     if (fontWeight == "bold") {
         weight = QFont::Bold;
     }
     if (fontWeight == "normal") {
         weight = QFont::Normal;
     }
     else if (!fontWeight.isEmpty()) {
         // Remember : Qt and CSS/XSL doesn't have the same scale. It's 100-900 instead of Qt's 0-100
         // See http://www.w3.org/TR/2001/REC-xsl-20011015/slice7.html#font-weight
         // and http://www.w3.org/TR/CSS2/fonts.html#font-boldness
         bool ok;
         qreal boldness = fontWeight.toUInt(&ok);
         if (ok) {
             boldness = qMin(boldness, 900.0);
             boldness = qMax(boldness, 100.0);
             weight = (boldness - 100.0) * 0.12375 /*== 99/800*/; // 0..99
         }
     }
     if (weight >= 0) {
         font->setWeight(weight);
     }
 
     font->setItalic(attr(el, "fo:font-style", QByteArray()) == "italic");
     font->setFixedPitch(attr(el, "style:font-pitch", QByteArray()) == "fixed");
     font->setFamily(attr(el, "fo:font-family", font->family()));
     font->setKerning(attr(el, "style:letter-kerning", font->kerning()));
 
     // underline
     const QByteArray underlineType(attr(el, "style:text-underline-type", QByteArray()));
     font->setUnderline(!underlineType.isEmpty() && underlineType != "none"); // double or single (we don't recognize them)
 
     // stricken-out
     const QByteArray strikeOutType(attr(el, "style:text-line-through-type", QByteArray()));
     font->setStrikeOut(!strikeOutType.isEmpty() && strikeOutType != "none"); // double or single (we don't recognize them)
 
 //! @todo support fo:font-size-rel?
 //! @todo support fo:font-size in px
     font->setPointSizeF(KReportUtils::attr(el, "fo:font-size", font->pointSizeF()));
 
     // letter spacing
     // §7.16.2 of [XSL] http://www.w3.org/TR/xsl11/#letter-spacing
     font->setLetterSpacing(QFont::PercentageSpacing,
                           100.0 * KReportUtils::attrPercent(el, "fo:letter-spacing", font->letterSpacing()));
 }
 
 void KReportUtils::writeFontAttributes(QDomElement *el, const QFont &font)
 {
     Q_ASSERT(el);
     switch (font.capitalization()) {
     case QFont::SmallCaps:
         el->setAttribute(QLatin1String("fo:font-variant"), QLatin1String("small-caps"));
         break;
     case QFont::MixedCase:
         // default: "normal", do not save
         break;
     case QFont::AllUppercase:
         el->setAttribute(QLatin1String("fo:text-transform"), QLatin1String("uppercase"));
         break;
     case QFont::AllLowercase:
         el->setAttribute(QLatin1String("fo:text-transform"), QLatin1String("lowercase"));
         break;
     case QFont::Capitalize:
         el->setAttribute(QLatin1String("fo:text-transform"), QLatin1String("capitalize"));
         break;
     }
 
     // Remember : Qt and CSS/XSL doesn't have the same scale. It's 100-900 instead of Qt's 0-100
     // See http://www.w3.org/TR/2001/REC-xsl-20011015/slice7.html#font-weight
     // and http://www.w3.org/TR/CSS2/fonts.html#font-boldness
     if (font.weight() == QFont::Light) {
         el->setAttribute(QLatin1String("fo:font-weight"), 200);
     }
     else if (font.weight() == QFont::Normal) {
         // Default
         //el->setAttribute("fo:font-weight", "normal"); // 400
     }
     else if (font.weight() == QFont::DemiBold) {
         el->setAttribute(QLatin1String("fo:font-weight"), 600);
     }
     else if (font.weight() == QFont::Bold) {
         el->setAttribute(QLatin1String("fo:font-weight"), QLatin1String("bold")); // 700
     }
     else if (font.weight() == QFont::Black) {
         el->setAttribute(QLatin1String("fo:font-weight"), 900);
     }
     else {
         el->setAttribute(QLatin1String("fo:font-weight"), qBound(10, font.weight(), 90) * 10);
     }
     // italic, default is "normal"
     if (font.italic()) {
         el->setAttribute(QLatin1String("fo:font-style"), QLatin1String("italic"));
     }
     // pitch, default is "variable"
     if (font.fixedPitch()) {
         el->setAttribute(QLatin1String("style:font-pitch"), QLatin1String("fixed"));
     }
     if (!font.family().isEmpty()) {
         el->setAttribute(QLatin1String("fo:font-family"), font.family());
     }
     // kerning, default is "true"
     el->setAttribute(QLatin1String("style:letter-kerning"), QLatin1String(font.kerning() ? "true" : "false"));
     // underline, default is "none"
     if (font.underline()) {
         el->setAttribute(QLatin1String("style:text-underline-type"), QLatin1String("single"));
     }
     // stricken-out, default is "none"
     if (font.strikeOut()) {
         el->setAttribute(QLatin1String("style:text-line-through-type"), QLatin1String("single"));
     }
     el->setAttribute(QLatin1String("fo:font-size"), font.pointSize());
 
     // letter spacing, default is "normal"
     // §7.16.2 of [XSL] http://www.w3.org/TR/xsl11/#letter-spacing
     if (font.letterSpacingType() == QFont::PercentageSpacing) {
         // A value of 100 will keep the spacing unchanged; a value of 200 will enlarge
         // the spacing after a character by the width of the character itself.
         if (font.letterSpacing() != 100.0) {
             el->setAttribute(QLatin1String("fo:letter-spacing"), roundValueToString(font.letterSpacing()) + QLatin1Char('%'));
         }
     }
     else {
         // QFont::AbsoluteSpacing
         // A positive value increases the letter spacing by the corresponding pixels; a negative value decreases the spacing.
         el->setAttribute(QLatin1String("fo:letter-spacing"), roundValueToString(font.letterSpacing()));
     }
 }
 
 
-void KReportUtils::buildXMLRect(QDomElement *entity, KRPos *pos, KRSize *size)
+void KReportUtils::buildXMLRect(QDomElement *entity, KReportPosition *pos, KReportSize *size)
 {
     Q_ASSERT(entity);
     Q_ASSERT(pos);
     Q_ASSERT(size);
     KReportUtils::setAttribute(entity, pos->toPoint() );
     KReportUtils::setAttribute(entity, size->toPoint() );
 }
 
 void KReportUtils::buildXMLTextStyle(QDomDocument *doc, QDomElement *entity, const KRTextStyleData &ts)
 {
     Q_ASSERT(doc);
     Q_ASSERT(entity);
     QDomElement element = doc->createElement(QLatin1String("report:text-style"));
 
     element.setAttribute(QLatin1String("fo:background-color"), ts.backgroundColor.name());
     element.setAttribute(QLatin1String("fo:foreground-color"), ts.foregroundColor.name());
     element.setAttribute(QLatin1String("fo:background-opacity"), QString::number(ts.backgroundOpacity) + QLatin1Char('%'));
     KReportUtils::writeFontAttributes(&element, ts.font);
 
     entity->appendChild(element);
 }
 
-void KReportUtils::buildXMLLineStyle(QDomDocument *doc, QDomElement *entity, const KRLineStyleData &ls)
+void KReportUtils::buildXMLLineStyle(QDomDocument *doc, QDomElement *entity, const KReportLineStyle &ls)
 {
     Q_ASSERT(doc);
     Q_ASSERT(entity);
     QDomElement element = doc->createElement(QLatin1String("report:line-style"));
 
-    element.setAttribute(QLatin1String("report:line-color"), ls.lineColor.name());
-    element.setAttribute(QLatin1String("report:line-weight"), ls.weight);
+    element.setAttribute(QLatin1String("report:line-color"), ls.color().name());
+    element.setAttribute(QLatin1String("report:line-weight"), ls.width());
 
     QString l;
-    switch (ls.style) {
+    switch (ls.penStyle()) {
         case Qt::NoPen:
             l = QLatin1String("nopen");
             break;
         case Qt::SolidLine:
             l = QLatin1String("solid");
             break;
         case Qt::DashLine:
             l = QLatin1String("dash");
             break;
         case Qt::DotLine:
             l = QLatin1String("dot");
             break;
         case Qt::DashDotLine:
             l = QLatin1String("dashdot");
             break;
         case Qt::DashDotDotLine:
             l = QLatin1String("dashdotdot");
             break;
         default:
             l = QLatin1String("solid");
     }
     element.setAttribute(QLatin1String("report:line-style"), l);
 
     entity->appendChild(element);
 }
 
 void KReportUtils::addPropertyAsAttribute(QDomElement* e, KProperty* p)
 {
     Q_ASSERT(e);
     Q_ASSERT(p);
     const QString name = QLatin1String("report:") + QLatin1String(p->name().toLower());
 
     switch (p->value().type()) {
         case QVariant::Int :
             e->setAttribute(name, p->value().toInt());
             break;
         case QVariant::Double:
             e->setAttribute(name, p->value().toDouble());
             break;
         case QVariant::Bool:
             e->setAttribute(name, p->value().toInt());
             break;
         default:
             e->setAttribute(name, p->value().toString());
             break;
     }
 }
 
 void KReportUtils::setAttribute(QDomElement *e, const QString &attribute, double value)
 {
     Q_ASSERT(e);
     QString s;
     s.setNum(value, 'f', DBL_DIG);
     e->setAttribute(attribute, s + QLatin1String("pt"));
 }
 
 void KReportUtils::setAttribute(QDomElement *e, const QPointF &value)
 {
     Q_ASSERT(e);
     KReportUtils::setAttribute(e, QLatin1String("svg:x"), value.x());
     KReportUtils::setAttribute(e, QLatin1String("svg:y"), value.y());
 }
 
 void KReportUtils::setAttribute(QDomElement *e, const QSizeF &value)
 {
     Q_ASSERT(e);
     KReportUtils::setAttribute(e, QLatin1String("svg:width"), value.width());
     KReportUtils::setAttribute(e, QLatin1String("svg:height"), value.height());
 }
 
 bool KReportUtils::parseReportTextStyleData(const QDomElement & elemSource, KRTextStyleData *ts)
 {
     Q_ASSERT(ts);
     if (elemSource.tagName() != QLatin1String("report:text-style"))
         return false;
     ts->backgroundColor = QColor(elemSource.attribute(QLatin1String("fo:background-color"), QLatin1String("#ffffff")));
     ts->foregroundColor = QColor(elemSource.attribute(QLatin1String("fo:foreground-color"), QLatin1String("#000000")));
 
     bool ok;
     ts->backgroundOpacity = KReportUtils::readPercent(elemSource, "fo:background-opacity", 100, &ok);
     if (!ok) {
         return false;
     }
     KReportUtils::readFontAttributes(elemSource, &ts->font);
     return true;
 }
 
-bool KReportUtils::parseReportLineStyleData(const QDomElement & elemSource, KRLineStyleData *ls)
+bool KReportUtils::parseReportLineStyleData(const QDomElement & elemSource, KReportLineStyle *ls)
 {
     Q_ASSERT(ls);
     if (elemSource.tagName() == QLatin1String("report:line-style")) {
-        ls->lineColor = QColor(elemSource.attribute(QLatin1String("report:line-color"), QLatin1String("#ffffff")));
-        ls->weight = elemSource.attribute(QLatin1String("report:line-weight"), QLatin1String("0")).toInt();
+        ls->setColor(QColor(elemSource.attribute(QLatin1String("report:line-color"), QLatin1String("#ffffff"))));
+        ls->setWidth(elemSource.attribute(QLatin1String("report:line-weight"), QLatin1String("0")).toInt());
 
         QString l = elemSource.attribute(QLatin1String("report:line-style"), QLatin1String("nopen"));
         if (l == QLatin1String("nopen")) {
-            ls->style = Qt::NoPen;
+            ls->setPenStyle(Qt::NoPen);
         } else if (l == QLatin1String("solid")) {
-            ls->style = Qt::SolidLine;
+            ls->setPenStyle(Qt::SolidLine);
         } else if (l == QLatin1String("dash")) {
-            ls->style = Qt::DashLine;
+            ls->setPenStyle(Qt::DashLine);
         } else if (l == QLatin1String("dot")) {
-            ls->style = Qt::DotLine;
+            ls->setPenStyle(Qt::DotLine);
         } else if (l == QLatin1String("dashdot")) {
-            ls->style = Qt::DashDotLine;
+            ls->setPenStyle(Qt::DashDotLine);
         } else if (l == QLatin1String("dashdotdot")) {
-            ls->style = Qt::DashDotDotLine;
+            ls->setPenStyle(Qt::DashDotDotLine);
         }
         return true;
     }
     return false;
 }
 
-bool KReportUtils::parseReportRect(const QDomElement & elemSource, KRPos *pos, KRSize *size)
+bool KReportUtils::parseReportRect(const QDomElement & elemSource, KReportPosition *pos, KReportSize *size)
 {
     Q_ASSERT(pos);
     Q_ASSERT(size);
 //    QStringList sl;
 //    QDomNamedNodeMap map = elemSource.attributes();
 //    for (int i=0; i < map.count(); ++i ) {
 //        sl << map.item(i).nodeName();
 //    }
     QPointF _pos;
     QSizeF _siz;
 
     _pos.setX(KReportUnit::parseValue(elemSource.attribute(QLatin1String("svg:x"), QLatin1String("1cm"))));
     _pos.setY(KReportUnit::parseValue(elemSource.attribute(QLatin1String("svg:y"), QLatin1String("1cm"))));
     _siz.setWidth(KReportUnit::parseValue(elemSource.attribute(QLatin1String("svg:width"), QLatin1String("1cm"))));
     _siz.setHeight(KReportUnit::parseValue(elemSource.attribute(QLatin1String("svg:height"), QLatin1String("1cm"))));
 
     pos->setPointPos(_pos);
     size->setPointSize(_siz);
     return true;
 }
 
 class PageIds : private QHash
 {
 public:
     PageIds() {}
     QPageSize::PageSizeId id(const QString &key) {
         if (isEmpty()) {
             for (int i = 0; i < QPageSize::LastPageSize; ++i) {
                 QString key(QPageSize::key(static_cast(i)));
                 if (key.isEmpty()) {
                     break;
                 }
                 insert(key, static_cast(i));
             }
         }
         return value(key);
     }
 };
 
 Q_GLOBAL_STATIC(PageIds, s_pageIds)
 
 QPageSize::PageSizeId KReportUtils::pageSizeId(const QString &key)
 {
     return s_pageIds->id(key);
 }
 
 QPageSize KReportUtils::pageSize(const QString &key)
 {
     return QPageSize(s_pageIds->id(key));
 }
diff --git a/src/common/KReportUtils.h b/src/common/KReportUtils.h
index 00186ef1..430f9375 100644
--- a/src/common/KReportUtils.h
+++ b/src/common/KReportUtils.h
@@ -1,131 +1,131 @@
 /* This file is part of the KDE project
    Copyright (C) 2010-2015 Jarosław Staniek 
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  * Boston, MA 02110-1301, USA.
 */
 
 #ifndef KREPORTUTILS_H
 #define KREPORTUTILS_H
 
 #include "kreport_export.h"
 
 #include 
 #include 
 #include 
 #include 
 
 class QDomDocument;
 class QDomElement;
 class QFont;
 class QPointF;
 class KProperty;
-class KRPos;
-class KRSize;
+class KReportPosition;
+class KReportSize;
 class KRTextStyleData;
-class KRLineStyleData;
+class KReportLineStyle;
 
 namespace KReportUtils
 {
     KREPORT_EXPORT QString attr(const QDomElement &el, const char *attrName,
                                 const QString &defaultValue = QString());
 
     KREPORT_EXPORT QByteArray attr(const QDomElement &el, const char *attrName,
                                    const QByteArray &defaultValue = QByteArray());
 
     KREPORT_EXPORT bool attr(const QDomElement &el, const char *attrName, bool defaultValue = false);
 
     KREPORT_EXPORT int attr(const QDomElement &el, const char *attrName, int defaultValue = 0);
 
     KREPORT_EXPORT qreal attr(const QDomElement &el, const char *attrName, qreal defaultValue = 0.0);
 
     KREPORT_EXPORT QColor attr(const QDomElement &el, const char *attrName, const QColor &defaultValue = QColor());
 
     //! @return percent value converted to qreal, e.g. 1.0 for "100%", 0.505 for "50.5%".
     //! @a defaultValue is returned if there is not "%" suffix or no proper number.
     KREPORT_EXPORT qreal attrPercent(const QDomElement& el, const char* attrName, qreal defaultValue = 0.0);
 
     //! @return pen style from @a str or @a defaultValue
     //! Values from ODF 1.2 19.493 style:line-style are also recognized.
     KREPORT_EXPORT Qt::PenStyle penStyle(const QString &str, Qt::PenStyle defaultValue);
 
     //! @return vertical alignment flag from @a str or @a defaultValue
     KREPORT_EXPORT Qt::Alignment verticalAlignment(const QString &str, Qt::Alignment defaultValue);
 
     //! @return horizontal alignment flag from @a str or @a defaultValue
     KREPORT_EXPORT Qt::Alignment horizontalAlignment(const QString &str, Qt::Alignment defaultValue);
 
     //! @return vertical alignment flag name from @a alignment
     KREPORT_EXPORT QString verticalToString(Qt::Alignment alignment);
 
     //! @return horizontal alignment flag from @a alignment
     KREPORT_EXPORT QString horizontalToString(Qt::Alignment alignment);
 
     //! @return rectangle value read from svg:x, svg:y, svg:width, svg:height attributes of @a el.
     //! If any of the arguments are missing, @a defaultValue is returned.
     KREPORT_EXPORT QRectF readRectAttributes(const QDomElement &el, const QRectF &defaultValue = QRectF());
 
     //! @return percent value for element @a name. If the element is missing, returns @a defaultPercentValue.
     //! If @a ok is not 0, *ok is set to the result.
     KREPORT_EXPORT int readPercent(const QDomElement & el, const char* name, int defaultPercentValue, bool *ok);
 
     //! Reads all font attributes for element @a el into @a font.
     //! @todo add unit tests
     KREPORT_EXPORT void readFontAttributes(const QDomElement& el, QFont* font);
 
     //! Writes all attributes of font @a font into element @a el.
     //! @todo add unit tests
     KREPORT_EXPORT void writeFontAttributes(QDomElement *el, const QFont &font);
 
     //! Writes attributes for the rect position @p pos, @p siz
-    KREPORT_EXPORT void buildXMLRect(QDomElement *entity, KRPos *pos, KRSize *size);
+    KREPORT_EXPORT void buildXMLRect(QDomElement *entity, KReportPosition *pos, KReportSize *size);
 
     //! Writes attributes for text style @p ts
     KREPORT_EXPORT void buildXMLTextStyle(QDomDocument *doc, QDomElement *entity, const KRTextStyleData &ts);
 
     //! Writes attributes for line style @p ls
-    KREPORT_EXPORT void buildXMLLineStyle(QDomDocument *doc, QDomElement *entity, const KRLineStyleData &ls);
+    KREPORT_EXPORT void buildXMLLineStyle(QDomDocument *doc, QDomElement *entity, const KReportLineStyle &ls);
 
     //! Writes attributes for the property @p p
     KREPORT_EXPORT void addPropertyAsAttribute(QDomElement* e, KProperty* p);
 
     //! Writes @p attribute to element @p e, @p value is stored in points with unit 'pt'
     KREPORT_EXPORT void setAttribute(QDomElement *e, const QString &attribute, double value);
 
     //! Writes point @p value as attributes to element @p e
     KREPORT_EXPORT void setAttribute(QDomElement *e, const QPointF &value);
 
     //! Writes size @p value as attributes to element @p e
     KREPORT_EXPORT void setAttribute(QDomElement *e, const QSizeF &value);
 
     //! Reads attributes from @p elemSource into text style @p ts
     KREPORT_EXPORT bool parseReportTextStyleData(const QDomElement & elemSource, KRTextStyleData *ts);
 
     //! Reads attributes from @p elemSource into line style @p ls
-    KREPORT_EXPORT bool parseReportLineStyleData(const QDomElement & elemSource, KRLineStyleData *ls);
+    KREPORT_EXPORT bool parseReportLineStyleData(const QDomElement & elemSource, KReportLineStyle *ls);
 
     //! Reads attributes from @p elemSource into rect @p pos, @p siz
-    KREPORT_EXPORT bool parseReportRect(const QDomElement & elemSource, KRPos *pos, KRSize *size);
+    KREPORT_EXPORT bool parseReportRect(const QDomElement & elemSource, KReportPosition *pos, KReportSize *size);
 
     //! @return page size ID for page key (the PPD standard mediaOption keyword, e.g. "A4")
     //! @note It's an efficient workaround because QPageSize misses this function.
     KREPORT_EXPORT QPageSize::PageSizeId pageSizeId(const QString &key);
 
     //! Like QPageSize::PageSizeId pageSizeId(const QString &key) but returns entire QPageSize object.
     KREPORT_EXPORT QPageSize pageSize(const QString &key);
 
 } // KReportUtils
 
 #endif
diff --git a/src/items/check/KReportCheckBoxPlugin.cpp b/src/items/check/KReportCheckBoxPlugin.cpp
new file mode 100644
index 00000000..45f2b20a
--- /dev/null
+++ b/src/items/check/KReportCheckBoxPlugin.cpp
@@ -0,0 +1,64 @@
+/* This file is part of the KDE project
+   Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this library; see the file COPYING.LIB.  If not, write to
+   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.
+*/
+
+#include "KReportCheckBoxPlugin.h"
+#include "KReportItemCheck.h"
+#include "KReportDesignerItemCheckBox.h"
+#include "KReportPluginMetaData.h"
+#include "KReportScriptCheck.h"
+
+KREPORT_PLUGIN_FACTORY(KReportCheckBoxPlugin, "check.json")
+
+KReportCheckBoxPlugin::KReportCheckBoxPlugin(QObject *parent, const QVariantList &args)
+    : KReportPluginInterface(parent, args)
+{
+}
+
+KReportCheckBoxPlugin::~KReportCheckBoxPlugin()
+{
+
+}
+
+QObject* KReportCheckBoxPlugin::createRendererInstance(const QDomNode& element)
+{
+    return new KReportItemCheckBox(element);
+}
+
+QObject* KReportCheckBoxPlugin::createDesignerInstance(const QDomNode& element, KReportDesigner* designer, QGraphicsScene* scene)
+{
+    return new KReportDesignerItemCheckBox(element, designer, scene);
+}
+
+QObject* KReportCheckBoxPlugin::createDesignerInstance(KReportDesigner* designer, QGraphicsScene* scene, const QPointF& pos)
+{
+    return new KReportDesignerItemCheckBox(designer, scene, pos);
+}
+
+#ifdef KREPORT_SCRIPTING
+QObject* KReportCheckBoxPlugin::createScriptInstance(KReportItemBase* item)
+{
+    KReportItemCheckBox *check = dynamic_cast(item);
+    if (check) {
+       return new Scripting::CheckBox(check);
+    }
+    return 0;
+}
+#endif
+
+#include "KReportCheckBoxPlugin.moc"
diff --git a/src/items/check/KoReportCheckPlugin.h b/src/items/check/KReportCheckBoxPlugin.h
similarity index 63%
rename from src/items/check/KoReportCheckPlugin.h
rename to src/items/check/KReportCheckBoxPlugin.h
index ec1adbe3..27efa8df 100644
--- a/src/items/check/KoReportCheckPlugin.h
+++ b/src/items/check/KReportCheckBoxPlugin.h
@@ -1,41 +1,41 @@
 /* This file is part of the KDE project
    Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
 */
 
-#ifndef KOREPORTCHECKPLUGIN_H
-#define KOREPORTCHECKPLUGIN_H
+#ifndef KREPORTCHECKPLUGIN_H
+#define KREPORTCHECKPLUGIN_H
 
-#include "KoReportStaticPluginInterface.h"
+#include "KReportStaticPluginInterface.h"
 
-KREPORT_DECLARE_STATIC_PLUGIN(KoReportCheckPlugin)
+KREPORT_DECLARE_STATIC_PLUGIN(KReportCheckBoxPlugin)
 
-class KoReportCheckPlugin : public KoReportPluginInterface
+class KReportCheckBoxPlugin : public KReportPluginInterface
 {
     public:
-        explicit KoReportCheckPlugin(QObject *parent, const QVariantList &args = QVariantList());
-        virtual ~KoReportCheckPlugin();
+        explicit KReportCheckBoxPlugin(QObject *parent, const QVariantList &args = QVariantList());
+        virtual ~KReportCheckBoxPlugin();
 
         virtual QObject* createRendererInstance(const QDomNode& element);
-        virtual QObject* createDesignerInstance(const QDomNode& element, KoReportDesigner* , QGraphicsScene* scene);
-        virtual QObject* createDesignerInstance(KoReportDesigner* , QGraphicsScene* scene, const QPointF& pos);
+        virtual QObject* createDesignerInstance(const QDomNode& element, KReportDesigner* , QGraphicsScene* scene);
+        virtual QObject* createDesignerInstance(KReportDesigner* , QGraphicsScene* scene, const QPointF& pos);
 #ifdef KREPORT_SCRIPTING
-        virtual QObject* createScriptInstance(KoReportItemBase* item);
+        virtual QObject* createScriptInstance(KReportItemBase* item);
 #endif
 };
 
-#endif // KOREPORTCHECKPLUGIN_H
+#endif // KREPORTCHECKPLUGIN_H
diff --git a/src/items/check/KoReportDesignerItemCheck.cpp b/src/items/check/KReportDesignerItemCheckBox.cpp
similarity index 78%
rename from src/items/check/KoReportDesignerItemCheck.cpp
rename to src/items/check/KReportDesignerItemCheckBox.cpp
index fd69f96d..aed1a3a3 100644
--- a/src/items/check/KoReportDesignerItemCheck.cpp
+++ b/src/items/check/KReportDesignerItemCheckBox.cpp
@@ -1,184 +1,184 @@
 /* This file is part of the KDE project
  * Copyright (C) 2009-2010 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "KoReportDesignerItemCheck.h"
-#include "wrtembed/KoReportDesignerItemRectBase.h"
-#include "wrtembed/KoReportDesigner.h"
-
+#include "KReportDesignerItemCheckBox.h"
+#include "KReportDesignerItemRectBase.h"
+#include "KReportDesigner.h"
+#include "KReportLineStyle.h"
 
 #include 
 #include 
 #include 
 #include 
 
 //
 // class ReportEntityCheck
 //
 
-void KoReportDesignerItemCheck::init(QGraphicsScene *scene, KoReportDesigner *d)
+void KReportDesignerItemCheckBox::init(QGraphicsScene *scene, KReportDesigner *d)
 {
     if (scene)
         scene->addItem(this);
 
-    KoReportDesignerItemRectBase::init(&m_pos, &m_size, m_set, d);
+    KReportDesignerItemRectBase::init(&m_pos, &m_size, m_set, d);
 
     connect(propertySet(), SIGNAL(propertyChanged(KPropertySet&,KProperty&)),
             this, SLOT(slotPropertyChanged(KPropertySet&,KProperty&)));
 
     setZValue(Z);
 }
 
 // methods (constructors)
-KoReportDesignerItemCheck::KoReportDesignerItemCheck(KoReportDesigner* d, QGraphicsScene * scene, const QPointF &pos)
-        : KoReportDesignerItemRectBase(d)
+KReportDesignerItemCheckBox::KReportDesignerItemCheckBox(KReportDesigner* d, QGraphicsScene * scene, const QPointF &pos)
+        : KReportDesignerItemRectBase(d)
 {
     Q_UNUSED(pos);
     init(scene, d);
-    setSceneRect(properRect(*d, KOREPORT_ITEM_CHECK_DEFAULT_WIDTH, KOREPORT_ITEM_CHECK_DEFAULT_HEIGHT));
+    setSceneRect(properRect(*d, KREPORT_ITEM_CHECK_DEFAULT_WIDTH, KREPORT_ITEM_CHECK_DEFAULT_HEIGHT));
     m_name->setValue(m_reportDesigner->suggestEntityName(typeName()));
 }
 
-KoReportDesignerItemCheck::KoReportDesignerItemCheck(const QDomNode & element, KoReportDesigner * d, QGraphicsScene * s)
-        : KoReportItemCheck(element), KoReportDesignerItemRectBase(d)
+KReportDesignerItemCheckBox::KReportDesignerItemCheckBox(const QDomNode & element, KReportDesigner * d, QGraphicsScene * s)
+        : KReportItemCheckBox(element), KReportDesignerItemRectBase(d)
 {
     init(s, d);
     setSceneRect(m_pos.toScene(), m_size.toScene());
 }
 
-KoReportDesignerItemCheck* KoReportDesignerItemCheck::clone()
+KReportDesignerItemCheckBox* KReportDesignerItemCheckBox::clone()
 {
     QDomDocument d;
     QDomElement e = d.createElement(QLatin1String("clone"));
     QDomNode n;
     buildXML(&d, &e);
     n = e.firstChild();
-    return new KoReportDesignerItemCheck(n, designer(), 0);
+    return new KReportDesignerItemCheckBox(n, designer(), 0);
 }
 
 // methods (deconstructor)
-KoReportDesignerItemCheck::~KoReportDesignerItemCheck()
+KReportDesignerItemCheckBox::~KReportDesignerItemCheckBox()
 {}
 
-void KoReportDesignerItemCheck::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
+void KReportDesignerItemCheckBox::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
 {
     Q_UNUSED(option);
     Q_UNUSED(widget);
 
     // store any values we plan on changing so we can restore them
     QFont f = painter->font();
     QPen  p = painter->pen();
     QBrush b = painter->brush();
 
     painter->setBackgroundMode(Qt::OpaqueMode);
     painter->setRenderHint(QPainter::Antialiasing);
 
     painter->setPen(m_foregroundColor->value().value());
 
     if ((Qt::PenStyle)m_lineStyle->value().toInt() == Qt::NoPen || m_lineWeight->value().toInt() <= 0) {
         painter->setPen(QPen(Qt::lightGray));
     } else {
         painter->setPen(QPen(m_lineColor->value().value(), m_lineWeight->value().toInt(), (Qt::PenStyle)m_lineStyle->value().toInt()));
     }
 
     qreal ox = m_size.toScene().width() / 5;
     qreal oy = m_size.toScene().height() / 5;
 
     //Checkbox Style
     if (m_checkStyle->value().toString() == QLatin1String("Cross")) {
         painter->drawRoundedRect(QGraphicsRectItem::rect(), m_size.toScene().width() / 10 , m_size.toScene().height() / 10);
 
         QPen lp;
         lp.setColor(m_foregroundColor->value().value());
         lp.setWidth(ox > oy ? oy : ox);
         painter->setPen(lp);
         painter->drawLine(ox, oy, m_size.toScene().width() - ox, m_size.toScene().height() - oy);
         painter->drawLine(ox, m_size.toScene().height() - oy, m_size.toScene().width() - ox, oy);
     } else if (m_checkStyle->value().toString() == QLatin1String("Dot")) {
         //Radio Style
         painter->drawEllipse(QGraphicsRectItem::rect());
 
         QBrush lb(m_foregroundColor->value().value());
         painter->setBrush(lb);
         painter->setPen(Qt::NoPen);
         painter->drawEllipse(rect().center(), m_size.toScene().width() / 2 - ox, m_size.toScene().height() / 2 - oy);
     } else {
         //Tickbox Style
         painter->drawRoundedRect(QGraphicsRectItem::rect(), m_size.toScene().width() / 10 , m_size.toScene().height() / 10);
 
         QPen lp;
         lp.setColor(m_foregroundColor->value().value());
         lp.setWidth(ox > oy ? oy : ox);
         painter->setPen(lp);
         painter->drawLine(ox, m_size.toScene().height() / 2, m_size.toScene().width() / 2, m_size.toScene().height() - oy);
         painter->drawLine(m_size.toScene().width() / 2, m_size.toScene().height() - oy, m_size.toScene().width() - ox, oy);
 
     }
 
     painter->setBackgroundMode(Qt::TransparentMode);
     painter->setPen(m_foregroundColor->value().value());
 
     // restore an values before we started just in case
     painter->setFont(f);
     painter->setPen(p);
     painter->setBrush(b);
 
     drawHandles(painter);
 }
 
-void KoReportDesignerItemCheck::buildXML(QDomDocument *doc, QDomElement *parent)
+void KReportDesignerItemCheckBox::buildXML(QDomDocument *doc, QDomElement *parent)
 {
     //kreportpluginDebug();
     QDomElement entity = doc->createElement(QLatin1String("report:") + typeName());
 
     //properties
     addPropertyAsAttribute(&entity, m_name);
     addPropertyAsAttribute(&entity, m_controlSource);
     entity.setAttribute(QLatin1String("fo:foreground-color"), m_foregroundColor->value().toString());
     addPropertyAsAttribute(&entity, m_checkStyle);
     addPropertyAsAttribute(&entity, m_staticValue);
 
     // bounding rect
     buildXMLRect(doc, &entity, &m_pos, &m_size);
 
     //Line Style
     buildXMLLineStyle(doc, &entity, lineStyle());
 
     parent->appendChild(entity);
 }
 
-void KoReportDesignerItemCheck::slotPropertyChanged(KPropertySet &s, KProperty &p)
+void KReportDesignerItemCheckBox::slotPropertyChanged(KPropertySet &s, KProperty &p)
 {
     Q_UNUSED(s)
 
     if (p.name() == "Name") {
         //For some reason p.oldValue returns an empty string
         if (!m_reportDesigner->isEntityNameUnique(p.value().toString(), this)) {
             p.setValue(m_oldName);
         } else {
             m_oldName = p.value().toString();
         }
     }
 
-    KoReportDesignerItemRectBase::propertyChanged(s, p);
+    KReportDesignerItemRectBase::propertyChanged(s, p);
     if (m_reportDesigner) m_reportDesigner->setModified(true);
 }
 
-void KoReportDesignerItemCheck::mousePressEvent(QGraphicsSceneMouseEvent * event)
+void KReportDesignerItemCheckBox::mousePressEvent(QGraphicsSceneMouseEvent * event)
 {
     m_controlSource->setListData(m_reportDesigner->fieldKeys(), m_reportDesigner->fieldNames());
-    KoReportDesignerItemRectBase::mousePressEvent(event);
+    KReportDesignerItemRectBase::mousePressEvent(event);
 }
diff --git a/src/items/check/KoReportDesignerItemCheck.h b/src/items/check/KReportDesignerItemCheckBox.h
similarity index 62%
rename from src/items/check/KoReportDesignerItemCheck.h
rename to src/items/check/KReportDesignerItemCheckBox.h
index 9b624cf3..0dcf66d9 100644
--- a/src/items/check/KoReportDesignerItemCheck.h
+++ b/src/items/check/KReportDesignerItemCheckBox.h
@@ -1,56 +1,55 @@
 /* This file is part of the KDE project
  * Copyright (C) 2009-2010 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#ifndef KOREPORTDESIGNERITEMCHECK_H
-#define KOREPORTDESIGNERITEMCHECK_H
+#ifndef KREPORTDESIGNERITEMCHECK_H
+#define KREPORTDESIGNERITEMCHECK_H
 
-#include 
+#include "KReportDesignerItemRectBase.h"
+#include "KReportItemCheck.h"
 
 #include 
+#include 
 
-#include "KoReportDesignerItemRectBase.h"
-#include "KoReportItemCheck.h"
-
-const int KOREPORT_ITEM_CHECK_DEFAULT_WIDTH = 15;
-const int KOREPORT_ITEM_CHECK_DEFAULT_HEIGHT = 15;
+const int KREPORT_ITEM_CHECK_DEFAULT_WIDTH = 15;
+const int KREPORT_ITEM_CHECK_DEFAULT_HEIGHT = 15;
 
-class KoReportDesignerItemCheck : public KoReportItemCheck, public KoReportDesignerItemRectBase
+class KReportDesignerItemCheckBox : public KReportItemCheckBox, public KReportDesignerItemRectBase
 {
     Q_OBJECT
 public:
-    KoReportDesignerItemCheck(KoReportDesigner *, QGraphicsScene * scene, const QPointF &pos);
-    KoReportDesignerItemCheck(const QDomNode & element, KoReportDesigner *, QGraphicsScene * scene);
+    KReportDesignerItemCheckBox(KReportDesigner *, QGraphicsScene * scene, const QPointF &pos);
+    KReportDesignerItemCheckBox(const QDomNode & element, KReportDesigner *, QGraphicsScene * scene);
 
-    virtual ~KoReportDesignerItemCheck();
+    virtual ~KReportDesignerItemCheckBox();
 
     virtual void buildXML(QDomDocument *doc, QDomElement *parent);
 
     virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0);
 
-    virtual KoReportDesignerItemCheck* clone();
+    virtual KReportDesignerItemCheckBox* clone();
 
 private:
-    void init(QGraphicsScene*, KoReportDesigner*);
+    void init(QGraphicsScene*, KReportDesigner*);
 
 private Q_SLOTS:
     void slotPropertyChanged(KPropertySet &, KProperty &);
 
 protected:
     virtual void mousePressEvent(QGraphicsSceneMouseEvent * event);
 };
 
-#endif // KOREPORTDESIGNERITEMCHECK_H
+#endif // KREPORTDESIGNERITEMCHECK_H
diff --git a/src/items/check/KoReportItemCheck.cpp b/src/items/check/KReportItemCheck.cpp
similarity index 82%
rename from src/items/check/KoReportItemCheck.cpp
rename to src/items/check/KReportItemCheck.cpp
index b82b954d..65dace68 100644
--- a/src/items/check/KoReportItemCheck.cpp
+++ b/src/items/check/KReportItemCheck.cpp
@@ -1,190 +1,190 @@
 /* This file is part of the KDE project
  * Copyright (C) 2009-2010 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "KoReportItemCheck.h"
-#include "common/renderobjects.h"
+#include "KReportItemCheck.h"
+#include "KReportRenderObjects.h"
 #include "kreportplugin_debug.h"
 #ifdef KREPORT_SCRIPTING
-#include "renderer/scripting/krscripthandler.h"
+#include "renderer/scripting/KReportScriptHandler.h"
 #endif
 
 #include 
 
 #include 
 #include 
 
-KoReportItemCheck::KoReportItemCheck()
+KReportItemCheckBox::KReportItemCheckBox()
 {
     createProperties();
 }
 
-KoReportItemCheck::KoReportItemCheck(const QDomNode &element)
+KReportItemCheckBox::KReportItemCheckBox(const QDomNode &element)
 {
     createProperties();
     QDomNodeList nl = element.childNodes();
     QString n;
     QDomNode node;
 
     m_name->setValue(element.toElement().attribute(QLatin1String("report:name")));
     m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source")));
     Z = element.toElement().attribute(QLatin1String("report:z-index")).toDouble();
     m_foregroundColor->setValue(QColor(element.toElement().attribute(QLatin1String("fo:foreground-color"))));
     m_checkStyle->setValue(element.toElement().attribute(QLatin1String("report:check-style")));
     m_staticValue->setValue(QVariant(element.toElement().attribute(QLatin1String("report:value"))).toBool());
 
     parseReportRect(element.toElement(), &m_pos, &m_size);
 
     for (int i = 0; i < nl.count(); i++) {
         node = nl.item(i);
         n = node.nodeName();
 
         if (n == QLatin1String("report:line-style")) {
-            KRLineStyleData ls;
+            KReportLineStyle ls;
             if (parseReportLineStyleData(node.toElement(), &ls)) {
-                m_lineWeight->setValue(ls.weight);
-                m_lineColor->setValue(ls.lineColor);
-                m_lineStyle->setValue(QPen(ls.style));
+                m_lineWeight->setValue(ls.width());
+                m_lineColor->setValue(ls.color());
+                m_lineStyle->setValue(QPen(ls.penStyle()));
             }
         } else {
             kreportpluginWarning() << "while parsing check element encountered unknow element: " << n;
         }
     }
 
 }
 
-KoReportItemCheck::~KoReportItemCheck()
+KReportItemCheckBox::~KReportItemCheckBox()
 {
     delete m_set;
 }
 
-void KoReportItemCheck::createProperties()
+void KReportItemCheckBox::createProperties()
 {
     m_set = new KPropertySet(0, QLatin1String("Check"));
 
     QStringList keys, strings;
 
     keys << QLatin1String("Cross") << QLatin1String("Tick") << QLatin1String("Dot");
     strings << tr("Cross") << tr("Tick") << tr("Dot");
     m_checkStyle = new KProperty("check-style", keys, strings, QLatin1String("Cross"), tr("Style"));
 
     m_controlSource = new KProperty("item-data-source", QStringList(), QStringList(), QString(), tr("Data Source"));
     m_controlSource->setOption("extraValueAllowed", QLatin1String("true"));
 
     m_foregroundColor = new KProperty("foreground-color", QPalette().color(QPalette::Foreground), tr("Foreground Color"));
 
     m_lineWeight = new KProperty("line-weight", 1, tr("Line Weight"));
     m_lineColor = new KProperty("line-color", QColor(Qt::black), tr("Line Color"));
     m_lineStyle = new KProperty("line-style", QPen(Qt::SolidLine), tr("Line Style"), tr("Line Style"), KProperty::LineStyle);
     m_staticValue = new KProperty("value", QVariant(false), tr("Value"), tr("Value used if not bound to a field"));
 
     addDefaultProperties();
     m_set->addProperty(m_controlSource);
     m_set->addProperty(m_staticValue);
     m_set->addProperty(m_checkStyle);
     m_set->addProperty(m_foregroundColor);
     m_set->addProperty(m_lineWeight);
     m_set->addProperty(m_lineColor);
     m_set->addProperty(m_lineStyle);
 }
 
-KRLineStyleData KoReportItemCheck::lineStyle()
+KReportLineStyle KReportItemCheckBox::lineStyle()
 {
-    KRLineStyleData ls;
-    ls.weight = m_lineWeight->value().toInt();
-    ls.lineColor = m_lineColor->value().value();
-    ls.style = (Qt::PenStyle)m_lineStyle->value().toInt();
+    KReportLineStyle ls;
+    ls.setWidth(m_lineWeight->value().toInt());
+    ls.setColor(m_lineColor->value().value());
+    ls.setPenStyle((Qt::PenStyle)m_lineStyle->value().toInt());
     return ls;
 }
 
-QString KoReportItemCheck::itemDataSource() const
+QString KReportItemCheckBox::itemDataSource() const
 {
     return m_controlSource->value().toString();
 }
 
 // RTTI
-QString KoReportItemCheck::typeName() const
+QString KReportItemCheckBox::typeName() const
 {
     return QLatin1String("check");
 }
 
-int KoReportItemCheck::renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset,
-                                        const QVariant &data, KRScriptHandler *script)
+int KReportItemCheckBox::renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset,
+                                        const QVariant &data, KReportScriptHandler *script)
 {
     OROCheck *chk = new OROCheck();
 
     chk->setPosition(m_pos.toScene() + offset);
     chk->setSize(m_size.toScene());
 
     chk->setLineStyle(lineStyle());
     chk->setForegroundColor(m_foregroundColor->value().value());
     chk->setCheckType(m_checkStyle->value().toString());
 
     QString str;
     bool v = false;
     QString cs = itemDataSource();
 
     //kreportpluginDebug() << "ControlSource:" << cs;
     if (!cs.isEmpty()) {
 #ifdef KREPORT_SCRIPTING
         if (cs.left(1) == QLatin1String("=") && script) {
             str = script->evaluate(cs.mid(1)).toString();
         } else
 #else
         Q_UNUSED(script);
 #endif
         {
             str = data.toString();
         }
 
         str = str.toLower();
 
         //kreportpluginDebug() << "Check Value:" << str;
         if (str == QLatin1String("t") || str == QLatin1String("y") || str == QLatin1String("true") || str == QLatin1String("1"))
             v = true;
 
     } else {
         v = value();
     }
 
     chk->setValue(v);
 
     if (page) {
         page->addPrimitive(chk);
     }
 
     if (section) {
         OROCheck *chk2 = dynamic_cast(chk->clone());
         chk2->setPosition(m_pos.toPoint());
         section->addPrimitive(chk2);
     }
 
     if (!page) {
         delete chk;
     }
 
     return 0; //Item doesn't stretch the section height
 }
 
-bool KoReportItemCheck::value() const
+bool KReportItemCheckBox::value() const
 {
     return m_staticValue->value().toBool();
 }
 
-void KoReportItemCheck::setValue(bool v)
+void KReportItemCheckBox::setValue(bool v)
 {
     m_staticValue->setValue(v);
 }
diff --git a/src/items/check/KoReportItemCheck.h b/src/items/check/KReportItemCheck.h
similarity index 71%
rename from src/items/check/KoReportItemCheck.h
rename to src/items/check/KReportItemCheck.h
index 1a806aa8..815daae3 100644
--- a/src/items/check/KoReportItemCheck.h
+++ b/src/items/check/KReportItemCheck.h
@@ -1,65 +1,65 @@
 /* This file is part of the KDE project
  * Copyright (C) 2009-2010 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#ifndef KOREPORTITEMCHECK_H
-#define KOREPORTITEMCHECK_H
+#ifndef KREPORTITEMCHECKBOX_H
+#define KREPORTITEMCHECKBOX_H
 
-#include "KoReportItemBase.h"
-#include "krpos.h"
-#include "krsize.h"
+#include "KReportItemBase.h"
+#include "KReportPosition.h"
+#include "KReportSize.h"
 
 class QDomNode;
 
 namespace Scripting
 {
-class Check;
+class CheckBox;
 }
 
-class KoReportItemCheck : public KoReportItemBase
+class KReportItemCheckBox : public KReportItemBase
 {
 Q_OBJECT
 public:
-    KoReportItemCheck();
-    explicit KoReportItemCheck(const QDomNode &element);
-    virtual ~KoReportItemCheck();
+    KReportItemCheckBox();
+    explicit KReportItemCheckBox(const QDomNode &element);
+    virtual ~KReportItemCheckBox();
 
     virtual QString typeName() const;
-    virtual int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KRScriptHandler *script);
+    virtual int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KReportScriptHandler *script);
 
     virtual QString itemDataSource()const;
 
 protected:
 
     KProperty * m_controlSource;
     KProperty* m_checkStyle;
     KProperty* m_foregroundColor;
     KProperty* m_lineColor;
     KProperty* m_lineWeight;
     KProperty* m_lineStyle;
     KProperty* m_staticValue;
 
     bool value() const;
     void setValue(bool);
-    KRLineStyleData lineStyle();
+    KReportLineStyle lineStyle();
 
 private:
     virtual void createProperties();
 
-    friend class Scripting::Check;
+    friend class Scripting::CheckBox;
 };
 
-#endif // KOREPORTITEMCHECK_H
+#endif // KREPORTITEMCHECKBOX_H
diff --git a/src/items/check/KoReportScriptCheck.cpp b/src/items/check/KReportScriptCheck.cpp
similarity index 69%
rename from src/items/check/KoReportScriptCheck.cpp
rename to src/items/check/KReportScriptCheck.cpp
index a3d1ca82..3be72ded 100644
--- a/src/items/check/KoReportScriptCheck.cpp
+++ b/src/items/check/KReportScriptCheck.cpp
@@ -1,112 +1,111 @@
-/*
- * KoReport Lirary
+/* This file is part of the KDE project
  * Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "KoReportScriptCheck.h"
+#include "KReportScriptCheck.h"
 #include 
 
 namespace Scripting
 {
 
-Check::Check(KoReportItemCheck *c)
+CheckBox::CheckBox(KReportItemCheckBox *c)
 {
     m_check = c;
 }
 
 
-Check::~Check()
+CheckBox::~CheckBox()
 {
 }
 
-bool Check::value()
+bool CheckBox::value()
 {
     return m_check->value();
 }
 
-void Check::setValue(bool v)
+void CheckBox::setValue(bool v)
 {
     m_check->setValue(v);
 }
 
-QString Check::checkStyle()
+QString CheckBox::checkStyle()
 {
     return m_check->m_checkStyle->value().toString();
 }
 
-void Check::setCheckStyle(const QString &style)
+void CheckBox::setCheckStyle(const QString &style)
 {
     m_check->m_checkStyle->setValue(style);
 }
 
-QColor Check::foregroundColor()
+QColor CheckBox::foregroundColor()
 {
     return m_check->m_foregroundColor->value().value();
 }
-void Check::setForegroundColor(const QColor& c)
+void CheckBox::setForegroundColor(const QColor& c)
 {
     m_check->m_foregroundColor->setValue(c);
 }
 
-QColor Check::lineColor()
+QColor CheckBox::lineColor()
 {
     return m_check->m_lineColor->value().value();
 }
-void Check::setLineColor(const QColor& c)
+void CheckBox::setLineColor(const QColor& c)
 {
     m_check->m_lineColor->setValue(c);
 }
 
-int Check::lineWeight()
+int CheckBox::lineWeight()
 {
     return m_check->m_lineWeight->value().toInt();
 }
-void Check::setLineWeight(int w)
+void CheckBox::setLineWeight(int w)
 {
     m_check->m_lineWeight->setValue(w);
 }
 
-int Check::lineStyle()
+int CheckBox::lineStyle()
 {
     return m_check->m_lineStyle->value().toInt();
 }
-void Check::setLineStyle(int s)
+void CheckBox::setLineStyle(int s)
 {
     if (s < 0 || s > 5) {
         s = 1;
     }
     m_check->m_lineStyle->setValue(s);
 }
 
-QPointF Check::position()
+QPointF CheckBox::position()
 {
     return m_check->m_pos.toPoint();
 }
-void Check::setPosition(const QPointF &p)
+void CheckBox::setPosition(const QPointF &p)
 {
     m_check->m_pos.setPointPos(p);
 }
 
-QSizeF Check::size()
+QSizeF CheckBox::size()
 {
     return m_check->m_size.toPoint();
 }
-void Check::setSize(const QSizeF &s)
+void CheckBox::setSize(const QSizeF &s)
 {
     m_check->m_size.setPointSize(s);
 }
 }
 
diff --git a/src/items/check/KoReportScriptCheck.h b/src/items/check/KReportScriptCheck.h
similarity index 83%
rename from src/items/check/KoReportScriptCheck.h
rename to src/items/check/KReportScriptCheck.h
index 3fae9428..fb21398f 100644
--- a/src/items/check/KoReportScriptCheck.h
+++ b/src/items/check/KReportScriptCheck.h
@@ -1,69 +1,68 @@
-/*
- * KoReport Lirary
+/* This file is part of the KDE project
  * Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#ifndef KOREPORTSCRIPTCHECK_H
-#define KOREPORTSCRIPTCHECK_H
+#ifndef KREPORTSCRIPTCHECK_H
+#define KREPORTSCRIPTCHECK_H
 
 #include 
 
-#include "KoReportItemCheck.h"
+#include "KReportItemCheck.h"
 
 namespace Scripting
 {
 
-    class Check : public QObject
+    class CheckBox : public QObject
     {
         Q_OBJECT
         public:
-            explicit Check(KoReportItemCheck *);
+            explicit CheckBox(KReportItemCheckBox *);
 
-            ~Check();
+            ~CheckBox();
 
         public Q_SLOTS:
             bool value();
             void setValue(bool val = true);
 
             /**Gets/sets the check style eg, Cross, Tick Dot*/
             QString checkStyle();
             void setCheckStyle(const QString&);
 
             QColor foregroundColor();
             void setForegroundColor(const QColor&);
 
             QColor lineColor();
             void setLineColor(const QColor&);
 
             int lineWeight();
             void setLineWeight(int);
 
             /**Gets/sets the line style.  Valid values are those from Qt::PenStyle (0-5)*/
             int lineStyle();
             void setLineStyle(int);
 
             QPointF position();
             void setPosition(const QPointF&);
 
             QSizeF size();
             void setSize(const QSizeF&);
 
         private:
-            KoReportItemCheck *m_check;
+            KReportItemCheckBox *m_check;
             };
 
 }
-#endif // KOREPORTSCRIPTCHECK_H
+#endif // KREPORTSCRIPTCHECK_H
diff --git a/src/items/check/KoReportCheckPlugin.cpp b/src/items/check/KoReportCheckPlugin.cpp
deleted file mode 100644
index 5b531065..00000000
--- a/src/items/check/KoReportCheckPlugin.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/* This file is part of the KDE project
-   Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public License
-   along with this library; see the file COPYING.LIB.  If not, write to
-   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.
-*/
-
-#include "KoReportCheckPlugin.h"
-#include "KoReportItemCheck.h"
-#include "KoReportDesignerItemCheck.h"
-#include "common/KReportPluginMetaData.h"
-#include "KoReportScriptCheck.h"
-
-KREPORT_PLUGIN_FACTORY(KoReportCheckPlugin, "check.json")
-
-KoReportCheckPlugin::KoReportCheckPlugin(QObject *parent, const QVariantList &args)
-    : KoReportPluginInterface(parent, args)
-{
-}
-
-KoReportCheckPlugin::~KoReportCheckPlugin()
-{
-
-}
-
-QObject* KoReportCheckPlugin::createRendererInstance(const QDomNode& element)
-{
-    return new KoReportItemCheck(element);
-}
-
-QObject* KoReportCheckPlugin::createDesignerInstance(const QDomNode& element, KoReportDesigner* designer, QGraphicsScene* scene)
-{
-    return new KoReportDesignerItemCheck(element, designer, scene);
-}
-
-QObject* KoReportCheckPlugin::createDesignerInstance(KoReportDesigner* designer, QGraphicsScene* scene, const QPointF& pos)
-{
-    return new KoReportDesignerItemCheck(designer, scene, pos);
-}
-
-#ifdef KREPORT_SCRIPTING
-QObject* KoReportCheckPlugin::createScriptInstance(KoReportItemBase* item)
-{
-    KoReportItemCheck *check = dynamic_cast(item);
-    if (check) {
-       return new Scripting::Check(check);
-    }
-    return 0;
-}
-#endif
-
-#include "KoReportCheckPlugin.moc"
diff --git a/src/items/field/KoReportDesignerItemField.cpp b/src/items/field/KReportDesignerItemField.cpp
similarity index 78%
rename from src/items/field/KoReportDesignerItemField.cpp
rename to src/items/field/KReportDesignerItemField.cpp
index 57a6c0db..4daadf02 100644
--- a/src/items/field/KoReportDesignerItemField.cpp
+++ b/src/items/field/KReportDesignerItemField.cpp
@@ -1,190 +1,191 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "KoReportDesignerItemField.h"
-#include "KoReportItemField.h"
-#include "wrtembed/KoReportDesigner.h"
+#include "KReportDesignerItemField.h"
+#include "KReportItemField.h"
+#include "KReportDesigner.h"
 #include "kreportplugin_debug.h"
+#include "KReportLineStyle.h"
 
 #include 
 #include 
 #include 
 #include 
 
 //
 // class ReportEntityField
 //
 
-void KoReportDesignerItemField::init(QGraphicsScene * scene, KoReportDesigner * d)
+void KReportDesignerItemField::init(QGraphicsScene * scene, KReportDesigner * d)
 {
     if (scene)
         scene->addItem(this);
 
-    KoReportDesignerItemRectBase::init(&m_pos, &m_size, m_set, d);
+    KReportDesignerItemRectBase::init(&m_pos, &m_size, m_set, d);
 
     connect(m_set, SIGNAL(propertyChanged(KPropertySet&,KProperty&)),
             this, SLOT(slotPropertyChanged(KPropertySet&,KProperty&)));
 
     setZValue(Z);
 
     updateRenderText(m_controlSource->value().toString(), m_itemValue->value().toString(), QLatin1String("field"));
 }
 
 // methods (constructors)
-KoReportDesignerItemField::KoReportDesignerItemField(KoReportDesigner * rw, QGraphicsScene * scene, const QPointF &pos)
-        : KoReportDesignerItemRectBase(rw)
+KReportDesignerItemField::KReportDesignerItemField(KReportDesigner * rw, QGraphicsScene * scene, const QPointF &pos)
+        : KReportDesignerItemRectBase(rw)
 {
     Q_UNUSED(pos);
     init(scene, rw);
     setSceneRect(properRect(*rw, getTextRect().width(), getTextRect().height()));
     m_name->setValue(m_reportDesigner->suggestEntityName(typeName()));
 }
 
-KoReportDesignerItemField::KoReportDesignerItemField(const QDomNode & element, KoReportDesigner * d, QGraphicsScene * s)
-        : KoReportItemField(element), KoReportDesignerItemRectBase(d)
+KReportDesignerItemField::KReportDesignerItemField(const QDomNode & element, KReportDesigner * d, QGraphicsScene * s)
+        : KReportItemField(element), KReportDesignerItemRectBase(d)
 {
     init(s, d);
     setSceneRect(m_pos.toScene(), m_size.toScene());
 }
 
-KoReportDesignerItemField* KoReportDesignerItemField::clone()
+KReportDesignerItemField* KReportDesignerItemField::clone()
 {
     QDomDocument d;
     QDomElement e = d.createElement(QLatin1String("clone"));
     QDomNode n;
     buildXML(&d, &e);
     n = e.firstChild();
-    return new KoReportDesignerItemField(n, designer(), 0);
+    return new KReportDesignerItemField(n, designer(), 0);
 }
 
 // methods (deconstructor)
-KoReportDesignerItemField::~KoReportDesignerItemField()
+KReportDesignerItemField::~KReportDesignerItemField()
 {}
 
-QRect KoReportDesignerItemField::getTextRect() const
+QRect KReportDesignerItemField::getTextRect() const
 {
     return QFontMetrics(font()).boundingRect(x(), y(), 0, 0, textFlags(), m_renderText);
 }
 
 
 
-void KoReportDesignerItemField::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget *widget)
+void KReportDesignerItemField::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget *widget)
 {
     Q_UNUSED(option);
     Q_UNUSED(widget);
 
     // store any values we plan on changing so we can restore them
     QFont f = painter->font();
     QPen  p = painter->pen();
 
 
     painter->setFont(font());
     painter->setBackgroundMode(Qt::TransparentMode);
 
     QColor bg = m_backgroundColor->value().value();
     bg.setAlphaF(m_backgroundOpacity->value().toReal() *0.01);
 
     painter->setPen(m_foregroundColor->value().value());
 
     painter->fillRect(QGraphicsRectItem::rect(), bg);
     painter->drawText(rect(), textFlags(), m_renderText);
 
 
     if ((Qt::PenStyle)m_lineStyle->value().toInt() == Qt::NoPen || m_lineWeight->value().toInt() <= 0) {
         painter->setPen(QPen(Qt::lightGray));
     } else {
         painter->setPen(QPen(m_lineColor->value().value(), m_lineWeight->value().toInt(), (Qt::PenStyle)m_lineStyle->value().toInt()));
     }
 
     painter->drawRect(rect());
 
 
     drawHandles(painter);
 
     // restore an values before we started just in case
     painter->setFont(f);
     painter->setPen(p);
 }
 
-void KoReportDesignerItemField::buildXML(QDomDocument *doc, QDomElement *parent)
+void KReportDesignerItemField::buildXML(QDomDocument *doc, QDomElement *parent)
 {
     QDomElement entity = doc->createElement(QLatin1String("report:") + typeName());
 
     // properties
     addPropertyAsAttribute(&entity, m_name);
     addPropertyAsAttribute(&entity, m_controlSource);
     addPropertyAsAttribute(&entity, m_verticalAlignment);
     addPropertyAsAttribute(&entity, m_horizontalAlignment);
     addPropertyAsAttribute(&entity, m_wordWrap);
     addPropertyAsAttribute(&entity, m_canGrow);
     addPropertyAsAttribute(&entity, m_itemValue);
 
     entity.setAttribute(QLatin1String("report:z-index"), zValue());
 
     // bounding rect
     buildXMLRect(doc, &entity, &m_pos, &m_size);
 
     //text style info
     buildXMLTextStyle(doc, &entity, textStyle());
 
     //Line Style
     buildXMLLineStyle(doc, &entity, lineStyle());
 
 
 #if 0 //Field Totals
     if (m_trackTotal) {
         QDomElement tracktotal = doc->createElement("tracktotal");
         if (m_trackBuiltinFormat)
             tracktotal.setAttribute("builtin", "true");
         if (_useSubTotal)
             tracktotal.setAttribute("subtotal", "true");
         tracktotal.appendChild(doc.createTextNode(_trackTotalFormat->value().toString()));
         entity.appendChild(tracktotal);
     }
 #endif
 
     parent->appendChild(entity);
 }
 
-void KoReportDesignerItemField::slotPropertyChanged(KPropertySet &s, KProperty &p)
+void KReportDesignerItemField::slotPropertyChanged(KPropertySet &s, KProperty &p)
 {
     Q_UNUSED(s);
 
     if (p.name() == "Name") {
         //For some reason p.oldValue returns an empty string
         if (!m_reportDesigner->isEntityNameUnique(p.value().toString(), this)) {
             p.setValue(m_oldName);
         } else {
             m_oldName = p.value().toString();
         }
     }
 
     updateRenderText(m_controlSource->value().toString(), m_itemValue->value().toString(), QLatin1String("field"));
 
-    KoReportDesignerItemRectBase::propertyChanged(s, p);
+    KReportDesignerItemRectBase::propertyChanged(s, p);
     if (m_reportDesigner)m_reportDesigner->setModified(true);
 }
 
-void KoReportDesignerItemField::mousePressEvent(QGraphicsSceneMouseEvent * event)
+void KReportDesignerItemField::mousePressEvent(QGraphicsSceneMouseEvent * event)
 {
     kreportpluginDebug() << m_reportDesigner->fieldKeys() <<  m_reportDesigner->fieldNames();
     m_controlSource->setListData(m_reportDesigner->fieldKeys(), m_reportDesigner->fieldNames());
-    KoReportDesignerItemRectBase::mousePressEvent(event);
+    KReportDesignerItemRectBase::mousePressEvent(event);
 }
 
 
diff --git a/src/items/field/KoReportDesignerItemField.h b/src/items/field/KReportDesignerItemField.h
similarity index 69%
rename from src/items/field/KoReportDesignerItemField.h
rename to src/items/field/KReportDesignerItemField.h
index 5fd6bca3..cb8b10d5 100644
--- a/src/items/field/KoReportDesignerItemField.h
+++ b/src/items/field/KReportDesignerItemField.h
@@ -1,55 +1,55 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
 
-#ifndef __KOREPORTDESIGNERITEMFIELD_H__
-#define __KOREPORTDESIGNERITEMFIELD_H__
+#ifndef KREPORTDESIGNERITEMFIELD_H
+#define KREPORTDESIGNERITEMFIELD_H
 
 #include 
 
 #include 
 
-#include "KoReportItemField.h"
-#include "KoReportDesignerItemRectBase.h"
+#include "KReportItemField.h"
+#include "KReportDesignerItemRectBase.h"
 
-class KoReportDesignerItemField : public KoReportItemField, public KoReportDesignerItemRectBase
+class KReportDesignerItemField : public KReportItemField, public KReportDesignerItemRectBase
 {
   Q_OBJECT
 public:
     //Used when creating new basic field
-    KoReportDesignerItemField(KoReportDesigner *, QGraphicsScene * scene, const QPointF &pos);
+    KReportDesignerItemField(KReportDesigner *, QGraphicsScene * scene, const QPointF &pos);
     //Used when loading from file
-    KoReportDesignerItemField(const QDomNode & element, KoReportDesigner *, QGraphicsScene * scene);
-    virtual ~KoReportDesignerItemField();
+    KReportDesignerItemField(const QDomNode & element, KReportDesigner *, QGraphicsScene * scene);
+    virtual ~KReportDesignerItemField();
     virtual void buildXML(QDomDocument *doc, QDomElement *parent);
 
     virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget *widget = 0);
-    virtual KoReportDesignerItemField* clone();
+    virtual KReportDesignerItemField* clone();
 
 protected:
     virtual void mousePressEvent(QGraphicsSceneMouseEvent * event);
 
 private:
-    void init(QGraphicsScene*, KoReportDesigner * d);
+    void init(QGraphicsScene*, KReportDesigner * d);
     QRect getTextRect() const;
 
 private Q_SLOTS:
     void slotPropertyChanged(KPropertySet &, KProperty &);
 };
 
 #endif
diff --git a/src/items/field/KReportFieldPlugin.cpp b/src/items/field/KReportFieldPlugin.cpp
new file mode 100644
index 00000000..67e28036
--- /dev/null
+++ b/src/items/field/KReportFieldPlugin.cpp
@@ -0,0 +1,66 @@
+/* This file is part of the KDE project
+   Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this library; see the file COPYING.LIB.  If not, write to
+   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.
+*/
+
+#include "KReportFieldPlugin.h"
+#include "KReportItemField.h"
+#include "KReportDesignerItemField.h"
+#include "KReportPluginMetaData.h"
+#ifdef KREPORT_SCRIPTING
+#include "KReportScriptField.h"
+#endif
+
+KREPORT_PLUGIN_FACTORY(KReportFieldPlugin, "field.json")
+
+KReportFieldPlugin::KReportFieldPlugin(QObject *parent, const QVariantList &args)
+    : KReportPluginInterface(parent, args)
+{
+}
+
+KReportFieldPlugin::~KReportFieldPlugin()
+{
+
+}
+
+QObject* KReportFieldPlugin::createRendererInstance(const QDomNode& element)
+{
+    return new KReportItemField(element);
+}
+
+QObject* KReportFieldPlugin::createDesignerInstance(const QDomNode& element, KReportDesigner* designer, QGraphicsScene* scene)
+{
+    return new KReportDesignerItemField(element, designer, scene);
+}
+
+QObject* KReportFieldPlugin::createDesignerInstance(KReportDesigner* designer, QGraphicsScene* scene, const QPointF& pos)
+{
+    return new KReportDesignerItemField(designer, scene, pos);
+}
+
+#ifdef KREPORT_SCRIPTING
+QObject* KReportFieldPlugin::createScriptInstance(KReportItemBase* item)
+{
+    KReportItemField *field = dynamic_cast(item);
+    if (field) {
+        return new Scripting::Field(field);
+    }
+    return 0;
+}
+#endif
+
+#include "KReportFieldPlugin.moc"
diff --git a/src/items/text/KoReportTextPlugin.h b/src/items/field/KReportFieldPlugin.h
similarity index 65%
rename from src/items/text/KoReportTextPlugin.h
rename to src/items/field/KReportFieldPlugin.h
index 168aa158..38f1aed7 100644
--- a/src/items/text/KoReportTextPlugin.h
+++ b/src/items/field/KReportFieldPlugin.h
@@ -1,41 +1,41 @@
 /* This file is part of the KDE project
    Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
 */
 
-#ifndef KOREPORTTEXTPLUGIN_H
-#define KOREPORTTEXTPLUGIN_H
+#ifndef KREPORTFIELDPLUGIN_H
+#define KREPORTFIELDPLUGIN_H
 
-#include "KoReportStaticPluginInterface.h"
+#include "KReportStaticPluginInterface.h"
 
-KREPORT_DECLARE_STATIC_PLUGIN(KoReportTextPlugin)
+KREPORT_DECLARE_STATIC_PLUGIN(KReportFieldPlugin)
 
-class KoReportTextPlugin : public KoReportPluginInterface
+class KReportFieldPlugin : public KReportPluginInterface
 {
     public:
-    explicit KoReportTextPlugin(QObject *parent, const QVariantList &args = QVariantList());
-    virtual ~KoReportTextPlugin();
+    explicit KReportFieldPlugin(QObject *parent, const QVariantList &args = QVariantList());
+    virtual ~KReportFieldPlugin();
 
     virtual QObject* createRendererInstance(const QDomNode& element);
-    virtual QObject* createDesignerInstance(const QDomNode& element, KoReportDesigner* , QGraphicsScene* scene);
-    virtual QObject* createDesignerInstance(KoReportDesigner* , QGraphicsScene* scene, const QPointF& pos);
+    virtual QObject* createDesignerInstance(const QDomNode& element, KReportDesigner* , QGraphicsScene* scene);
+    virtual QObject* createDesignerInstance(KReportDesigner* , QGraphicsScene* scene, const QPointF& pos);
 #ifdef KREPORT_SCRIPTING
-    virtual QObject* createScriptInstance(KoReportItemBase* item);
+    virtual QObject* createScriptInstance(KReportItemBase* item);
 #endif
 };
 
-#endif // KOREPORTTEXTPLUGIN_H
+#endif // KREPORTFIELDPLUGIN_H
diff --git a/src/items/field/KoReportItemField.cpp b/src/items/field/KReportItemField.cpp
similarity index 89%
rename from src/items/field/KoReportItemField.cpp
rename to src/items/field/KReportItemField.cpp
index a6e250ff..e59d3794 100644
--- a/src/items/field/KoReportItemField.cpp
+++ b/src/items/field/KReportItemField.cpp
@@ -1,291 +1,291 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "KoReportItemField.h"
-#include "common/renderobjects.h"
+#include "KReportItemField.h"
+#include "KReportRenderObjects.h"
 #include "kreportplugin_debug.h"
 #ifdef KREPORT_SCRIPTING
-#include "renderer/scripting/krscripthandler.h"
+#include "renderer/scripting/KReportScriptHandler.h"
 #endif
 
 #include 
 
 #include 
 #include 
 #include 
 #include 
 
-KoReportItemField::KoReportItemField()
+KReportItemField::KReportItemField()
 {
     createProperties();
 }
 
-KoReportItemField::KoReportItemField(const QDomNode & element)
+KReportItemField::KReportItemField(const QDomNode & element)
 {
     createProperties();
     QDomNodeList nl = element.childNodes();
     QString n;
     QDomNode node;
 
     m_name->setValue(element.toElement().attribute(QLatin1String("report:name")));
     m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source")));
     m_itemValue->setValue(element.toElement().attribute(QLatin1String("report:value")));
     Z = element.toElement().attribute(QLatin1String("report:z-index")).toDouble();
     m_horizontalAlignment->setValue(element.toElement().attribute(QLatin1String("report:horizontal-align")));
     m_verticalAlignment->setValue(element.toElement().attribute(QLatin1String("report:vertical-align")));
 
     m_canGrow->setValue(element.toElement().attribute(QLatin1String("report:can-grow")));
     m_wordWrap->setValue(element.toElement().attribute(QLatin1String("report:word-wrap")));
 
     parseReportRect(element.toElement(), &m_pos, &m_size);
 
     for (int i = 0; i < nl.count(); i++) {
         node = nl.item(i);
         n = node.nodeName();
 
         if (n == QLatin1String("report:text-style")) {
             KRTextStyleData ts;
             if (parseReportTextStyleData(node.toElement(), &ts)) {
                 m_backgroundColor->setValue(ts.backgroundColor);
                 m_foregroundColor->setValue(ts.foregroundColor);
                 m_backgroundOpacity->setValue(ts.backgroundOpacity);
                 m_font->setValue(ts.font);
 
             }
         } else if (n == QLatin1String("report:line-style")) {
-            KRLineStyleData ls;
+            KReportLineStyle ls;
             if (parseReportLineStyleData(node.toElement(), &ls)) {
-                m_lineWeight->setValue(ls.weight);
-                m_lineColor->setValue(ls.lineColor);
-                m_lineStyle->setValue(QPen(ls.style));
+                m_lineWeight->setValue(ls.width());
+                m_lineColor->setValue(ls.color());
+                m_lineStyle->setValue(QPen(ls.penStyle()));
             }
         } else {
             kreportpluginWarning() << "while parsing field element encountered unknow element: " << n;
         }
     }
 }
 
-KoReportItemField::~KoReportItemField()
+KReportItemField::~KReportItemField()
 {
     delete m_set;
 }
 
-void KoReportItemField::createProperties()
+void KReportItemField::createProperties()
 {
     m_set = new KPropertySet(0, QLatin1String("Field"));
 
     QStringList keys, strings;
 
     m_controlSource = new KProperty("item-data-source", QStringList(), QStringList(), QString(), tr("Data Source"));
     m_controlSource->setOption("extraValueAllowed", QLatin1String("true"));
 
     m_itemValue = new KProperty("value", QString(), tr("Value"), tr("Value used if not bound to a field"));
 
     keys << QLatin1String("left") << QLatin1String("center") << QLatin1String("right");
     strings << tr("Left") << tr("Center") << tr("Right");
     m_horizontalAlignment = new KProperty("horizontal-align", keys, strings, QLatin1String("left"), tr("Horizontal Alignment"));
 
     keys.clear();
     strings.clear();
     keys << QLatin1String("top") << QLatin1String("center") << QLatin1String("bottom");
     strings << tr("Top") << tr("Center") << tr("Bottom");
     m_verticalAlignment = new KProperty("vertical-align", keys, strings, QLatin1String("center"), tr("Vertical Alignment"));
 
     m_font = new KProperty("font", QApplication::font(), tr("Font"));
 
     m_backgroundColor = new KProperty("background-color", QColor(Qt::white), tr("Background Color"));
     m_foregroundColor = new KProperty("foreground-color", QPalette().color(QPalette::Foreground), tr("Foreground Color"));
 
     m_backgroundOpacity = new KProperty("background-opacity", QVariant(0), tr("Background Opacity"));
     m_backgroundOpacity->setOption("max", 100);
     m_backgroundOpacity->setOption("min", 0);
     m_backgroundOpacity->setOption("unit", QLatin1String("%"));
 
     m_lineWeight = new KProperty("line-weight", 1, tr("Line Weight"));
     m_lineColor = new KProperty("line-color", QColor(Qt::black), tr("Line Color"));
     m_lineStyle = new KProperty("line-style", QPen(Qt::NoPen), tr("Line Style"), tr("Line Style"), KProperty::LineStyle);
 
     m_wordWrap = new KProperty("word-wrap", QVariant(false), tr("Word Wrap"));
     m_canGrow = new KProperty("can-grow", QVariant(false), tr("Can Grow"));
 
     //! @todo I do not think we need these
 #if 0 //Field Totals
     m_trackTotal = new KProperty("trackTotal", QVariant(false), futureI18n("Track Total"));
     m_trackBuiltinFormat = new KProperty("trackBuiltinFormat", QVariant(false), futureI18n("Track Builtin Format"));
     _useSubTotal = new KProperty("useSubTotal", QVariant(false), futureI18n("Use Sub Total"_);
     _trackTotalFormat = new KProperty("trackTotalFormat", QString(), futureI18n("Track Total Format"));
 #endif
 
     addDefaultProperties();
     m_set->addProperty(m_controlSource);
     m_set->addProperty(m_itemValue);
     m_set->addProperty(m_horizontalAlignment);
     m_set->addProperty(m_verticalAlignment);
     m_set->addProperty(m_font);
     m_set->addProperty(m_backgroundColor);
     m_set->addProperty(m_foregroundColor);
     m_set->addProperty(m_backgroundOpacity);
     m_set->addProperty(m_lineWeight);
     m_set->addProperty(m_lineColor);
     m_set->addProperty(m_lineStyle);
     m_set->addProperty(m_wordWrap);
     m_set->addProperty(m_canGrow);
 
     //_set->addProperty ( _trackTotal );
     //_set->addProperty ( _trackBuiltinFormat );
     //_set->addProperty ( _useSubTotal );
     //_set->addProperty ( _trackTotalFormat );
 }
 
-int KoReportItemField::textFlags() const
+int KReportItemField::textFlags() const
 {
     int flags;
     QString t;
     t = m_horizontalAlignment->value().toString();
     if (t == QLatin1String("center"))
         flags = Qt::AlignHCenter;
     else if (t == QLatin1String("right"))
         flags = Qt::AlignRight;
     else
         flags = Qt::AlignLeft;
 
     t = m_verticalAlignment->value().toString();
     if (t == QLatin1String("center"))
         flags |= Qt::AlignVCenter;
     else if (t == QLatin1String("bottom"))
         flags |= Qt::AlignBottom;
     else
         flags |= Qt::AlignTop;
 
     if (m_wordWrap->value().toBool() == true) {
         flags |= Qt::TextWordWrap;
     }
     return flags;
 }
 
-KRTextStyleData KoReportItemField::textStyle() const
+KRTextStyleData KReportItemField::textStyle() const
 {
     KRTextStyleData d;
     d.backgroundColor = m_backgroundColor->value().value();
     d.foregroundColor = m_foregroundColor->value().value();
     d.font = m_font->value().value();
     d.backgroundOpacity = m_backgroundOpacity->value().toInt();
 
     return d;
 }
 
-QString KoReportItemField::itemDataSource() const
+QString KReportItemField::itemDataSource() const
 {
     return m_controlSource->value().toString();
 }
 
-void KoReportItemField::setItemDataSource(const QString& t)
+void KReportItemField::setItemDataSource(const QString& t)
 {
     if (m_controlSource->value() != t) {
         m_controlSource->setValue(t);
     }
     //kreportpluginDebug() << "Field: " << entityName() << "is" << itemDataSource();
 }
 
-KRLineStyleData KoReportItemField::lineStyle() const
+KReportLineStyle KReportItemField::lineStyle() const
 {
-    KRLineStyleData ls;
-    ls.weight = m_lineWeight->value().toInt();
-    ls.lineColor = m_lineColor->value().value();
-    ls.style = (Qt::PenStyle)m_lineStyle->value().toInt();
+    KReportLineStyle ls;
+    ls.setWidth(m_lineWeight->value().toInt());
+    ls.setColor(m_lineColor->value().value());
+    ls.setPenStyle((Qt::PenStyle)m_lineStyle->value().toInt());
     return ls;
 }
 // RTTI
-QString KoReportItemField::typeName() const
+QString KReportItemField::typeName() const
 {
     return QLatin1String("field");
 }
 
-int KoReportItemField::renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset,
-                                        const QVariant &data, KRScriptHandler *script)
+int KReportItemField::renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset,
+                                        const QVariant &data, KReportScriptHandler *script)
 {
     OROTextBox * tb = new OROTextBox();
     tb->setPosition(m_pos.toScene() + offset);
     tb->setSize(m_size.toScene());
     tb->setFont(font());
     tb->setFlags(textFlags());
     tb->setTextStyle(textStyle());
     tb->setLineStyle(lineStyle());
     tb->setCanGrow(m_canGrow->value().toBool());
     tb->setWordWrap(m_wordWrap->value().toBool());
 
     QString str;
 
     QString ids = itemDataSource();
     if (!ids.isEmpty()) {
 #ifdef KREPORT_SCRIPTING
         if (ids.left(1) == QLatin1String("=") && script) { //Everything after = is treated as code
             if (!ids.contains(QLatin1String("PageTotal()"))) {
                 QVariant v = script->evaluate(ids.mid(1));
                 str = v.toString();
             } else {
                 str = ids.mid(1);
                 tb->setRequiresPostProcessing();
             }
         } else
 #else
         Q_UNUSED(script);
 #endif
         if (ids.left(1) == QLatin1String("$")) { //Everything past $ is treated as a string
             str = ids.mid(1);
         } else {
             str = data.toString();
         }
     } else {
             str = m_itemValue->value().toString();
     }
 
     tb->setText(str);
 
     //Work out the size of the text
     if (tb->canGrow()) {
         QRect r;
         if (tb->wordWrap()) {
             //Grow vertically
             QFontMetrics metrics(font());
             QRect temp(tb->position().x(), tb->position().y(), tb->size().width(), 5000); // a large vertical height
             r = metrics.boundingRect(temp, tb->flags(), str);
         } else {
             //Grow Horizontally
             QFontMetrics metrics(font());
             QRect temp(tb->position().x(), tb->position().y(), 5000, tb->size().height()); // a large vertical height
             r = metrics.boundingRect(temp, tb->flags(), str);
         }
         tb->setSize(r.size() + QSize(4,4));
     }
 
     if (page) {
         page->addPrimitive(tb);
     }
 
     if (section) {
         OROPrimitive *clone = tb->clone();
         clone->setPosition(m_pos.toScene());
         section->addPrimitive(clone);
     }
     int height = m_pos.toScene().y() + tb->size().height();
     //If there is no page to add the item to, delete it now because it wont be deleted later
     if (!page) {
         delete tb;
     }
     return height;
 }
diff --git a/src/items/field/KoReportItemField.h b/src/items/field/KReportItemField.h
similarity index 84%
rename from src/items/field/KoReportItemField.h
rename to src/items/field/KReportItemField.h
index 51a07025..d9a320c2 100644
--- a/src/items/field/KoReportItemField.h
+++ b/src/items/field/KReportItemField.h
@@ -1,91 +1,91 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#ifndef KOREPORTITEMFIELD_H
-#define KOREPORTITEMFIELD_H
+#ifndef KREPORTITEMFIELD_H
+#define KREPORTITEMFIELD_H
 
-#include "KoReportItemBase.h"
-#include "krsize.h"
+#include "KReportItemBase.h"
+#include "KReportSize.h"
 
 #include 
 
 class QDomNode;
 
 namespace Scripting
 {
 class Field;
 }
 
-class KoReportItemField : public KoReportItemBase
+class KReportItemField : public KReportItemBase
 {
 Q_OBJECT
 public:
-    KoReportItemField();
-    explicit KoReportItemField(const QDomNode & element);
-    virtual ~KoReportItemField();
+    KReportItemField();
+    explicit KReportItemField(const QDomNode & element);
+    virtual ~KReportItemField();
 
     virtual QString typeName() const;
-    virtual int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KRScriptHandler *script);
+    virtual int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KReportScriptHandler *script);
 
     virtual QString itemDataSource() const;
 
 protected:
 
     KProperty * m_controlSource;
     KProperty * m_horizontalAlignment;
     KProperty * m_verticalAlignment;
     KProperty * m_font;
     //KProperty * m_trackTotal;
     //KProperty * m_trackBuiltinFormat;
     //KProperty * _useSubTotal;
     //KProperty * _trackTotalFormat;
     KProperty * m_foregroundColor;
     KProperty * m_backgroundColor;
     KProperty* m_backgroundOpacity;
     KProperty* m_lineColor;
     KProperty* m_lineWeight;
     KProperty* m_lineStyle;
     KProperty* m_wordWrap;
     KProperty* m_canGrow;
     KProperty* m_itemValue;
 
     //bool builtinFormat;
     //QString format;
 
     QStringList fieldNames(const QString &);
 
-    KRLineStyleData lineStyle() const;
+    KReportLineStyle lineStyle() const;
     KRTextStyleData textStyle() const;
 
     void setTrackTotal(bool);
     void setTrackTotalFormat(const QString &, bool = false);
     void setUseSubTotal(bool);
     int textFlags() const;
 
     QFont font() const {
         return m_font->value().value();
     }
 
     void setItemDataSource(const QString&);
 
 private:
     virtual void createProperties();
 
     friend class Scripting::Field;
 };
 
 #endif
diff --git a/src/items/field/krscriptfield.cpp b/src/items/field/KReportScriptField.cpp
similarity index 98%
rename from src/items/field/krscriptfield.cpp
rename to src/items/field/KReportScriptField.cpp
index 63beba04..feef1db2 100644
--- a/src/items/field/krscriptfield.cpp
+++ b/src/items/field/KReportScriptField.cpp
@@ -1,183 +1,183 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "krscriptfield.h"
+#include "KReportScriptField.h"
 
 namespace Scripting
 {
-Field::Field(KoReportItemField *f)
+Field::Field(KReportItemField *f)
 {
     m_field = f;
 }
 
 
 Field::~Field()
 {
 }
 
 QString Field::source()
 {
     return m_field->itemDataSource();
 }
 
 void Field::setSource(const QString& s)
 {
     m_field->setItemDataSource(s);
 }
 
 int Field::horizontalAlignment()
 {
     const QString a = m_field->m_horizontalAlignment->value().toString().toLower();
 
     if (a == QLatin1String("left")) {
         return -1;
     }
     if (a == QLatin1String("center")) {
         return 0;
     }
     if (a == QLatin1String("right")) {
         return 1;
     }
     return -1;
 }
 void Field::setHorizonalAlignment(int a)
 {
     switch (a) {
     case -1:
         m_field->m_horizontalAlignment->setValue(QLatin1String("left"));
         break;
     case 0:
         m_field->m_horizontalAlignment->setValue(QLatin1String("center"));
         break;
     case 1:
         m_field->m_horizontalAlignment->setValue(QLatin1String("right"));
         break;
     default:
         m_field->m_horizontalAlignment->setValue(QLatin1String("left"));
         break;
     }
 }
 
 int Field::verticalAlignment()
 {
     const QString a = m_field->m_horizontalAlignment->value().toString().toLower();
 
     if (a == QLatin1String("top")) {
         return -1;
     }
     if (a == QLatin1String("middle")) {
         return 0;
     }
     if (a == QLatin1String("bottom")) {
         return 1;
     }
     return -1;
 }
 void Field::setVerticalAlignment(int a)
 {
     switch (a) {
     case -1:
         m_field->m_verticalAlignment->setValue(QLatin1String("top"));
         break;
     case 0:
         m_field->m_verticalAlignment->setValue(QLatin1String("middle"));
         break;
     case 1:
         m_field->m_verticalAlignment->setValue(QLatin1String("bottom"));
         break;
     default:
         m_field->m_verticalAlignment->setValue(QLatin1String("middle"));
         break;
     }
 }
 
 QColor Field::backgroundColor()
 {
     return m_field->m_backgroundColor->value().value();
 }
 void Field::setBackgroundColor(const QColor& c)
 {
     m_field->m_backgroundColor->setValue(c);
 }
 
 QColor Field::foregroundColor()
 {
     return m_field->m_foregroundColor->value().value();
 }
 void Field::setForegroundColor(const QColor& c)
 {
     m_field->m_foregroundColor->setValue(c);
 }
 
 int Field::backgroundOpacity()
 {
     return m_field->m_backgroundOpacity->value().toInt();
 }
 void Field::setBackgroundOpacity(int o)
 {
     m_field->m_backgroundOpacity->setValue(o);
 }
 
 QColor Field::lineColor()
 {
     return m_field->m_lineColor->value().value();
 }
 void Field::setLineColor(const QColor& c)
 {
     m_field->m_lineColor->setValue(c);
 }
 
 int Field::lineWeight()
 {
     return m_field->m_lineWeight->value().toInt();
 }
 void Field::setLineWeight(int w)
 {
     m_field->m_lineWeight->setValue(w);
 }
 
 int Field::lineStyle()
 {
     return m_field->m_lineStyle->value().toInt();
 }
 void Field::setLineStyle(int s)
 {
     if (s < 0 || s > 5) {
         s = 1;
     }
     m_field->m_lineStyle->setValue(s);
 }
 
 QPointF Field::position()
 {
     return m_field->m_pos.toPoint();
 }
 void Field::setPosition(const QPointF &p)
 {
     m_field->m_pos.setPointPos(p);
 }
 
 QSizeF Field::size()
 {
     return m_field->m_size.toPoint();
 }
 void Field::setSize(const QSizeF &s)
 {
     m_field->m_size.setPointSize(s);
 }
 
 }
diff --git a/src/items/field/krscriptfield.h b/src/items/field/KReportScriptField.h
similarity index 94%
rename from src/items/field/krscriptfield.h
rename to src/items/field/KReportScriptField.h
index ace342a1..e64a8685 100644
--- a/src/items/field/krscriptfield.h
+++ b/src/items/field/KReportScriptField.h
@@ -1,78 +1,78 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
 #ifndef KRSCRIPTFIELD_H
 #define KRSCRIPTFIELD_H
 
 #include 
 
-#include "KoReportItemField.h"
+#include "KReportItemField.h"
 
 /**
 */
 namespace Scripting
 {
 class Field : public QObject
 {
     Q_OBJECT
 public:
-    explicit Field(KoReportItemField*);
+    explicit Field(KReportItemField*);
 
     ~Field();
 
 public Q_SLOTS:
     /**Returns the source (column) that the field gets its data from*/
     QString source();
     /**Sets the source (column) for the field*/
     void setSource(const QString&);
 
     int horizontalAlignment();
     void setHorizonalAlignment(int);
 
     int verticalAlignment();
     void setVerticalAlignment(int);
 
     QColor backgroundColor();
     void setBackgroundColor(const QColor&);
 
     QColor foregroundColor();
     void setForegroundColor(const QColor&);
 
     int backgroundOpacity();
     void setBackgroundOpacity(int);
 
     QColor lineColor();
     void setLineColor(const QColor&);
 
     int lineWeight();
     void setLineWeight(int);
 
     int lineStyle();
     void setLineStyle(int);
 
     QPointF position();
     void setPosition(const QPointF&);
 
     QSizeF size();
     void setSize(const QSizeF&);
 
 private:
-    KoReportItemField *m_field;
+    KReportItemField *m_field;
 
 };
 }
 #endif
diff --git a/src/items/field/KoReportFieldPlugin.cpp b/src/items/field/KoReportFieldPlugin.cpp
deleted file mode 100644
index 8a4bb8a9..00000000
--- a/src/items/field/KoReportFieldPlugin.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/* This file is part of the KDE project
-   Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public License
-   along with this library; see the file COPYING.LIB.  If not, write to
-   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.
-*/
-
-#include "KoReportFieldPlugin.h"
-#include "KoReportItemField.h"
-#include "KoReportDesignerItemField.h"
-#include "common/KReportPluginMetaData.h"
-#ifdef KREPORT_SCRIPTING
-#include "krscriptfield.h"
-#endif
-
-KREPORT_PLUGIN_FACTORY(KoReportFieldPlugin, "field.json")
-
-KoReportFieldPlugin::KoReportFieldPlugin(QObject *parent, const QVariantList &args)
-    : KoReportPluginInterface(parent, args)
-{
-}
-
-KoReportFieldPlugin::~KoReportFieldPlugin()
-{
-
-}
-
-QObject* KoReportFieldPlugin::createRendererInstance(const QDomNode& element)
-{
-    return new KoReportItemField(element);
-}
-
-QObject* KoReportFieldPlugin::createDesignerInstance(const QDomNode& element, KoReportDesigner* designer, QGraphicsScene* scene)
-{
-    return new KoReportDesignerItemField(element, designer, scene);
-}
-
-QObject* KoReportFieldPlugin::createDesignerInstance(KoReportDesigner* designer, QGraphicsScene* scene, const QPointF& pos)
-{
-    return new KoReportDesignerItemField(designer, scene, pos);
-}
-
-#ifdef KREPORT_SCRIPTING
-QObject* KoReportFieldPlugin::createScriptInstance(KoReportItemBase* item)
-{
-    KoReportItemField *field = dynamic_cast(item);
-    if (field) {
-        return new Scripting::Field(field);
-    }
-    return 0;
-}
-#endif
-
-#include "KoReportFieldPlugin.moc"
diff --git a/src/items/image/KoReportDesignerItemImage.cpp b/src/items/image/KReportDesignerItemImage.cpp
similarity index 73%
rename from src/items/image/KoReportDesignerItemImage.cpp
rename to src/items/image/KReportDesignerItemImage.cpp
index b72e0dd5..ffaae833 100644
--- a/src/items/image/KoReportDesignerItemImage.cpp
+++ b/src/items/image/KReportDesignerItemImage.cpp
@@ -1,153 +1,152 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "KoReportDesignerItemImage.h"
-#include "wrtembed/KoReportDesignerItemBase.h"
-#include "wrtembed/KoReportDesigner.h"
+#include "KReportDesignerItemImage.h"
+#include "KReportDesignerItemBase.h"
+#include "KReportDesigner.h"
 
 #include 
-
 #include 
 #include 
 #include 
 #include 
 
 //
 // ReportEntitiesImage
 //
 // contructors/deconstructors
 
-void KoReportDesignerItemImage::init(QGraphicsScene *scene, KoReportDesigner *d)
+void KReportDesignerItemImage::init(QGraphicsScene *scene, KReportDesigner *d)
 {
     //kreportpluginDebug();
     if (scene)
         scene->addItem(this);
 
-    KoReportDesignerItemRectBase::init(&m_pos, &m_size, m_set, d);
+    KReportDesignerItemRectBase::init(&m_pos, &m_size, m_set, d);
 
     connect(m_set, SIGNAL(propertyChanged(KPropertySet&,KProperty&)),
             this, SLOT(slotPropertyChanged(KPropertySet&,KProperty&)));
 
     m_controlSource->setListData(m_reportDesigner->fieldKeys(), m_reportDesigner->fieldNames());
     setZValue(Z);
 }
 
-KoReportDesignerItemImage::KoReportDesignerItemImage(KoReportDesigner * rw, QGraphicsScene* scene, const QPointF &pos)
-        : KoReportDesignerItemRectBase(rw)
+KReportDesignerItemImage::KReportDesignerItemImage(KReportDesigner * rw, QGraphicsScene* scene, const QPointF &pos)
+        : KReportDesignerItemRectBase(rw)
 {
     Q_UNUSED(pos);
     //kreportpluginDebug();
     init(scene, rw);
-    setSceneRect(properRect(*rw, KOREPORT_ITEM_RECT_DEFAULT_WIDTH, KOREPORT_ITEM_RECT_DEFAULT_WIDTH));
+    setSceneRect(properRect(*rw, KREPORT_ITEM_RECT_DEFAULT_WIDTH, KREPORT_ITEM_RECT_DEFAULT_WIDTH));
     m_name->setValue(m_reportDesigner->suggestEntityName(typeName()));
 }
 
-KoReportDesignerItemImage::KoReportDesignerItemImage(const QDomNode & element, KoReportDesigner * rw, QGraphicsScene* scene)
-        : KoReportItemImage(element), KoReportDesignerItemRectBase(rw)
+KReportDesignerItemImage::KReportDesignerItemImage(const QDomNode & element, KReportDesigner * rw, QGraphicsScene* scene)
+        : KReportItemImage(element), KReportDesignerItemRectBase(rw)
 {
     init(scene, rw);
     setSceneRect(m_pos.toScene(), m_size.toScene());
 }
 
-KoReportDesignerItemImage* KoReportDesignerItemImage::clone()
+KReportDesignerItemImage* KReportDesignerItemImage::clone()
 {
     QDomDocument d;
     QDomElement e = d.createElement(QLatin1String("clone"));
     QDomNode n;
     buildXML(&d, &e);
     n = e.firstChild();
-    return new KoReportDesignerItemImage(n, designer(), 0);
+    return new KReportDesignerItemImage(n, designer(), 0);
 }
 
-KoReportDesignerItemImage::~KoReportDesignerItemImage()
+KReportDesignerItemImage::~KReportDesignerItemImage()
 {
     // do we need to clean anything up?
 }
 
-void KoReportDesignerItemImage::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
+void KReportDesignerItemImage::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
 {
     Q_UNUSED(option);
     Q_UNUSED(widget);
 
     // store any values we plan on changing so we can restore them
     QPen  p = painter->pen();
 
     if (isInline()) {
         //QImage t_img = _image;
         QImage t_img = m_staticImage->value().value().toImage();
         if (mode() == QLatin1String("stretch")) {
             t_img = t_img.scaled(rect().width(), rect().height(), Qt::KeepAspectRatio);
         }
         painter->drawImage(rect().left(), rect().top(), t_img, 0, 0, rect().width(), rect().height());
     } else {
         painter->drawText(rect(), 0, dataSourceAndObjectTypeName(itemDataSource(), QLatin1String("image")));
     }
 
     //Draw a border so user knows the object edge
     painter->setPen(QPen(Qt::lightGray));
     painter->drawRect(rect());
 
 
     drawHandles(painter);
 
     // restore an values before we started just in case
     painter->setPen(p);
 }
 
-void KoReportDesignerItemImage::buildXML(QDomDocument *doc, QDomElement *parent)
+void KReportDesignerItemImage::buildXML(QDomDocument *doc, QDomElement *parent)
 {
     QDomElement entity = doc->createElement(QLatin1String("report:") + typeName());
 
     // properties
     addPropertyAsAttribute(&entity, m_name);
     addPropertyAsAttribute(&entity, m_resizeMode);
     entity.setAttribute(QLatin1String("report:z-index"), zValue());
     buildXMLRect(doc, &entity, &m_pos, &m_size);
 
 
     if (isInline()) {
         QDomElement map = doc->createElement(QLatin1String("report:inline-image-data"));
         map.appendChild(doc->createTextNode(QLatin1String(inlineImageData())));
         entity.appendChild(map);
     } else {
         addPropertyAsAttribute(&entity, m_controlSource);
     }
 
     parent->appendChild(entity);
 }
 
-void KoReportDesignerItemImage::slotPropertyChanged(KPropertySet &s, KProperty &p)
+void KReportDesignerItemImage::slotPropertyChanged(KPropertySet &s, KProperty &p)
 {
     if (p.name() == "Name") {
         //For some reason p.oldValue returns an empty string
         if (!m_reportDesigner->isEntityNameUnique(p.value().toString(), this)) {
             p.setValue(m_oldName);
         } else {
             m_oldName = p.value().toString();
         }
     }
 
-    KoReportDesignerItemRectBase::propertyChanged(s, p);
+    KReportDesignerItemRectBase::propertyChanged(s, p);
     if (m_reportDesigner) m_reportDesigner->setModified(true);
 }
 
-void KoReportDesignerItemImage::mousePressEvent(QGraphicsSceneMouseEvent * event)
+void KReportDesignerItemImage::mousePressEvent(QGraphicsSceneMouseEvent * event)
 {
     m_controlSource->setListData(m_reportDesigner->fieldKeys(), m_reportDesigner->fieldNames());
-    KoReportDesignerItemRectBase::mousePressEvent(event);
+    KReportDesignerItemRectBase::mousePressEvent(event);
 }
diff --git a/src/plugins/barcode/KoReportDesignerItemBarcode.h b/src/items/image/KReportDesignerItemImage.h
similarity index 65%
rename from src/plugins/barcode/KoReportDesignerItemBarcode.h
rename to src/items/image/KReportDesignerItemImage.h
index 03346041..fd33011a 100644
--- a/src/plugins/barcode/KoReportDesignerItemBarcode.h
+++ b/src/items/image/KReportDesignerItemImage.h
@@ -1,57 +1,50 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
+#ifndef KREPORTDESIGNERITEMIMAGE_H
+#define KREPORTDESIGNERITEMIMAGE_H
 
-#ifndef __REPORTENTITYBARCODE_H__
-#define __REPORTENTITYBARCODE_H__
+#include "KReportDesignerItemRectBase.h"
+#include "KReportItemImage.h"
 
 #include 
 
-#include "KoReportDesignerItemRectBase.h"
-#include "KoReportItemBarcode.h"
-
-//
-// ReportEntityBarcode
-//
-class KoReportDesignerItemBarcode : public KoReportItemBarcode, public KoReportDesignerItemRectBase
+class KReportDesignerItemImage : public KReportItemImage, public KReportDesignerItemRectBase
 {
-    Q_OBJECT
+  Q_OBJECT
 public:
-    KoReportDesignerItemBarcode(KoReportDesigner *, QGraphicsScene* scene, const QPointF &pos);
-    KoReportDesignerItemBarcode(const QDomNode & element, KoReportDesigner *, QGraphicsScene* scene);
+    KReportDesignerItemImage(KReportDesigner *, QGraphicsScene* scene, const QPointF &pos);
+    KReportDesignerItemImage(const QDomNode & element, KReportDesigner *, QGraphicsScene* scene);
 
-    virtual ~KoReportDesignerItemBarcode();
+    virtual ~KReportDesignerItemImage();
     virtual void buildXML(QDomDocument *doc, QDomElement *parent);
     virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0);
-
-    virtual KoReportDesignerItemBarcode* clone();
-
+    virtual KReportDesignerItemImage* clone();
 
 protected:
     virtual void mousePressEvent(QGraphicsSceneMouseEvent * event);
 
 private:
-    void init(QGraphicsScene*, KoReportDesigner*);
-
-    QRect getTextRect();
+    void init(QGraphicsScene*, KReportDesigner*);
 
 private Q_SLOTS:
     void slotPropertyChanged(KPropertySet &, KProperty &);
+
 };
 
 #endif
diff --git a/src/items/image/KReportImagePlugin.cpp b/src/items/image/KReportImagePlugin.cpp
new file mode 100644
index 00000000..adf0b86f
--- /dev/null
+++ b/src/items/image/KReportImagePlugin.cpp
@@ -0,0 +1,67 @@
+/* This file is part of the KDE project
+   Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this library; see the file COPYING.LIB.  If not, write to
+   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.
+*/
+
+#include "KReportImagePlugin.h"
+#include "KReportItemImage.h"
+#include "KReportDesignerItemImage.h"
+#include "KReportPluginMetaData.h"
+#ifdef KREPORT_SCRIPTING
+#include "KReportScriptImage.h"
+#endif
+
+KREPORT_PLUGIN_FACTORY(KReportImagePlugin, "image.json")
+
+KReportImagePlugin::KReportImagePlugin(QObject *parent, const QVariantList &args)
+    : KReportPluginInterface(parent, args)
+{
+    Q_UNUSED(args)
+}
+
+KReportImagePlugin::~KReportImagePlugin()
+{
+
+}
+
+QObject* KReportImagePlugin::createRendererInstance(const QDomNode& element)
+{
+    return new KReportItemImage(element);
+}
+
+QObject* KReportImagePlugin::createDesignerInstance(const QDomNode& element, KReportDesigner* designer, QGraphicsScene* scene)
+{
+    return new KReportDesignerItemImage(element, designer, scene);
+}
+
+QObject* KReportImagePlugin::createDesignerInstance(KReportDesigner* designer, QGraphicsScene* scene, const QPointF& pos)
+{
+    return new KReportDesignerItemImage(designer, scene, pos);
+}
+
+#ifdef KREPORT_SCRIPTING
+QObject* KReportImagePlugin::createScriptInstance(KReportItemBase* item)
+{
+    KReportItemImage *image = dynamic_cast(item);
+    if (image) {
+        return new Scripting::Image(image);
+    }
+    return 0;
+}
+#endif
+
+#include "KReportImagePlugin.moc"
diff --git a/src/items/image/KoReportImagePlugin.h b/src/items/image/KReportImagePlugin.h
similarity index 63%
rename from src/items/image/KoReportImagePlugin.h
rename to src/items/image/KReportImagePlugin.h
index e214aee4..2d32a321 100644
--- a/src/items/image/KoReportImagePlugin.h
+++ b/src/items/image/KReportImagePlugin.h
@@ -1,41 +1,41 @@
 /* This file is part of the KDE project
    Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
 */
 
-#ifndef KOREPORTIMAGEPLUGIN_H
-#define KOREPORTIMAGEPLUGIN_H
+#ifndef KREPORTIMAGEPLUGIN_H
+#define KREPORTIMAGEPLUGIN_H
 
-#include "KoReportStaticPluginInterface.h"
+#include "KReportStaticPluginInterface.h"
 
-KREPORT_DECLARE_STATIC_PLUGIN(KoReportImagePlugin)
+KREPORT_DECLARE_STATIC_PLUGIN(KReportImagePlugin)
 
-class KoReportImagePlugin : public KoReportPluginInterface
+class KReportImagePlugin : public KReportPluginInterface
 {
     public:
-    explicit KoReportImagePlugin(QObject *parent, const QVariantList &args = QVariantList());
-    virtual ~KoReportImagePlugin();
+    explicit KReportImagePlugin(QObject *parent, const QVariantList &args = QVariantList());
+    virtual ~KReportImagePlugin();
 
     virtual QObject* createRendererInstance(const QDomNode& element);
-    virtual QObject* createDesignerInstance(const QDomNode& element, KoReportDesigner* , QGraphicsScene* scene);
-    virtual QObject* createDesignerInstance(KoReportDesigner* , QGraphicsScene* scene, const QPointF& pos);
+    virtual QObject* createDesignerInstance(const QDomNode& element, KReportDesigner* , QGraphicsScene* scene);
+    virtual QObject* createDesignerInstance(KReportDesigner* , QGraphicsScene* scene, const QPointF& pos);
 #ifdef KREPORT_SCRIPTING
-    virtual QObject* createScriptInstance(KoReportItemBase* item);
+    virtual QObject* createScriptInstance(KReportItemBase* item);
 #endif
 };
 
-#endif // KOREPORTIMAGEPLUGIN_H
+#endif // KREPORTIMAGEPLUGIN_H
diff --git a/src/items/image/KoReportItemImage.cpp b/src/items/image/KReportItemImage.cpp
similarity index 85%
rename from src/items/image/KoReportItemImage.cpp
rename to src/items/image/KReportItemImage.cpp
index 77635dd4..6cc53bf3 100644
--- a/src/items/image/KoReportItemImage.cpp
+++ b/src/items/image/KReportItemImage.cpp
@@ -1,192 +1,192 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "KoReportItemImage.h"
-#include "common/renderobjects.h"
+#include "KReportItemImage.h"
+#include "KReportRenderObjects.h"
 #include "kreportplugin_debug.h"
 
 #include 
 
 #include 
 #include 
 
 
-KoReportItemImage::KoReportItemImage()
+KReportItemImage::KReportItemImage()
 {
     createProperties();
 }
 
-KoReportItemImage::KoReportItemImage(const QDomNode & element)
+KReportItemImage::KReportItemImage(const QDomNode & element)
 {
     createProperties();
     QDomNodeList nl = element.childNodes();
     QString n;
     QDomNode node;
 
     m_name->setValue(element.toElement().attribute(QLatin1String("report:name")));
     m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source")));
     m_resizeMode->setValue(element.toElement().attribute(QLatin1String("report:resize-mode"), QLatin1String("stretch")));
     Z = element.toElement().attribute(QLatin1String("report:z-index")).toDouble();
 
     parseReportRect(element.toElement(), &m_pos, &m_size);
 
     for (int i = 0; i < nl.count(); i++) {
         node = nl.item(i);
         n = node.nodeName();
 
         if (n == QLatin1String("report:inline-image-data")) {
 
             setInlineImageData(node.firstChild().nodeValue().toLatin1());
         } else {
             kreportpluginWarning() << "while parsing image element encountered unknow element: " << n;
         }
     }
 
 }
 
-KoReportItemImage::~KoReportItemImage()
+KReportItemImage::~KReportItemImage()
 {
     delete m_set;
 }
 
-bool KoReportItemImage::isInline() const
+bool KReportItemImage::isInline() const
 {
     return !(inlineImageData().isEmpty());
 }
 
-QByteArray KoReportItemImage::inlineImageData() const
+QByteArray KReportItemImage::inlineImageData() const
 {
     QPixmap pixmap = m_staticImage->value().value();
     QByteArray ba;
     QBuffer buffer(&ba);
     buffer.open(QIODevice::ReadWrite);
     pixmap.save(&buffer, "PNG");   // writes pixmap into ba in PNG format,
     //! @todo should I remember the format used, or save as PNG as its lossless?
 
     return buffer.buffer().toBase64();
 }
 
-void KoReportItemImage::setInlineImageData(const QByteArray &dat, const QString &fn)
+void KReportItemImage::setInlineImageData(const QByteArray &dat, const QString &fn)
 {
     if (!fn.isEmpty()) {
         QPixmap pix(fn);
         if (!pix.isNull())
             m_staticImage->setValue(pix);
         else {
             QPixmap blank(1, 1);
             blank.fill();
             m_staticImage->setValue(blank);
         }
     } else {
         const QByteArray binaryStream(QByteArray::fromBase64(dat));
         const QPixmap pix(QPixmap::fromImage(QImage::fromData(binaryStream), Qt::ColorOnly));
         m_staticImage->setValue(pix);
     }
 
 }
 
-QString KoReportItemImage::mode() const
+QString KReportItemImage::mode() const
 {
     return m_resizeMode->value().toString();
 }
 
-void KoReportItemImage::setMode(const QString &m)
+void KReportItemImage::setMode(const QString &m)
 {
     if (mode() != m) {
         m_resizeMode->setValue(m);
     }
 }
 
-void KoReportItemImage::createProperties()
+void KReportItemImage::createProperties()
 {
     m_set = new KPropertySet(0, QLatin1String("Image"));
 
     m_controlSource = new KProperty("item-data-source", QStringList(), QStringList(), QString(), tr("Data Source"));
 
     QStringList keys, strings;
     keys << QLatin1String("clip") << QLatin1String("stretch");
     strings << tr("Clip") << tr("Stretch");
     m_resizeMode = new KProperty("resize-mode", keys, strings, QLatin1String("clip"), tr("Resize Mode"));
 
     m_staticImage = new KProperty("static-image", QPixmap(), tr("Value"), tr("Value used if not bound to a field"));
 
     addDefaultProperties();
     m_set->addProperty(m_controlSource);
     m_set->addProperty(m_resizeMode);
     m_set->addProperty(m_staticImage);
 }
 
 
-void KoReportItemImage::setColumn(const QString &c)
+void KReportItemImage::setColumn(const QString &c)
 {
     m_controlSource->setValue(c);
 }
 
-QString KoReportItemImage::itemDataSource() const
+QString KReportItemImage::itemDataSource() const
 {
     return m_controlSource->value().toString();
 }
 
-QString KoReportItemImage::typeName() const
+QString KReportItemImage::typeName() const
 {
     return QLatin1String("image");
 }
 
-int KoReportItemImage::renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset,
-                                        const QVariant &data, KRScriptHandler *script)
+int KReportItemImage::renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset,
+                                        const QVariant &data, KReportScriptHandler *script)
 {
     Q_UNUSED(script)
 
     QByteArray uudata;
     QByteArray imgdata;
     if (!isInline()) {
         imgdata = data.toByteArray();
     } else {
         uudata = inlineImageData();
         imgdata = QByteArray::fromBase64(uudata);
     }
 
     QImage img;
     img.loadFromData(imgdata);
     OROImage * id = new OROImage();
     id->setImage(img);
     if (mode().toLower() == QLatin1String("stretch")) {
         id->setScaled(true);
         id->setAspectRatioMode(Qt::KeepAspectRatio);
         id->setTransformationMode(Qt::SmoothTransformation);
     }
 
     id->setPosition(m_pos.toScene() + offset);
     id->setSize(m_size.toScene());
     if (page) {
         page->addPrimitive(id);
     }
 
     if (section) {
         OROImage *i2 = dynamic_cast(id->clone());
         i2->setPosition(m_pos.toPoint());
         section->addPrimitive(i2);
     }
 
     if (!page) {
         delete id;
     }
 
     return 0; //Item doesn't stretch the section height
 }
 
 
diff --git a/src/items/image/KoReportItemImage.h b/src/items/image/KReportItemImage.h
similarity index 79%
rename from src/items/image/KoReportItemImage.h
rename to src/items/image/KReportItemImage.h
index 7f4e631f..bbafc02e 100644
--- a/src/items/image/KoReportItemImage.h
+++ b/src/items/image/KReportItemImage.h
@@ -1,63 +1,63 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#ifndef KOREPORTITEMIMAGE_H
-#define KOREPORTITEMIMAGE_H
+#ifndef KREPORTITEMIMAGE_H
+#define KREPORTITEMIMAGE_H
 
-#include "KoReportItemBase.h"
-#include "krpos.h"
-#include "krsize.h"
+#include "KReportItemBase.h"
+#include "KReportPosition.h"
+#include "KReportSize.h"
 
 class QDomNode;
 
 namespace Scripting
 {
 class Image;
 }
 
-class KoReportItemImage : public KoReportItemBase
+class KReportItemImage : public KReportItemBase
 {
     Q_OBJECT
 public:
-    KoReportItemImage();
-    explicit KoReportItemImage(const QDomNode & element);
-    virtual ~KoReportItemImage();
+    KReportItemImage();
+    explicit KReportItemImage(const QDomNode & element);
+    virtual ~KReportItemImage();
 
     virtual QString typeName() const;
-    virtual int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KRScriptHandler *script);
+    virtual int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KReportScriptHandler *script);
 
     virtual QString itemDataSource() const;
 
 protected:
     KProperty * m_controlSource;
     KProperty* m_resizeMode;
     KProperty* m_staticImage;
 
     void setMode(const QString&);
     void setInlineImageData(const QByteArray &dat, const QString& = QString());
     void setColumn(const QString&);
     QString mode() const;
     bool isInline() const;
     QByteArray inlineImageData() const;
 
 private:
     virtual void createProperties();
 
     friend class Scripting::Image;
 };
 
 #endif
diff --git a/src/items/image/krscriptimage.cpp b/src/items/image/KReportScriptImage.cpp
similarity index 94%
rename from src/items/image/krscriptimage.cpp
rename to src/items/image/KReportScriptImage.cpp
index d0da9e5b..c1f365d0 100644
--- a/src/items/image/krscriptimage.cpp
+++ b/src/items/image/KReportScriptImage.cpp
@@ -1,78 +1,78 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "krscriptimage.h"
-#include "KoReportItemImage.h"
+#include "KReportScriptImage.h"
+#include "KReportItemImage.h"
 
 #include 
 
 namespace Scripting
 {
 
-Image::Image(KoReportItemImage *i)
+Image::Image(KReportItemImage *i)
 {
     m_image = i;
 }
 
 
 Image::~Image()
 {
 }
 
 QPointF Image::position()
 {
     return m_image->m_pos.toPoint();
 }
 void Image::setPosition(const QPointF& p)
 {
     m_image->m_pos.setPointPos(p);
 }
 
 QSizeF Image::size()
 {
     return m_image->m_size.toPoint();
 }
 void Image::setSize(const QSizeF& s)
 {
     m_image->m_size.setPointSize(s);
 }
 
 QString Image::resizeMode()
 {
     return m_image->m_resizeMode->value().toString();
 }
 
 void Image::setResizeMode(const QString &rm)
 {
     if (rm == QLatin1String("Stretch")) {
         m_image->m_resizeMode->setValue(QLatin1String("Stretch"));
     } else {
         m_image->m_resizeMode->setValue(QLatin1String("Clip"));
     }
 }
 
 void Image::setInlineImage(const QByteArray &ba)
 {
     m_image->setInlineImageData(ba);
 }
 
 void Image::loadFromFile(const QVariant &pth)
 {
     QString str = pth.toString();
     m_image->setInlineImageData(QByteArray(), str);
 }
 }
diff --git a/src/items/image/krscriptimage.h b/src/items/image/KReportScriptImage.h
similarity index 95%
rename from src/items/image/krscriptimage.h
rename to src/items/image/KReportScriptImage.h
index 895f0810..ac922b46 100644
--- a/src/items/image/krscriptimage.h
+++ b/src/items/image/KReportScriptImage.h
@@ -1,100 +1,100 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
 #ifndef SCRIPTINGKRSCRIPTIMAGE_H
 #define SCRIPTINGKRSCRIPTIMAGE_H
 
 #include 
 #include 
 #include 
 
-class KoReportItemImage;
+class KReportItemImage;
 
 namespace Scripting
 {
 
 /**
 */
 class Image : public QObject
 {
     Q_OBJECT
 public:
-    explicit Image(KoReportItemImage *);
+    explicit Image(KReportItemImage *);
 
     ~Image();
 public Q_SLOTS:
 
 
     /**
     * Get the position of the barcode
     * @return position in points
      */
     QPointF position();
 
 
     /**
      * Sets the position of the barcode in points
      * @param Position
      */
     void setPosition(const QPointF&);
 
     /**
      * Get the size of the barcode
      * @return size in points
      */
     QSizeF size();
 
     /**
      * Set the size of the barcode in points
      * @param Size
      */
     void setSize(const QSizeF&);
 
     /**
      * Get the resize mode for the image
      * @return resizeMode Clip or Stretch
      */
     QString resizeMode();
 
     /**
      * Sets the resize mode for the image
      * @param ResizeMode "Stretch" or "Clip" default is to clip
      */
     void setResizeMode(const QString &);
 
     /**
      * Sets the data for the static image
      * the data should be base64 encoded
      * @param RawImageData
      */
     void setInlineImage(const QByteArray&);
 
     /**
      * Get the data from a file (expected to be an image)
      * the returned data will be base64 encoded
      * @param Path location of file
      * @return File data enoded in base64
      */
     void loadFromFile(const QVariant &);
 private:
-    KoReportItemImage *m_image;
+    KReportItemImage *m_image;
 
 };
 
 }
 
 #endif
diff --git a/src/items/image/KoReportImagePlugin.cpp b/src/items/image/KoReportImagePlugin.cpp
deleted file mode 100644
index 080a58c8..00000000
--- a/src/items/image/KoReportImagePlugin.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/* This file is part of the KDE project
-   Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public License
-   along with this library; see the file COPYING.LIB.  If not, write to
-   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.
-*/
-
-#include "KoReportImagePlugin.h"
-#include "KoReportItemImage.h"
-#include "KoReportDesignerItemImage.h"
-#include "common/KReportPluginMetaData.h"
-#ifdef KREPORT_SCRIPTING
-#include "krscriptimage.h"
-#endif
-
-KREPORT_PLUGIN_FACTORY(KoReportImagePlugin, "image.json")
-
-KoReportImagePlugin::KoReportImagePlugin(QObject *parent, const QVariantList &args)
-    : KoReportPluginInterface(parent, args)
-{
-    Q_UNUSED(args)
-}
-
-KoReportImagePlugin::~KoReportImagePlugin()
-{
-
-}
-
-QObject* KoReportImagePlugin::createRendererInstance(const QDomNode& element)
-{
-    return new KoReportItemImage(element);
-}
-
-QObject* KoReportImagePlugin::createDesignerInstance(const QDomNode& element, KoReportDesigner* designer, QGraphicsScene* scene)
-{
-    return new KoReportDesignerItemImage(element, designer, scene);
-}
-
-QObject* KoReportImagePlugin::createDesignerInstance(KoReportDesigner* designer, QGraphicsScene* scene, const QPointF& pos)
-{
-    return new KoReportDesignerItemImage(designer, scene, pos);
-}
-
-#ifdef KREPORT_SCRIPTING
-QObject* KoReportImagePlugin::createScriptInstance(KoReportItemBase* item)
-{
-    KoReportItemImage *image = dynamic_cast(item);
-    if (image) {
-        return new Scripting::Image(image);
-    }
-    return 0;
-}
-#endif
-
-#include "KoReportImagePlugin.moc"
diff --git a/src/items/label/BoundedTextItem.cpp b/src/items/label/KReportBoundedTextItem.cpp
similarity index 98%
rename from src/items/label/BoundedTextItem.cpp
rename to src/items/label/KReportBoundedTextItem.cpp
index 771bd592..f284eef3 100644
--- a/src/items/label/BoundedTextItem.cpp
+++ b/src/items/label/KReportBoundedTextItem.cpp
@@ -1,84 +1,84 @@
 /* This file is part of the KDE project
   Copyright (C) 2014 Adam Pigg 
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.
 
   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.
 
   You should have received a copy of the GNU Library General Public License
   along with this library; see the file COPYING.LIB.  If not, write to
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301, USA.
 */
 
-#include "BoundedTextItem.h"
+#include "KReportBoundedTextItem.h"
 #include 
 #include 
 #include 
 
 BoundedTextItem::BoundedTextItem(QGraphicsItem* parent): QGraphicsTextItem(parent)
 {
     setTextInteractionFlags(Qt::TextEditorInteraction);
     setCursor(QCursor(Qt::IBeamCursor));
 }
 
 QRectF BoundedTextItem::boundingRect() const
 {
     if (parentItem()) {
         return parentItem()->boundingRect();
     }
 
     return QGraphicsTextItem::boundingRect();
 }
 
 void BoundedTextItem::paint( QPainter *painter, const QStyleOptionGraphicsItem *o, QWidget *w)
 {
     QColor bg = m_backgroundColor.isValid() ? m_backgroundColor : o->palette.base().color();
     bg.setAlphaF(m_backgroundOpacity * 0.01);
 
     QColor fc = m_foregroundColor.isValid() ? m_foregroundColor : o->palette.text().color();
     painter->setBrush(bg);
     painter->setPen(fc);
 
     painter->drawRect(boundingRect());
 
     QStyleOptionGraphicsItem opt(*o);
     opt.state &= ~QStyle::State_HasFocus;
     QGraphicsTextItem::paint(painter, &opt, w);
 }
 
 void BoundedTextItem::setBackgroudColor(const QColor& bc)
 {
     m_backgroundColor = bc;
 }
 
 void BoundedTextItem::setForegroundColor(const QColor& fc)
 {
     m_foregroundColor = fc;
 }
 
 void BoundedTextItem::setDisplayFont(const QFont& f)
 {
     m_font = f;
     setFont(m_font);
 }
 
 void BoundedTextItem::setBackgroudOpacity(int o)
 {
     m_backgroundOpacity = o;
 }
 
 void BoundedTextItem::keyReleaseEvent(QKeyEvent* event)
 {
     if (event->key() == Qt::Key_Escape) {
         emit exitEditMode();
     } else {
         QGraphicsTextItem::keyReleaseEvent(event);
     }
 }
diff --git a/src/items/label/BoundedTextItem.h b/src/items/label/KReportBoundedTextItem.h
similarity index 94%
rename from src/items/label/BoundedTextItem.h
rename to src/items/label/KReportBoundedTextItem.h
index 30cd6e32..337dfca9 100644
--- a/src/items/label/BoundedTextItem.h
+++ b/src/items/label/KReportBoundedTextItem.h
@@ -1,62 +1,62 @@
 /* This file is part of the KDE project
   Copyright (C) 2014 Adam Pigg 
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.
 
   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.
 
   You should have received a copy of the GNU Library General Public License
   along with this library; see the file COPYING.LIB.  If not, write to
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301, USA.
 */
 
-#ifndef KOREPORT_BOUNDEDTEXTITEM_H
-#define KOREPORT_BOUNDEDTEXTITEM_H
+#ifndef KREPORT_BOUNDEDTEXTITEM_H
+#define KREPORT_BOUNDEDTEXTITEM_H
 
 #include 
 #include 
 
 /**
  * @brief Subclass of QGraphicsTextItem which simply forces
  * its boundingRect to be the same as its parent.
  * By default a QGraphicsTextItem will size to its text and
  * we want it to size to the parent item.
  *
  */
 class BoundedTextItem : public QGraphicsTextItem
 {
     Q_OBJECT
 
 public:
     explicit BoundedTextItem(QGraphicsItem *parent);
     virtual QRectF boundingRect() const;
     virtual void paint( QPainter *painter, const QStyleOptionGraphicsItem *o, QWidget *w);
     void setBackgroudColor(const QColor &bc);
     void setForegroundColor(const QColor &fc);
     void setBackgroudOpacity(int o);
     void setDisplayFont(const QFont &f);
 
 
 protected:
     virtual void keyReleaseEvent ( QKeyEvent * event );
 
 private:
     QColor m_backgroundColor;
     QColor m_foregroundColor;
     QFont m_font;
 
     int m_backgroundOpacity;
 
 Q_SIGNALS:
     void exitEditMode();
 
 };
 
-#endif // KOREPORT_BOUNDEDTEXTITEM_H
+#endif // KREPORT_BOUNDEDTEXTITEM_H
diff --git a/src/items/label/KoReportDesignerItemLabel.cpp b/src/items/label/KReportDesignerItemLabel.cpp
similarity index 79%
rename from src/items/label/KoReportDesignerItemLabel.cpp
rename to src/items/label/KReportDesignerItemLabel.cpp
index 2ad4ecea..5d297db9 100644
--- a/src/items/label/KoReportDesignerItemLabel.cpp
+++ b/src/items/label/KReportDesignerItemLabel.cpp
@@ -1,222 +1,223 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "KoReportDesignerItemLabel.h"
-#include "wrtembed/KoReportDesignerItemBase.h"
-#include "wrtembed/KoReportDesigner.h"
-#include "wrtembed/reportscene.h"
+#include "KReportDesignerItemLabel.h"
+#include "KReportDesignerItemBase.h"
+#include "KReportDesigner.h"
+#include "KReportDesignerScene.h"
+#include "KReportLineStyle.h"
 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 
-void KoReportDesignerItemLabel::init(QGraphicsScene *scene, KoReportDesigner *d)
+void KReportDesignerItemLabel::init(QGraphicsScene *scene, KReportDesigner *d)
 {
     if (scene)
         scene->addItem(this);
 
-    KoReportDesignerItemRectBase::init(&m_pos, &m_size, m_set, d);
+    KReportDesignerItemRectBase::init(&m_pos, &m_size, m_set, d);
 
     connect(propertySet(), SIGNAL(propertyChanged(KPropertySet&,KProperty&)),
             this, SLOT(slotPropertyChanged(KPropertySet&,KProperty&)));
 
     setZValue(Z);
     setFlag(ItemIsFocusable);
 
     m_inlineEdit = new BoundedTextItem(this);
     m_inlineEdit->setVisible(false);
     m_inlineEdit->setFlag(ItemIsFocusable);
     m_inlineEdit->setFlag(ItemIsSelectable, false);
     QTextDocument *doc = new QTextDocument;
     doc->setDocumentMargin(0);
     doc->setPlainText(text());
     m_inlineEdit->setDocument(doc);
 
     connect(m_inlineEdit, SIGNAL(exitEditMode()), this, SLOT(exitInlineEditingMode()));
 }
 
 // methods (constructors)
-KoReportDesignerItemLabel::KoReportDesignerItemLabel(KoReportDesigner* d, QGraphicsScene * scene, const QPointF &pos)
-        : KoReportDesignerItemRectBase(d)
+KReportDesignerItemLabel::KReportDesignerItemLabel(KReportDesigner* d, QGraphicsScene * scene, const QPointF &pos)
+        : KReportDesignerItemRectBase(d)
 {
     Q_UNUSED(pos);
     init(scene, d);
     setSceneRect(properRect(*d, getTextRect().width(), getTextRect().height()));
     m_name->setValue(m_reportDesigner->suggestEntityName(typeName()));
 
     enterInlineEditingMode();
 }
 
-KoReportDesignerItemLabel::KoReportDesignerItemLabel(const QDomNode & element, KoReportDesigner * d, QGraphicsScene * s)
-        : KoReportItemLabel(element), KoReportDesignerItemRectBase(d), m_inlineEdit(0)
+KReportDesignerItemLabel::KReportDesignerItemLabel(const QDomNode & element, KReportDesigner * d, QGraphicsScene * s)
+        : KReportItemLabel(element), KReportDesignerItemRectBase(d), m_inlineEdit(0)
 {
     init(s, d);
     setSceneRect(m_pos.toScene(), m_size.toScene());
 }
 
-KoReportDesignerItemLabel* KoReportDesignerItemLabel::clone()
+KReportDesignerItemLabel* KReportDesignerItemLabel::clone()
 {
     QDomDocument d;
     QDomElement e = d.createElement(QLatin1String("clone"));
     QDomNode n;
     buildXML(&d, &e);
     n = e.firstChild();
-    return new KoReportDesignerItemLabel(n, designer(), 0);
+    return new KReportDesignerItemLabel(n, designer(), 0);
 }
 
 // methods (deconstructor)
-KoReportDesignerItemLabel::~KoReportDesignerItemLabel()
+KReportDesignerItemLabel::~KReportDesignerItemLabel()
 {}
 
-QRectF KoReportDesignerItemLabel::getTextRect() const
+QRectF KReportDesignerItemLabel::getTextRect() const
 {
     return QFontMetrics(font()).boundingRect(x(), y(), 0, 0, textFlags(), m_text->value().toString());
 }
 
-void KoReportDesignerItemLabel::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
+void KReportDesignerItemLabel::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
 {
     Q_UNUSED(option);
     Q_UNUSED(widget);
 
     if (m_inlineEdit->isVisible()) {
         return;
     }
 
     // store any values we plan on changing so we can restore them
     QFont f = painter->font();
     QPen  p = painter->pen();
 
     painter->setFont(font());
     painter->setBackgroundMode(Qt::TransparentMode);
 
     QColor bg = m_backgroundColor->value().value();
     bg.setAlphaF(m_backgroundOpacity->value().toReal() * 0.01);
 
     painter->setPen(m_foregroundColor->value().value());
 
     painter->fillRect(QGraphicsRectItem::rect(), bg);
     painter->drawText(rect(), textFlags(), text());
 
     if ((Qt::PenStyle)m_lineStyle->value().toInt() == Qt::NoPen || m_lineWeight->value().toInt() <= 0) {
         painter->setPen(QPen(QColor(224, 224, 224)));
     } else {
         painter->setPen(QPen(m_lineColor->value().value(), m_lineWeight->value().toInt(), (Qt::PenStyle)m_lineStyle->value().toInt()));
     }
 
     painter->drawRect(QGraphicsRectItem::rect());
     painter->setPen(m_foregroundColor->value().value());
 
     drawHandles(painter);
 
     // restore an values before we started just in case
     painter->setFont(f);
     painter->setPen(p);
 }
 
-void KoReportDesignerItemLabel::buildXML(QDomDocument *doc, QDomElement *parent)
+void KReportDesignerItemLabel::buildXML(QDomDocument *doc, QDomElement *parent)
 {
     //kreportpluginDebug();
     QDomElement entity = doc->createElement(QLatin1String("report:") + typeName());
 
     // properties
     addPropertyAsAttribute(&entity, m_name);
     addPropertyAsAttribute(&entity, m_text);
     addPropertyAsAttribute(&entity, m_verticalAlignment);
     addPropertyAsAttribute(&entity, m_horizontalAlignment);
     entity.setAttribute(QLatin1String("report:z-index"), zValue());
 
     // bounding rect
     buildXMLRect(doc, &entity, &m_pos, &m_size);
 
     //text style info
     buildXMLTextStyle(doc, &entity, textStyle());
 
     //Line Style
     buildXMLLineStyle(doc, &entity, lineStyle());
 
     parent->appendChild(entity);
 }
 
-void KoReportDesignerItemLabel::slotPropertyChanged(KPropertySet &s, KProperty &p)
+void KReportDesignerItemLabel::slotPropertyChanged(KPropertySet &s, KProperty &p)
 {
     Q_UNUSED(s);
 
     if (p.name() == "Name") {
         //For some reason p.oldValue returns an empty string
         if (!m_reportDesigner->isEntityNameUnique(p.value().toString(), this)) {
             p.setValue(m_oldName);
         } else {
             m_oldName = p.value().toString();
         }
     } else if (p.name() == "caption") {
         m_inlineEdit->setPlainText(p.value().toString());
     }
 
-    KoReportDesignerItemRectBase::propertyChanged(s, p);
+    KReportDesignerItemRectBase::propertyChanged(s, p);
     if (m_reportDesigner) m_reportDesigner->setModified(true);
 
 }
 
-void KoReportDesignerItemLabel::enterInlineEditingMode()
+void KReportDesignerItemLabel::enterInlineEditingMode()
 {
     if (!m_inlineEdit->isVisible()) {
         m_inlineEdit->setVisible(true);
         m_inlineEdit->setPlainText(text());
         m_inlineEdit->setFocus();
 
         QTextCursor c = m_inlineEdit->textCursor();
         c.select(QTextCursor::Document);
         m_inlineEdit->setTextCursor(c);
 
         m_inlineEdit->setFont(m_font->value().value());
         m_inlineEdit->setDefaultTextColor(m_foregroundColor->value().value());
         m_inlineEdit->setBackgroudColor(m_backgroundColor->value().value());
         m_inlineEdit->setBackgroudOpacity(m_backgroundOpacity->value().toInt());
         m_inlineEdit->setForegroundColor(m_foregroundColor->value().value());
         m_inlineEdit->setFont(m_font->value().value());
 
         update();
     }
 }
 
-void KoReportDesignerItemLabel::exitInlineEditingMode()
+void KReportDesignerItemLabel::exitInlineEditingMode()
 {
     if (m_inlineEdit->isVisible()) {
         m_inlineEdit->setVisible(false);
         setText(m_inlineEdit->toPlainText());
     }
 }
 
-void KoReportDesignerItemLabel::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event)
+void KReportDesignerItemLabel::mouseDoubleClickEvent(QGraphicsSceneMouseEvent* event)
 {
     Q_UNUSED(event);
     enterInlineEditingMode();
 }
 
-void KoReportDesignerItemLabel::keyReleaseEvent(QKeyEvent* event)
+void KReportDesignerItemLabel::keyReleaseEvent(QKeyEvent* event)
 {
     if (event->key() == Qt::Key_F2) {
         enterInlineEditingMode();
     } else {
         QGraphicsRectItem::keyReleaseEvent(event);
     }
 }
diff --git a/src/items/label/KoReportDesignerItemLabel.h b/src/items/label/KReportDesignerItemLabel.h
similarity index 71%
rename from src/items/label/KoReportDesignerItemLabel.h
rename to src/items/label/KReportDesignerItemLabel.h
index 8576c3ab..2372204a 100644
--- a/src/items/label/KoReportDesignerItemLabel.h
+++ b/src/items/label/KReportDesignerItemLabel.h
@@ -1,62 +1,61 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#ifndef __KOREPORTDESIGNERITEMLABEL_H__
-#define __KOREPORTDESIGNERITEMLABEL_H__
+#ifndef KREPORTDESIGNERITEMLABEL_H
+#define KREPORTDESIGNERITEMLABEL_H
+
+#include "KReportItemLabel.h"
+#include "KReportDesignerItemRectBase.h"
+#include "KReportBoundedTextItem.h"
 
 #include 
 #include 
 #include 
-
 #include 
 
-#include "KoReportItemLabel.h"
-#include "KoReportDesignerItemRectBase.h"
-#include "BoundedTextItem.h"
-
-class KoReportDesignerItemLabel : public KoReportItemLabel, public KoReportDesignerItemRectBase
+class KReportDesignerItemLabel : public KReportItemLabel, public KReportDesignerItemRectBase
 {
   Q_OBJECT
 public:
-    KoReportDesignerItemLabel(KoReportDesigner *, QGraphicsScene * scene, const QPointF &pos);
-    KoReportDesignerItemLabel(const QDomNode & element, KoReportDesigner *, QGraphicsScene * scene);
-    virtual ~KoReportDesignerItemLabel();
+    KReportDesignerItemLabel(KReportDesigner *, QGraphicsScene * scene, const QPointF &pos);
+    KReportDesignerItemLabel(const QDomNode & element, KReportDesigner *, QGraphicsScene * scene);
+    virtual ~KReportDesignerItemLabel();
 
     virtual void buildXML(QDomDocument *doc, QDomElement *parent);
     virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0);
-    virtual KoReportDesignerItemLabel* clone();
+    virtual KReportDesignerItemLabel* clone();
 
 public Q_SLOTS:
     virtual void enterInlineEditingMode();
     virtual void exitInlineEditingMode();
 
 protected:
     virtual void mouseDoubleClickEvent ( QGraphicsSceneMouseEvent * event );
     virtual void keyReleaseEvent ( QKeyEvent * event );
 
 private:
-    void init(QGraphicsScene*, KoReportDesigner*);
+    void init(QGraphicsScene*, KReportDesigner*);
     QRectF getTextRect() const;
     BoundedTextItem *m_inlineEdit;
 
 private Q_SLOTS:
     void slotPropertyChanged(KPropertySet &, KProperty &);
 
 };
 
 #endif
diff --git a/src/items/label/KoReportItemLabel.cpp b/src/items/label/KReportItemLabel.cpp
similarity index 85%
rename from src/items/label/KoReportItemLabel.cpp
rename to src/items/label/KReportItemLabel.cpp
index 83a1f846..148321fe 100644
--- a/src/items/label/KoReportItemLabel.cpp
+++ b/src/items/label/KReportItemLabel.cpp
@@ -1,212 +1,212 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "KoReportItemLabel.h"
-#include "common/renderobjects.h"
+#include "KReportItemLabel.h"
+#include "KReportRenderObjects.h"
 #include "kreportplugin_debug.h"
 
 #include 
 
 #include 
 #include 
 #include 
 
-KoReportItemLabel::KoReportItemLabel()
+KReportItemLabel::KReportItemLabel()
 {
     createProperties();
 }
 
-KoReportItemLabel::KoReportItemLabel(const QDomNode & element)
+KReportItemLabel::KReportItemLabel(const QDomNode & element)
 {
     createProperties();
     QDomNodeList nl = element.childNodes();
     QString n;
     QDomNode node;
 
     m_name->setValue(element.toElement().attribute(QLatin1String("report:name")));
     m_text->setValue(element.toElement().attribute(QLatin1String("report:caption")));
     Z = element.toElement().attribute(QLatin1String("report:z-index")).toDouble();
     m_horizontalAlignment->setValue(element.toElement().attribute(QLatin1String("report:horizontal-align")));
     m_verticalAlignment->setValue(element.toElement().attribute(QLatin1String("report:vertical-align")));
 
     parseReportRect(element.toElement(), &m_pos, &m_size);
 
     for (int i = 0; i < nl.count(); i++) {
         node = nl.item(i);
         n = node.nodeName();
 
         if (n == QLatin1String("report:text-style")) {
             KRTextStyleData ts;
             if (parseReportTextStyleData(node.toElement(), &ts)) {
                 m_backgroundColor->setValue(ts.backgroundColor);
                 m_foregroundColor->setValue(ts.foregroundColor);
                 m_backgroundOpacity->setValue(ts.backgroundOpacity);
                 m_font->setValue(ts.font);
 
             }
         } else if (n == QLatin1String("report:line-style")) {
-            KRLineStyleData ls;
+            KReportLineStyle ls;
             if (parseReportLineStyleData(node.toElement(), &ls)) {
-                m_lineWeight->setValue(ls.weight);
-                m_lineColor->setValue(ls.lineColor);
-                m_lineStyle->setValue(QPen(ls.style));
+                m_lineWeight->setValue(ls.width());
+                m_lineColor->setValue(ls.color());
+                m_lineStyle->setValue(QPen(ls.penStyle()));
             }
         } else {
             kreportpluginWarning() << "while parsing label element encountered unknow element: " << n;
         }
     }
 }
 
-KoReportItemLabel::~KoReportItemLabel()
+KReportItemLabel::~KReportItemLabel()
 {
     delete m_set;
 }
 
-QString KoReportItemLabel::text() const
+QString KReportItemLabel::text() const
 {
     return m_text->value().toString();
 }
 
-void KoReportItemLabel::setText(const QString& t)
+void KReportItemLabel::setText(const QString& t)
 {
     m_text->setValue(t);
 }
 
-void KoReportItemLabel::createProperties()
+void KReportItemLabel::createProperties()
 {
     m_set = new KPropertySet(0, QLatin1String("Label"));
 
     m_text = new KProperty("caption", QLatin1String("Label"), tr("Caption"));
     QStringList keys, strings;
 
     keys << QLatin1String("left") << QLatin1String("center") << QLatin1String("right");
     strings << tr("Left") << tr("Center") << tr("Right");
     m_horizontalAlignment = new KProperty("horizontal-align", keys, strings, QLatin1String("left"), tr("Horizontal Alignment"));
 
     keys.clear();
     strings.clear();
     keys << QLatin1String("top") << QLatin1String("center") << QLatin1String("bottom");
     strings << tr("Top") << tr("Center") << tr("Bottom");
     m_verticalAlignment = new KProperty("vertical-align", keys, strings, QLatin1String("center"), tr("Vertical Alignment"));
 
     m_font = new KProperty("font", QFontDatabase::systemFont(QFontDatabase::GeneralFont), tr("Font"), tr("Font"));
 
     m_backgroundColor = new KProperty("background-color", QColor(Qt::white), tr("Background Color"));
     m_foregroundColor = new KProperty("foreground-color", QPalette().color(QPalette::Foreground), tr("Foreground Color"));
 
     m_backgroundOpacity = new KProperty("background-opacity", QVariant(0), tr("Background Opacity"));
     m_backgroundOpacity->setOption("max", 100);
     m_backgroundOpacity->setOption("min", 0);
     m_backgroundOpacity->setOption("unit", QLatin1String("%"));
 
     m_lineWeight = new KProperty("line-weight", 1, tr("Line Weight"));
     m_lineColor = new KProperty("line-color", QColor(Qt::black), tr("Line Color"));
     m_lineStyle = new KProperty("line-style", QPen(Qt::NoPen), tr("Line Style"), tr("Line Style"), KProperty::LineStyle);
 
     addDefaultProperties();
     m_set->addProperty(m_text);
     m_set->addProperty(m_horizontalAlignment);
     m_set->addProperty(m_verticalAlignment);
     m_set->addProperty(m_font);
     m_set->addProperty(m_backgroundColor);
     m_set->addProperty(m_foregroundColor);
     m_set->addProperty(m_backgroundOpacity);
     m_set->addProperty(m_lineWeight);
     m_set->addProperty(m_lineColor);
     m_set->addProperty(m_lineStyle);
 }
 
-Qt::Alignment KoReportItemLabel::textFlags() const
+Qt::Alignment KReportItemLabel::textFlags() const
 {
     Qt::Alignment align;
     QString t;
     t = m_horizontalAlignment->value().toString();
     if (t == QLatin1String("center"))
         align = Qt::AlignHCenter;
     else if (t == QLatin1String("right"))
         align = Qt::AlignRight;
     else
         align = Qt::AlignLeft;
 
     t = m_verticalAlignment->value().toString();
     if (t == QLatin1String("center"))
         align |= Qt::AlignVCenter;
     else if (t == QLatin1String("bottom"))
         align |= Qt::AlignBottom;
     else
         align |= Qt::AlignTop;
 
     return align;
 }
 
-KRTextStyleData KoReportItemLabel::textStyle() const
+KRTextStyleData KReportItemLabel::textStyle() const
 {
     KRTextStyleData d;
     d.backgroundColor = m_backgroundColor->value().value();
     d.foregroundColor = m_foregroundColor->value().value();
     d.font = m_font->value().value();
     d.backgroundOpacity = m_backgroundOpacity->value().toInt();
     return d;
 }
 
-KRLineStyleData KoReportItemLabel::lineStyle() const
+KReportLineStyle KReportItemLabel::lineStyle() const
 {
-    KRLineStyleData ls;
-    ls.weight = m_lineWeight->value().toInt();
-    ls.lineColor = m_lineColor->value().value();
-    ls.style = (Qt::PenStyle)m_lineStyle->value().toInt();
+    KReportLineStyle ls;
+    ls.setWidth(m_lineWeight->value().toInt());
+    ls.setColor(m_lineColor->value().value());
+    ls.setPenStyle((Qt::PenStyle)m_lineStyle->value().toInt());
     return ls;
 }
 
 // RTTI
-QString KoReportItemLabel::typeName() const
+QString KReportItemLabel::typeName() const
 {
     return QLatin1String("label");
 }
 
-int KoReportItemLabel::renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset,
-                                        const QVariant &data, KRScriptHandler *script)
+int KReportItemLabel::renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset,
+                                        const QVariant &data, KReportScriptHandler *script)
 {
     Q_UNUSED(data)
     Q_UNUSED(script)
 
     OROTextBox * tb = new OROTextBox();
     tb->setPosition(m_pos.toScene() + offset);
     tb->setSize(m_size.toScene());
     tb->setFont(font());
     tb->setText(text());
     tb->setFlags(textFlags());
     tb->setTextStyle(textStyle());
     tb->setLineStyle(lineStyle());
 
     if (page) {
         page->addPrimitive(tb);
     }
 
     if (section) {
         OROPrimitive *clone = tb->clone();
         clone->setPosition(m_pos.toScene());
         section->addPrimitive(clone);
     }
 
     if (!page) {
         delete tb;
     }
 
     return 0; //Item doesn't stretch the section height
 }
 
diff --git a/src/items/label/KoReportItemLabel.h b/src/items/label/KReportItemLabel.h
similarity index 79%
rename from src/items/label/KoReportItemLabel.h
rename to src/items/label/KReportItemLabel.h
index 8d8f96d5..98b8f1e8 100644
--- a/src/items/label/KoReportItemLabel.h
+++ b/src/items/label/KReportItemLabel.h
@@ -1,74 +1,74 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#ifndef KOREPORTITEMLABEL_H
-#define KOREPORTITEMLABEL_H
+#ifndef KReportItemLabel_H
+#define KReportItemLabel_H
 
-#include "KoReportItemBase.h"
-#include "krpos.h"
-#include "krsize.h"
+#include "KReportItemBase.h"
+#include "KReportPosition.h"
+#include "KReportSize.h"
 
 #include 
 
 class QDomNode;
 
 namespace Scripting
 {
 class Label;
 }
 
 /**
 */
-class KoReportItemLabel : public KoReportItemBase
+class KReportItemLabel : public KReportItemBase
 {
 Q_OBJECT
 public:
-    KoReportItemLabel();
-    explicit KoReportItemLabel(const QDomNode & element);
-    virtual ~KoReportItemLabel();
+    KReportItemLabel();
+    explicit KReportItemLabel(const QDomNode & element);
+    virtual ~KReportItemLabel();
 
     virtual QString typeName() const;
-    virtual int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KRScriptHandler *script);
+    virtual int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KReportScriptHandler *script);
 
 protected:
 
     KProperty *m_text;
     KProperty *m_horizontalAlignment;
     KProperty *m_verticalAlignment;
     KProperty *m_font;
     KProperty *m_foregroundColor;
     KProperty *m_backgroundColor;
     KProperty *m_backgroundOpacity;
     KProperty *m_lineColor;
     KProperty *m_lineWeight;
     KProperty *m_lineStyle;
 
     QString text() const;
     QFont font() const {
         return m_font->value().value();
     }
     Qt::Alignment textFlags() const;
     void setText(const QString&);
     KRTextStyleData textStyle() const;
-    KRLineStyleData lineStyle() const;
+    KReportLineStyle lineStyle() const;
 
 private:
     virtual void createProperties();
 
     friend class Scripting::Label;
 };
 #endif
diff --git a/src/items/label/KoReportLabelPlugin.cpp b/src/items/label/KReportLabelPlugin.cpp
similarity index 65%
rename from src/items/label/KoReportLabelPlugin.cpp
rename to src/items/label/KReportLabelPlugin.cpp
index 87b153fa..94383a12 100644
--- a/src/items/label/KoReportLabelPlugin.cpp
+++ b/src/items/label/KReportLabelPlugin.cpp
@@ -1,106 +1,107 @@
 /* This file is part of the KDE project
    Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
 */
 
-#include "KoReportLabelPlugin.h"
-#include "KoReportItemLabel.h"
-#include "KoReportDesignerItemLabel.h"
-#include "wrtembed/KoReportDesigner.h"
-#include "common/KReportPluginMetaData.h"
+#include "KReportLabelPlugin.h"
+#include "KReportItemLabel.h"
+#include "KReportDesignerItemLabel.h"
+#include "KReportDesigner.h"
+#include "KReportPluginMetaData.h"
 #include "KReportLabelElement.h"
 #include "KReportLineStyle.h"
 #include "KReportUtils.h"
+
 #ifdef KREPORT_SCRIPTING
-#include "krscriptlabel.h"
+#include "KReportScriptLabel.h"
 #endif
 
 #include 
 
-KREPORT_PLUGIN_FACTORY(KoReportLabelPlugin, "label.json")
+KREPORT_PLUGIN_FACTORY(KReportLabelPlugin, "label.json")
 
-KoReportLabelPlugin::KoReportLabelPlugin(QObject *parent, const QVariantList &args)
-    : KoReportPluginInterface(parent, args)
+KReportLabelPlugin::KReportLabelPlugin(QObject *parent, const QVariantList &args)
+    : KReportPluginInterface(parent, args)
 {
 }
 
-KoReportLabelPlugin::~KoReportLabelPlugin()
+KReportLabelPlugin::~KReportLabelPlugin()
 {
 
 }
 
-QObject* KoReportLabelPlugin::createRendererInstance(const QDomNode &elem)
+QObject* KReportLabelPlugin::createRendererInstance(const QDomNode &elem)
 {
-    return new KoReportItemLabel(elem);
+    return new KReportItemLabel(elem);
 }
 
-QObject* KoReportLabelPlugin::createDesignerInstance(KoReportDesigner* designer, QGraphicsScene* scene, const QPointF &pos)
+QObject* KReportLabelPlugin::createDesignerInstance(KReportDesigner* designer, QGraphicsScene* scene, const QPointF &pos)
 {
-    return new KoReportDesignerItemLabel(designer, scene, pos);
+    return new KReportDesignerItemLabel(designer, scene, pos);
 }
 
-QObject* KoReportLabelPlugin::createDesignerInstance(const QDomNode & element, KoReportDesigner *designer, QGraphicsScene * scene)
+QObject* KReportLabelPlugin::createDesignerInstance(const QDomNode & element, KReportDesigner *designer, QGraphicsScene * scene)
 {
-    return new KoReportDesignerItemLabel(element, designer, scene);
+    return new KReportDesignerItemLabel(element, designer, scene);
 }
 
-KReportElement KoReportLabelPlugin::createElement()
+KReportElement KReportLabelPlugin::createElement()
 {
     return KReportLabelElement();
 }
 
-bool KoReportLabelPlugin::loadElement(KReportElement *el, const QDomElement &dom, KReportDesignReadingStatus *status)
+bool KReportLabelPlugin::loadElement(KReportElement *el, const QDomElement &dom, KReportDesignReadingStatus *status)
 {
-    if (!KoReportPluginInterface::loadElement(el, dom, status)) {
+    if (!KReportPluginInterface::loadElement(el, dom, status)) {
         return false;
     }
     KReportLabelElement label(*el);
     label.setText(KReportUtils::attr(dom, "report:caption", QString()));
     QString s = KReportUtils::attr(dom, "report:horizontal-align", QString());
     Qt::Alignment alignment = KReportUtils::horizontalAlignment(s, label.alignment() & Qt::AlignHorizontal_Mask);
     s = KReportUtils::attr(dom, "report:vertical-align", QString());
     alignment |= KReportUtils::verticalAlignment(s, label.alignment() & Qt::AlignVertical_Mask);
     label.setAlignment(alignment);
 
     const QDomElement textStyleDom = dom.firstChildElement(QLatin1String("report:text-style"));
     QFont font(label.font());
     KReportUtils::readFontAttributes(textStyleDom, &font);
     label.setFont(font);
 
     const QDomElement lineStyleDom = dom.firstChildElement(QLatin1String("report:line-style"));
     KReportLineStyle borderStyle(label.borderStyle());
     s = KReportUtils::attr(lineStyleDom, "report:line-style", QString());
     borderStyle.setPenStyle(KReportUtils::penStyle(s, borderStyle.penStyle()));
     borderStyle.setColor(KReportUtils::attr(lineStyleDom, "report:line-color", borderStyle.color()));
     // border-line-width could be better name but it's too late...
     borderStyle.setWidth(KReportUtils::attr(lineStyleDom, "report:line-weight", borderStyle.width()));
     label.setBorderStyle(borderStyle);
     return true;
 }
 
 #ifdef KREPORT_SCRIPTING
-QObject* KoReportLabelPlugin::createScriptInstance(KoReportItemBase *item)
+QObject* KReportLabelPlugin::createScriptInstance(KReportItemBase *item)
 {
-    KoReportItemLabel *label = dynamic_cast(item);
+    KReportItemLabel *label = dynamic_cast(item);
     if (label) {
         return new Scripting::Label(label);
     }
     return 0;
 }
 #endif
 
-#include "KoReportLabelPlugin.moc"
+#include "KReportLabelPlugin.moc"
diff --git a/src/items/label/KoReportLabelPlugin.h b/src/items/label/KReportLabelPlugin.h
similarity index 67%
rename from src/items/label/KoReportLabelPlugin.h
rename to src/items/label/KReportLabelPlugin.h
index 84943343..5e332903 100644
--- a/src/items/label/KoReportLabelPlugin.h
+++ b/src/items/label/KReportLabelPlugin.h
@@ -1,45 +1,45 @@
 /* This file is part of the KDE project
    Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
 */
 
-#ifndef KOREPORTLABELPLUGIN_H
-#define KOREPORTLABELPLUGIN_H
+#ifndef KReportLabelPlugin_H
+#define KReportLabelPlugin_H
 
-#include "KoReportStaticPluginInterface.h"
+#include "KReportStaticPluginInterface.h"
 
-KREPORT_DECLARE_STATIC_PLUGIN(KoReportLabelPlugin)
+KREPORT_DECLARE_STATIC_PLUGIN(KReportLabelPlugin)
 
-class KoReportLabelPlugin : public KoReportPluginInterface
+class KReportLabelPlugin : public KReportPluginInterface
 {
     Q_OBJECT
 public:
-    explicit KoReportLabelPlugin(QObject *parent = 0, const QVariantList &args = QVariantList());
+    explicit KReportLabelPlugin(QObject *parent = 0, const QVariantList &args = QVariantList());
 
-    virtual ~KoReportLabelPlugin();
+    virtual ~KReportLabelPlugin();
 
     virtual QObject* createRendererInstance(const QDomNode&);
-    virtual QObject* createDesignerInstance(KoReportDesigner* , QGraphicsScene* scene, const QPointF&);
-    virtual QObject* createDesignerInstance(const QDomNode & element, KoReportDesigner *, QGraphicsScene * scene);
+    virtual QObject* createDesignerInstance(KReportDesigner* , QGraphicsScene* scene, const QPointF&);
+    virtual QObject* createDesignerInstance(const QDomNode & element, KReportDesigner *, QGraphicsScene * scene);
     virtual KReportElement createElement() Q_DECL_OVERRIDE;
     virtual bool loadElement(KReportElement *el, const QDomElement &dom, KReportDesignReadingStatus *status) Q_DECL_OVERRIDE;
 #ifdef KREPORT_SCRIPTING
-    virtual QObject* createScriptInstance(KoReportItemBase* item);
+    virtual QObject* createScriptInstance(KReportItemBase* item);
 #endif
 };
 
-#endif // KOREPORTLABELPLUGIN_H
+#endif // KReportLabelPlugin_H
diff --git a/src/items/label/krscriptlabel.cpp b/src/items/label/KReportScriptLabel.cpp
similarity index 98%
rename from src/items/label/krscriptlabel.cpp
rename to src/items/label/KReportScriptLabel.cpp
index 1016efcc..d8466f82 100644
--- a/src/items/label/krscriptlabel.cpp
+++ b/src/items/label/KReportScriptLabel.cpp
@@ -1,183 +1,183 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "krscriptlabel.h"
+#include "KReportScriptLabel.h"
 
 namespace Scripting
 {
-Label::Label(KoReportItemLabel *l)
+Label::Label(KReportItemLabel *l)
 {
     m_label = l;
 }
 
 
 Label::~Label()
 {
 }
 
 QString Label::caption()
 {
     return m_label->text();
 }
 
 void Label::setCaption(const QString& c)
 {
     m_label->setText(c);
 }
 
 int Label::horizontalAlignment()
 {
     const QString a = m_label->m_horizontalAlignment->value().toString().toLower();
 
     if (a == QLatin1String("left")) {
         return -1;
     }
     if (a == QLatin1String("center")) {
         return 0;
     }
     if (a == QLatin1String("right")) {
         return 1;
     }
     return -1;
 }
 void Label::setHorizonalAlignment(int a)
 {
     switch (a) {
     case -1:
         m_label->m_horizontalAlignment->setValue(QLatin1String("left"));
         break;
     case 0:
         m_label->m_horizontalAlignment->setValue(QLatin1String("center"));
         break;
     case 1:
         m_label->m_horizontalAlignment->setValue(QLatin1String("right"));
         break;
     default:
         m_label->m_horizontalAlignment->setValue(QLatin1String("left"));
         break;
     }
 }
 
 int Label::verticalAlignment()
 {
     const QString a = m_label->m_horizontalAlignment->value().toString().toLower();
 
     if (a == QLatin1String("top")) {
         return -1;
     }
     if (a == QLatin1String("middle")) {
         return 0;
     }
     if (a == QLatin1String("bottom")) {
         return 1;
     }
     return -1;
 }
 void Label::setVerticalAlignment(int a)
 {
     switch (a) {
     case -1:
         m_label->m_verticalAlignment->setValue(QLatin1String("top"));
         break;
     case 0:
         m_label->m_verticalAlignment->setValue(QLatin1String("middle"));
         break;
     case 1:
         m_label->m_verticalAlignment->setValue(QLatin1String("bottom"));
         break;
     default:
         m_label->m_verticalAlignment->setValue(QLatin1String("middle"));
         break;
     }
 }
 
 QColor Label::backgroundColor()
 {
     return m_label->m_backgroundColor->value().value();
 }
 void Label::setBackgroundColor(const QColor& c)
 {
     m_label->m_backgroundColor->setValue(c);
 }
 
 QColor Label::foregroundColor()
 {
     return m_label->m_foregroundColor->value().value();
 }
 void Label::setForegroundColor(const QColor& c)
 {
     m_label->m_foregroundColor->setValue(c);
 }
 
 int Label::backgroundOpacity()
 {
     return m_label->m_backgroundOpacity->value().toInt();
 }
 void Label::setBackgroundOpacity(int o)
 {
     m_label->m_backgroundOpacity->setValue(o);
 }
 
 QColor Label::lineColor()
 {
     return m_label->m_lineColor->value().value();
 }
 void Label::setLineColor(const QColor& c)
 {
     m_label->m_lineColor->setValue(c);
 }
 
 int Label::lineWeight()
 {
     return m_label->m_lineWeight->value().toInt();
 }
 void Label::setLineWeight(int w)
 {
     m_label->m_lineWeight->setValue(w);
 }
 
 int Label::lineStyle()
 {
     return m_label->m_lineStyle->value().toInt();
 }
 void Label::setLineStyle(int s)
 {
     if (s < 0 || s > 5) {
         s = 1;
     }
     m_label->m_lineStyle->setValue(s);
 }
 
 QPointF Label::position()
 {
     return m_label->m_pos.toPoint();
 }
 void Label::setPosition(const QPointF &p)
 {
     m_label->m_pos.setPointPos(p);
 }
 
 QSizeF Label::size()
 {
     return m_label->m_size.toPoint();
 }
 void Label::setSize(const QSizeF &s)
 {
     m_label->m_size.setPointSize(s);
 }
 }
 
diff --git a/src/items/label/krscriptlabel.h b/src/items/label/KReportScriptLabel.h
similarity index 94%
rename from src/items/label/krscriptlabel.h
rename to src/items/label/KReportScriptLabel.h
index 8759a4be..8195f362 100644
--- a/src/items/label/krscriptlabel.h
+++ b/src/items/label/KReportScriptLabel.h
@@ -1,79 +1,79 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
 #ifndef KRSCRIPTLABEL_H
 #define KRSCRIPTLABEL_H
 
 #include 
 
-#include "KoReportItemLabel.h"
+#include "KReportItemLabel.h"
 
 /**
 */
 namespace Scripting
 {
 class Label : public QObject
 {
     Q_OBJECT
 public:
-    explicit Label(KoReportItemLabel *);
+    explicit Label(KReportItemLabel *);
 
     ~Label();
 
 public Q_SLOTS:
     QString caption();
     void setCaption(const QString&);
 
     /**Gets/sets the horizontal alignment, -1 Left, 0 Center, +1 Right*/
     int horizontalAlignment();
     void setHorizonalAlignment(int);
 
     /**Gets/sets the vertical alignment, -1 Top, 0 Middle, +1 Bottom*/
     int verticalAlignment();
     void setVerticalAlignment(int);
 
     QColor backgroundColor();
     void setBackgroundColor(const QColor&);
 
     QColor foregroundColor();
     void setForegroundColor(const QColor&);
 
     int backgroundOpacity();
     void setBackgroundOpacity(int);
 
     QColor lineColor();
     void setLineColor(const QColor&);
 
     int lineWeight();
     void setLineWeight(int);
 
     /**Gets/sets the line style.  Valid values are those from Qt::PenStyle (0-5)*/
     int lineStyle();
     void setLineStyle(int);
 
     QPointF position();
     void setPosition(const QPointF&);
 
     QSizeF size();
     void setSize(const QSizeF&);
 
 private:
-    KoReportItemLabel *m_label;
+    KReportItemLabel *m_label;
 };
 }
 
 #endif
diff --git a/src/items/text/KoReportDesignerItemText.cpp b/src/items/text/KReportDesignerItemText.cpp
similarity index 77%
rename from src/items/text/KoReportDesignerItemText.cpp
rename to src/items/text/KReportDesignerItemText.cpp
index 28eedea8..c4b7ea0b 100644
--- a/src/items/text/KoReportDesignerItemText.cpp
+++ b/src/items/text/KReportDesignerItemText.cpp
@@ -1,184 +1,184 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "KoReportDesignerItemText.h"
-#include "wrtembed/KoReportDesignerItemBase.h"
-#include "wrtembed/KoReportDesigner.h"
+#include "KReportDesignerItemText.h"
+#include "KReportDesignerItemBase.h"
+#include "KReportDesigner.h"
+#include "KReportLineStyle.h"
 
 #include 
-
 #include 
 #include 
 #include 
 #include 
 #include "kreportplugin_debug.h"
 
 //
 // class ReportEntityText
 //
 // methods (constructors)
 
-void KoReportDesignerItemText::init(QGraphicsScene *scene, KoReportDesigner *d)
+void KReportDesignerItemText::init(QGraphicsScene *scene, KReportDesigner *d)
 {
     //setFlags(ItemIsSelectable | ItemIsMovable);
     if (scene)
         scene->addItem(this);
 
     connect(propertySet(), SIGNAL(propertyChanged(KPropertySet&,KProperty&)),
             this, SLOT(slotPropertyChanged(KPropertySet&,KProperty&)));
 
-    KoReportDesignerItemRectBase::init(&m_pos, &m_size, m_set, d);
+    KReportDesignerItemRectBase::init(&m_pos, &m_size, m_set, d);
 
     m_controlSource->setListData(m_reportDesigner->fieldKeys(), m_reportDesigner->fieldNames());
     setZValue(Z);
 
     updateRenderText(m_controlSource->value().toString(), m_itemValue->value().toString(),
                      QLatin1String("textarea"));
 }
 
-KoReportDesignerItemText::KoReportDesignerItemText(KoReportDesigner * rw, QGraphicsScene * scene, const QPointF &pos)
-        : KoReportDesignerItemRectBase(rw)
+KReportDesignerItemText::KReportDesignerItemText(KReportDesigner * rw, QGraphicsScene * scene, const QPointF &pos)
+        : KReportDesignerItemRectBase(rw)
 {
     Q_UNUSED(pos);
     init(scene, rw);
     setSceneRect(properRect(*rw, getTextRect().width(), getTextRect().height()));
     m_name->setValue(m_reportDesigner->suggestEntityName(typeName()));
 }
 
-KoReportDesignerItemText::KoReportDesignerItemText(const QDomNode & element, KoReportDesigner * d, QGraphicsScene * s)
-        : KoReportItemText(element), KoReportDesignerItemRectBase(d)
+KReportDesignerItemText::KReportDesignerItemText(const QDomNode & element, KReportDesigner * d, QGraphicsScene * s)
+        : KReportItemText(element), KReportDesignerItemRectBase(d)
 {
     init(s, d);
     setSceneRect(m_pos.toScene(), m_size.toScene());
 }
 
-KoReportDesignerItemText* KoReportDesignerItemText::clone()
+KReportDesignerItemText* KReportDesignerItemText::clone()
 {
     QDomDocument d;
     QDomElement e = d.createElement(QLatin1String("clone"));
     QDomNode n;
     buildXML(&d, &e);
     n = e.firstChild();
-    return new KoReportDesignerItemText(n, designer(), 0);
+    return new KReportDesignerItemText(n, designer(), 0);
 }
 
-KoReportDesignerItemText::~KoReportDesignerItemText
+KReportDesignerItemText::~KReportDesignerItemText
 
 ()
 {}
 
-QRect KoReportDesignerItemText::getTextRect() const
+QRect KReportDesignerItemText::getTextRect() const
 {
     return QFontMetrics(font()).boundingRect(int (x()), int (y()), 0, 0, textFlags(), m_renderText);
 }
 
-void KoReportDesignerItemText::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
+void KReportDesignerItemText::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
 {
     Q_UNUSED(option);
     Q_UNUSED(widget)
 
     // store any values we plan on changing so we can restore them
     QFont f = painter->font();
     QPen  p = painter->pen();
 
     painter->setFont(font());
     painter->setBackgroundMode(Qt::TransparentMode);
 
     QColor bg = m_backgroundColor->value().value();
     bg.setAlphaF(m_backgroundOpacity->value().toReal()*0.01);
 
     painter->setPen(m_foregroundColor->value().value());
 
     painter->fillRect(rect(),  bg);
     painter->drawText(rect(), textFlags(), m_renderText);
 
     if ((Qt::PenStyle)m_lineStyle->value().toInt() == Qt::NoPen || m_lineWeight->value().toInt() <= 0) {
         painter->setPen(QPen(Qt::lightGray));
     } else {
         painter->setPen(QPen(m_lineColor->value().value(), m_lineWeight->value().toInt(), (Qt::PenStyle)m_lineStyle->value().toInt()));
     }
     painter->drawRect(rect());
 
     painter->setPen(m_foregroundColor->value().value());
 
     drawHandles(painter);
 
     // restore an values before we started just in case
     painter->setFont(f);
     painter->setPen(p);
 }
 
-void KoReportDesignerItemText::buildXML(QDomDocument *doc, QDomElement *parent)
+void KReportDesignerItemText::buildXML(QDomDocument *doc, QDomElement *parent)
 {
     //kreportpluginDebug();
     QDomElement entity = doc->createElement(QLatin1String("report:") + typeName());
 
     // properties
     addPropertyAsAttribute(&entity, m_name);
     addPropertyAsAttribute(&entity, m_controlSource);
     addPropertyAsAttribute(&entity, m_verticalAlignment);
     addPropertyAsAttribute(&entity, m_horizontalAlignment);
     entity.setAttribute(QLatin1String("report:bottom-padding"), m_bottomPadding);
     entity.setAttribute(QLatin1String("report:z-index"), zValue());
     addPropertyAsAttribute(&entity, m_itemValue);
 
     // bounding rect
     buildXMLRect(doc, &entity, &m_pos, &m_size);
 
     //text style info
     buildXMLTextStyle(doc, &entity, textStyle());
 
     //Line Style
     buildXMLLineStyle(doc, &entity, lineStyle());
 
     parent->appendChild(entity);
 }
 
-void KoReportDesignerItemText::mousePressEvent(QGraphicsSceneMouseEvent * event)
+void KReportDesignerItemText::mousePressEvent(QGraphicsSceneMouseEvent * event)
 {
     m_controlSource->setListData(m_reportDesigner->fieldKeys(), m_reportDesigner->fieldNames());
-    KoReportDesignerItemRectBase::mousePressEvent(event);
+    KReportDesignerItemRectBase::mousePressEvent(event);
 }
 
 
-void KoReportDesignerItemText::slotPropertyChanged(KPropertySet &s, KProperty &p)
+void KReportDesignerItemText::slotPropertyChanged(KPropertySet &s, KProperty &p)
 {
     Q_UNUSED(s);
 
     if (p.name() == "position") {
-        m_pos.setUnitPos(p.value().toPointF(), KRPos::DontUpdateProperty);
+        m_pos.setUnitPos(p.value().toPointF(), KReportPosition::DontUpdateProperty);
     } else if (p.name() == "size") {
-        m_size.setUnitSize(p.value().toSizeF(), KRSize::DontUpdateProperty);
+        m_size.setUnitSize(p.value().toSizeF(), KReportSize::DontUpdateProperty);
     } else if (p.name() == "name") {
         //For some reason p.oldValue returns an empty string
         if (!m_reportDesigner->isEntityNameUnique(p.value().toString(), this)) {
             p.setValue(m_oldName);
         } else {
             m_oldName = p.value().toString();
         }
     }
 
     setSceneRect(m_pos.toScene(), m_size.toScene(), DontUpdateProperty);
     if (m_reportDesigner)
         m_reportDesigner->setModified(true);
     if (scene())
         scene()->update();
 
     updateRenderText(m_controlSource->value().toString(), m_itemValue->value().toString(),
                      QLatin1String("textarea"));
 }
diff --git a/src/items/text/KoReportDesignerItemText.h b/src/items/text/KReportDesignerItemText.h
similarity index 69%
rename from src/items/text/KoReportDesignerItemText.h
rename to src/items/text/KReportDesignerItemText.h
index 4ebefb3f..bf995c8f 100644
--- a/src/items/text/KoReportDesignerItemText.h
+++ b/src/items/text/KReportDesignerItemText.h
@@ -1,55 +1,54 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
 
-#ifndef __KOREPORTDESIGNERITEMTEXT_H__
-#define __KOREPORTDESIGNERITEMTEXT_H__
+#ifndef KREPORTDESIGNERITEMTEXT_H
+#define KREPORTDESIGNERITEMTEXT_H
 
-#include 
-
-#include "KoReportDesignerItemRectBase.h"
-#include "KoReportItemText.h"
+#include "KReportDesignerItemRectBase.h"
+#include "KReportItemText.h"
 
+#include 
 
 //
 // ReportEntityText
 //
-class KoReportDesignerItemText : public KoReportItemText, public KoReportDesignerItemRectBase
+class KReportDesignerItemText : public KReportItemText, public KReportDesignerItemRectBase
 {
   Q_OBJECT
 public:
-    KoReportDesignerItemText(KoReportDesigner *, QGraphicsScene * scene, const QPointF &pos);
-    KoReportDesignerItemText(const QDomNode & element, KoReportDesigner *, QGraphicsScene * scene);
-    virtual ~KoReportDesignerItemText();
+    KReportDesignerItemText(KReportDesigner *, QGraphicsScene * scene, const QPointF &pos);
+    KReportDesignerItemText(const QDomNode & element, KReportDesigner *, QGraphicsScene * scene);
+    virtual ~KReportDesignerItemText();
 
     virtual void buildXML(QDomDocument *doc, QDomElement *parent);
     virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0);
-    virtual KoReportDesignerItemText* clone();
+    virtual KReportDesignerItemText* clone();
 
 protected:
     virtual void mousePressEvent(QGraphicsSceneMouseEvent * event);
 
 private:
     QRect getTextRect() const;
-    void init(QGraphicsScene*, KoReportDesigner*);
+    void init(QGraphicsScene*, KReportDesigner*);
 
 private Q_SLOTS:
     void slotPropertyChanged(KPropertySet &, KProperty &);
 };
 
 #endif
diff --git a/src/items/text/KoReportItemText.cpp b/src/items/text/KReportItemText.cpp
similarity index 89%
rename from src/items/text/KoReportItemText.cpp
rename to src/items/text/KReportItemText.cpp
index 51ebca5f..db7aea1c 100644
--- a/src/items/text/KoReportItemText.cpp
+++ b/src/items/text/KReportItemText.cpp
@@ -1,315 +1,315 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "KoReportItemText.h"
-#include "common/renderobjects.h"
+#include "KReportItemText.h"
+#include "KReportRenderObjects.h"
 #include "kreportplugin_debug.h"
 
 #include 
 
 #include 
 #include 
 #include 
 #include 
 #include 
 
-KoReportItemText::KoReportItemText()
+KReportItemText::KReportItemText()
 {
     createProperties();
 }
 
-KoReportItemText::KoReportItemText(const QDomNode & element) : m_bottomPadding(0.0)
+KReportItemText::KReportItemText(const QDomNode & element) : m_bottomPadding(0.0)
 {
     QDomNodeList nl = element.childNodes();
     QString n;
     QDomNode node;
 
     createProperties();
     m_name->setValue(element.toElement().attribute(QLatin1String("report:name")));
     m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source")));
     m_itemValue->setValue(element.toElement().attribute(QLatin1String("report:value")));
     Z = element.toElement().attribute(QLatin1String("report:z-index")).toDouble();
     m_horizontalAlignment->setValue(element.toElement().attribute(QLatin1String("report:horizontal-align")));
     m_verticalAlignment->setValue(element.toElement().attribute(QLatin1String("report:vertical-align")));
     m_bottomPadding = element.toElement().attribute(QLatin1String("report:bottom-padding")).toDouble();
 
     parseReportRect(element.toElement(), &m_pos, &m_size);
 
     for (int i = 0; i < nl.count(); i++) {
         node = nl.item(i);
         n = node.nodeName();
 
         if (n == QLatin1String("report:text-style")) {
             KRTextStyleData ts;
             if (parseReportTextStyleData(node.toElement(), &ts)) {
                 m_backgroundColor->setValue(ts.backgroundColor);
                 m_foregroundColor->setValue(ts.foregroundColor);
                 m_backgroundOpacity->setValue(ts.backgroundOpacity);
                 m_font->setValue(ts.font);
 
             }
         } else if (n == QLatin1String("report:line-style")) {
-            KRLineStyleData ls;
+            KReportLineStyle ls;
             if (parseReportLineStyleData(node.toElement(), &ls)) {
-                m_lineWeight->setValue(ls.weight);
-                m_lineColor->setValue(ls.lineColor);
-                m_lineStyle->setValue(QPen(ls.style));
+                m_lineWeight->setValue(ls.width());
+                m_lineColor->setValue(ls.color());
+                m_lineStyle->setValue(QPen(ls.penStyle()));
             }
         } else {
             kreportpluginWarning() << "while parsing field element encountered unknow element: " << n;
         }
     }
 
 }
 
-KoReportItemText::~KoReportItemText()
+KReportItemText::~KReportItemText()
 {
     delete m_set;
 }
 
-Qt::Alignment KoReportItemText::textFlags() const
+Qt::Alignment KReportItemText::textFlags() const
 {
     Qt::Alignment align;
     QString t;
     t = m_horizontalAlignment->value().toString();
     if (t == QLatin1String("center"))
         align = Qt::AlignHCenter;
     else if (t == QLatin1String("right"))
         align = Qt::AlignRight;
     else
         align = Qt::AlignLeft;
 
     t = m_verticalAlignment->value().toString();
     if (t == QLatin1String("center"))
         align |= Qt::AlignVCenter;
     else if (t == QLatin1String("bottom"))
         align |= Qt::AlignBottom;
     else
         align |= Qt::AlignTop;
 
     return align;
 }
 
-void KoReportItemText::createProperties()
+void KReportItemText::createProperties()
 {
     m_set = new KPropertySet(0, QLatin1String("Text"));
 
     //connect ( set, SIGNAL ( propertyChanged ( KPropertySet &, KProperty & ) ), this, SLOT ( propertyChanged ( KPropertySet &, KProperty & ) ) );
 
     QStringList keys, strings;
 
     //_query = new KProperty ( "Query", QStringList(), QStringList(), "Data Source", "Query" );
     m_controlSource = new KProperty("item-data-source", QStringList(), QStringList(), QString(), tr("Data Source"));
 
     m_itemValue = new KProperty("value", QString(), tr("Value"), tr("Value used if not bound to a field"));
 
     keys << QLatin1String("left") << QLatin1String("center") << QLatin1String("right");
     strings << tr("Left") << tr("Center") << tr("Right");
     m_horizontalAlignment = new KProperty("horizontal-align", keys, strings, QLatin1String("left"), tr("Horizontal Alignment"));
 
     keys.clear();
     strings.clear();
     keys << QLatin1String("top") << QLatin1String("center") << QLatin1String("bottom");
     strings << tr("Top") << tr("Center") << tr("Bottom");
     m_verticalAlignment = new KProperty("vertical-align", keys, strings, QLatin1String("center"), tr("Vertical Alignment"));
 
     m_font = new KProperty("font", QApplication::font(), tr("Font"));
 
     m_backgroundColor = new KProperty("background-color", QColor(Qt::white), tr("Background Color"));
     m_foregroundColor = new KProperty("foreground-color", QPalette().color(QPalette::Foreground), tr("Foreground Color"));
 
     m_lineWeight = new KProperty("line-weight", 1, tr("Line Weight"));
     m_lineColor = new KProperty("line-color", QColor(Qt::black), tr("Line Color"));
     m_lineStyle = new KProperty("line-style", QPen(Qt::NoPen), tr("Line Style"), tr("Line Style"), KProperty::LineStyle);
     m_backgroundOpacity = new KProperty("background-opacity", QVariant(0), tr("Background Opacity"));
     m_backgroundOpacity->setOption("max", 100);
     m_backgroundOpacity->setOption("min", 0);
     m_backgroundOpacity->setOption("unit", QLatin1String("%"));
 
     addDefaultProperties();
     m_set->addProperty(m_controlSource);
     m_set->addProperty(m_itemValue);
     m_set->addProperty(m_horizontalAlignment);
     m_set->addProperty(m_verticalAlignment);
     m_set->addProperty(m_font);
     m_set->addProperty(m_backgroundColor);
     m_set->addProperty(m_foregroundColor);
     m_set->addProperty(m_backgroundOpacity);
     m_set->addProperty(m_lineWeight);
     m_set->addProperty(m_lineColor);
     m_set->addProperty(m_lineStyle);
 
 }
 
-QString KoReportItemText::itemDataSource() const
+QString KReportItemText::itemDataSource() const
 {
     return m_controlSource->value().toString();
 }
 
-qreal KoReportItemText::bottomPadding() const
+qreal KReportItemText::bottomPadding() const
 {
     return m_bottomPadding;
 }
 
-void KoReportItemText::setBottomPadding(qreal bp)
+void KReportItemText::setBottomPadding(qreal bp)
 {
     if (m_bottomPadding != bp) {
         m_bottomPadding = bp;
     }
 }
 
-KRTextStyleData KoReportItemText::textStyle() const
+KRTextStyleData KReportItemText::textStyle() const
 {
     KRTextStyleData d;
     d.backgroundColor = m_backgroundColor->value().value();
     d.foregroundColor = m_foregroundColor->value().value();
     d.font = m_font->value().value();
     d.backgroundOpacity = m_backgroundOpacity->value().toInt();
     return d;
 }
 
-KRLineStyleData KoReportItemText::lineStyle() const
+KReportLineStyle KReportItemText::lineStyle() const
 {
-    KRLineStyleData ls;
-    ls.weight = m_lineWeight->value().toInt();
-    ls.lineColor = m_lineColor->value().value();
-    ls.style = (Qt::PenStyle)m_lineStyle->value().toInt();
+    KReportLineStyle ls;
+    ls.setWidth(m_lineWeight->value().toInt());
+    ls.setColor(m_lineColor->value().value());
+    ls.setPenStyle((Qt::PenStyle)m_lineStyle->value().toInt());
     return ls;
 }
 
 // RTTI
-QString KoReportItemText::typeName() const
+QString KReportItemText::typeName() const
 {
     return QLatin1String("text");
 }
 
-int KoReportItemText::renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset,
-                                       const QVariant &data, KRScriptHandler *script)
+int KReportItemText::renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset,
+                                       const QVariant &data, KReportScriptHandler *script)
 
 {
     Q_UNUSED(script);
 
     QString qstrValue;
 
     QString cs = itemDataSource();
 
     if (!cs.isEmpty()) {
         if (cs.left(1) == QLatin1String("$")) { //Everything past $ is treated as a string
             qstrValue = cs.mid(1);
         } else {
             qstrValue = data.toString();
         }
     } else {
         qstrValue = m_itemValue->value().toString();
     }
 
     QPointF pos = m_pos.toScene();
     QSizeF size = m_size.toScene();
     pos += offset;
 
     QRectF trf(pos, size);
     qreal intStretch = trf.top() - offset.y();
 
     if (qstrValue.length()) {
         QRectF rect = trf;
 
         int pos = 0;
         QChar separator;
         QRegExp re(QLatin1String("\\s"));
         QPrinter prnt(QPrinter::HighResolution);
         QFontMetrics fm(font(), &prnt);
 
         // int   intRectWidth    = (int)(trf.width() * prnt.resolution()) - 10;
         int     intRectWidth    = (int)((m_size.toPoint().width() / 72) * prnt.resolution());
         int     intLineCounter  = 0;
         qreal   intBaseTop      = trf.top();
         qreal   intRectHeight   = trf.height();
 
         while (qstrValue.length()) {
             int idx = re.indexIn(qstrValue, pos);
             if (idx == -1) {
                 idx = qstrValue.length();
                 separator = QLatin1Char('\n');
             } else
                 separator = qstrValue.at(idx);
 
             if (fm.boundingRect(qstrValue.left(idx)).width() < intRectWidth || pos == 0) {
                 pos = idx + 1;
                 if (separator == QLatin1Char('\n')) {
                     QString line = qstrValue.left(idx);
 
                     qstrValue.remove(0, idx + 1);
 
                     pos = 0;
 
                     rect.setTop(intBaseTop + (intLineCounter * intRectHeight));
                     rect.setBottom(rect.top() + intRectHeight);
 
                     OROTextBox * tb = new OROTextBox();
                     tb->setPosition(rect.topLeft());
                     tb->setSize(rect.size());
                     tb->setFont(font());
                     tb->setText(line);
                     tb->setFlags(textFlags());
                     tb->setTextStyle(textStyle());
                     tb->setLineStyle(lineStyle());
 
                     if (page) {
                         page->addPrimitive(tb);
                     }
 
                     if (section) {
                         OROTextBox *tb2 = dynamic_cast(tb->clone());
                         tb2->setPosition(m_pos.toPoint());
                         section->addPrimitive(tb2);
                     }
 
                     if (!page) {
                         delete tb;
                     }
 
                     intStretch += intRectHeight;
                     intLineCounter++;
                 }
             } else {
                 QString line = qstrValue.left(pos - 1);
                 qstrValue.remove(0, pos);
                 pos = 0;
 
                 rect.setTop(intBaseTop + (intLineCounter * intRectHeight));
                 rect.setBottom(rect.top() + intRectHeight);
 
                 OROTextBox * tb = new OROTextBox();
                 tb->setPosition(rect.topLeft());
                 tb->setSize(rect.size());
                 tb->setFont(font());
                 tb->setText(line);
                 tb->setFlags(textFlags());
                 tb->setTextStyle(textStyle());
                 tb->setLineStyle(lineStyle());
                 if (page) page->addPrimitive(tb);
 
                 intStretch += intRectHeight;
                 intLineCounter++;
             }
         }
 
         intStretch += (m_bottomPadding / 100.0);
     }
 
     return intStretch; //Item returns its required section height
 }
diff --git a/src/items/text/KoReportItemText.h b/src/items/text/KReportItemText.h
similarity index 80%
rename from src/items/text/KoReportItemText.h
rename to src/items/text/KReportItemText.h
index 306eb262..ae65b2f3 100644
--- a/src/items/text/KoReportItemText.h
+++ b/src/items/text/KReportItemText.h
@@ -1,84 +1,84 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#ifndef KOREPORTITEMTEXT_H
-#define KOREPORTITEMTEXT_H
+#ifndef KREPORTITEMTEXT_H
+#define KREPORTITEMTEXT_H
 
-#include "KoReportItemBase.h"
-#include "krpos.h"
-#include "krsize.h"
+#include "KReportItemBase.h"
+#include "KReportPosition.h"
+#include "KReportSize.h"
 
 #include 
 
 class QDomNode;
 
 namespace Scripting
 {
 class Text;
 
 }
 /**
 */
-class KoReportItemText : public KoReportItemBase
+class KReportItemText : public KReportItemBase
 {
 Q_OBJECT
 public:
-    KoReportItemText();
-    explicit KoReportItemText(const QDomNode & element);
-    virtual ~KoReportItemText();
+    KReportItemText();
+    explicit KReportItemText(const QDomNode & element);
+    virtual ~KReportItemText();
 
     virtual QString typeName() const;
-    virtual int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KRScriptHandler *script);
+    virtual int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KReportScriptHandler *script);
 
     virtual QString itemDataSource() const;
 
 protected:
 
     KProperty* m_controlSource;
     KProperty* m_horizontalAlignment;
     KProperty* m_verticalAlignment;
     KProperty* m_font;
     KProperty* m_foregroundColor;
     KProperty* m_backgroundColor;
     KProperty* m_backgroundOpacity;
     KProperty* m_lineColor;
     KProperty* m_lineWeight;
     KProperty* m_lineStyle;
     KProperty* m_itemValue;
 
 
     qreal m_bottomPadding;
 
     Qt::Alignment textFlags() const;
     QFont font() const {
         return m_font->value().value();
     }
 
     void setBottomPadding(qreal bp);
     qreal bottomPadding() const;
 
 
     KRTextStyleData textStyle() const;
-    KRLineStyleData lineStyle() const;
+    KReportLineStyle lineStyle() const;
 
 private:
     virtual void createProperties();
 
     friend class Scripting::Text;
 };
 
 #endif
diff --git a/src/items/text/krscripttext.cpp b/src/items/text/KReportScriptText.cpp
similarity index 98%
rename from src/items/text/krscripttext.cpp
rename to src/items/text/KReportScriptText.cpp
index 7e7d40de..5245d1e8 100644
--- a/src/items/text/krscripttext.cpp
+++ b/src/items/text/KReportScriptText.cpp
@@ -1,205 +1,205 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
-#include "krscripttext.h"
+#include "KReportScriptText.h"
 
 #include 
 #include 
 #include "kreportplugin_debug.h"
 
 namespace Scripting
 {
 
-Text::Text(KoReportItemText* t)
+Text::Text(KReportItemText* t)
 {
     m_text = t;
 }
 
 
 Text::~Text()
 {
 }
 
 QString Text::source()
 {
     return m_text->itemDataSource();
 }
 
 void Text::setSource(const QString& s)
 {
     m_text->m_controlSource->setValue(s);
 }
 
 int Text::horizontalAlignment()
 {
     const QString a = m_text->m_horizontalAlignment->value().toString().toLower();
 
     if (a == QLatin1String("left")) {
         return -1;
     }
     if (a == QLatin1String("center")) {
         return 0;
     }
     if (a == QLatin1String("right")) {
         return 1;
     }
     return -1;
 }
 void Text::setHorizonalAlignment(int a)
 {
     switch (a) {
     case -1:
         m_text->m_horizontalAlignment->setValue(QLatin1String("left"));
         break;
     case 0:
         m_text->m_horizontalAlignment->setValue(QLatin1String("center"));
         break;
     case 1:
         m_text->m_horizontalAlignment->setValue(QLatin1String("right"));
         break;
     default:
         m_text->m_horizontalAlignment->setValue(QLatin1String("left"));
         break;
     }
 }
 
 int Text::verticalAlignment()
 {
     const QString a = m_text->m_horizontalAlignment->value().toString().toLower();
 
     if (a == QLatin1String("top")) {
         return -1;
     }
     if (a == QLatin1String("middle")) {
         return 0;
     }
     if (a == QLatin1String("bottom")) {
         return 1;
     }
     return -1;
 }
 void Text::setVerticalAlignment(int a)
 {
     switch (a) {
     case -1:
         m_text->m_verticalAlignment->setValue(QLatin1String("top"));
         break;
     case 0:
         m_text->m_verticalAlignment->setValue(QLatin1String("middle"));
         break;
     case 1:
         m_text->m_verticalAlignment->setValue(QLatin1String("bottom"));
         break;
     default:
         m_text->m_verticalAlignment->setValue(QLatin1String("middle"));
         break;
     }
 }
 
 QColor Text::backgroundColor()
 {
     return m_text->m_backgroundColor->value().value();
 }
 void Text::setBackgroundColor(const QColor& c)
 {
     m_text->m_backgroundColor->setValue(QColor(c));
 }
 
 QColor Text::foregroundColor()
 {
     return m_text->m_foregroundColor->value().value();
 }
 void Text::setForegroundColor(const QColor& c)
 {
     m_text->m_foregroundColor->setValue(QColor(c));
 }
 
 int Text::backgroundOpacity()
 {
     return m_text->m_backgroundOpacity->value().toInt();
 }
 void Text::setBackgroundOpacity(int o)
 {
     m_text->m_backgroundOpacity->setValue(o);
 }
 
 QColor Text::lineColor()
 {
     return m_text->m_lineColor->value().value();
 }
 void Text::setLineColor(const QColor& c)
 {
     m_text->m_lineColor->setValue(QColor(c));
 }
 
 int Text::lineWeight()
 {
     return m_text->m_lineWeight->value().toInt();
 }
 void Text::setLineWeight(int w)
 {
     m_text->m_lineWeight->setValue(w);
 }
 
 int Text::lineStyle()
 {
     return m_text->m_lineStyle->value().toInt();
 }
 void Text::setLineStyle(int s)
 {
     if (s < 0 || s > 5) {
         s = 1;
     }
     m_text->m_lineStyle->setValue(s);
 }
 
 QPointF Text::position()
 {
     return m_text->m_pos.toPoint();
 }
 void Text::setPosition(const QPointF& p)
 {
     m_text->m_pos.setPointPos(p);
 }
 
 QSizeF Text::size()
 {
     return m_text->m_size.toPoint();
 }
 void Text::setSize(const QSizeF& s)
 {
     m_text->m_size.setPointSize(s);
 }
 
 void Text::loadFromFile(const QString &fn)
 {
     QFile file(fn);
     //kreportpluginDebug() << "Loading from" << fn;
     if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
         m_text->m_controlSource->setValue(tr("$Unable to read %1").arg(fn));
         return;
     }
     QTextStream in(&file);
     QString data = in.readAll();
     /*
     while (!in.atEnd()) {
       QString line = in.readLine();
       process_line(line);
     }*/
     m_text->m_controlSource->setValue(QVariant(QLatin1String("$") + data));
 }
 
 }
diff --git a/src/items/text/krscripttext.h b/src/items/text/KReportScriptText.h
similarity index 95%
rename from src/items/text/krscripttext.h
rename to src/items/text/KReportScriptText.h
index 7469cb9c..dc52bdf4 100644
--- a/src/items/text/krscripttext.h
+++ b/src/items/text/KReportScriptText.h
@@ -1,83 +1,83 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 #ifndef SCRIPTINGKRSCRIPTTEXT_H
 #define SCRIPTINGKRSCRIPTTEXT_H
 
 #include 
 
-#include "KoReportItemText.h"
+#include "KReportItemText.h"
 
 namespace Scripting
 {
 
 /**
 */
 class Text : public QObject
 {
     Q_OBJECT
 public:
-    explicit Text(KoReportItemText*);
+    explicit Text(KReportItemText*);
 
     ~Text();
 public Q_SLOTS:
 
     /**Returns the source (column) that the field gets its data from*/
     QString source();
     /**Sets the source (column) for the field*/
     void setSource(const QString&);
 
     /**Gets/sets the horizontal alignment, -1 Left, 0 Center, +1 Right*/
     int horizontalAlignment();
     void setHorizonalAlignment(int);
 
     /**Gets/sets the vertical alignment, -1 Top, 0 Middle, +1 Bottom*/
     int verticalAlignment();
     void setVerticalAlignment(int);
 
     QColor backgroundColor();
     void setBackgroundColor(const QColor&);
 
     QColor foregroundColor();
     void setForegroundColor(const QColor&);
 
     int backgroundOpacity();
     void setBackgroundOpacity(int);
 
     QColor lineColor();
     void setLineColor(const QColor&);
 
     int lineWeight();
     void setLineWeight(int);
 
     /**Gets/sets the line style.  Valid values are those from Qt::PenStyle (0-5)*/
     int lineStyle();
     void setLineStyle(int);
 
     QPointF position();
     void setPosition(const QPointF&);
 
     QSizeF size();
     void setSize(const QSizeF&);
 
     void loadFromFile(const QString&);
 private:
-    KoReportItemText *m_text;
+    KReportItemText *m_text;
 };
 
 }
 
 #endif
diff --git a/src/items/text/KReportTextPlugin.cpp b/src/items/text/KReportTextPlugin.cpp
new file mode 100644
index 00000000..de09867a
--- /dev/null
+++ b/src/items/text/KReportTextPlugin.cpp
@@ -0,0 +1,66 @@
+/* This file is part of the KDE project
+   Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this library; see the file COPYING.LIB.  If not, write to
+   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.
+*/
+
+#include "KReportTextPlugin.h"
+#include "KReportItemText.h"
+#include "KReportDesignerItemText.h"
+#include "KReportPluginMetaData.h"
+#ifdef KREPORT_SCRIPTING
+#include "KReportScriptText.h"
+#endif
+
+KREPORT_PLUGIN_FACTORY(KReportTextPlugin, "text.json")
+
+KReportTextPlugin::KReportTextPlugin(QObject *parent, const QVariantList &args)
+    : KReportPluginInterface(parent, args)
+{
+}
+
+KReportTextPlugin::~KReportTextPlugin()
+{
+
+}
+
+QObject* KReportTextPlugin::createRendererInstance(const QDomNode& element)
+{
+    return new KReportItemText(element);
+}
+
+QObject* KReportTextPlugin::createDesignerInstance(const QDomNode& element, KReportDesigner* designer, QGraphicsScene* scene)
+{
+    return new KReportDesignerItemText(element, designer, scene);
+}
+
+QObject* KReportTextPlugin::createDesignerInstance(KReportDesigner* designer, QGraphicsScene* scene, const QPointF& pos)
+{
+    return new KReportDesignerItemText(designer, scene, pos);
+}
+
+#ifdef KREPORT_SCRIPTING
+QObject* KReportTextPlugin::createScriptInstance(KReportItemBase* item)
+{
+    KReportItemText *text = dynamic_cast(item);
+    if (text) {
+        return new Scripting::Text(text);
+    }
+    return 0;
+}
+#endif
+
+#include "KReportTextPlugin.moc"
diff --git a/src/items/field/KoReportFieldPlugin.h b/src/items/text/KReportTextPlugin.h
similarity index 63%
rename from src/items/field/KoReportFieldPlugin.h
rename to src/items/text/KReportTextPlugin.h
index 5f31fe9b..dc843bd5 100644
--- a/src/items/field/KoReportFieldPlugin.h
+++ b/src/items/text/KReportTextPlugin.h
@@ -1,41 +1,41 @@
 /* This file is part of the KDE project
    Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
 */
 
-#ifndef KOREPORTFIELDPLUGIN_H
-#define KOREPORTFIELDPLUGIN_H
+#ifndef KReportTextPlugin_H
+#define KReportTextPlugin_H
 
-#include "KoReportStaticPluginInterface.h"
+#include "KReportStaticPluginInterface.h"
 
-KREPORT_DECLARE_STATIC_PLUGIN(KoReportFieldPlugin)
+KREPORT_DECLARE_STATIC_PLUGIN(KReportTextPlugin)
 
-class KoReportFieldPlugin : public KoReportPluginInterface
+class KReportTextPlugin : public KReportPluginInterface
 {
     public:
-    explicit KoReportFieldPlugin(QObject *parent, const QVariantList &args = QVariantList());
-    virtual ~KoReportFieldPlugin();
+    explicit KReportTextPlugin(QObject *parent, const QVariantList &args = QVariantList());
+    virtual ~KReportTextPlugin();
 
     virtual QObject* createRendererInstance(const QDomNode& element);
-    virtual QObject* createDesignerInstance(const QDomNode& element, KoReportDesigner* , QGraphicsScene* scene);
-    virtual QObject* createDesignerInstance(KoReportDesigner* , QGraphicsScene* scene, const QPointF& pos);
+    virtual QObject* createDesignerInstance(const QDomNode& element, KReportDesigner* , QGraphicsScene* scene);
+    virtual QObject* createDesignerInstance(KReportDesigner* , QGraphicsScene* scene, const QPointF& pos);
 #ifdef KREPORT_SCRIPTING
-    virtual QObject* createScriptInstance(KoReportItemBase* item);
+    virtual QObject* createScriptInstance(KReportItemBase* item);
 #endif
 };
 
-#endif // KOREPORTFIELDPLUGIN_H
+#endif // KReportTextPlugin_H
diff --git a/src/items/text/KoReportTextPlugin.cpp b/src/items/text/KoReportTextPlugin.cpp
deleted file mode 100644
index 46f10a92..00000000
--- a/src/items/text/KoReportTextPlugin.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/* This file is part of the KDE project
-   Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public License
-   along with this library; see the file COPYING.LIB.  If not, write to
-   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.
-*/
-
-#include "KoReportTextPlugin.h"
-#include "KoReportItemText.h"
-#include "KoReportDesignerItemText.h"
-#include "common/KReportPluginMetaData.h"
-#ifdef KREPORT_SCRIPTING
-#include "krscripttext.h"
-#endif
-
-KREPORT_PLUGIN_FACTORY(KoReportTextPlugin, "text.json")
-
-KoReportTextPlugin::KoReportTextPlugin(QObject *parent, const QVariantList &args)
-    : KoReportPluginInterface(parent, args)
-{
-}
-
-KoReportTextPlugin::~KoReportTextPlugin()
-{
-
-}
-
-QObject* KoReportTextPlugin::createRendererInstance(const QDomNode& element)
-{
-    return new KoReportItemText(element);
-}
-
-QObject* KoReportTextPlugin::createDesignerInstance(const QDomNode& element, KoReportDesigner* designer, QGraphicsScene* scene)
-{
-    return new KoReportDesignerItemText(element, designer, scene);
-}
-
-QObject* KoReportTextPlugin::createDesignerInstance(KoReportDesigner* designer, QGraphicsScene* scene, const QPointF& pos)
-{
-    return new KoReportDesignerItemText(designer, scene, pos);
-}
-
-#ifdef KREPORT_SCRIPTING
-QObject* KoReportTextPlugin::createScriptInstance(KoReportItemBase* item)
-{
-    KoReportItemText *text = dynamic_cast(item);
-    if (text) {
-        return new Scripting::Text(text);
-    }
-    return 0;
-}
-#endif
-
-#include "KoReportTextPlugin.moc"
diff --git a/src/koreport_itemplugin.desktop b/src/kreport_elementplugin.desktop
similarity index 93%
rename from src/koreport_itemplugin.desktop
rename to src/kreport_elementplugin.desktop
index 351705a1..366861df 100644
--- a/src/koreport_itemplugin.desktop
+++ b/src/kreport_elementplugin.desktop
@@ -1,24 +1,24 @@
 [Desktop Entry]
 Type=ServiceType
-X-KDE-ServiceType=KoReport/ItemPlugin
-Comment=KoReport Item Plugin
+X-KDE-ServiceType=KReport/Element
+Comment=KReport Element Plugin
 Comment[ca]=Connector de l'element KoReport
 Comment[de]=KoReport-Elementmodul
 Comment[es]=Complemento del elemento KoReport
 Comment[fi]=KoReportin elementtiliitännäinen
 Comment[fr]=Module externe d'élément KoReport
 Comment[gl]=Complemento de elementos de KoReport.
 Comment[hu]=KoReport elembővítmény
 Comment[it]=Estensione per elemento KoReport
 Comment[ja]=KoReport アイテムプラグイン
 Comment[nb]=Programtillegg for KoReport-element
 Comment[nl]=Plug-in voor KoReport-item
 Comment[pl]=Wtyczka elementu KoReport
 Comment[pt]='Plugin' de Itens do KoReport
 Comment[pt_BR]=Plugin de itens do KoReport
 Comment[sk]=Plugin položky KoReport
 Comment[sv]=Insticksprogram för Koffice objektrapport
 Comment[tr]=KoReport Öge Eklentisi
 Comment[uk]=Додаток елементів KoReport
 Comment[x-test]=xxKoReport Item Pluginxx
 Comment[zh_CN]=KoReport 项目插件
diff --git a/src/plugins/barcode/3of9.cpp b/src/plugins/barcode/3of9.cpp
index f24905d4..84fa1fdb 100644
--- a/src/plugins/barcode/3of9.cpp
+++ b/src/plugins/barcode/3of9.cpp
@@ -1,186 +1,186 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
 /*
  *     This file contains the implementation of the 3of9 barcode renderer.
  * All this code assumes a 100dpi rendering surface for it's calculations.
  */
 
-#include "renderobjects.h"
+#include "KReportRenderObjects.h"
 
 #include 
 #include 
 #include 
 #include 
 #include "kreportplugin_debug.h"
 
 struct code3of9 {
     char code;
     int values[9];
 };
 
 const struct code3of9 _3of9codes[] = {
     { '0', { 0, 0, 0, 1, 1, 0, 1, 0, 0 } },
     { '1', { 1, 0, 0, 1, 0, 0, 0, 0, 1 } },
     { '2', { 0, 0, 1, 1, 0, 0, 0, 0, 1 } },
     { '3', { 1, 0, 1, 1, 0, 0, 0, 0, 0 } },
     { '4', { 0, 0, 0, 1, 1, 0, 0, 0, 1 } },
     { '5', { 1, 0, 0, 1, 1, 0, 0, 0, 0 } },
     { '6', { 0, 0, 1, 1, 1, 0, 0, 0, 0 } },
     { '7', { 0, 0, 0, 1, 0, 0, 1, 0, 1 } },
     { '8', { 1, 0, 0, 1, 0, 0, 1, 0, 0 } },
     { '9', { 0, 0, 1, 1, 0, 0, 1, 0, 0 } },
 
     { 'A', { 1, 0, 0, 0, 0, 1, 0, 0, 1 } },
     { 'B', { 0, 0, 1, 0, 0, 1, 0, 0, 1 } },
     { 'C', { 1, 0, 1, 0, 0, 1, 0, 0, 0 } },
     { 'D', { 0, 0, 0, 0, 1, 1, 0, 0, 1 } },
     { 'E', { 1, 0, 0, 0, 1, 1, 0, 0, 0 } },
     { 'F', { 0, 0, 1, 0, 1, 1, 0, 0, 0 } },
     { 'G', { 0, 0, 0, 0, 0, 1, 1, 0, 1 } },
     { 'H', { 1, 0, 0, 0, 0, 1, 1, 0, 0 } },
     { 'I', { 0, 0, 1, 0, 0, 1, 1, 0, 0 } },
     { 'J', { 0, 0, 0, 0, 1, 1, 1, 0, 0 } },
     { 'K', { 1, 0, 0, 0, 0, 0, 0, 1, 1 } },
     { 'L', { 0, 0, 1, 0, 0, 0, 0, 1, 1 } },
     { 'M', { 1, 0, 1, 0, 0, 0, 0, 1, 0 } },
     { 'N', { 0, 0, 0, 0, 1, 0, 0, 1, 1 } },
     { 'O', { 1, 0, 0, 0, 1, 0, 0, 1, 0 } },
     { 'P', { 0, 0, 1, 0, 1, 0, 0, 1, 0 } },
     { 'Q', { 0, 0, 0, 0, 0, 0, 1, 1, 1 } },
     { 'R', { 1, 0, 0, 0, 0, 0, 1, 1, 0 } },
     { 'S', { 0, 0, 1, 0, 0, 0, 1, 1, 0 } },
     { 'T', { 0, 0, 0, 0, 1, 0, 1, 1, 0 } },
     { 'U', { 1, 1, 0, 0, 0, 0, 0, 0, 1 } },
     { 'V', { 0, 1, 1, 0, 0, 0, 0, 0, 1 } },
     { 'W', { 1, 1, 1, 0, 0, 0, 0, 0, 0 } },
     { 'X', { 0, 1, 0, 0, 1, 0, 0, 0, 1 } },
     { 'Y', { 1, 1, 0, 0, 1, 0, 0, 0, 0 } },
     { 'Z', { 0, 1, 1, 0, 1, 0, 0, 0, 0 } },
 
     { '-', { 0, 1, 0, 0, 0, 0, 1, 0, 1 } },
     { '.', { 1, 1, 0, 0, 0, 0, 1, 0, 0 } },
     { ' ', { 0, 1, 1, 0, 0, 0, 1, 0, 0 } },
     { '$', { 0, 1, 0, 1, 0, 1, 0, 0, 0 } },
     { '/', { 0, 1, 0, 1, 0, 0, 0, 1, 0 } },
     { '+', { 0, 1, 0, 0, 0, 1, 0, 1, 0 } },
     { '%', { 0, 0, 0, 1, 0, 1, 0, 1, 0 } },
 
     { '*', { 0, 1, 0, 0, 1, 0, 1, 0, 0 } }, // this is a special start/stop character
 
     { '\0', { 0, 0, 0, 0, 0, 0, 0, 0, 0 } } // null termininator of list
 };
 
 int codeIndex(QChar code)
 {
     // we are a case insensitive search
     const char latin1Code = code.toUpper().toLatin1();
     for (int idx = 0; _3of9codes[idx].code != '\0'; idx++) {
         if (_3of9codes[idx].code == latin1Code) return idx;
     }
     return -1;  // couldn't find it
 }
 
 
 void render3of9(OROPage * page, const QRectF & r, const QString & _str, int align)
 {
     QString str = _str;
     // lets determine some core attributes about this barcode
     qreal narrow_bar = 1; // a narrow bar is 1/100th inch wide
     qreal interchange_gap = narrow_bar; // the space between each 'set' of bars
     int bar_width_mult = 2; // the wide bar width multiple of the narrow bar
 
     // this is our mandatory minimum quiet zone
     qreal quiet_zone = narrow_bar * 10;
     if (quiet_zone < 0.1)
         quiet_zone = 0.1;
 
     // what kind of area do we have to work with
     qreal draw_width = r.width();
     qreal draw_height = r.height();
 
     // how long is the value we need to encode?
     int val_length = str.length();
 
     // L = (C + 2)(3N + 6)X + (C + 1)I
     // L length of barcode (excluding quite zone) in units same as X and I
     // C the number of characters in the value excluding the start/stop
     // N the bar width multiple for wide bars
     // X the width of a bar (pixels in our case)
     // I the interchange gap in the same units as X (value is same as X for our case)
     qreal L;
 
     qreal C = val_length;
     qreal N = bar_width_mult;
     qreal X = narrow_bar;
     qreal I = interchange_gap;
 
     L = ((C + 2.0) * (3.0 * N + 6.0) * X) + ((C + 1.0) * I);
 
     // now we have the actual width the barcode will be so can determine the actual
     // size of the quiet zone (we assume we center the barcode in the given area
     // what should we do if the area is too small????
     // At the moment the way the code is written is we will always start at the minimum
     // required quiet zone if we don't have enough space.... I guess we'll just have over-run
     // to the right
     //
     // calculate the starting position based on the alignment option
     // for left align we don't need to do anything as the values are already setup for it
     if (align == 1) { // center
         qreal nqz = (draw_width - L) / 2.0;
         if (nqz > quiet_zone)
             quiet_zone = nqz;
     } else if (align > 1)  // right
         quiet_zone = draw_width - (L + quiet_zone);
     //else if(align < 1) {} // left : do nothing
 
     qreal pos = r.left() + quiet_zone;
     qreal top = r.top();
 
     // ok we need to prepend and append the str with a *
     //str = QString().sprintf("*%s*",(const char*)str);
     str = QLatin1Char('*') + str + QLatin1Char('*');
 
     QPen pen(Qt::NoPen);
     QBrush brush(QColor("black"));
     for (int i = 0; i < str.length(); i++) {
         // loop through each char and render the barcode
         QChar c = str.at(i);
         int idx = codeIndex(c);
         kreportpluginDebug() << idx;
         if (idx == -1) {
             kreportpluginWarning() << "Encountered a non-compliant character while rendering a 3of9 barcode -- skipping";
             continue;
         }
 
         bool space = false;
         for (int b = 0; b < 9; b++, space = !space) {
             qreal w = (_3of9codes[idx].values[b] == 1 ? narrow_bar * bar_width_mult : narrow_bar);
             kreportpluginDebug() << w << space;
             if (!space) {
                 ORORect * rect = new ORORect();
                 rect->setPen(pen);
                 rect->setBrush(brush);
                 rect->setRect(QRectF(pos, top, w, draw_height));
                 page->addPrimitive(rect);
             }
             pos += w;
         }
         pos += interchange_gap;
     }
 }
diff --git a/src/plugins/barcode/CMakeLists.txt b/src/plugins/barcode/CMakeLists.txt
index 6d8306e8..938e9d5c 100644
--- a/src/plugins/barcode/CMakeLists.txt
+++ b/src/plugins/barcode/CMakeLists.txt
@@ -1,32 +1,32 @@
-ecm_create_qm_loader(koreport_barcodeplugin_QM_LOADER kreport_barcodeplugin_qt)
+ecm_create_qm_loader(kreport_barcodeplugin_QM_LOADER kreport_barcodeplugin_qt)
 
 set(kreport_barcodeplugin_LIB_SRCS
     ${PROJECT_SOURCE_DIR}/src/common/kreportplugin_debug.cpp
-    KoReportItemBarcode.cpp
-    KoReportDesignerItemBarcode.cpp
-    krscriptbarcode.cpp
+    KReportItemBarcode.cpp
+    KReportDesignerItemBarcode.cpp
+    KReportScriptBarcode.cpp
     3of9.cpp
     i2of5.cpp
     code128.cpp
     codeean.cpp
     ext3of9.cpp
     i2of5paint.cpp
     3of9paint.cpp
     ext3of9paint.cpp
     codeeanpaint.cpp
     code128paint.cpp
-    KoReportBarcodePlugin.cpp
-    ${koreport_barcodeplugin_QM_LOADER}
+    KReportBarcodePlugin.cpp
+    ${kreport_barcodeplugin_QM_LOADER}
 )
 
 add_library(kreport_barcodeplugin MODULE ${kreport_barcodeplugin_LIB_SRCS})
 kcoreaddons_desktop_to_json(kreport_barcodeplugin kreport_barcodeplugin.desktop)
 
 target_link_libraries(kreport_barcodeplugin
     PUBLIC
         KReport
 )
 
 install(TARGETS kreport_barcodeplugin DESTINATION ${KREPORT_PLUGIN_INSTALL_DIR})
 
 add_subdirectory(pics)
diff --git a/src/plugins/barcode/KReportBarcodePlugin.cpp b/src/plugins/barcode/KReportBarcodePlugin.cpp
new file mode 100644
index 00000000..8b1de9ed
--- /dev/null
+++ b/src/plugins/barcode/KReportBarcodePlugin.cpp
@@ -0,0 +1,66 @@
+/* This file is part of the KDE project
+   Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
+
+   This library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Library General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   This library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Library General Public License for more details.
+
+   You should have received a copy of the GNU Library General Public License
+   along with this library; see the file COPYING.LIB.  If not, write to
+   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.
+*/
+
+#include "KReportBarcodePlugin.h"
+#include "KReportItemBarcode.h"
+#include "KReportDesignerItemBarcode.h"
+#include "KReportPluginMetaData.h"
+#ifdef KREPORT_SCRIPTING
+#include "KReportScriptBarcode.h"
+#endif
+
+
+KREPORT_PLUGIN_FACTORY(KReportBarcodePlugin, "kreport_barcodeplugin.json")
+
+KReportBarcodePlugin::KReportBarcodePlugin(QObject *parent, const QVariantList &args)
+    : KReportPluginInterface(parent, args)
+{
+}
+
+KReportBarcodePlugin::~KReportBarcodePlugin()
+{
+}
+
+QObject* KReportBarcodePlugin::createRendererInstance(const QDomNode& element)
+{
+    return new KReportItemBarcode(element);
+}
+
+QObject* KReportBarcodePlugin::createDesignerInstance(const QDomNode& element, KReportDesigner* designer , QGraphicsScene* scene)
+{
+    return new KReportDesignerItemBarcode(element, designer, scene);
+}
+
+QObject* KReportBarcodePlugin::createDesignerInstance(KReportDesigner* designer, QGraphicsScene* scene, const QPointF& pos)
+{
+    return new KReportDesignerItemBarcode(designer, scene, pos);
+}
+
+#ifdef KREPORT_SCRIPTING
+QObject* KReportBarcodePlugin::createScriptInstance(KReportItemBase* item)
+{
+    KReportItemBarcode *barcode = dynamic_cast(item);
+    if (barcode) {
+        return new Scripting::Barcode(barcode);
+    }
+    return 0;
+}
+#endif
+
+#include "KReportBarcodePlugin.moc"
diff --git a/src/plugins/barcode/KoReportBarcodePlugin.h b/src/plugins/barcode/KReportBarcodePlugin.h
similarity index 65%
rename from src/plugins/barcode/KoReportBarcodePlugin.h
rename to src/plugins/barcode/KReportBarcodePlugin.h
index 1241ac90..14d284fb 100644
--- a/src/plugins/barcode/KoReportBarcodePlugin.h
+++ b/src/plugins/barcode/KReportBarcodePlugin.h
@@ -1,39 +1,39 @@
 /* This file is part of the KDE project
    Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
 */
 
-#ifndef KOREPORTBARCODEPLUGIN_H
-#define KOREPORTBARCODEPLUGIN_H
+#ifndef KREPORTBARCODEPLUGIN_H
+#define KREPORTBARCODEPLUGIN_H
 
-#include 
+#include 
 
-class KoReportBarcodePlugin : public KoReportPluginInterface
+class KReportBarcodePlugin : public KReportPluginInterface
 {
     public:
-    explicit KoReportBarcodePlugin(QObject *parent, const QVariantList &args = QVariantList());
-    virtual ~KoReportBarcodePlugin();
+    explicit KReportBarcodePlugin(QObject *parent, const QVariantList &args = QVariantList());
+    virtual ~KReportBarcodePlugin();
 
     virtual QObject* createRendererInstance(const QDomNode& element);
-    virtual QObject* createDesignerInstance(const QDomNode& element, KoReportDesigner* , QGraphicsScene* scene);
-    virtual QObject* createDesignerInstance(KoReportDesigner* , QGraphicsScene* scene, const QPointF& pos);
+    virtual QObject* createDesignerInstance(const QDomNode& element, KReportDesigner* , QGraphicsScene* scene);
+    virtual QObject* createDesignerInstance(KReportDesigner* , QGraphicsScene* scene, const QPointF& pos);
 #ifdef KREPORT_SCRIPTING
-    virtual QObject* createScriptInstance(KoReportItemBase* item);
+    virtual QObject* createScriptInstance(KReportItemBase* item);
 #endif
 };
 
-#endif // KOREPORTBARCODEPLUGIN_H
+#endif // KREPORTBARCODEPLUGIN_H
diff --git a/src/plugins/barcode/KoReportDesignerItemBarcode.cpp b/src/plugins/barcode/KReportDesignerItemBarcode.cpp
similarity index 79%
rename from src/plugins/barcode/KoReportDesignerItemBarcode.cpp
rename to src/plugins/barcode/KReportDesignerItemBarcode.cpp
index a6d7acec..c7596d84 100644
--- a/src/plugins/barcode/KoReportDesignerItemBarcode.cpp
+++ b/src/plugins/barcode/KReportDesignerItemBarcode.cpp
@@ -1,174 +1,174 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "KoReportDesignerItemBarcode.h"
-#include "KoReportDesignerItemBase.h"
-#include "KoReportDesigner.h"
+#include "KReportDesignerItemBarcode.h"
+#include "KReportDesignerItemBase.h"
+#include "KReportDesigner.h"
 
 #include "barcodepaint.h"
 
 #include 
 #include 
 
 #include 
 #include 
 #include 
 #include 
 #include "kreportplugin_debug.h"
 
-void KoReportDesignerItemBarcode::init(QGraphicsScene *scene, KoReportDesigner *d)
+void KReportDesignerItemBarcode::init(QGraphicsScene *scene, KReportDesigner *d)
 {
     if (scene)
         scene->addItem(this);
 
     connect(m_set, SIGNAL(propertyChanged(KPropertySet&,KProperty&)),
             this, SLOT(slotPropertyChanged(KPropertySet&,KProperty&)));
 
-    KoReportDesignerItemRectBase::init(&m_pos, &m_size, m_set, d);
+    KReportDesignerItemRectBase::init(&m_pos, &m_size, m_set, d);
     setMaxLength(5);
     setZValue(Z);
 
     updateRenderText(m_itemValue->value().toString().isEmpty() ?  m_format->value().toString() : QString(), m_itemValue->value().toString(), QString());
 
 }
 // methods (constructors)
-KoReportDesignerItemBarcode::KoReportDesignerItemBarcode(KoReportDesigner * rw, QGraphicsScene* scene, const QPointF &pos)
-        : KoReportDesignerItemRectBase(rw)
+KReportDesignerItemBarcode::KReportDesignerItemBarcode(KReportDesigner * rw, QGraphicsScene* scene, const QPointF &pos)
+        : KReportDesignerItemRectBase(rw)
 {
     Q_UNUSED(pos);
     init(scene, rw);
     setSceneRect(properRect(*rw, m_minWidthTotal*m_dpiX, m_minHeight*m_dpiY));
     m_name->setValue(m_reportDesigner->suggestEntityName(typeName()));
 }
 
-KoReportDesignerItemBarcode::KoReportDesignerItemBarcode(const QDomNode & element, KoReportDesigner * rw, QGraphicsScene* scene)
-        : KoReportItemBarcode(element), KoReportDesignerItemRectBase(rw)
+KReportDesignerItemBarcode::KReportDesignerItemBarcode(const QDomNode & element, KReportDesigner * rw, QGraphicsScene* scene)
+        : KReportItemBarcode(element), KReportDesignerItemRectBase(rw)
 {
     init(scene, rw);
     setSceneRect(m_pos.toScene(), m_size.toScene());
 }
 
-KoReportDesignerItemBarcode* KoReportDesignerItemBarcode::clone()
+KReportDesignerItemBarcode* KReportDesignerItemBarcode::clone()
 {
     QDomDocument d;
     QDomElement e = d.createElement(QLatin1String("clone"));
     QDomNode n;
     buildXML(&d, &e);
     n = e.firstChild();
-    return new KoReportDesignerItemBarcode(n, designer(), 0);
+    return new KReportDesignerItemBarcode(n, designer(), 0);
 }
 
 // methods (deconstructor)
-KoReportDesignerItemBarcode::~KoReportDesignerItemBarcode()
+KReportDesignerItemBarcode::~KReportDesignerItemBarcode()
 {}
 
-QRect KoReportDesignerItemBarcode::getTextRect()
+QRect KReportDesignerItemBarcode::getTextRect()
 {
     QFont fnt = QFont();
     return QFontMetrics(fnt)
             .boundingRect(int (x()), int (y()), 0, 0, 0,
                           dataSourceAndObjectTypeName(itemDataSource(), QLatin1String("barcode")));
 }
 
-void KoReportDesignerItemBarcode::paint(QPainter* painter,
+void KReportDesignerItemBarcode::paint(QPainter* painter,
                                         const QStyleOptionGraphicsItem* option,
                                         QWidget* widget)
 {
     Q_UNUSED(option);
     Q_UNUSED(widget);
 
     // store any values we plan on changing so we can restore them
     QPen  p = painter->pen();
 
     painter->setBackground(Qt::white);
 
     //Draw a border so user knows the object edge
     painter->setPen(QPen(QColor(224, 224, 224)));
     painter->drawRect(rect());
 
     drawHandles(painter);
 
     QByteArray fmt = m_format->value().toByteArray();
     if (fmt == "i2of5") {
         renderI2of5(rect().toRect(), m_renderText, alignment(), painter);
     } else if (fmt == "3of9") {
         render3of9(rect().toRect(), m_renderText, alignment(), painter);
     } else if (fmt == "3of9+") {
         renderExtended3of9(rect().toRect(), m_renderText, alignment(), painter);
     } else if (fmt == "128") {
         renderCode128(rect().toRect(), m_renderText, alignment(), painter);
     } else if (fmt == "upc-a") {
         renderCodeUPCA(rect().toRect(), m_renderText, alignment(), painter);
     } else if (fmt == "upc-e") {
         renderCodeUPCE(rect().toRect(), m_renderText, alignment(), painter);
     } else if (fmt == "ean13") {
         renderCodeEAN13(rect().toRect(), m_renderText, alignment(), painter);
     } else if (fmt == "ean8") {
         renderCodeEAN8(rect().toRect(), m_renderText, alignment(), painter);
     }
 
     painter->setPen(Qt::black);
     painter->drawText(rect(), 0, dataSourceAndObjectTypeName(itemDataSource(),
                                                              QLatin1String("barcode")));
 
     // restore an values before we started just in case
     painter->setPen(p);
 }
 
-void KoReportDesignerItemBarcode::buildXML(QDomDocument *doc, QDomElement *parent)
+void KReportDesignerItemBarcode::buildXML(QDomDocument *doc, QDomElement *parent)
 {
     //kreportpluginDebug();
     QDomElement entity = doc->createElement(QLatin1String("report:") + typeName());
 
     // properties
     addPropertyAsAttribute(&entity, m_name);
     addPropertyAsAttribute(&entity, m_controlSource);
     addPropertyAsAttribute(&entity, m_horizontalAlignment);
     addPropertyAsAttribute(&entity, m_format);
     addPropertyAsAttribute(&entity, m_maxLength);
     entity.setAttribute(QLatin1String("report:z-index"), zValue());
     addPropertyAsAttribute(&entity, m_itemValue);
 
     // bounding rect
     buildXMLRect(doc, &entity, &m_pos, &m_size);
 
     parent->appendChild(entity);
 }
 
-void KoReportDesignerItemBarcode::slotPropertyChanged(KPropertySet &s, KProperty &p)
+void KReportDesignerItemBarcode::slotPropertyChanged(KPropertySet &s, KProperty &p)
 {
     if (p.name() == "Name") {
         //For some reason p.oldValue returns an empty string
         if (!m_reportDesigner->isEntityNameUnique(p.value().toString(), this)) {
             p.setValue(m_oldName);
         } else {
             m_oldName = p.value().toString();
         }
     }
 
     updateRenderText(m_itemValue->value().toString().isEmpty() ?  m_format->value().toString() : QString(), m_itemValue->value().toString(), QString());
 
-    KoReportDesignerItemRectBase::propertyChanged(s, p);
+    KReportDesignerItemRectBase::propertyChanged(s, p);
     if (m_reportDesigner) m_reportDesigner->setModified(true);
 }
 
-void KoReportDesignerItemBarcode::mousePressEvent(QGraphicsSceneMouseEvent * event)
+void KReportDesignerItemBarcode::mousePressEvent(QGraphicsSceneMouseEvent * event)
 {
     m_controlSource->setListData(m_reportDesigner->fieldKeys(), m_reportDesigner->fieldNames());
-    KoReportDesignerItemRectBase::mousePressEvent(event);
+    KReportDesignerItemRectBase::mousePressEvent(event);
 }
diff --git a/src/items/image/KoReportDesignerItemImage.h b/src/plugins/barcode/KReportDesignerItemBarcode.h
similarity index 68%
rename from src/items/image/KoReportDesignerItemImage.h
rename to src/plugins/barcode/KReportDesignerItemBarcode.h
index 55dcd328..da043cdb 100644
--- a/src/items/image/KoReportDesignerItemImage.h
+++ b/src/plugins/barcode/KReportDesignerItemBarcode.h
@@ -1,51 +1,57 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#ifndef __KOREPORTDESIGNERITEMIMAGE_H__
-#define __KOREPORTDESIGNERITEMIMAGE_H__
 
+#ifndef KREPORTDESIGNERITEMBARCODE_H
+#define KREPORTDESIGNERITEMBARCODE_H
 
-#include 
+#include "KReportDesignerItemRectBase.h"
+#include "KReportItemBarcode.h"
 
-#include "KoReportDesignerItemRectBase.h"
-#include "KoReportItemImage.h"
+#include 
 
-class KoReportDesignerItemImage : public KoReportItemImage, public KoReportDesignerItemRectBase
+//
+// ReportEntityBarcode
+//
+class KReportDesignerItemBarcode : public KReportItemBarcode, public KReportDesignerItemRectBase
 {
-  Q_OBJECT
+    Q_OBJECT
 public:
-    KoReportDesignerItemImage(KoReportDesigner *, QGraphicsScene* scene, const QPointF &pos);
-    KoReportDesignerItemImage(const QDomNode & element, KoReportDesigner *, QGraphicsScene* scene);
+    KReportDesignerItemBarcode(KReportDesigner *, QGraphicsScene* scene, const QPointF &pos);
+    KReportDesignerItemBarcode(const QDomNode & element, KReportDesigner *, QGraphicsScene* scene);
 
-    virtual ~KoReportDesignerItemImage();
+    virtual ~KReportDesignerItemBarcode();
     virtual void buildXML(QDomDocument *doc, QDomElement *parent);
     virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0);
-    virtual KoReportDesignerItemImage* clone();
+
+    virtual KReportDesignerItemBarcode* clone();
+
 
 protected:
     virtual void mousePressEvent(QGraphicsSceneMouseEvent * event);
 
 private:
-    void init(QGraphicsScene*, KoReportDesigner*);
+    void init(QGraphicsScene*, KReportDesigner*);
+
+    QRect getTextRect();
 
 private Q_SLOTS:
     void slotPropertyChanged(KPropertySet &, KProperty &);
-
 };
 
 #endif
diff --git a/src/plugins/barcode/KoReportItemBarcode.cpp b/src/plugins/barcode/KReportItemBarcode.cpp
similarity index 92%
rename from src/plugins/barcode/KoReportItemBarcode.cpp
rename to src/plugins/barcode/KReportItemBarcode.cpp
index 54749ac7..c481dceb 100644
--- a/src/plugins/barcode/KoReportItemBarcode.cpp
+++ b/src/plugins/barcode/KReportItemBarcode.cpp
@@ -1,253 +1,253 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "KoReportItemBarcode.h"
+#include "KReportItemBarcode.h"
 
 #include 
 #include 
 
 #include 
 
 #include "kreportplugin_debug.h"
 
 #include "barcodes.h"
 
-KoReportItemBarcode::KoReportItemBarcode()
+KReportItemBarcode::KReportItemBarcode()
 {
     createProperties();
 }
 
-KoReportItemBarcode::KoReportItemBarcode(const QDomNode & element)
+KReportItemBarcode::KReportItemBarcode(const QDomNode & element)
 {
     createProperties();
     QDomNodeList nl = element.childNodes();
     QString n;
     QDomNode node;
 
     m_name->setValue(element.toElement().attribute(QLatin1String("report:name")));
     m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source")));
     m_itemValue->setValue(element.toElement().attribute(QLatin1String("report:value")));
     Z = element.toElement().attribute(QLatin1String("report:z-index")).toDouble();
     m_horizontalAlignment->setValue(element.toElement().attribute(QLatin1String("report:horizontal-align")));
     m_maxLength->setValue(element.toElement().attribute(QLatin1String("report:barcode-max-length")));
     m_format->setValue(element.toElement().attribute(QLatin1String("report:barcode-format")));
     parseReportRect(element.toElement(), &m_pos, &m_size);
 
 }
 
-void KoReportItemBarcode::setMaxLength(int i)
+void KReportItemBarcode::setMaxLength(int i)
 {
     if (i > 0) {
         if (m_maxLength->value().toInt() != i) {
             m_maxLength->setValue(i);
         }
         if (m_format->value().toString() == QLatin1String("3of9")) {
             int C = i; // number of characters
             int N = 2; // narrow mult for wide line
             int X = 1; // narrow line width
             int I = 1; // interchange line width
             m_minWidthData = (((C + 2) * ((3 * N) + 6) * X) + ((C + 1) * I)) / 100.0;
             m_minHeight = m_minWidthData * 0.15;
             /*if(min_height < 0.25)*/ m_minHeight = 0.25;
             m_minWidthTotal = m_minWidthData + 0.22; // added a little buffer to make sure we don't loose any
             // of our required quiet zone in conversions
         } else if (m_format->value().toString() == QLatin1String("3of9+")) {
             int C = i * 2; // number of characters
             int N = 2; // narrow mult for wide line
             int X = 1; // 1px narrow line
             int I = 1; // 1px narrow line interchange
             m_minWidthData = (((C + 2) * ((3 * N) + 6) * X) + ((C + 1) * I)) / 100.0;
             m_minHeight = m_minWidthData * 0.15;
             /*if(min_height < 0.25)*/ m_minHeight = 0.25;
             m_minWidthTotal = m_minWidthData + 0.22; // added a little buffer to make sure we don't loose any
             // of our required quiet zone in conversions
         } else if (m_format->value().toString() == QLatin1String("i2of5")) {
             int C = i * 2; // number of characters
             int N = 2; // narrow mult for wide line
             int X = 1; // 1px narrow line
             m_minWidthTotal = ((C * (2.0*N + 3.0) + 6.0 + N) * X);
             m_minHeight = 0.25;
             m_minWidthTotal = m_minWidthData + 0.22;
         } else if (m_format->value().toString() == QLatin1String("128")) {
             int C = i; // assuming 1:1 ratio of data passed in to data actually used in encoding
             int X = 1; // 1px wide
             m_minWidthData = (((11 * C) + 35) * X) / 100.0;       // assuming CODE A or CODE B
             m_minHeight = m_minWidthData * 0.15;
             /*if(min_height < 0.25)*/ m_minHeight = 0.25;
             m_minWidthTotal = m_minWidthData + 0.22; // added a little bugger to make sure we don't loose any
             // of our required quiet zone in conversions
         } else if (m_format->value().toString() == QLatin1String("upc-a")) {
             m_minWidthData = 0.95;
             m_minWidthTotal = 1.15;
             m_minHeight = 0.25;
         } else if (m_format->value().toString() == QLatin1String("upc-e")) {
             m_minWidthData = 0.52;
             m_minWidthTotal = 0.70;
             m_minHeight = 0.25;
         } else if (m_format->value().toString() == QLatin1String("ean13")) {
             m_minWidthData = 0.95;
             m_minWidthTotal = 1.15;
             m_minHeight = 0.25;
         } else if (m_format->value().toString() == QLatin1String("ean8")) {
             m_minWidthData = 0.67;
             m_minWidthTotal = 0.90;
             m_minHeight = 0.25;
         } else {
             kreportpluginDebug() << "Unknown format encountered: " << m_format->value().toString();
         }
     }
 }
 
-void KoReportItemBarcode::createProperties()
+void KReportItemBarcode::createProperties()
 {
     m_set = new KPropertySet(0, QLatin1String("Barcode"));
 
     QStringList keys, strings;
 
     m_controlSource = new KProperty("item-data-source", QStringList(), QStringList(),
                                     QString(), tr("Data Source"));
 
     m_itemValue = new KProperty("value", QString(), tr("Value"),
                                 tr("Value used if not bound to a field"));
 
     keys << QLatin1String("left") << QLatin1String("center") << QLatin1String("right");
     strings << tr("Left") << tr("Center") << tr("Right");
     m_horizontalAlignment = new KProperty("horizontal-align", keys, strings,
                                           QLatin1String("left"), tr("Horizontal Alignment"));
 
     keys.clear();
     strings.clear();
     keys << QLatin1String("3of9") << QLatin1String("3of9+") << QLatin1String("128")
          << QLatin1String("ean8") << QLatin1String("ean13") << QLatin1String("i2of5")
          << QLatin1String("upc-a") << QLatin1String("upc-e");
     strings << tr("Code 3 of 9", "Barcode symbology, keep short")
             << tr("Code 3 of 9 Ext.", "Barcode symbology, keep short")
             << tr("Code 128", "Barcode symbology, keep short")
             << tr("EAN-8", "Barcode symbology, keep short")
             << tr("EAN-13", "Barcode symbology, keep short")
             << tr("Interleaved 2 of 5", "Barcode symbology, keep short")
             << tr("UPC-A", "Barcode symbology, keep short")
             << tr("UPC-E", "Barcode symbology, keep short");
     m_format = new KProperty("barcode-format", keys, strings, QLatin1String("3of9"),
                              tr("Barcode Format"));
 
     m_maxLength = new KProperty("barcode-max-length", 5, tr("Max Length"),
                                 tr("Maximum Barcode Length"));
 
     addDefaultProperties();
     m_set->addProperty(m_controlSource);
     m_set->addProperty(m_itemValue);
     m_set->addProperty(m_format);
     m_set->addProperty(m_horizontalAlignment);
     m_set->addProperty(m_maxLength);
 }
 
-KoReportItemBarcode::~KoReportItemBarcode()
+KReportItemBarcode::~KReportItemBarcode()
 {
     delete m_set;
 }
 
-int KoReportItemBarcode::alignment()
+int KReportItemBarcode::alignment()
 {
     QByteArray a = m_horizontalAlignment->value().toByteArray();
 
     if (a == "left")
         return 0;
     else if (a == "center")
         return 1;
     else if (a == "right")
         return 2;
     else
         return 0;
 }
 
-QString KoReportItemBarcode::itemDataSource() const
+QString KReportItemBarcode::itemDataSource() const
 {
     return m_controlSource->value().toString();
 }
 
-QString KoReportItemBarcode::format()
+QString KReportItemBarcode::format()
 {
     return m_format->value().toString();
 }
 
-int KoReportItemBarcode::maxLength()
+int KReportItemBarcode::maxLength()
 {
     return m_maxLength->value().toInt();
 }
 
-void KoReportItemBarcode::setFormat(const QString& f)
+void KReportItemBarcode::setFormat(const QString& f)
 {
     m_format->setValue(f);
 }
 
-void KoReportItemBarcode::setAlignment(int)
+void KReportItemBarcode::setAlignment(int)
 {
     //! @todo Barcode alignment
 }
 
 //RTTI
-QString KoReportItemBarcode::typeName() const
+QString KReportItemBarcode::typeName() const
 {
     return QLatin1String("barcode");
 }
 
-int KoReportItemBarcode::renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset,
-                                          const QVariant &data, KRScriptHandler *script)
+int KReportItemBarcode::renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset,
+                                          const QVariant &data, KReportScriptHandler *script)
 {
     Q_UNUSED(section);
     Q_UNUSED(script);
 
     QPointF pos = m_pos.toScene();
     QSizeF size = m_size.toScene();
     pos += offset;
 
     QRectF rect = QRectF(pos, size);
 
     QString val;
 
     if (m_controlSource->value().toString().isEmpty()) {
         val = m_itemValue->value().toString();
     } else {
         val = data.toString();
     }
 
     if (page) {
         QByteArray fmt = m_format->value().toByteArray();
         int align = alignment();
         if (fmt == "3of9")
             render3of9(page, rect, val, align);
         else if (fmt == "3of9+")
             renderExtended3of9(page, rect, val, align);
         else if (fmt == "i2of5")
             renderI2of5(page, rect, val, align);
         else if (fmt == "128")
             renderCode128(page, rect, val, align);
         else if (fmt == "ean13")
             renderCodeEAN13(page, rect, val, align);
         else if (fmt == "ean8")
             renderCodeEAN8(page, rect, val, align);
         else if (fmt == "upc-a")
             renderCodeUPCA(page, rect, val, align);
         else if (fmt == "upc-e")
             renderCodeUPCE(page, rect, val, align);
         else {
             kreportpluginDebug() << "Unknown barcode format:" << fmt;
         }
     }
     return 0;
 }
diff --git a/src/plugins/barcode/KoReportItemBarcode.h b/src/plugins/barcode/KReportItemBarcode.h
similarity index 80%
rename from src/plugins/barcode/KoReportItemBarcode.h
rename to src/plugins/barcode/KReportItemBarcode.h
index d69043b2..45bfd46f 100644
--- a/src/plugins/barcode/KoReportItemBarcode.h
+++ b/src/plugins/barcode/KReportItemBarcode.h
@@ -1,74 +1,74 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#ifndef KRBARCODEDATA_H
-#define KRBARCODEDATA_H
+#ifndef KREPORTITEMBRCODE_H
+#define KREPORTITEMBRCODE_H
 
-#include "KoReportItemBase.h"
-#include 
-#include 
+#include "KReportItemBase.h"
+#include 
+#include 
 
 class QDomNode;
 
 namespace Scripting
 {
 class Barcode;
 }
 
 /**
 */
-class KoReportItemBarcode : public KoReportItemBase
+class KReportItemBarcode : public KReportItemBase
 {
 Q_OBJECT
 public:
-    KoReportItemBarcode();
-    explicit KoReportItemBarcode(const QDomNode &element);
-    ~KoReportItemBarcode();
+    KReportItemBarcode();
+    explicit KReportItemBarcode(const QDomNode &element);
+    ~KReportItemBarcode();
 
     virtual QString typeName() const;
-    virtual int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KRScriptHandler *script);
+    virtual int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KReportScriptHandler *script);
     virtual QString itemDataSource() const;
 
 protected:
 
     KProperty * m_controlSource;
     KProperty * m_horizontalAlignment;
     KProperty * m_format;
     KProperty * m_maxLength;
     KProperty* m_itemValue;
 
 
     int alignment();
     void setAlignment(int);
     int maxLength();
     void setMaxLength(int i);
     QString format();
     void setFormat(const QString&);
 
     // all these values are in inches and
     // are for internal use only
     qreal m_minWidthData;
     qreal m_minWidthTotal;
     qreal m_minHeight;
 
 private:
     virtual void createProperties();
 
     friend class Scripting::Barcode;
 };
 
 #endif
diff --git a/src/plugins/barcode/krscriptbarcode.cpp b/src/plugins/barcode/KReportScriptBarcode.cpp
similarity index 96%
rename from src/plugins/barcode/krscriptbarcode.cpp
rename to src/plugins/barcode/KReportScriptBarcode.cpp
index 61e46789..4cd93120 100644
--- a/src/plugins/barcode/krscriptbarcode.cpp
+++ b/src/plugins/barcode/KReportScriptBarcode.cpp
@@ -1,105 +1,105 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "krscriptbarcode.h"
+#include "KReportScriptBarcode.h"
 
 #include 
 
 namespace Scripting
 {
 
-Barcode::Barcode(KoReportItemBarcode *b)
+Barcode::Barcode(KReportItemBarcode *b)
 {
     m_barcode = b;
 }
 
 
 Barcode::~Barcode()
 {
 }
 
 QPointF Barcode::position()
 {
     return m_barcode->m_pos.toPoint();
 }
 void Barcode::setPosition(const QPointF& p)
 {
     m_barcode->m_pos.setPointPos(p);
 }
 
 QSizeF Barcode::size()
 {
     return m_barcode->m_size.toPoint();
 }
 void Barcode::setSize(const QSizeF& s)
 {
     m_barcode->m_size.setPointSize(s);
 }
 
 int Barcode::horizontalAlignment()
 {
     const QString a = m_barcode->m_horizontalAlignment->value().toString().toLower();
 
     if (a == QLatin1String("left")) {
         return -1;
     }
     if (a == QLatin1String("center")) {
         return 0;
     }
     if (a == QLatin1String("right")) {
         return 1;
     }
     return -1;
 }
 void Barcode::setHorizonalAlignment(int a)
 {
     switch (a) {
     case -1:
         m_barcode->m_horizontalAlignment->setValue(QLatin1String("left"));
         break;
     case 0:
         m_barcode->m_horizontalAlignment->setValue(QLatin1String("center"));
         break;
     case 1:
         m_barcode->m_horizontalAlignment->setValue(QLatin1String("right"));
         break;
     default:
         m_barcode->m_horizontalAlignment->setValue(QLatin1String("left"));
         break;
     }
 }
 
 QString Barcode::source()
 {
     return m_barcode->m_controlSource->value().toString();
 }
 
 void Barcode::setSource(const QString& s)
 {
     m_barcode->m_controlSource->setValue(s);
 }
 
 QString Barcode::format()
 {
     return m_barcode->m_format->value().toString();
 }
 
 void Barcode::setFormat(const QString& s)
 {
     m_barcode->m_format->setValue(s);
 }
 }
diff --git a/src/plugins/barcode/krscriptbarcode.h b/src/plugins/barcode/KReportScriptBarcode.h
similarity index 95%
rename from src/plugins/barcode/krscriptbarcode.h
rename to src/plugins/barcode/KReportScriptBarcode.h
index 11643dec..bfec8efa 100644
--- a/src/plugins/barcode/krscriptbarcode.h
+++ b/src/plugins/barcode/KReportScriptBarcode.h
@@ -1,115 +1,115 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
 #ifndef SCRIPTINGKRSCRIPTBARCODE_H
 #define SCRIPTINGKRSCRIPTBARCODE_H
 
 #include 
 
-#include "KoReportItemBarcode.h"
+#include "KReportItemBarcode.h"
 
 namespace Scripting
 {
 
 /**
 */
 class Barcode : public QObject
 {
     Q_OBJECT
 public:
-    explicit Barcode(KoReportItemBarcode *f);
+    explicit Barcode(KReportItemBarcode *f);
 
     ~Barcode();
 
 public Q_SLOTS:
 
 
     /**
      * Get the position of the barcode
      * @return position in points
      */
     QPointF position();
 
 
     /**
      * Sets the position of the barcode in points
      * @param Position
      */
     void setPosition(const QPointF&);
 
     /**
      * Get the size of the barcode
      * @return size in points
      */
     QSizeF size();
 
     /**
      * Set the size of the barcode in points
      * @param Size
      */
     void setSize(const QSizeF&);
 
     /**
      * Get the horizontal alignment
      * -1 Left
      * 0 Center
      * +1 Right
      * @return alignment
     */
     int horizontalAlignment();
 
     /**
      * Sets the horizontal alignment
      * @param  Alignemnt
      */
     void setHorizonalAlignment(int);
 
 
     /**
      * Get the control source (field name) of the barcode
      * @return control source
      */
     QString source();
 
 
     /**
      * Set the control source (field name) of the barcode
      * @param controlsource
      */
     void setSource(const QString&);
 
 
     /**
      * Get the barcode format
      * @return format as string
      */
     QString format();
 
     /**
      * Set the barcode format
      * @param format
      */
     void setFormat(const QString&);
 
 
 private:
-    KoReportItemBarcode *m_barcode;
+    KReportItemBarcode *m_barcode;
 };
 
 }
 
 #endif
diff --git a/src/plugins/barcode/KoReportBarcodePlugin.cpp b/src/plugins/barcode/KoReportBarcodePlugin.cpp
deleted file mode 100644
index 5a9de992..00000000
--- a/src/plugins/barcode/KoReportBarcodePlugin.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/* This file is part of the KDE project
-   Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
-
-   This library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   This library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
-
-   You should have received a copy of the GNU Library General Public License
-   along with this library; see the file COPYING.LIB.  If not, write to
-   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-   Boston, MA 02110-1301, USA.
-*/
-
-#include "KoReportBarcodePlugin.h"
-#include "KoReportItemBarcode.h"
-#include "KoReportDesignerItemBarcode.h"
-#include "KReportPluginMetaData.h"
-#ifdef KREPORT_SCRIPTING
-#include "krscriptbarcode.h"
-#endif
-
-
-KREPORT_PLUGIN_FACTORY(KoReportBarcodePlugin, "kreport_barcodeplugin.json")
-
-KoReportBarcodePlugin::KoReportBarcodePlugin(QObject *parent, const QVariantList &args)
-    : KoReportPluginInterface(parent, args)
-{
-}
-
-KoReportBarcodePlugin::~KoReportBarcodePlugin()
-{
-}
-
-QObject* KoReportBarcodePlugin::createRendererInstance(const QDomNode& element)
-{
-    return new KoReportItemBarcode(element);
-}
-
-QObject* KoReportBarcodePlugin::createDesignerInstance(const QDomNode& element, KoReportDesigner* designer , QGraphicsScene* scene)
-{
-    return new KoReportDesignerItemBarcode(element, designer, scene);
-}
-
-QObject* KoReportBarcodePlugin::createDesignerInstance(KoReportDesigner* designer, QGraphicsScene* scene, const QPointF& pos)
-{
-    return new KoReportDesignerItemBarcode(designer, scene, pos);
-}
-
-#ifdef KREPORT_SCRIPTING
-QObject* KoReportBarcodePlugin::createScriptInstance(KoReportItemBase* item)
-{
-    KoReportItemBarcode *barcode = dynamic_cast(item);
-    if (barcode) {
-        return new Scripting::Barcode(barcode);
-    }
-    return 0;
-}
-#endif
-
-#include "KoReportBarcodePlugin.moc"
diff --git a/src/plugins/barcode/code128.cpp b/src/plugins/barcode/code128.cpp
index c3533b05..3ed828fd 100644
--- a/src/plugins/barcode/code128.cpp
+++ b/src/plugins/barcode/code128.cpp
@@ -1,345 +1,345 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
 /*
  *     This file contains the implementation of the Code 128 barcode renderer.
  * All this code assumes a 100dpi rendering surface for it's calculations.
  */
 
 #include 
 #include 
 #include 
 #include 
 #include 
 
-#include "renderobjects.h"
+#include "KReportRenderObjects.h"
 #include "kreportplugin_debug.h"
 
 static const int SETA = 0;
 static const int SETB = 1;
 static const int SETC = 2;
 
 static const char FNC1   = (char)130;
 static const char FNC2   = (char)131;
 static const char FNC3   = (char)132;
 static const char FNC4   = (char)133;
 static const char SHIFT  = (char)134;
 static const char CODEA  = (char)135;
 static const char CODEB  = (char)136;
 static const char CODEC  = (char)137;
 static const char STARTA = (char)138;
 static const char STARTB = (char)139;
 static const char STARTC = (char)140;
 
 
 struct code128 {
     char codea;
     char codeb;
     char codec;
 
     int values[6];
 
     bool _null;
 };
 
 static const struct code128 _128codes[] = {
     // A ,     B ,     C ,    { B  S  B  S  B  S }, NULL? },
     { ' ',    ' ',      0,    { 2, 1, 2, 2, 2, 2 }, false },
     { '!',    '!',      1,    { 2, 2, 2, 1, 2, 2 }, false },
     { '"',    '"',      2,    { 2, 2, 2, 2, 2, 1 }, false },
     { '#',    '#',      3,    { 1, 2, 1, 2, 2, 3 }, false },
     { '$',    '$',      4,    { 1, 2, 1, 3, 2, 2 }, false },
     { '%',    '%',      5,    { 1, 3, 1, 2, 2, 2 }, false },
     { '&',    '&',      6,    { 1, 2, 2, 2, 1, 3 }, false },
     { '\'',   '\'',     7,    { 1, 2, 2, 3, 1, 2 }, false },
     { '(',    '(',      8,    { 1, 3, 2, 2, 1, 2 }, false },
     { ')',    ')',      9,    { 2, 2, 1, 2, 1, 3 }, false },
     { '*',    '*',     10,    { 2, 2, 1, 3, 1, 2 }, false },
     { '+',    '+',     11,    { 2, 3, 1, 2, 1, 2 }, false },
     { ',',    ',',     12,    { 1, 1, 2, 2, 3, 2 }, false },
     { '-',    '-',     13,    { 1, 2, 2, 1, 3, 2 }, false },
     { '.',    '.',     14,    { 1, 2, 2, 2, 3, 1 }, false },
     { '/',    '/',     15,    { 1, 1, 3, 2, 2, 2 }, false },
     { '0',    '0',     16,    { 1, 2, 3, 1, 2, 2 }, false },
     { '1',    '1',     17,    { 1, 2, 3, 2, 2, 1 }, false },
     { '2',    '2',     18,    { 2, 2, 3, 2, 1, 1 }, false },
     { '3',    '3',     19,    { 2, 2, 1, 1, 3, 2 }, false },
     { '4',    '4',     20,    { 2, 2, 1, 2, 3, 1 }, false },
     { '5',    '5',     21,    { 2, 1, 3, 2, 1, 2 }, false },
     { '6',    '6',     22,    { 2, 2, 3, 1, 1, 2 }, false },
     { '7',    '7',     23,    { 3, 1, 2, 1, 3, 1 }, false },
     { '8',    '8',     24,    { 3, 1, 1, 2, 2, 2 }, false },
     { '9',    '9',     25,    { 3, 2, 1, 1, 2, 2 }, false },
     { ':',    ':',     26,    { 3, 2, 1, 2, 2, 1 }, false },
     { ';',    ';',     27,    { 3, 1, 2, 2, 1, 2 }, false },
     { '<',    '<',     28,    { 3, 2, 2, 1, 1, 2 }, false },
     { '=',    '=',     29,    { 3, 2, 2, 2, 1, 1 }, false },
     { '>',    '>',     30,    { 2, 1, 2, 1, 2, 3 }, false },
     { '?',    '?',     31,    { 2, 1, 2, 3, 2, 1 }, false },
     { '@',    '@',     32,    { 2, 3, 2, 1, 2, 1 }, false },
     { 'A',    'A',     33,    { 1, 1, 1, 3, 2, 3 }, false },
     { 'B',    'B',     34,    { 1, 3, 1, 1, 2, 3 }, false },
     { 'C',    'C',     35,    { 1, 3, 1, 3, 2, 1 }, false },
     { 'D',    'D',     36,    { 1, 1, 2, 3, 1, 3 }, false },
     { 'E',    'E',     37,    { 1, 3, 2, 1, 1, 3 }, false },
     { 'F',    'F',     38,    { 1, 3, 2, 3, 1, 1 }, false },
     { 'G',    'G',     39,    { 2, 1, 1, 3, 1, 3 }, false },
     { 'H',    'H',     40,    { 2, 3, 1, 1, 1, 3 }, false },
     { 'I',    'I',     41,    { 2, 3, 1, 3, 1, 1 }, false },
     { 'J',    'J',     42,    { 1, 1, 2, 1, 3, 3 }, false },
     { 'K',    'K',     43,    { 1, 1, 2, 3, 3, 1 }, false },
     { 'L',    'L',     44,    { 1, 3, 2, 1, 3, 1 }, false },
     { 'M',    'M',     45,    { 1, 1, 3, 1, 2, 3 }, false },
     { 'N',    'N',     46,    { 1, 1, 3, 3, 2, 1 }, false },
     { 'O',    'O',     47,    { 1, 3, 3, 1, 2, 1 }, false },
     { 'P',    'P',     48,    { 3, 1, 3, 1, 2, 1 }, false },
     { 'Q',    'Q',     49,    { 2, 1, 1, 3, 3, 1 }, false },
     { 'R',    'R',     50,    { 2, 3, 1, 1, 3, 1 }, false },
     { 'S',    'S',     51,    { 2, 1, 3, 1, 1, 3 }, false },
     { 'T',    'T',     52,    { 2, 1, 3, 3, 1, 1 }, false },
     { 'U',    'U',     53,    { 2, 1, 3, 1, 3, 1 }, false },
     { 'V',    'V',     54,    { 3, 1, 1, 1, 2, 3 }, false },
     { 'W',    'W',     55,    { 3, 1, 1, 3, 2, 1 }, false },
     { 'X',    'X',     56,    { 3, 3, 1, 1, 2, 1 }, false },
     { 'Y',    'Y',     57,    { 3, 1, 2, 1, 1, 3 }, false },
     { 'Z',    'Z',     58,    { 3, 1, 2, 3, 1, 1 }, false },
     { '[',    '[',     59,    { 3, 3, 2, 1, 1, 1 }, false },
     { '\\',   '\\',    60,    { 3, 1, 4, 1, 1, 1 }, false },
     { ']',    ']',     61,    { 2, 2, 1, 4, 1, 1 }, false },
     { '^',    '^',     62,    { 4, 3, 1, 1, 1, 1 }, false },
     { '_',    '_',     63,    { 1, 1, 1, 2, 2, 4 }, false },
     { 0x00,   '`',     64,    { 1, 1, 1, 4, 2, 2 }, false }, // NUL
     { 0x01,   'a',     65,    { 1, 2, 1, 1, 2, 4 }, false }, // SOH
     { 0x02,   'b',     66,    { 1, 2, 1, 4, 2, 1 }, false }, // STX
     { 0x03,   'c',     67,    { 1, 4, 1, 1, 2, 2 }, false }, // ETX
     { 0x04,   'd',     68,    { 1, 4, 1, 2, 2, 1 }, false }, // EOT
     { 0x05,   'e',     69,    { 1, 1, 2, 2, 1, 4 }, false }, // ENQ
     { 0x06,   'f',     70,    { 1, 1, 2, 4, 1, 2 }, false }, // ACK
     { 0x07,   'g',     71,    { 1, 2, 2, 1, 1, 4 }, false }, // BEL
     { 0x08,   'h',     72,    { 1, 2, 2, 4, 1, 1 }, false }, // BS
     { 0x09,   'i',     73,    { 1, 4, 2, 1, 1, 2 }, false }, // HT
     { 0x0A,   'j',     74,    { 1, 4, 2, 2, 1, 1 }, false }, // LF
     { 0x0B,   'k',     75,    { 2, 4, 1, 2, 1, 1 }, false }, // VT
     { 0x0C,   'l',     76,    { 2, 2, 1, 1, 1, 4 }, false }, // FF
     { 0x0D,   'm',     77,    { 4, 1, 3, 1, 1, 1 }, false }, // CR
     { 0x0E,   'n',     78,    { 2, 4, 1, 1, 1, 2 }, false }, // SO
     { 0x0F,   'o',     79,    { 1, 3, 4, 1, 1, 1 }, false }, // SI
     { 0x10,   'p',     80,    { 1, 1, 1, 2, 4, 2 }, false }, // DLE
     { 0x11,   'q',     81,    { 1, 2, 1, 1, 4, 2 }, false }, // DC1
     { 0x12,   'r',     82,    { 1, 2, 1, 2, 4, 1 }, false }, // DC2
     { 0x13,   's',     83,    { 1, 1, 4, 2, 1, 2 }, false }, // DC3
     { 0x14,   't',     84,    { 1, 2, 4, 1, 1, 2 }, false }, // DC4
     { 0x15,   'u',     85,    { 1, 2, 4, 2, 1, 1 }, false }, // NAK
     { 0x16,   'v',     86,    { 4, 1, 1, 2, 1, 2 }, false }, // SYN
     { 0x17,   'w',     87,    { 4, 2, 1, 1, 1, 2 }, false }, // ETB
     { 0x18,   'x',     88,    { 4, 2, 1, 2, 1, 1 }, false }, // CAN
     { 0x19,   'y',     89,    { 2, 1, 2, 1, 4, 1 }, false }, // EM
     { 0x1A,   'z',     90,    { 2, 1, 4, 1, 2, 1 }, false }, // SUB
     { 0x1B,   '{',     91,    { 4, 1, 2, 1, 2, 1 }, false }, // ESC
     { 0x1C,   '|',     92,    { 1, 1, 1, 1, 4, 3 }, false }, // FS
     { 0x1D,   '}',     93,    { 1, 1, 1, 3, 4, 1 }, false }, // GS
     { 0x1E,   '~',     94,    { 1, 3, 1, 1, 4, 1 }, false }, // RS
     { 0x1F,   0x7F,    95,    { 1, 1, 4, 1, 1, 3 }, false }, // US    DEL
     { FNC3,   FNC3,    96,    { 1, 1, 4, 3, 1, 1 }, false }, // FNC3  FNC3
     { FNC2,   FNC2,    97,    { 4, 1, 1, 1, 1, 3 }, false }, // FNC2  FNC2
     { SHIFT,  SHIFT,   98,    { 4, 1, 1, 3, 1, 1 }, false }, // SHIFT SHIFT
     { CODEC,  CODEC,   99,    { 1, 1, 3, 1, 4, 1 }, false }, // CODEC CODEC
     { CODEB,  FNC4,   CODEB,  { 1, 1, 4, 1, 3, 1 }, false }, // CODEB FNC4  CODEB
     { FNC4,   CODEA,  CODEA,  { 3, 1, 1, 1, 4, 1 }, false }, // FNC4  CODEA CODEA
     { FNC1,   FNC1,   FNC1,   { 4, 1, 1, 1, 3, 1 }, false }, // FNC1  FNC1  FNC1
     { STARTA, STARTA, STARTA, { 2, 1, 1, 4, 1, 2 }, false }, // STARTA
     { STARTB, STARTB, STARTB, { 2, 1, 1, 2, 1, 4 }, false }, // STARTB
     { STARTC, STARTC, STARTC, { 2, 1, 1, 2, 3, 2 }, false }, // STARTC
 
     { '\0', '\0', '\0', { 0, 0, 0, 0, 0, 0 }, true } // null termininator of list
 };
 
 // STOP CHARACTER { 2 3 3 1 1 1 2 }
 
 int code128Index(QChar code, int set)
 {
     const char latin1Code = code.toLatin1();
     for (int idx = 0; _128codes[idx]._null == false; ++idx) {
         if (set == SETA && _128codes[idx].codea == latin1Code) return idx;
         if (set == SETB && _128codes[idx].codeb == latin1Code) return idx;
         if (set == SETC && _128codes[idx].codec == latin1Code) return idx;
     }
     return -1;  // couldn't find it
 }
 
 
 
 void renderCode128(OROPage * page, const QRectF & r, const QString & _str, int align)
 {
     QVector str;
 
     // create the list.. if the list is empty then just set a start code and move on
     if (_str.isEmpty())
         str.push_back(104);
     else {
         int rank_a = 0;
         int rank_b = 0;
         int rank_c = 0;
 
         QChar c;
         for (int i = 0; i < _str.length(); ++i) {
             c = _str.at(i);
             rank_a += (code128Index(c, SETA) != -1 ? 1 : 0);
             rank_b += (code128Index(c, SETB) != -1 ? 1 : 0);
             rank_c += (c >= QLatin1Char('0') && c <= QLatin1Char('9') ? 1 : 0);
         }
         if (rank_c == _str.length() && ((rank_c % 2) == 0 || rank_c > 4)) {
             // every value in the is a digit so we are going to go with mode C
             // and we have an even number or we have more than 4 values
             int i;
             if ((rank_c % 2) == 1) {
                 str.push_back(104); // START B
                 c = _str.at(0);
                 str.push_back(code128Index(c, SETB));
                 str.push_back(99); // MODE C
                 i = 1;
             } else {
                 str.push_back(105); // START C
                 i = 0;
             }
 
             for (; i < _str.length(); i += 2) {
                 char a, b;
                 c = _str.at(i);
                 a = c.toLatin1();
                 a -= 48;
                 c = _str.at(i + 1);
                 b = c.toLatin1();
                 b -= 48;
                 str.push_back(int((a * 10) + b));
             }
         } else {
             // start in the mode that had the higher number of hits and then
             // just shift into the opposite mode as needed
             int set = (rank_a > rank_b ? SETA : SETB);
             str.push_back((rank_a > rank_b ? 103 : 104));
             for (int i = 0; i < _str.length(); ++i) {
                 c = _str.at(i);
                 int v = code128Index(c, set);
                 if (v == -1) {
                     v = code128Index(c, (set == SETA ? SETB : SETA));
                     if (v != -1) {
                         str.push_back(98); // SHIFT
                         str.push_back(v);
                     }
                 } else
                     str.push_back(v);
             }
         }
     }
 
     // calculate and append the checksum value to the list
     int checksum = str.at(0);
     for (int i = 1; i < str.size(); ++i)
         checksum += (str.at(i) * i);
     checksum = checksum % 103;
     str.push_back(checksum);
 
     // lets determine some core attributes about this barcode
     qreal bar_width = 1; // the width of the base unit bar 1/100 inch
 
     // this is are mandatory minimum quiet zone
     qreal quiet_zone = bar_width * 10;
     if (quiet_zone < 0.1)
         quiet_zone = 0.1;
 
     // what kind of area do we have to work with
     qreal draw_width = r.width();
     qreal draw_height = r.height();
 
     // how long is the value we need to encode?
     int val_length = str.size() - 2; // we include start and checksum in are list so
     // subtract them out for our calculations
 
     // L = (11C + 35)X
     // L length of barcode (excluding quite zone) in units same as X and I
     // C the number of characters in the value excluding the start/stop and checksum characters
     // X the width of a bar (pixels in our case)
     qreal L;
 
     qreal C = val_length;
     qreal X = bar_width;
 
     L = (((11.0 * C) + 35.0) * X);
 
     // now we have the actual width the barcode will be so can determine the actual
     // size of the quiet zone (we assume we center the barcode in the given area
     // what should we do if the area is too small????
     // At the moment the way the code is written is we will always start at the minimum
     // required quiet zone if we don't have enough space.... I guess we'll just have over-run
     // to the right
     //
     // calculate the starting position based on the alignment option
     // for left align we don't need to do anything as the values are already setup for it
     if (align == 1) { // center
         qreal nqz = (draw_width - L) / 2.0;
         if (nqz > quiet_zone)
             quiet_zone = nqz;
     } else if (align > 1) // right
         quiet_zone = draw_width - (L + quiet_zone);
     // else if(align < 1) {} // left : do nothing
 
     qreal pos = r.left() + quiet_zone;
     qreal top = r.top();
 
     QPen pen(Qt::NoPen);
     QBrush brush(QColor("black"));
 
     bool space = false;
     for (int i = 0; i < str.size(); ++i) {
         // loop through each value and render the barcode
         const int idx = str.at(i);
         if (idx < 0 || idx > 105) {
             kreportpluginWarning() << "Encountered a non-compliant element while rendering a 3of9 barcode -- skipping";
             continue;
         }
         space = false;
         for (int b = 0; b < 6; ++b, space = !space) {
             qreal w = _128codes[idx].values[b] * bar_width;
             if (!space) {
                 ORORect * rect = new ORORect();
                 rect->setPen(pen);
                 rect->setBrush(brush);
                 rect->setRect(QRectF(pos, top, w, draw_height));
                 page->addPrimitive(rect);
             }
             pos += w;
         }
     }
 
     // we have to do the stop character separately like this because it has
     // 7 elements in it's bar sequence rather than 6 like the others
     int STOP_CHARACTER[] = { 2, 3, 3, 1, 1, 1, 2 };
     space = false;
     for (int b = 0; b < 7; ++b, space = !space) {
         qreal w = STOP_CHARACTER[b] * bar_width;
         if (!space) {
             ORORect * rect = new ORORect();
             rect->setPen(pen);
             rect->setBrush(brush);
             rect->setRect(QRectF(pos, top, w, draw_height));
             page->addPrimitive(rect);
         }
         pos += w;
     }
 }
diff --git a/src/plugins/barcode/code128paint.cpp b/src/plugins/barcode/code128paint.cpp
index 93ddda66..cb805bfe 100644
--- a/src/plugins/barcode/code128paint.cpp
+++ b/src/plugins/barcode/code128paint.cpp
@@ -1,349 +1,349 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
 /*
  *     This file contains the implementation of the Code 128 barcode renderer.
  * All this code assumes a 100dpi rendering surface for it's calculations.
  */
 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 
-#include "renderobjects.h"
+#include "KReportRenderObjects.h"
 #include "kreportplugin_debug.h"
 
 static const int SETA = 0;
 static const int SETB = 1;
 static const int SETC = 2;
 
 static const char FNC1   = (char)130;
 static const char FNC2   = (char)131;
 static const char FNC3   = (char)132;
 static const char FNC4   = (char)133;
 static const char SHIFT  = (char)134;
 static const char CODEA  = (char)135;
 static const char CODEB  = (char)136;
 static const char CODEC  = (char)137;
 static const char STARTA = (char)138;
 static const char STARTB = (char)139;
 static const char STARTC = (char)140;
 
 
 struct code128 {
     char codea;
     char codeb;
     char codec;
 
     int values[6];
 
     bool _null;
 };
 
 static const struct code128 _128codes[] = {
     // A ,     B ,     C ,    { B  S  B  S  B  S }, NULL? },
     { ' ',    ' ',      0,    { 2, 1, 2, 2, 2, 2 }, false },
     { '!',    '!',      1,    { 2, 2, 2, 1, 2, 2 }, false },
     { '"',    '"',      2,    { 2, 2, 2, 2, 2, 1 }, false },
     { '#',    '#',      3,    { 1, 2, 1, 2, 2, 3 }, false },
     { '$',    '$',      4,    { 1, 2, 1, 3, 2, 2 }, false },
     { '%',    '%',      5,    { 1, 3, 1, 2, 2, 2 }, false },
     { '&',    '&',      6,    { 1, 2, 2, 2, 1, 3 }, false },
     { '\'',   '\'',     7,    { 1, 2, 2, 3, 1, 2 }, false },
     { '(',    '(',      8,    { 1, 3, 2, 2, 1, 2 }, false },
     { ')',    ')',      9,    { 2, 2, 1, 2, 1, 3 }, false },
     { '*',    '*',     10,    { 2, 2, 1, 3, 1, 2 }, false },
     { '+',    '+',     11,    { 2, 3, 1, 2, 1, 2 }, false },
     { ',',    ',',     12,    { 1, 1, 2, 2, 3, 2 }, false },
     { '-',    '-',     13,    { 1, 2, 2, 1, 3, 2 }, false },
     { '.',    '.',     14,    { 1, 2, 2, 2, 3, 1 }, false },
     { '/',    '/',     15,    { 1, 1, 3, 2, 2, 2 }, false },
     { '0',    '0',     16,    { 1, 2, 3, 1, 2, 2 }, false },
     { '1',    '1',     17,    { 1, 2, 3, 2, 2, 1 }, false },
     { '2',    '2',     18,    { 2, 2, 3, 2, 1, 1 }, false },
     { '3',    '3',     19,    { 2, 2, 1, 1, 3, 2 }, false },
     { '4',    '4',     20,    { 2, 2, 1, 2, 3, 1 }, false },
     { '5',    '5',     21,    { 2, 1, 3, 2, 1, 2 }, false },
     { '6',    '6',     22,    { 2, 2, 3, 1, 1, 2 }, false },
     { '7',    '7',     23,    { 3, 1, 2, 1, 3, 1 }, false },
     { '8',    '8',     24,    { 3, 1, 1, 2, 2, 2 }, false },
     { '9',    '9',     25,    { 3, 2, 1, 1, 2, 2 }, false },
     { ':',    ':',     26,    { 3, 2, 1, 2, 2, 1 }, false },
     { ';',    ';',     27,    { 3, 1, 2, 2, 1, 2 }, false },
     { '<',    '<',     28,    { 3, 2, 2, 1, 1, 2 }, false },
     { '=',    '=',     29,    { 3, 2, 2, 2, 1, 1 }, false },
     { '>',    '>',     30,    { 2, 1, 2, 1, 2, 3 }, false },
     { '?',    '?',     31,    { 2, 1, 2, 3, 2, 1 }, false },
     { '@',    '@',     32,    { 2, 3, 2, 1, 2, 1 }, false },
     { 'A',    'A',     33,    { 1, 1, 1, 3, 2, 3 }, false },
     { 'B',    'B',     34,    { 1, 3, 1, 1, 2, 3 }, false },
     { 'C',    'C',     35,    { 1, 3, 1, 3, 2, 1 }, false },
     { 'D',    'D',     36,    { 1, 1, 2, 3, 1, 3 }, false },
     { 'E',    'E',     37,    { 1, 3, 2, 1, 1, 3 }, false },
     { 'F',    'F',     38,    { 1, 3, 2, 3, 1, 1 }, false },
     { 'G',    'G',     39,    { 2, 1, 1, 3, 1, 3 }, false },
     { 'H',    'H',     40,    { 2, 3, 1, 1, 1, 3 }, false },
     { 'I',    'I',     41,    { 2, 3, 1, 3, 1, 1 }, false },
     { 'J',    'J',     42,    { 1, 1, 2, 1, 3, 3 }, false },
     { 'K',    'K',     43,    { 1, 1, 2, 3, 3, 1 }, false },
     { 'L',    'L',     44,    { 1, 3, 2, 1, 3, 1 }, false },
     { 'M',    'M',     45,    { 1, 1, 3, 1, 2, 3 }, false },
     { 'N',    'N',     46,    { 1, 1, 3, 3, 2, 1 }, false },
     { 'O',    'O',     47,    { 1, 3, 3, 1, 2, 1 }, false },
     { 'P',    'P',     48,    { 3, 1, 3, 1, 2, 1 }, false },
     { 'Q',    'Q',     49,    { 2, 1, 1, 3, 3, 1 }, false },
     { 'R',    'R',     50,    { 2, 3, 1, 1, 3, 1 }, false },
     { 'S',    'S',     51,    { 2, 1, 3, 1, 1, 3 }, false },
     { 'T',    'T',     52,    { 2, 1, 3, 3, 1, 1 }, false },
     { 'U',    'U',     53,    { 2, 1, 3, 1, 3, 1 }, false },
     { 'V',    'V',     54,    { 3, 1, 1, 1, 2, 3 }, false },
     { 'W',    'W',     55,    { 3, 1, 1, 3, 2, 1 }, false },
     { 'X',    'X',     56,    { 3, 3, 1, 1, 2, 1 }, false },
     { 'Y',    'Y',     57,    { 3, 1, 2, 1, 1, 3 }, false },
     { 'Z',    'Z',     58,    { 3, 1, 2, 3, 1, 1 }, false },
     { '[',    '[',     59,    { 3, 3, 2, 1, 1, 1 }, false },
     { '\\',   '\\',    60,    { 3, 1, 4, 1, 1, 1 }, false },
     { ']',    ']',     61,    { 2, 2, 1, 4, 1, 1 }, false },
     { '^',    '^',     62,    { 4, 3, 1, 1, 1, 1 }, false },
     { '_',    '_',     63,    { 1, 1, 1, 2, 2, 4 }, false },
     { 0x00,   '`',     64,    { 1, 1, 1, 4, 2, 2 }, false }, // NUL
     { 0x01,   'a',     65,    { 1, 2, 1, 1, 2, 4 }, false }, // SOH
     { 0x02,   'b',     66,    { 1, 2, 1, 4, 2, 1 }, false }, // STX
     { 0x03,   'c',     67,    { 1, 4, 1, 1, 2, 2 }, false }, // ETX
     { 0x04,   'd',     68,    { 1, 4, 1, 2, 2, 1 }, false }, // EOT
     { 0x05,   'e',     69,    { 1, 1, 2, 2, 1, 4 }, false }, // ENQ
     { 0x06,   'f',     70,    { 1, 1, 2, 4, 1, 2 }, false }, // ACK
     { 0x07,   'g',     71,    { 1, 2, 2, 1, 1, 4 }, false }, // BEL
     { 0x08,   'h',     72,    { 1, 2, 2, 4, 1, 1 }, false }, // BS
     { 0x09,   'i',     73,    { 1, 4, 2, 1, 1, 2 }, false }, // HT
     { 0x0A,   'j',     74,    { 1, 4, 2, 2, 1, 1 }, false }, // LF
     { 0x0B,   'k',     75,    { 2, 4, 1, 2, 1, 1 }, false }, // VT
     { 0x0C,   'l',     76,    { 2, 2, 1, 1, 1, 4 }, false }, // FF
     { 0x0D,   'm',     77,    { 4, 1, 3, 1, 1, 1 }, false }, // CR
     { 0x0E,   'n',     78,    { 2, 4, 1, 1, 1, 2 }, false }, // SO
     { 0x0F,   'o',     79,    { 1, 3, 4, 1, 1, 1 }, false }, // SI
     { 0x10,   'p',     80,    { 1, 1, 1, 2, 4, 2 }, false }, // DLE
     { 0x11,   'q',     81,    { 1, 2, 1, 1, 4, 2 }, false }, // DC1
     { 0x12,   'r',     82,    { 1, 2, 1, 2, 4, 1 }, false }, // DC2
     { 0x13,   's',     83,    { 1, 1, 4, 2, 1, 2 }, false }, // DC3
     { 0x14,   't',     84,    { 1, 2, 4, 1, 1, 2 }, false }, // DC4
     { 0x15,   'u',     85,    { 1, 2, 4, 2, 1, 1 }, false }, // NAK
     { 0x16,   'v',     86,    { 4, 1, 1, 2, 1, 2 }, false }, // SYN
     { 0x17,   'w',     87,    { 4, 2, 1, 1, 1, 2 }, false }, // ETB
     { 0x18,   'x',     88,    { 4, 2, 1, 2, 1, 1 }, false }, // CAN
     { 0x19,   'y',     89,    { 2, 1, 2, 1, 4, 1 }, false }, // EM
     { 0x1A,   'z',     90,    { 2, 1, 4, 1, 2, 1 }, false }, // SUB
     { 0x1B,   '{',     91,    { 4, 1, 2, 1, 2, 1 }, false }, // ESC
     { 0x1C,   '|',     92,    { 1, 1, 1, 1, 4, 3 }, false }, // FS
     { 0x1D,   '}',     93,    { 1, 1, 1, 3, 4, 1 }, false }, // GS
     { 0x1E,   '~',     94,    { 1, 3, 1, 1, 4, 1 }, false }, // RS
     { 0x1F,   0x7F,    95,    { 1, 1, 4, 1, 1, 3 }, false }, // US    DEL
     { FNC3,   FNC3,    96,    { 1, 1, 4, 3, 1, 1 }, false }, // FNC3  FNC3
     { FNC2,   FNC2,    97,    { 4, 1, 1, 1, 1, 3 }, false }, // FNC2  FNC2
     { SHIFT,  SHIFT,   98,    { 4, 1, 1, 3, 1, 1 }, false }, // SHIFT SHIFT
     { CODEC,  CODEC,   99,    { 1, 1, 3, 1, 4, 1 }, false }, // CODEC CODEC
     { CODEB,  FNC4,   CODEB,  { 1, 1, 4, 1, 3, 1 }, false }, // CODEB FNC4  CODEB
     { FNC4,   CODEA,  CODEA,  { 3, 1, 1, 1, 4, 1 }, false }, // FNC4  CODEA CODEA
     { FNC1,   FNC1,   FNC1,   { 4, 1, 1, 1, 3, 1 }, false }, // FNC1  FNC1  FNC1
     { STARTA, STARTA, STARTA, { 2, 1, 1, 4, 1, 2 }, false }, // STARTA
     { STARTB, STARTB, STARTB, { 2, 1, 1, 2, 1, 4 }, false }, // STARTB
     { STARTC, STARTC, STARTC, { 2, 1, 1, 2, 3, 2 }, false }, // STARTC
 
     { '\0', '\0', '\0', { 0, 0, 0, 0, 0, 0 }, true } // null termininator of list
 };
 
 // STOP CHARACTER { 2 3 3 1 1 1 2 }
 
 int code128IndexP(QChar code, int set)
 {
     const char latin1Code = code.toLatin1();
     for (int idx = 0; _128codes[idx]._null == false; idx++) {
         if (set == SETA && _128codes[idx].codea == latin1Code) return idx;
         if (set == SETB && _128codes[idx].codeb == latin1Code) return idx;
         if (set == SETC && _128codes[idx].codec == latin1Code) return idx;
     }
     return -1;  // couldn't find it
 }
 
 void renderCode128(const QRect & r, const QString & _str, int align, QPainter * pPainter)
 {
     QVector str;
 
     // create the list.. if the list is empty then just set a start code and move on
     if (_str.isEmpty()) {
         str.push_back(104);
     } else {
         int rank_a = 0;
         int rank_b = 0;
         int rank_c = 0;
 
         QChar c;
         for (int i = 0; i < _str.length(); ++i) {
             c = _str.at(i);
             rank_a += (code128IndexP(c, SETA) != -1 ? 1 : 0);
             rank_b += (code128IndexP(c, SETB) != -1 ? 1 : 0);
             rank_c += (c >= QLatin1Char('0') && c <= QLatin1Char('9') ? 1 : 0);
         }
         if (rank_c == _str.length() && ((rank_c % 2) == 0 || rank_c > 4)) {
             // every value in the is a digit so we are going to go with mode C
             // and we have an even number or we have more than 4 values
             int i;
             if ((rank_c % 2) == 1) {
                 str.push_back(104); // START B
                 c = _str.at(0);
                 str.push_back(code128IndexP(c, SETB));
                 str.push_back(99); // MODE C
                 i = 1;
             } else {
                 str.push_back(105); // START C
                 i = 0;
             }
             for (; i < _str.length(); i += 2) {
                 char a, b;
                 c = _str.at(i);
                 a = c.toLatin1();
                 a -= 48;
                 c = _str.at(i + 1);
                 b = c.toLatin1();
                 b -= 48;
                 str.push_back(int((a * 10) + b));
             }
         } else {
             // start in the mode that had the higher number of hits and then
             // just shift into the opposite mode as needed
             int set = (rank_a > rank_b ? SETA : SETB);
             str.push_back((rank_a > rank_b ? 103 : 104));
             for (int i = 0; i < _str.length(); ++i) {
                 c = _str.at(i);
                 int v = code128IndexP(c, set);
                 if (v == -1) {
                     v = code128IndexP(c, (set == SETA ? SETB : SETA));
                     if (v != -1) {
                         str.push_back(98); // SHIFT
                         str.push_back(v);
                     }
                 } else {
                     str.push_back(v);
                 }
             }
         }
     }
 
     // calculate and append the checksum value to the list
     int checksum = str.at(0);
     for (int i = 1; i < str.size(); ++i) {
         checksum += (str.at(i) * i);
     }
     checksum = checksum % 103;
     str.push_back(checksum);
 
     // lets determine some core attributes about this barcode
     int bar_width = 1; // the width of the base unit bar
 
     // this is are mandatory minimum quiet zone
     int quiet_zone = bar_width * 10;
     if (quiet_zone < 10) quiet_zone = 10;
 
     // what kind of area do we have to work with
     int draw_width = r.width();
     int draw_height = r.height();
 
     // how long is the value we need to encode?
     int val_length = str.size() - 2; // we include start and checksum in are list so
     // subtract them out for our calculations
 
     // L = (11C + 35)X
     // L length of barcode (excluding quite zone) in units same as X and I
     // C the number of characters in the value excluding the start/stop and checksum characters
     // X the width of a bar (pixels in our case)
     int L;
 
     int C = val_length;
     int X = bar_width;
 
     L = (((11 * C) + 35) * X);
 
     // now we have the actual width the barcode will be so can determine the actual
     // size of the quiet zone (we assume we center the barcode in the given area
     // what should we do if the area is too small????
     // At the moment the way the code is written is we will always start at the minimum
     // required quiet zone if we don't have enough space.... I guess we'll just have over-run
     // to the right
     //
     // calculate the starting position based on the alignment option
     // for left align we don't need to do anything as the values are already setup for it
     if (align == 1) { // center
         int nqz = (draw_width - L) / 2;
         if (nqz > quiet_zone) quiet_zone = nqz;
     } else if (align > 1) { // right
         quiet_zone = draw_width - (L + quiet_zone);
     } // else if(align < 1) {} // left : do nothing
 
     int pos = r.left() + quiet_zone;
     int top = r.top();
 
     if (pPainter) {
         pPainter->save();
 
         QPen oneWide(pPainter->pen());
         oneWide.setWidth(1);
 #ifndef Q_OS_WIN32
         oneWide.setJoinStyle(Qt::MiterJoin);
 #endif
         pPainter->setPen(oneWide);
         pPainter->setBrush(pPainter->pen().color());
     }
 
 
     bool space = false;
     for (int i = 0; i < str.size(); ++i) {
         // loop through each value and render the barcode
         int idx = str.at(i);
         if (idx < 0 || idx > 105) {
             kreportpluginWarning() << "Encountered a non-compliant element while rendering a 3of9 barcode -- skipping";
             continue;
         }
         space = false;
         for (int b = 0; b < 6; b++, space = !space) {
             int w = _128codes[idx].values[b] * bar_width;
             if (!space && pPainter) {
                 pPainter->fillRect(pos, top, w, draw_height, pPainter->pen().color());
             }
             pos += w;
         }
     }
 
     // we have to do the stop character separately like this because it has
     // 7 elements in it's bar sequence rather than 6 like the others
     int STOP_CHARACTER[] = { 2, 3, 3, 1, 1, 1, 2 };
     space = false;
     for (int b = 0; b < 7; b++, space = !space) {
         int w = STOP_CHARACTER[b] * bar_width;
         if (!space && pPainter) {
             pPainter->fillRect(pos, top, w, draw_height, pPainter->pen().color());
         }
         pos += w;
     }
 
     if (pPainter) {
         pPainter->restore();
     }
 }
diff --git a/src/plugins/barcode/codeean.cpp b/src/plugins/barcode/codeean.cpp
index 2c494a2e..66cdce99 100644
--- a/src/plugins/barcode/codeean.cpp
+++ b/src/plugins/barcode/codeean.cpp
@@ -1,842 +1,842 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
 /*
  *     This file contains the implementation of the Code EAN and similar
  * formats for rendering purposes. All this code assumes a 100dpi
  * rendering surface for it's calculations.
  */
 
 #include 
 #include 
 #include 
 #include 
 
-#include "renderobjects.h"
+#include "KReportRenderObjects.h"
 
 static const int LEFTHAND_ODD = 0;
 static const int LEFTHAND_EVEN = 1;
 static const int RIGHTHAND = 2;
 
 static const int _encodings[10][3][7] = {
     /*   LEFTHAND_ODD   */  /*   LEFTHAND_EVEN   */  /*     RIGHTHAND     */
     { { 0, 0, 0, 1, 1, 0, 1}, { 0, 1, 0, 0, 1, 1, 1 }, { 1, 1, 1, 0, 0, 1, 0 } }, // 0
     { { 0, 0, 1, 1, 0, 0, 1}, { 0, 1, 1, 0, 0, 1, 1 }, { 1, 1, 0, 0, 1, 1, 0 } }, // 1
     { { 0, 0, 1, 0, 0, 1, 1}, { 0, 0, 1, 1, 0, 1, 1 }, { 1, 1, 0, 1, 1, 0, 0 } }, // 2
     { { 0, 1, 1, 1, 1, 0, 1}, { 0, 1, 0, 0, 0, 0, 1 }, { 1, 0, 0, 0, 0, 1, 0 } }, // 3
     { { 0, 1, 0, 0, 0, 1, 1}, { 0, 0, 1, 1, 1, 0, 1 }, { 1, 0, 1, 1, 1, 0, 0 } }, // 4
     { { 0, 1, 1, 0, 0, 0, 1}, { 0, 1, 1, 1, 0, 0, 1 }, { 1, 0, 0, 1, 1, 1, 0 } }, // 5
     { { 0, 1, 0, 1, 1, 1, 1}, { 0, 0, 0, 0, 1, 0, 1 }, { 1, 0, 1, 0, 0, 0, 0 } }, // 6
     { { 0, 1, 1, 1, 0, 1, 1}, { 0, 0, 1, 0, 0, 0, 1 }, { 1, 0, 0, 0, 1, 0, 0 } }, // 7
     { { 0, 1, 1, 0, 1, 1, 1}, { 0, 0, 0, 1, 0, 0, 1 }, { 1, 0, 0, 1, 0, 0, 0 } }, // 8
     { { 0, 0, 0, 1, 0, 1, 1}, { 0, 0, 1, 0, 1, 1, 1 }, { 1, 1, 1, 0, 1, 0, 0 } }  // 9
 };
 
 static const int odd = LEFTHAND_ODD;
 static const int even = LEFTHAND_EVEN;
 
 static const int _parity[10][6] = {
     { odd,  odd,  odd,  odd,  odd,  odd }, // 0
     { odd,  odd, even,  odd, even, even }, // 1
     { odd,  odd, even, even,  odd, even }, // 2
     { odd,  odd, even, even, even,  odd }, // 3
     { odd, even,  odd,  odd, even, even }, // 4
     { odd, even, even,  odd,  odd, even }, // 5
     { odd, even, even, even,  odd,  odd }, // 6
     { odd, even,  odd, even,  odd, even }, // 7
     { odd, even,  odd, even, even,  odd }, // 8
     { odd, even, even,  odd, even,  odd }  // 9
 };
 
 static const int _upcparenc[10][2][6] = {
     /*             PARITY 0             */  /*             PARITY 1             */
     { { even, even, even,  odd,  odd,  odd }, {  odd,  odd,  odd, even, even, even } }, // 0
     { { even, even,  odd, even,  odd,  odd }, {  odd,  odd, even,  odd, even, even } }, // 1
     { { even, even,  odd,  odd, even,  odd }, {  odd,  odd, even, even,  odd, even } }, // 2
     { { even, even,  odd,  odd,  odd, even }, {  odd,  odd, even, even, even,  odd } }, // 3
     { { even,  odd, even, even,  odd,  odd }, {  odd, even,  odd,  odd, even, even } }, // 4
     { { even,  odd,  odd, even, even,  odd }, {  odd, even, even,  odd,  odd, even } }, // 5
     { { even,  odd,  odd,  odd, even, even }, {  odd, even, even, even,  odd,  odd } }, // 6
     { { even,  odd, even,  odd, even,  odd }, {  odd, even,  odd, even,  odd, even } }, // 7
     { { even,  odd, even,  odd,  odd, even }, {  odd, even,  odd, even, even,  odd } }, // 8
     { { even,  odd,  odd, even,  odd, even }, {  odd, even, even,  odd, even,  odd } }  // 9
 };
 
 
 
 //
 //! @todo New Renderer Functions
 ////////////////////////////////////////////////////////
 
 void renderCodeEAN13(OROPage * page, const QRectF & r, const QString & _str, int align)
 {
     int val[13];
 
     // initialize all the values just so we can be predictable
     for (int i = 0; i < 13; ++i)
         val[i] = -1;
 
     // verify that the passed in string is valid
     // if it's not either twelve or thirteen characters
     // then it must be invalid to begin with
     if (_str.length() != 12 && _str.length() != 13)
         return;
     // loop through and convert each char to a digit.
     // if we can't convert all characters then this is
     // an invalid number
     for (int i = 0; i < _str.length(); ++i) {
         val[i] = ((QChar)_str.at(i)).digitValue();
         if (val[i] == -1)
             return;
     }
 
     // calculate and append the checksum value
     int old_sum = val[12]; // get the old check sum value (-1 if none was set)
     int checksum = 0;
     for (int i = 0; i < 12; ++i) {
         checksum += val[i] * ((i % 2) ? 3 : 1);
     }
     checksum = (checksum % 10);
     if (checksum) checksum = 10 - checksum;
     val[12] = checksum;
 
     // if we had an old checksum value and if it doesn't match what we came
     // up with then the string must be invalid so we will bail
     if (old_sum != -1 && old_sum != checksum)
         return;
 
 
     // lets determine some core attributes about this barcode
     qreal bar_width = 1; // the width of the base unit bar 1/100 inch
 
     // this is are mandatory minimum quiet zone
     qreal quiet_zone = bar_width * 10;
     if (quiet_zone < 10)
         quiet_zone = 10;
 
     // what kind of area do we have to work with
     qreal draw_width = r.width();
     qreal draw_height = r.height() - 2;
 
     // L = 95X
     // L length of barcode (excluding quite zone) in units same as X and I
     // X the width of a bar (pixels in our case)
     qreal L;
 
     qreal X = bar_width;
 
     L = (95.0 * X);
 
     // now we have the actual width the barcode will be so can determine the actual
     // size of the quiet zone (we assume we center the barcode in the given area
     // what should we do if the area is too small????
     // At the moment the way the code is written is we will always start at the minimum
     // required quiet zone if we don't have enough space.... I guess we'll just have over-run
     // to the right
     //
     // calculate the starting position based on the alignment option
     // for left align we don't need to do anything as the values are already setup for it
     if (align == 1) { // center
         qreal nqz = (draw_width - L) / 2;
         if (nqz > quiet_zone)
             quiet_zone = nqz;
     } else if (align > 1) // right
         quiet_zone = draw_width - (L + quiet_zone);
     // else if(align < 1) {} // left : do nothing
 
     qreal pos = r.left() + quiet_zone;
     qreal top = r.top();
 
 
     QPen pen(Qt::NoPen);
     QBrush brush(QColor("black"));
 
     // render open guard
     ORORect * rect = new ORORect();
     rect->setPen(pen);
     rect->setBrush(brush);
     rect->setRect(QRectF(pos, top, bar_width, draw_height));
     page->addPrimitive(rect);
 
     pos += (bar_width * 2.0);
 
     rect = new ORORect();
     rect->setPen(pen);
     rect->setBrush(brush);
     rect->setRect(QRectF(pos, top, bar_width, draw_height));
     page->addPrimitive(rect);
 
     pos += bar_width;
 
     // render first set
     for (int i = 0; i < 6; ++i) {
         int b = val[i+1];
         for (int w = 0; w < 7; ++w) {
             if (_encodings[b][_parity[val[0]][i]][w]) {
                 rect = new ORORect();
                 rect->setPen(pen);
                 rect->setBrush(brush);
                 rect->setRect(QRectF(pos, top, bar_width, draw_height - 0.07));
                 page->addPrimitive(rect);
             }
             pos += bar_width;
         }
     }
 
     // render center guard
     pos += bar_width;
 
     rect = new ORORect();
     rect->setPen(pen);
     rect->setBrush(brush);
     rect->setRect(QRectF(pos, top, bar_width, draw_height));
     page->addPrimitive(rect);
 
     pos += (bar_width * 2.0);
 
     rect = new ORORect();
     rect->setPen(pen);
     rect->setBrush(brush);
     rect->setRect(QRectF(pos, top, bar_width, draw_height));
     page->addPrimitive(rect);
 
     pos += (bar_width * 2.0);
 
     // render last set
     for (int i = 0; i < 6; ++i) {
         int b = val[i+7];
         for (int w = 0; w < 7; ++w) {
             if (_encodings[b][RIGHTHAND][w]) {
                 rect = new ORORect();
                 rect->setPen(pen);
                 rect->setBrush(brush);
                 rect->setRect(QRectF(pos, top, bar_width, draw_height - 0.07));
                 page->addPrimitive(rect);
             }
             pos += bar_width;
         }
     }
 
     // render close guard
     rect = new ORORect();
     rect->setPen(pen);
     rect->setBrush(brush);
     rect->setRect(QRectF(pos, top, bar_width, draw_height));
     page->addPrimitive(rect);
 
     pos += (bar_width * 2.0);
 
     rect = new ORORect();
     rect->setPen(pen);
     rect->setBrush(brush);
     rect->setRect(QRectF(pos, top, bar_width, draw_height));
     page->addPrimitive(rect);
 
     QString parstr = QString::fromLatin1("%1").arg(val[0]);
     QString leftstr = QString().sprintf("%d%d%d%d%d%d",
                                         val[1], val[2], val[3], val[4], val[5], val[6]);
     QString rightstr = QString().sprintf("%d%d%d%d%d%d",
                                          val[7], val[8], val[9], val[10], val[11], val[12]);
     QFont font(QLatin1String("Arial"), 6);
 
     OROTextBox * tb = new OROTextBox();
     tb->setPosition(QPointF(r.left(), r.top() + draw_height - 0.12));
     tb->setSize(QSizeF(quiet_zone - 0.02, 0.12));
     tb->setFont(font);
     tb->setText(parstr);
     tb->setFlags(Qt::AlignRight | Qt::AlignTop);
     page->addPrimitive(tb);
 
     tb = new OROTextBox();
     tb->setPosition(QPointF(r.left() + quiet_zone + 0.03, (r.top() + draw_height) - 0.07));
     tb->setSize(QSizeF(0.42, 0.1));
     tb->setFont(font);
     tb->setText(leftstr);
     tb->setFlags(Qt::AlignHCenter | Qt::AlignTop);
     page->addPrimitive(tb);
 
     tb = new OROTextBox();
     tb->setPosition(QPointF(r.left() + quiet_zone + 0.5, (r.top() + draw_height) - 0.07));
     tb->setSize(QSizeF(0.42, 0.1));
     tb->setFont(font);
     tb->setText(rightstr);
     tb->setFlags(Qt::AlignHCenter | Qt::AlignTop);
     page->addPrimitive(tb);
 }
 
 void renderCodeUPCA(OROPage * page, const QRectF & r, const QString & _str, int align)
 {
     int val[13];
 
     // initialize all the values just so we can be predictable
     for (int i = 0; i < 13; ++i) {
         val[i] = -1;
     }
 
     // verify that the passed in string is valid
     // if it's not either twelve or thirteen characters
     // then it must be invalid to begin with
     if (_str.length() != 11 && _str.length() != 12)
         return;
     // loop through and convert each char to a digit.
     // if we can't convert all characters then this is
     // an invalid number
     val[0] = 0;
     for (int i = 0; i < _str.length(); ++i) {
         val[i+1] = ((QChar)_str.at(i)).digitValue();
         if (val[i+1] == -1)
             return;
     }
 
     // calculate and append the checksum value
     int old_sum = val[12]; // get the old check sum value (-1 if none was set)
     int checksum = 0;
     for (int i = 0; i < 12; ++i) {
         checksum += val[i] * ((i % 2) ? 3 : 1);
     }
     checksum = (checksum % 10);
     if (checksum) checksum = 10 - checksum;
     val[12] = checksum;
 
     // if we had an old checksum value and if it doesn't match what we came
     // up with then the string must be invalid so we will bail
     if (old_sum != -1 && old_sum != checksum)
         return;
 
     // lets determine some core attributes about this barcode
     qreal bar_width = 1; // the width of the base unit bar
 
     // this is are mandatory minimum quiet zone
     qreal quiet_zone = bar_width * 10;
     if (quiet_zone < 10) quiet_zone = 10;
 
     // what kind of area do we have to work with
     qreal draw_width = r.width();
     qreal draw_height = r.height() - 2;
 
     // L = 95X
     // L length of barcode (excluding quite zone) in units same as X and I
     // X the width of a bar (pixels in our case)
     qreal L;
 
     qreal X = bar_width;
 
     L = (95.0 * X);
 
     // now we have the actual width the barcode will be so can determine the actual
     // size of the quiet zone (we assume we center the barcode in the given area
     // what should we do if the area is too small????
     // At the moment the way the code is written is we will always start at the minimum
     // required quiet zone if we don't have enough space.... I guess we'll just have over-run
     // to the right
     //
     // calculate the starting position based on the alignment option
     // for left align we don't need to do anything as the values are already setup for it
     if (align == 1) { // center
         qreal nqz = (draw_width - L) / 2;
         if (nqz > quiet_zone)
             quiet_zone = nqz;
     } else if (align > 1) // right
         quiet_zone = draw_width - (L + quiet_zone);
     // else if(align < 1) {} // left : do nothing
 
     qreal pos = r.left() + quiet_zone;
     qreal top = r.top();
 
     QPen pen(Qt::NoPen);
     QBrush brush(QColor("black"));
 
     // render open guard
     ORORect * rect = new ORORect();
     rect->setPen(pen);
     rect->setBrush(brush);
     rect->setRect(QRectF(pos, top, bar_width, draw_height));
     page->addPrimitive(rect);
 
     pos += (bar_width * 2.0);
 
     rect = new ORORect();
     rect->setPen(pen);
     rect->setBrush(brush);
     rect->setRect(QRectF(pos, top, bar_width, draw_height));
     page->addPrimitive(rect);
 
     pos += bar_width;
 
     // render first set
     for (int i = 0; i < 6; ++i) {
         int b = val[i+1];
         for (int w = 0; w < 7; ++w) {
             if (_encodings[b][_parity[val[0]][i]][w]) {
                 rect = new ORORect();
                 rect->setPen(pen);
                 rect->setBrush(brush);
                 rect->setRect(QRectF(pos, top, bar_width, draw_height - (i == 0 ? 0 : 0.07)));
                 page->addPrimitive(rect);
             }
             pos += bar_width;
         }
     }
 
     // render center guard
     pos += bar_width;
     rect = new ORORect();
     rect->setPen(pen);
     rect->setBrush(brush);
     rect->setRect(QRectF(pos, top, bar_width, draw_height));
     page->addPrimitive(rect);
 
     pos += (bar_width * 2.0);
 
     rect = new ORORect();
     rect->setPen(pen);
     rect->setBrush(brush);
     rect->setRect(QRectF(pos, top, bar_width, draw_height));
     page->addPrimitive(rect);
 
     pos += (bar_width * 2.0);
 
     // render last set
     for (int i = 0; i < 6; ++i) {
         int b = val[i+7];
         for (int w = 0; w < 7; ++w) {
             if (_encodings[b][RIGHTHAND][w]) {
                 rect = new ORORect();
                 rect->setPen(pen);
                 rect->setBrush(brush);
                 rect->setRect(QRectF(pos, top, bar_width, draw_height - (i == 5 ? 0 : 0.07)));
                 page->addPrimitive(rect);
             }
             pos += bar_width;
         }
     }
 
     // render close guard
     rect = new ORORect();
     rect->setPen(pen);
     rect->setBrush(brush);
     rect->setRect(QRectF(pos, top, bar_width, draw_height));
     page->addPrimitive(rect);
 
     pos += (bar_width * 2.0);
 
     rect = new ORORect();
     rect->setPen(pen);
     rect->setBrush(brush);
     rect->setRect(QRectF(pos, top, bar_width, draw_height));
     page->addPrimitive(rect);
 
     QString parstr = QString::number(val[1]);
     QString chkstr = QString::number(val[12]);
     QString leftstr = QString().sprintf("%d%d%d%d%d",
                                         val[2], val[3], val[4], val[5], val[6]);
     QString rightstr = QString().sprintf("%d%d%d%d%d",
                                          val[7], val[8], val[9], val[10], val[11]);
 
     QFont font(QLatin1String("Arial"), 6);
     KRTextStyleData ts;
     ts.backgroundColor = Qt::white;
     ts.font = font;
     ts.foregroundColor = Qt::black;
     ts.backgroundOpacity = 100;
     ts.alignment = Qt::AlignRight | Qt::AlignTop;
 
     OROTextBox * tb = new OROTextBox();
     tb->setPosition(QPointF(r.left(), r.top() + draw_height - 12));
     tb->setSize(QSizeF(quiet_zone - 2, 12));
     tb->setTextStyle(ts);
     tb->setText(parstr);
 
     page->addPrimitive(tb);
 
     tb = new OROTextBox();
     tb->setPosition(QPointF(r.left() + quiet_zone + 10, (r.top() + draw_height) - 7));
     tb->setSize(QSizeF(35, 10));
     tb->setTextStyle(ts);
     tb->setText(leftstr);
     page->addPrimitive(tb);
 
     tb = new OROTextBox();
     tb->setPosition(QPointF(r.left() + quiet_zone + 50, (r.top() + draw_height) - 7));
     tb->setSize(QSizeF(35, 10));
     tb->setTextStyle(ts);
     tb->setText(rightstr);
     page->addPrimitive(tb);
 
     tb = new OROTextBox();
     tb->setPosition(QPointF(r.left() + quiet_zone + L + 2, (r.top() + draw_height) - 12));
     tb->setSize(QSizeF(8, 12));
     tb->setTextStyle(ts);
     tb->setText(chkstr);
     page->addPrimitive(tb);
 }
 
 void renderCodeEAN8(OROPage * page, const QRectF & r, const QString & _str, int align)
 {
     int val[8];
 
     // initialize all the values just so we can be predictable
     for (int i = 0; i < 8; ++i) {
         val[i] = -1;
     }
 
     // verify that the passed in string is valid
     // if it's not either twelve or thirteen characters
     // then it must be invalid to begin with
     if (_str.length() != 7 && _str.length() != 8)
         return;
     // loop through and convert each char to a digit.
     // if we can't convert all characters then this is
     // an invalid number
     for (int i = 0; i < _str.length(); ++i) {
         val[i] = ((QChar)_str.at(i)).digitValue();
         if (val[i] == -1)
             return;
     }
 
     // calculate and append the checksum value
     int old_sum = val[7]; // get the old check sum value (-1 if none was set)
     int checksum = 0;
     for (int i = 0; i < 7; ++i) {
         checksum += val[i] * ((i % 2) ? 1 : 3);
     }
     checksum = (checksum % 10);
     if (checksum) checksum = 10 - checksum;
     val[7] = checksum;
 
     // if we had an old checksum value and if it doesn't match what we came
     // up with then the string must be invalid so we will bail
     if (old_sum != -1 && old_sum != checksum)
         return;
 
 
     // lets determine some core attributes about this barcode
     qreal bar_width = 1; // the width of the base unit bar
 
     // this is are mandatory minimum quiet zone
     qreal quiet_zone = bar_width * 10;
     if (quiet_zone < 10)
         quiet_zone = 10;
 
     // what kind of area do we have to work with
     qreal draw_width = r.width();
     qreal draw_height = r.height() - 0.02;
 
     // L = 60X
     // L length of barcode (excluding quite zone) in units same as X and I
     // X the width of a bar (pixels in our case)
     qreal L;
 
     qreal X = bar_width;
 
     L = (67.0 * X);
 
     // now we have the actual width the barcode will be so can determine the actual
     // size of the quiet zone (we assume we center the barcode in the given area
     // what should we do if the area is too small????
     // At the moment the way the code is written is we will always start at the minimum
     // required quiet zone if we don't have enough space.... I guess we'll just have over-run
     // to the right
     //
     // calculate the starting position based on the alignment option
     // for left align we don't need to do anything as the values are already setup for it
     if (align == 1) { // center
         qreal nqz = (draw_width - L) / 2;
         if (nqz > quiet_zone)
             quiet_zone = nqz;
     } else if (align > 1) // right
         quiet_zone = draw_width - (L + quiet_zone);
     // else if(align < 1) {} // left : do nothing
 
     qreal pos = r.left() + quiet_zone;
     qreal top = r.top();
 
     QPen pen(Qt::NoPen);
     QBrush brush(QColor("black"));
 
     // render open guard
     ORORect * rect = new ORORect();
     rect->setPen(pen);
     rect->setBrush(brush);
     rect->setRect(QRectF(pos, top, bar_width, draw_height));
     page->addPrimitive(rect);
 
     pos += (bar_width * 2.0);
 
     rect = new ORORect();
     rect->setPen(pen);
     rect->setBrush(brush);
     rect->setRect(QRectF(pos, top, bar_width, draw_height));
     page->addPrimitive(rect);
 
     pos += bar_width;
 
     // render first set
     for (int i = 0; i < 4; ++i) {
         int b = val[i];
         for (int w = 0; w < 7; ++w) {
             if (_encodings[b][LEFTHAND_ODD][w]) {
                 ORORect * rect = new ORORect();
                 rect->setPen(pen);
                 rect->setBrush(brush);
                 rect->setRect(QRectF(pos, top, bar_width, draw_height - 0.06));
                 page->addPrimitive(rect);
             }
             pos += bar_width;
         }
     }
 
     // render center guard
     pos += bar_width;
 
     rect = new ORORect();
     rect->setPen(pen);
     rect->setBrush(brush);
     rect->setRect(QRectF(pos, top, bar_width, draw_height));
     page->addPrimitive(rect);
 
     pos += (bar_width * 2.0);
 
     rect = new ORORect();
     rect->setPen(pen);
     rect->setBrush(brush);
     rect->setRect(QRectF(pos, top, bar_width, draw_height));
     page->addPrimitive(rect);
 
     pos += (bar_width * 2.0);
 
     // render last set
     for (int i = 0; i < 4; ++i) {
         int b = val[i+4];
         for (int w = 0; w < 7; ++w) {
             if (_encodings[b][RIGHTHAND][w]) {
                 ORORect * rect = new ORORect();
                 rect->setPen(pen);
                 rect->setBrush(brush);
                 rect->setRect(QRectF(pos, top, bar_width, draw_height - 0.06));
                 page->addPrimitive(rect);
             }
             pos += bar_width;
         }
     }
 
     // render close guard
     rect = new ORORect();
     rect->setPen(pen);
     rect->setBrush(brush);
     rect->setRect(QRectF(pos, top, bar_width, draw_height));
     page->addPrimitive(rect);
 
     pos += (bar_width * 2.0);
 
     rect = new ORORect();
     rect->setPen(pen);
     rect->setBrush(brush);
     rect->setRect(QRectF(pos, top, bar_width, draw_height));
     page->addPrimitive(rect);
 
     QString leftstr = QString().sprintf("%d%d%d%d",
                                         val[0], val[1], val[2], val[3]);
     QString rightstr = QString().sprintf("%d%d%d%d",
                                          val[4], val[5], val[6], val[7]);
     QFont font(QLatin1String("Arial"), 6);
     OROTextBox * tb = new OROTextBox();
 
     tb->setPosition(QPointF(r.left() + quiet_zone + 0.03, (r.top() + draw_height) - 0.06));
     tb->setSize(QSizeF(0.28, 0.10));
     tb->setFont(font);
     tb->setText(leftstr);
     tb->setFlags(Qt::AlignHCenter | Qt::AlignTop);
     page->addPrimitive(tb);
 
     tb = new OROTextBox();
     tb->setPosition(QPointF(r.left() + quiet_zone + 0.36, (r.top() + draw_height) - 0.06));
     tb->setSize(QSizeF(0.28, 0.10));
     tb->setFont(font);
     tb->setText(rightstr);
     tb->setFlags(Qt::AlignHCenter | Qt::AlignTop);
     page->addPrimitive(tb);
 }
 
 void renderCodeUPCE(OROPage * page, const QRectF & r, const QString & _str, int align)
 {
     int val[8];
 
     // initialize all the values just so we can be predictable
     for (int i = 0; i < 8; ++i) {
         val[i] = -1;
     }
 
     // verify that the passed in string is valid
     // if it's not either twelve or thirteen characters
     // then it must be invalid to begin with
     if (_str.length() != 8)
         return;
     // loop through and convert each char to a digit.
     // if we can't convert all characters then this is
     // an invalid number
     for (int i = 0; i < _str.length(); ++i) {
         val[i] = ((QChar)_str.at(i)).digitValue();
         if (val[i] == -1)
             return;
     }
 
     // calculate and append the checksum value
     // because everything is so messed up we don't calculate
     // the checksum and require that it be passed in already
     // however we do have to verify that the first digit is
     // either 0 or 1 as that is our parity
     if (val[0] != 0 && val[0] != 1)
         return;
 
     // lets determine some core attributes about this barcode
     qreal bar_width = 1; // the width of the base unit bar
 
     // this is are mandatory minimum quiet zone
     qreal quiet_zone = bar_width * 0.10;
     if (quiet_zone < 0.10)
         quiet_zone = 0.10;
 
     // what kind of area do we have to work with
     qreal draw_width = r.width();
     qreal draw_height = r.height() - 2;
 
     // L = 51X
     // L length of barcode (excluding quite zone) in units same as X and I
     // X the width of a bar (pixels in our case)
     qreal L;
 
     qreal X = bar_width;
 
     L = (51.0 * X);
 
     // now we have the actual width the barcode will be so can determine the actual
     // size of the quiet zone (we assume we center the barcode in the given area
     // what should we do if the area is too small????
     // At the moment the way the code is written is we will always start at the minimum
     // required quiet zone if we don't have enough space.... I guess we'll just have over-run
     // to the right
     //
     // calculate the starting position based on the alignment option
     // for left align we don't need to do anything as the values are already setup for it
     if (align == 1) { // center
         qreal nqz = (draw_width - L) / 2;
         if (nqz > quiet_zone)
             quiet_zone = nqz;
     } else if (align > 1) // right
         quiet_zone = draw_width - (L + quiet_zone);
     // else if(align < 1) {} // left : do nothing
 
     qreal pos = r.left() + quiet_zone;
     qreal top = r.top();
 
     QPen pen(Qt::NoPen);
     QBrush brush(QColor("black"));
 
     // render open guard
     ORORect * rect = new ORORect();
     rect->setPen(pen);
     rect->setBrush(brush);
     rect->setRect(QRectF(pos, top, bar_width, draw_height));
     page->addPrimitive(rect);
 
     pos += (bar_width * 2.0);
 
     rect = new ORORect();
     rect->setPen(pen);
     rect->setBrush(brush);
     rect->setRect(QRectF(pos, top, bar_width, draw_height));
     page->addPrimitive(rect);
 
     pos += bar_width;
 
     // render first set
     for (int i = 0; i < 6; ++i) {
         int b = val[i+1];
         for (int w = 0; w < 7; ++w) {
             if (_encodings[b][_upcparenc[val[7]][val[0]][i]][w]) {
                 rect = new ORORect();
                 rect->setPen(pen);
                 rect->setBrush(brush);
                 rect->setRect(QRectF(pos, top, bar_width, draw_height - 7));
                 page->addPrimitive(rect);
             }
             pos += bar_width;
         }
     }
 
     // render center guard
     pos += bar_width;
 
     rect = new ORORect();
     rect->setPen(pen);
     rect->setBrush(brush);
     rect->setRect(QRectF(pos, top, bar_width, draw_height));
     page->addPrimitive(rect);
 
     pos += (bar_width * 2.0);
 
     rect = new ORORect();
     rect->setPen(pen);
     rect->setBrush(brush);
     rect->setRect(QRectF(pos, top, bar_width, draw_height));
     page->addPrimitive(rect);
 
     pos += (bar_width * 2.0);
 
     // render close guard
 
     rect = new ORORect();
     rect->setPen(pen);
     rect->setBrush(brush);
     rect->setRect(QRectF(pos, top, bar_width, draw_height));
     page->addPrimitive(rect);
 
     QString parstr = QString::number(val[0]);
     QString chkstr = QString::number(val[7]);
     QString leftstr = QString().sprintf("%d%d%d%d%d%d",
                                         val[1], val[2], val[3], val[4], val[5], val[6]);
     QFont font(QLatin1String("Arial"), 6);
     KRTextStyleData ts;
     ts.backgroundColor = Qt::white;
     ts.font = font;
     ts.foregroundColor = Qt::black;
     ts.backgroundOpacity = 100;
     ts.alignment = Qt::AlignRight | Qt::AlignTop;
 
     OROTextBox * tb = new OROTextBox();
     tb->setPosition(QPointF(r.left(), r.top() + draw_height - 12));
     tb->setSize(QSizeF(quiet_zone - 2, 12));
     tb->setTextStyle(ts);
     tb->setText(parstr);
     page->addPrimitive(tb);
 
     tb = new OROTextBox();
     tb->setPosition(QPointF(r.left() + quiet_zone + 3, (r.top() + draw_height) - 7));
     tb->setSize(QSizeF(42, 10));
     tb->setTextStyle(ts);
     tb->setText(leftstr);
     page->addPrimitive(tb);
 
     tb = new OROTextBox();
     tb->setPosition(QPointF(r.left() + quiet_zone + L + 2, r.top() + draw_height - 12));
     tb->setSize(QSizeF(8, 12));
     tb->setTextStyle(ts);
     tb->setText(chkstr);
     page->addPrimitive(tb);
 }
diff --git a/src/plugins/barcode/codeeanpaint.cpp b/src/plugins/barcode/codeeanpaint.cpp
index d3122a00..014a39c9 100644
--- a/src/plugins/barcode/codeeanpaint.cpp
+++ b/src/plugins/barcode/codeeanpaint.cpp
@@ -1,651 +1,651 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
 /*
  *     This file contains the implementation of the Code EAN and similar
  * formats for rendering purposes. All this code assumes a 100dpi
  * rendering surface for it's calculations.
  */
 
 #include 
 #include 
 #include 
 #include 
 #include 
 
-#include "renderobjects.h"
+#include "KReportRenderObjects.h"
 
 static const int LEFTHAND_ODD = 0;
 static const int LEFTHAND_EVEN = 1;
 static const int RIGHTHAND = 2;
 
 static int const _encodings[10][3][7] = {
     /*   LEFTHAND_ODD   */  /*   LEFTHAND_EVEN   */  /*     RIGHTHAND     */
     { { 0, 0, 0, 1, 1, 0, 1}, { 0, 1, 0, 0, 1, 1, 1 }, { 1, 1, 1, 0, 0, 1, 0 } }, // 0
     { { 0, 0, 1, 1, 0, 0, 1}, { 0, 1, 1, 0, 0, 1, 1 }, { 1, 1, 0, 0, 1, 1, 0 } }, // 1
     { { 0, 0, 1, 0, 0, 1, 1}, { 0, 0, 1, 1, 0, 1, 1 }, { 1, 1, 0, 1, 1, 0, 0 } }, // 2
     { { 0, 1, 1, 1, 1, 0, 1}, { 0, 1, 0, 0, 0, 0, 1 }, { 1, 0, 0, 0, 0, 1, 0 } }, // 3
     { { 0, 1, 0, 0, 0, 1, 1}, { 0, 0, 1, 1, 1, 0, 1 }, { 1, 0, 1, 1, 1, 0, 0 } }, // 4
     { { 0, 1, 1, 0, 0, 0, 1}, { 0, 1, 1, 1, 0, 0, 1 }, { 1, 0, 0, 1, 1, 1, 0 } }, // 5
     { { 0, 1, 0, 1, 1, 1, 1}, { 0, 0, 0, 0, 1, 0, 1 }, { 1, 0, 1, 0, 0, 0, 0 } }, // 6
     { { 0, 1, 1, 1, 0, 1, 1}, { 0, 0, 1, 0, 0, 0, 1 }, { 1, 0, 0, 0, 1, 0, 0 } }, // 7
     { { 0, 1, 1, 0, 1, 1, 1}, { 0, 0, 0, 1, 0, 0, 1 }, { 1, 0, 0, 1, 0, 0, 0 } }, // 8
     { { 0, 0, 0, 1, 0, 1, 1}, { 0, 0, 1, 0, 1, 1, 1 }, { 1, 1, 1, 0, 1, 0, 0 } }  // 9
 };
 
 static const int odd = LEFTHAND_ODD;
 static const int even = LEFTHAND_EVEN;
 
 static const int _parity[10][6] = {
     { odd,  odd,  odd,  odd,  odd,  odd }, // 0
     { odd,  odd, even,  odd, even, even }, // 1
     { odd,  odd, even, even,  odd, even }, // 2
     { odd,  odd, even, even, even,  odd }, // 3
     { odd, even,  odd,  odd, even, even }, // 4
     { odd, even, even,  odd,  odd, even }, // 5
     { odd, even, even, even,  odd,  odd }, // 6
     { odd, even,  odd, even,  odd, even }, // 7
     { odd, even,  odd, even, even,  odd }, // 8
     { odd, even, even,  odd, even,  odd }  // 9
 };
 
 static const int _upcparenc[10][2][6] = {
     /*             PARITY 0             */  /*             PARITY 1             */
     { { even, even, even,  odd,  odd,  odd }, {  odd,  odd,  odd, even, even, even } }, // 0
     { { even, even,  odd, even,  odd,  odd }, {  odd,  odd, even,  odd, even, even } }, // 1
     { { even, even,  odd,  odd, even,  odd }, {  odd,  odd, even, even,  odd, even } }, // 2
     { { even, even,  odd,  odd,  odd, even }, {  odd,  odd, even, even, even,  odd } }, // 3
     { { even,  odd, even, even,  odd,  odd }, {  odd, even,  odd,  odd, even, even } }, // 4
     { { even,  odd,  odd, even, even,  odd }, {  odd, even, even,  odd,  odd, even } }, // 5
     { { even,  odd,  odd,  odd, even, even }, {  odd, even, even, even,  odd,  odd } }, // 6
     { { even,  odd, even,  odd, even,  odd }, {  odd, even,  odd, even,  odd, even } }, // 7
     { { even,  odd, even,  odd,  odd, even }, {  odd, even,  odd, even, even,  odd } }, // 8
     { { even,  odd,  odd, even,  odd, even }, {  odd, even, even,  odd, even,  odd } }  // 9
 };
 
 
 void renderCodeEAN13(const QRect & r, const QString & _str, int align, QPainter * pPainter)
 {
     int val[13];
 
     // initialize all the values just so we can be predictable
     for (int i = 0; i < 13; ++i) {
         val[i] = -1;
     }
 
     // verify that the passed in string is valid
     // if it's not either twelve or thirteen characters
     // then it must be invalid to begin with
     if (_str.length() != 12 && _str.length() != 13) return;
     // loop through and convert each char to a digit.
     // if we can't convert all characters then this is
     // an invalid number
     for (int i = 0; i < _str.length(); ++i) {
         val[i] = ((QChar) _str.at(i)).digitValue();
         if (val[i] == -1) return;
     }
 
     // calculate and append the checksum value
     int old_sum = val[12]; // get the old check sum value (-1 if none was set)
     int checksum = 0;
     for (int i = 0; i < 12; ++i) {
         checksum += val[i] * ((i % 2) ? 3 : 1);
     }
     checksum = (checksum % 10);
     if (checksum) checksum = 10 - checksum;
     val[12] = checksum;
 
     // if we had an old checksum value and if it doesn't match what we came
     // up with then the string must be invalid so we will bail
     if (old_sum != -1 && old_sum != checksum) return;
 
 
     // lets determine some core attributes about this barcode
     int bar_width = 1; // the width of the base unit bar
 
     // this is are mandatory minimum quiet zone
     int quiet_zone = bar_width * 10;
     if (quiet_zone < 10) quiet_zone = 10;
 
     // what kind of area do we have to work with
     int draw_width = r.width();
     int draw_height = r.height() - 2;
 
     // L = 95X
     // L length of barcode (excluding quite zone) in units same as X and I
     // X the width of a bar (pixels in our case)
     int L;
 
     int X = bar_width;
 
     L = (95 * X);
 
     // now we have the actual width the barcode will be so can determine the actual
     // size of the quiet zone (we assume we center the barcode in the given area
     // what should we do if the area is too small????
     // At the moment the way the code is written is we will always start at the minimum
     // required quiet zone if we don't have enough space.... I guess we'll just have over-run
     // to the right
     //
     // calculate the starting position based on the alignment option
     // for left align we don't need to do anything as the values are already setup for it
     if (align == 1) {   // center
         int nqz = (draw_width - L) / 2;
         if (nqz > quiet_zone) quiet_zone = nqz;
     } else if (align > 1) {  // right
         quiet_zone = draw_width - (L + quiet_zone);
     } // else if(align < 1) {} // left : do nothing
 
     int pos = r.left() + quiet_zone;
     int top = r.top();
 
     if (pPainter) {
         pPainter->save();
 
         QPen oneWide(pPainter->pen());
         oneWide.setWidth(1);
 #ifndef Q_OS_WIN32
         oneWide.setJoinStyle(Qt::MiterJoin);
 #endif
         pPainter->setPen(oneWide);
         pPainter->setBrush(pPainter->pen().color());
 
         // render open guard
         pPainter->fillRect(pos, top, 1, draw_height, pPainter->pen().color());
         pos += 2;
         pPainter->fillRect(pos, top, 1, draw_height, pPainter->pen().color());
         pos ++;
 
         // render first set
         for (int i = 0; i < 6; ++i) {
             int b = val[i+1];
             for (int w = 0; w < 7; ++w) {
                 if (_encodings[b][_parity[val[0]][i]][w]) {
                     pPainter->fillRect(pos, top, 1, draw_height - 7, pPainter->pen().color());
                 }
                 pos++;
             }
         }
 
         // render center guard
         pos++;
         pPainter->fillRect(pos, top, 1, draw_height, pPainter->pen().color());
         pos += 2;
         pPainter->fillRect(pos, top, 1, draw_height, pPainter->pen().color());
         pos += 2;
 
         // render last set
         for (int i = 0; i < 6; ++i) {
             int b = val[i+7];
             for (int w = 0; w < 7; ++w) {
                 if (_encodings[b][RIGHTHAND][w]) {
                     pPainter->fillRect(pos, top, 1, draw_height - 7, pPainter->pen().color());
                 }
                 pos++;
             }
         }
 
         // render close guard
         pPainter->fillRect(pos, top, 1, draw_height, pPainter->pen().color());
         pos += 2;
         pPainter->fillRect(pos, top, 1, draw_height, pPainter->pen().color());
 
         QString parstr = QString::number(val[0]);
         QString leftstr = QString().sprintf("%d%d%d%d%d%d",
                                             val[1], val[2], val[3], val[4], val[5], val[6]);
         QString rightstr = QString().sprintf("%d%d%d%d%d%d",
                                              val[7], val[8], val[9], val[10], val[11], val[12]);
         pPainter->setFont(QFont(QLatin1String("Arial"), 6));
         pPainter->drawText(r.left(), r.top() + draw_height - 12,
                            quiet_zone - 2, 12, Qt::AlignRight | Qt::AlignTop,
                            parstr);
         pPainter->drawText(r.left() + quiet_zone + 3,
                            (r.top() + draw_height) - 7,
                            42, 10, Qt::AlignHCenter | Qt::AlignTop,
                            leftstr);
         pPainter->drawText(r.left() + quiet_zone + 50,
                            (r.top() + draw_height) - 7,
                            42, 10, Qt::AlignHCenter | Qt::AlignTop,
                            rightstr);
 
         pPainter->restore();
     }
 }
 
 void renderCodeUPCA(const QRect & r, const QString & _str, int align, QPainter * pPainter)
 {
     int val[13];
 
     // initialize all the values just so we can be predictable
     for (int i = 0; i < 13; ++i) {
         val[i] = -1;
     }
 
     // verify that the passed in string is valid
     // if it's not either twelve or thirteen characters
     // then it must be invalid to begin with
     if (_str.length() != 11 && _str.length() != 12) return;
     // loop through and convert each char to a digit.
     // if we can't convert all characters then this is
     // an invalid number
     val[0] = 0;
     for (int i = 0; i < _str.length(); ++i) {
         val[i+1] = ((QChar) _str.at(i)).digitValue();
         if (val[i+1] == -1) return;
     }
 
     // calculate and append the checksum value
     int old_sum = val[12]; // get the old check sum value (-1 if none was set)
     int checksum = 0;
     for (int i = 0; i < 12; ++i) {
         checksum += val[i] * ((i % 2) ? 3 : 1);
     }
     checksum = (checksum % 10);
     if (checksum) checksum = 10 - checksum;
     val[12] = checksum;
 
     // if we had an old checksum value and if it doesn't match what we came
     // up with then the string must be invalid so we will bail
     if (old_sum != -1 && old_sum != checksum) return;
 
 
     // lets determine some core attributes about this barcode
     int bar_width = 1; // the width of the base unit bar
 
     // this is are mandatory minimum quiet zone
     int quiet_zone = bar_width * 10;
     if (quiet_zone < 10) quiet_zone = 10;
 
     // what kind of area do we have to work with
     int draw_width = r.width();
     int draw_height = r.height() - 2;
 
     // L = 95X
     // L length of barcode (excluding quite zone) in units same as X and I
     // X the width of a bar (pixels in our case)
     int L;
 
     int X = bar_width;
 
     L = (95 * X);
 
     // now we have the actual width the barcode will be so can determine the actual
     // size of the quiet zone (we assume we center the barcode in the given area
     // what should we do if the area is too small????
     // At the moment the way the code is written is we will always start at the minimum
     // required quiet zone if we don't have enough space.... I guess we'll just have over-run
     // to the right
     //
     // calculate the starting position based on the alignment option
     // for left align we don't need to do anything as the values are already setup for it
     if (align == 1) {   // center
         int nqz = (draw_width - L) / 2;
         if (nqz > quiet_zone) quiet_zone = nqz;
     } else if (align > 1) {  // right
         quiet_zone = draw_width - (L + quiet_zone);
     } // else if(align < 1) {} // left : do nothing
 
     int pos = r.left() + quiet_zone;
     int top = r.top();
 
     if (pPainter) {
         pPainter->save();
 
         QPen oneWide(pPainter->pen());
         oneWide.setWidth(1);
 #ifndef Q_OS_WIN32
         oneWide.setJoinStyle(Qt::MiterJoin);
 #endif
         pPainter->setPen(oneWide);
         pPainter->setBrush(pPainter->pen().color());
 
         // render open guard
         pPainter->fillRect(pos, top, 1, draw_height, pPainter->pen().color());
         pos += 2;
         pPainter->fillRect(pos, top, 1, draw_height, pPainter->pen().color());
         pos ++;
 
         // render first set
         for (int i = 0; i < 6; ++i) {
             int b = val[i+1];
             for (int w = 0; w < 7; ++w) {
                 if (_encodings[b][_parity[val[0]][i]][w]) {
                     pPainter->fillRect(pos, top, 1, draw_height - (i == 0 ? 0 : 7), pPainter->pen().color());
                 }
                 pos++;
             }
         }
 
         // render center guard
         pos++;
         pPainter->fillRect(pos, top, 1, draw_height, pPainter->pen().color());
         pos += 2;
         pPainter->fillRect(pos, top, 1, draw_height, pPainter->pen().color());
         pos += 2;
 
         // render last set
         for (int i = 0; i < 6; ++i) {
             int b = val[i+7];
             for (int w = 0; w < 7; ++w) {
                 if (_encodings[b][RIGHTHAND][w]) {
                     pPainter->fillRect(pos, top, 1, draw_height - (i == 5 ? 0 : 7), pPainter->pen().color());
                 }
                 pos++;
             }
         }
 
         // render close guard
         pPainter->fillRect(pos, top, 1, draw_height, pPainter->pen().color());
         pos += 2;
         pPainter->fillRect(pos, top, 1, draw_height, pPainter->pen().color());
 
         QString parstr = QString::number(val[1]);
         QString chkstr = QString::number(val[12]);
         QString leftstr = QString().sprintf("%d%d%d%d%d",
                                             val[2], val[3], val[4], val[5], val[6]);
         QString rightstr = QString().sprintf("%d%d%d%d%d",
                                              val[7], val[8], val[9], val[10], val[11]);
         pPainter->setFont(QFont(QLatin1String("Arial"), 6));
         pPainter->drawText(r.left(), r.top() + draw_height - 12,
                            quiet_zone - 2, 12, Qt::AlignRight | Qt::AlignTop,
                            parstr);
         pPainter->drawText(r.left() + quiet_zone + 10,
                            (r.top() + draw_height) - 7,
                            35, 10, Qt::AlignHCenter | Qt::AlignTop,
                            leftstr);
         pPainter->drawText(r.left() + quiet_zone + 50,
                            (r.top() + draw_height) - 7,
                            35, 10, Qt::AlignHCenter | Qt::AlignTop,
                            rightstr);
         pPainter->drawText(r.left() + quiet_zone + L + 2, r.top() + draw_height - 12,
                            8, 12, Qt::AlignLeft | Qt::AlignTop,
                            chkstr);
 
         pPainter->restore();
     }
 }
 
 void renderCodeEAN8(const QRect & r, const QString & _str, int align, QPainter * pPainter)
 {
     int val[8];
 
     // initialize all the values just so we can be predictable
     for (int i = 0; i < 8; ++i) {
         val[i] = -1;
     }
 
     // verify that the passed in string is valid
     // if it's not either twelve or thirteen characters
     // then it must be invalid to begin with
     if (_str.length() != 7 && _str.length() != 8) return;
     // loop through and convert each char to a digit.
     // if we can't convert all characters then this is
     // an invalid number
     for (int i = 0; i < _str.length(); ++i) {
         val[i] = ((QChar) _str.at(i)).digitValue();
         if (val[i] == -1) return;
     }
 
     // calculate and append the checksum value
     int old_sum = val[7]; // get the old check sum value (-1 if none was set)
     int checksum = 0;
     for (int i = 0; i < 7; ++i) {
         checksum += val[i] * ((i % 2) ? 1 : 3);
     }
     checksum = (checksum % 10);
     if (checksum) checksum = 10 - checksum;
     val[7] = checksum;
 
     // if we had an old checksum value and if it doesn't match what we came
     // up with then the string must be invalid so we will bail
     if (old_sum != -1 && old_sum != checksum) return;
 
 
     // lets determine some core attributes about this barcode
     int bar_width = 1; // the width of the base unit bar
 
     // this is are mandatory minimum quiet zone
     int quiet_zone = bar_width * 10;
     if (quiet_zone < 10) quiet_zone = 10;
 
     // what kind of area do we have to work with
     int draw_width = r.width();
     int draw_height = r.height() - 2;
 
     // L = 60X
     // L length of barcode (excluding quite zone) in units same as X and I
     // X the width of a bar (pixels in our case)
     int L;
 
     int X = bar_width;
 
     L = (67 * X);
 
     // now we have the actual width the barcode will be so can determine the actual
     // size of the quiet zone (we assume we center the barcode in the given area
     // what should we do if the area is too small????
     // At the moment the way the code is written is we will always start at the minimum
     // required quiet zone if we don't have enough space.... I guess we'll just have over-run
     // to the right
     //
     // calculate the starting position based on the alignment option
     // for left align we don't need to do anything as the values are already setup for it
     if (align == 1) {   // center
         int nqz = (draw_width - L) / 2;
         if (nqz > quiet_zone) quiet_zone = nqz;
     } else if (align > 1) {  // right
         quiet_zone = draw_width - (L + quiet_zone);
     } // else if(align < 1) {} // left : do nothing
 
     int pos = r.left() + quiet_zone;
     int top = r.top();
 
     if (pPainter) {
         pPainter->save();
 
         QPen oneWide(pPainter->pen());
         oneWide.setWidth(1);
 #ifndef Q_OS_WIN32
         oneWide.setJoinStyle(Qt::MiterJoin);
 #endif
         pPainter->setPen(oneWide);
         pPainter->setBrush(pPainter->pen().color());
 
         // render open guard
         pPainter->fillRect(pos, top, 1, draw_height, pPainter->pen().color());
         pos += 2;
         pPainter->fillRect(pos, top, 1, draw_height, pPainter->pen().color());
         pos ++;
 
         // render first set
         for (int i = 0; i < 4; ++i) {
             int b = val[i];
             for (int w = 0; w < 7; ++w) {
                 if (_encodings[b][LEFTHAND_ODD][w]) {
                     pPainter->fillRect(pos, top, 1, draw_height - 6, pPainter->pen().color());
                 }
                 pos++;
             }
         }
 
         // render center guard
         pos++;
         pPainter->fillRect(pos, top, 1, draw_height, pPainter->pen().color());
         pos += 2;
         pPainter->fillRect(pos, top, 1, draw_height, pPainter->pen().color());
         pos += 2;
 
         // render last set
         for (int i = 0; i < 4; ++i) {
             int b = val[i+4];
             for (int w = 0; w < 7; ++w) {
                 if (_encodings[b][RIGHTHAND][w]) {
                     pPainter->fillRect(pos, top, 1, draw_height - 6, pPainter->pen().color());
                 }
                 pos++;
             }
         }
 
         // render close guard
         pPainter->fillRect(pos, top, 1, draw_height, pPainter->pen().color());
         pos += 2;
         pPainter->fillRect(pos, top, 1, draw_height, pPainter->pen().color());
 
         QString leftstr = QString().sprintf("%d%d%d%d",
                                             val[0], val[1], val[2], val[3]);
         QString rightstr = QString().sprintf("%d%d%d%d",
                                              val[4], val[5], val[6], val[7]);
         pPainter->setFont(QFont(QLatin1String("Arial"), 6));
         pPainter->drawText(r.left() + quiet_zone + 3,
                            (r.top() + draw_height) - 6,
                            28, 10, Qt::AlignHCenter | Qt::AlignTop,
                            leftstr);
         pPainter->drawText(r.left() + quiet_zone + 36,
                            (r.top() + draw_height) - 6,
                            28, 10, Qt::AlignHCenter | Qt::AlignTop,
                            rightstr);
 
         pPainter->restore();
     }
 }
 
 void renderCodeUPCE(const QRect & r, const QString & _str, int align, QPainter * pPainter)
 {
     int val[8];
 
     // initialize all the values just so we can be predictable
     for (int i = 0; i < 8; ++i) {
         val[i] = -1;
     }
 
     // verify that the passed in string is valid
     // if it's not either twelve or thirteen characters
     // then it must be invalid to begin with
     if (_str.length() != 8) return;
     // loop through and convert each char to a digit.
     // if we can't convert all characters then this is
     // an invalid number
     for (int i = 0; i < _str.length(); ++i) {
         val[i] = ((QChar) _str.at(i)).digitValue();
         if (val[i] == -1) return;
     }
 
     // calculate and append the checksum value
     // because everything is so messed up we don't calculate
     // the checksum and require that it be passed in already
     // however we do have to verify that the first digit is
     // either 0 or 1 as that is our parity
     if (val[0] != 0 && val[0] != 1) return;
 
     // lets determine some core attributes about this barcode
     int bar_width = 1; // the width of the base unit bar
 
     // this is are mandatory minimum quiet zone
     int quiet_zone = bar_width * 10;
     if (quiet_zone < 10) quiet_zone = 10;
 
     // what kind of area do we have to work with
     int draw_width = r.width();
     int draw_height = r.height() - 2;
 
     // L = 51X
     // L length of barcode (excluding quite zone) in units same as X and I
     // X the width of a bar (pixels in our case)
     int L;
 
     int X = bar_width;
 
     L = (51 * X);
 
     // now we have the actual width the barcode will be so can determine the actual
     // size of the quiet zone (we assume we center the barcode in the given area
     // what should we do if the area is too small????
     // At the moment the way the code is written is we will always start at the minimum
     // required quiet zone if we don't have enough space.... I guess we'll just have over-run
     // to the right
     //
     // calculate the starting position based on the alignment option
     // for left align we don't need to do anything as the values are already setup for it
     if (align == 1) {   // center
         int nqz = (draw_width - L) / 2;
         if (nqz > quiet_zone) quiet_zone = nqz;
     } else if (align > 1) {  // right
         quiet_zone = draw_width - (L + quiet_zone);
     } // else if(align < 1) {} // left : do nothing
 
     int pos = r.left() + quiet_zone;
     int top = r.top();
 
     if (pPainter) {
         pPainter->save();
 
         QPen oneWide(pPainter->pen());
         oneWide.setWidth(1);
 #ifndef Q_OS_WIN32
         oneWide.setJoinStyle(Qt::MiterJoin);
 #endif
         pPainter->setPen(oneWide);
         pPainter->setBrush(pPainter->pen().color());
 
         // render open guard
         pPainter->fillRect(pos, top, 1, draw_height, pPainter->pen().color());
         pos += 2;
         pPainter->fillRect(pos, top, 1, draw_height, pPainter->pen().color());
         pos ++;
 
         // render first set
         for (int i = 0; i < 6; ++i) {
             int b = val[i+1];
             for (int w = 0; w < 7; ++w) {
                 if (_encodings[b][_upcparenc[val[7]][val[0]][i]][w]) {
                     pPainter->fillRect(pos, top, 1, draw_height - 7, pPainter->pen().color());
                 }
                 pos++;
             }
         }
 
         // render center guard
         pos++;
         pPainter->fillRect(pos, top, 1, draw_height, pPainter->pen().color());
         pos += 2;
         pPainter->fillRect(pos, top, 1, draw_height, pPainter->pen().color());
         pos += 2;
 
         // render close guard
         pPainter->fillRect(pos, top, 1, draw_height, pPainter->pen().color());
 
         QString parstr = QString::number(val[0]);
         QString chkstr = QString::number(val[7]);
         QString leftstr = QString().sprintf("%d%d%d%d%d%d",
                                             val[1], val[2], val[3], val[4], val[5], val[6]);
         pPainter->setFont(QFont(QLatin1String("Arial"), 6));
         pPainter->drawText(r.left(), r.top() + draw_height - 12,
                            quiet_zone - 2, 12, Qt::AlignRight | Qt::AlignTop,
                            parstr);
         pPainter->drawText(r.left() + quiet_zone + 3,
                            (r.top() + draw_height) - 7,
                            42, 10, Qt::AlignHCenter | Qt::AlignTop,
                            leftstr);
         pPainter->drawText(r.left() + quiet_zone + L + 2, r.top() + draw_height - 12,
                            8, 12, Qt::AlignLeft | Qt::AlignTop,
                            chkstr);
 
         pPainter->restore();
     }
 }
 
diff --git a/src/plugins/barcode/i2of5.cpp b/src/plugins/barcode/i2of5.cpp
index d8e0e79b..fec790ae 100644
--- a/src/plugins/barcode/i2of5.cpp
+++ b/src/plugins/barcode/i2of5.cpp
@@ -1,152 +1,152 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2012 by OpenMFG, LLC
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  * Please contact info@openmfg.com with any questions on this license.
  */
 
 /*
  *     This file contains the implementation of the interleaved 2 of 5 barcode renderer.
  * All this code assumes a 100dpi rendering surface for it's calculations.
  */
 
 #include 
 #include 
 #include 
 #include 
 
-#include "renderobjects.h"
+#include "KReportRenderObjects.h"
 
 const char* _i2of5charmap[] = {
     "NNWWN",
     "WNNNW",
     "NWNNW",
     "WWNNN",
     "NNWNW",
     "WNWNN",
     "NWWNN",
     "NNNWW",
     "WNNWN",
     "NWNWN"
 };
 
 
 static QPointF addElement(OROPage * page, const QRectF &r, QPointF startPos, qreal width, bool isSpace)
 {
     QPen pen(Qt::NoPen);
     QBrush brush(QColor("black"));
 
     if (!isSpace) {
         ORORect * rect = new ORORect();
         rect->setPen(pen);
         rect->setBrush(brush);
         rect->setRect(QRectF(startPos.x(),startPos.y(), width, r.height()));
         //rect->setRotationAxis(bc->rect.topLeft()); //!< @todo check this
         page->addPrimitive(rect);
     }
     return QPointF(startPos.x() + width, startPos.y());
 }
 
 static QPointF addBar(OROPage * page, const QRectF &r, QPointF startPos, qreal width)
 {
     return addElement(page, r, startPos, width, false);
 }
 static QPointF addSpace(OROPage * page, const QRectF &r, QPointF startPos, qreal width)
 {
     return addElement(page, r, startPos, width, true);
 }
 
 
 void renderI2of5(OROPage * page, const QRectF &r, const QString & _str, int align)
 {
     QString str = _str;
     qreal narrow_bar = 1; // a narrow bar is 1/100th inch wide
     qreal bar_width_mult = 2.5; // the wide bar width multiple of the narrow bar
     qreal wide_bar = narrow_bar * bar_width_mult;
 
     if (str.length() % 2) {
         str = QLatin1Char('0') + str; // padding zero if number of characters is not even
     }
 
     // this is our mandatory minimum quiet zone
     qreal quiet_zone = narrow_bar * 10;
     if (quiet_zone < 0.1) {
         quiet_zone = 0.1;
     }
 
     // what kind of area do we have to work with
     qreal draw_width = r.width();
 
     // how long is the value we need to encode?
     int val_length = str.length();
 
     // L = (C(2N+3)+6+N)X
     // L length of barcode (excluding quite zone
     // C the number of characters in the value excluding the start/stop
     // N the bar width multiple for wide bars
     // X the width of a bar (pixels in our case)
     qreal L;
     qreal C = val_length;
     qreal N = bar_width_mult;
     qreal X = narrow_bar;
 
     L = (C * (2.0*N + 3.0) + 6.0 + N) * X;
 
     // now we have the actual width the barcode will be so can determine the actual
     // size of the quiet zone (we assume we center the barcode in the given area)
     // At the moment the way the code is written is we will always start at the minimum
     // required quiet zone if we don't have enough space.... I guess we'll just have over-run
     // to the right
     //
     // calculate the starting position based on the alignment option
     if (align == 1) { // center
         qreal nqz = (draw_width - L) / 2.0;
         if (nqz > quiet_zone) {
             quiet_zone = nqz;
         }
     }
     else if (align > 1) { // right
         quiet_zone = draw_width - (L + quiet_zone);
     }
     //else if (align < 1) {} // left : do nothing
 
     QPointF pos(r.left() + quiet_zone, r.top());
 
     // start character
     pos = addBar(page, r, pos, narrow_bar);
     pos = addSpace(page, r, pos, narrow_bar);
     pos = addBar(page, r, pos, narrow_bar);
     pos = addSpace(page, r, pos, narrow_bar);
 
     for (int i = 0; i < str.length()-1; i+=2) {
         for (int iElt = 0; _i2of5charmap [0][iElt] != '\0'; iElt++) {
             for (int offset=0; offset<=1; offset++) {
                 QChar c = str.at(i+offset);
                 if (!c.isDigit()) {
                     break; // invalid character
                 }
 
                 int iChar = c.digitValue();
                 qreal width = _i2of5charmap[iChar][iElt] == 'W' ? wide_bar : narrow_bar;
                 pos = addElement(page, r, pos, width, offset==1);
             }
         }
     }
 
     // stop character
     pos = addBar(page, r, pos, wide_bar);
     pos = addSpace(page, r, pos, narrow_bar);
     pos = addBar(page, r, pos, narrow_bar);
 }
diff --git a/src/plugins/chart/CMakeLists.txt b/src/plugins/chart/CMakeLists.txt
index 75fd92b2..02bf1e04 100644
--- a/src/plugins/chart/CMakeLists.txt
+++ b/src/plugins/chart/CMakeLists.txt
@@ -1,22 +1,22 @@
 ecm_create_qm_loader(koreport_chartplugin_QM_LOADER kreport_chartplugin_qt)
 
 set(koreport_chartplugin_LIB_SRCS
     ${PROJECT_SOURCE_DIR}/src/common/kreportplugin_debug.cpp
-    KoReportItemChart.cpp
-    KoReportDesignerItemChart.cpp
-    krscriptchart.cpp
-    KoReportChartPlugin.cpp
+    KReportItemChart.cpp
+    KReportDesignerItemChart.cpp
+    KReportScriptChart.cpp
+    KReportChartPlugin.cpp
     ${koreport_chartplugin_QM_LOADER}
 )
 
 add_library(koreport_chartplugin MODULE ${koreport_chartplugin_LIB_SRCS})
 
 target_link_libraries(koreport_chartplugin
     ${KOREPORT_LIBS}
     KChart
     KProperty
 )
 
 install(TARGETS koreport_chartplugin  DESTINATION ${PLUGIN_INSTALL_DIR})
 
 add_subdirectory(pics)
diff --git a/src/plugins/chart/KoReportChartPlugin.cpp b/src/plugins/chart/KReportChartPlugin.cpp
similarity index 68%
rename from src/plugins/chart/KoReportChartPlugin.cpp
rename to src/plugins/chart/KReportChartPlugin.cpp
index b6bf6245..98543465 100644
--- a/src/plugins/chart/KoReportChartPlugin.cpp
+++ b/src/plugins/chart/KReportChartPlugin.cpp
@@ -1,73 +1,73 @@
 /* This file is part of the KDE project
    Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
 */
 
 #include "KoReportChartPlugin.h"
 #include "KoReportItemChart.h"
 #include "KoReportDesignerItemChart.h"
 #include "KoReportPluginInfo.h"
 #ifdef KREPORT_SCRIPTING
 #include "krscriptchart.h"
 #endif
 
 #include 
 
 K_EXPORT_KOREPORT_ITEMPLUGIN(KoReportChartPlugin, chartplugin)
 
-KoReportChartPlugin::KoReportChartPlugin(QObject *parent, const QVariantList &args) : KoReportPluginInterface(parent)
+KReportChartPlugin::KReportChartPlugin(QObject *parent, const QVariantList &args) : KReportPluginInterface(parent)
 {
     Q_UNUSED(args);
 
     KoReportPluginInfo *info = new KoReportPluginInfo();
     info->setClassName("chart");
     info->setIcon(koIcon("office-chart-area"));
     info->setName(tr("Chart"));
     info->setPriority(10);
     setInfo(info);
 }
 
-KoReportChartPlugin::~KoReportChartPlugin()
+KReportChartPlugin::~KReportChartPlugin()
 {
 
 }
 
-QObject* KoReportChartPlugin::createRendererInstance(const QDomNode& element)
+QObject* KReportChartPlugin::createRendererInstance(const QDomNode& element)
 {
-    return new KoReportItemChart(element);
+    return new KReportItemChart(element);
 }
 
-QObject* KoReportChartPlugin::createDesignerInstance(const QDomNode& element, KoReportDesigner* designer, QGraphicsScene* scene)
+QObject* KReportChartPlugin::createDesignerInstance(const QDomNode& element, KoReportDesigner* designer, QGraphicsScene* scene)
 {
-    return new KoReportDesignerItemChart(element, designer, scene);
+    return new KReportDesignerItemChart(element, designer, scene);
 }
 
-QObject* KoReportChartPlugin::createDesignerInstance(KoReportDesigner* designer, QGraphicsScene* scene, const QPointF& pos)
+QObject* KReportChartPlugin::createDesignerInstance(KoReportDesigner* designer, QGraphicsScene* scene, const QPointF& pos)
 {
-    return new KoReportDesignerItemChart(designer, scene, pos);
+    return new KReportDesignerItemChart(designer, scene, pos);
 }
 
 #ifdef KREPORT_SCRIPTING
-QObject* KoReportChartPlugin::createScriptInstance(KoReportItemBase* item)
+QObject* KoReportChartPlugin::createScriptInstance(KReportItemBase* item)
 {
     KoReportItemChart *chart = dynamic_cast(item);
     if (chart) {
         return new Scripting::Chart(chart);
     }
     return 0;
 }
 #endif
diff --git a/src/plugins/chart/KoReportChartPlugin.h b/src/plugins/chart/KReportChartPlugin.h
similarity index 77%
rename from src/plugins/chart/KoReportChartPlugin.h
rename to src/plugins/chart/KReportChartPlugin.h
index 459c37cd..4e737a52 100644
--- a/src/plugins/chart/KoReportChartPlugin.h
+++ b/src/plugins/chart/KReportChartPlugin.h
@@ -1,40 +1,40 @@
 /* This file is part of the KDE project
    Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
 */
 
-#ifndef KOREPORTCHARTPLUGIN_H
-#define KOREPORTCHARTPLUGIN_H
+#ifndef KREPORTCHARTPLUGIN_H
+#define KREPORTCHARTPLUGIN_H
 
-#include 
+#include 
 
-class KoReportChartPlugin : public KoReportPluginInterface
+class KReportChartPlugin : public KReportPluginInterface
 {
     Q_OBJECT
     public:
-        explicit KoReportChartPlugin(QObject *parent, const QVariantList &args = QVariantList());
-        virtual ~KoReportChartPlugin();
+        explicit KReportChartPlugin(QObject *parent, const QVariantList &args = QVariantList());
+        virtual ~KReportChartPlugin();
 
         virtual QObject* createRendererInstance(const QDomNode& element);
         virtual QObject* createDesignerInstance(const QDomNode& element, KoReportDesigner* , QGraphicsScene* scene);
         virtual QObject* createDesignerInstance(KoReportDesigner* , QGraphicsScene* scene, const QPointF& pos);
 #ifdef KREPORT_SCRIPTING
-        virtual QObject* createScriptInstance(KoReportItemBase* item);
+        virtual QObject* createScriptInstance(KReportItemBase* item);
 #endif
 };
 
 #endif // KOREPORTCHARTPLUGIN_H
diff --git a/src/plugins/chart/KoReportDesignerItemChart.cpp b/src/plugins/chart/KReportDesignerItemChart.cpp
similarity index 85%
rename from src/plugins/chart/KoReportDesignerItemChart.cpp
rename to src/plugins/chart/KReportDesignerItemChart.cpp
index f0fce73b..e72c6c98 100644
--- a/src/plugins/chart/KoReportDesignerItemChart.cpp
+++ b/src/plugins/chart/KReportDesignerItemChart.cpp
@@ -1,201 +1,201 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 #include "KoReportDesignerItemChart.h"
 
 #include 
 #include "KoReportDesigner.h"
 
 #include 
 #include 
 
 #include 
 #include 
 #include 
 #include 
 
-void KoReportDesignerItemChart::init(QGraphicsScene* scene, KoReportDesigner *d)
+void KReportDesignerItemChart::init(QGraphicsScene* scene, KoReportDesigner *d)
 {
     setPos(0, 0);
 
     if (scene)
         scene->addItem(this);
 
     connect(m_set, SIGNAL(propertyChanged(KPropertySet&,KProperty&)),
             this, SLOT(slotPropertyChanged(KPropertySet&,KProperty&)));
 
     KoReportDesignerItemRectBase::init(&m_pos, &m_size, m_set, d);
     setZValue(Z);
 
     connect(m_reportDesigner, SIGNAL(reportDataChanged()), this, SLOT(slotReportDataChanged()));
 }
 
-KoReportDesignerItemChart::KoReportDesignerItemChart(KoReportDesigner * rd, QGraphicsScene* scene, const QPointF &pos)
+KReportDesignerItemChart::KReportDesignerItemChart(KoReportDesigner * rd, QGraphicsScene* scene, const QPointF &pos)
         : KoReportDesignerItemRectBase(rd)
 {
     Q_UNUSED(pos);
     init(scene, rd);
     setSceneRect(properRect(*rd, m_dpiX, m_dpiY));
     m_name->setValue(m_reportDesigner->suggestEntityName(typeName()));
 }
 
-KoReportDesignerItemChart::KoReportDesignerItemChart(QDomNode *element, KoReportDesigner * rd, QGraphicsScene* scene) :
-       KoReportItemChart(element),  KoReportDesignerItemRectBase(rd)
+KReportDesignerItemChart::KReportDesignerItemChart(QDomNode *element, KoReportDesigner * rd, QGraphicsScene* scene) :
+       KReportItemChart(element),  KoReportDesignerItemRectBase(rd)
 {
     init(scene, rd);
     populateData();
     setSceneRect(m_pos.toScene(), m_size.toScene());
 
 }
 
-KoReportDesignerItemChart::~KoReportDesignerItemChart()
+KReportDesignerItemChart::~KReportDesignerItemChart()
 {
 }
 
-void KoReportDesignerItemChart::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget *widget)
+void KReportDesignerItemChart::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget *widget)
 {
     Q_UNUSED(option);
     Q_UNUSED(widget);
 
     // store any values we plan on changing so we can restore them
     QFont f = painter->font();
     QPen  p = painter->pen();
     QColor bg = Qt::white;
 
     painter->fillRect(QGraphicsRectItem::rect(), bg);
 
     if (m_chartWidget) {
         m_chartWidget->setFixedSize(m_size.toScene().toSize());
         painter->drawImage(rect().left(), rect().top(),
                            QPixmap::grabWidget(m_chartWidget).toImage(),
                            0, 0, rect().width(), rect().height());
     }
     bg.setAlpha(255);
 
     painter->setBackground(bg);
     painter->setPen(Qt::black);
     painter->drawText(rect(), 0, dataSourceAndObjectTypeName(m_dataSource->value().toString(), "chart"));
     painter->setPen(QPen(QColor(224, 224, 224)));
     painter->drawRect(rect());
     painter->setBackgroundMode(Qt::TransparentMode);
 
     drawHandles(painter);
 
     // restore an values before we started just in case
     painter->setFont(f);
     painter->setPen(p);
 }
 
-KoReportDesignerItemChart* KoReportDesignerItemChart::clone()
+KReportDesignerItemChart* KReportDesignerItemChart::clone()
 {
     QDomDocument d;
     QDomElement e = d.createElement("clone");
     QDomNode n;
     buildXML(&d, &e);
     n = e.firstChild();
-    return new KoReportDesignerItemChart(n, designer(), 0);
+    return new KReportDesignerItemChart(n, designer(), 0);
 }
 
-void KoReportDesignerItemChart::buildXML(QDomDocument *doc, QDomElement *parent)
+void KReportDesignerItemChart::buildXML(QDomDocument *doc, QDomElement *parent)
 {
     QDomElement entity = doc->createElement(QLatin1String("report:") + typeName());
 
     // properties
     addPropertyAsAttribute(&entity, m_name);
     addPropertyAsAttribute(&entity, m_dataSource);
     addPropertyAsAttribute(&entity, m_chartType);
     addPropertyAsAttribute(&entity, m_chartSubType);
     addPropertyAsAttribute(&entity, m_threeD);
     addPropertyAsAttribute(&entity, m_colorScheme);
     addPropertyAsAttribute(&entity, m_aa);
     addPropertyAsAttribute(&entity, m_xTitle);
     addPropertyAsAttribute(&entity, m_yTitle);
     addPropertyAsAttribute(&entity, m_backgroundColor);
     addPropertyAsAttribute(&entity, m_displayLegend);
     addPropertyAsAttribute(&entity, m_legendPosition);
     addPropertyAsAttribute(&entity, m_legendOrientation);
     addPropertyAsAttribute(&entity, m_linkChild);
     addPropertyAsAttribute(&entity, m_linkMaster);
     entity.setAttribute("report:z-index", zValue());
 
     // bounding rect
     buildXMLRect(doc, &entity, &m_pos, &m_size);
 
     parent->appendChild(entity);
 }
 
-void KoReportDesignerItemChart::slotPropertyChanged(KPropertySet &s, KProperty &p)
+void KReportDesignerItemChart::slotPropertyChanged(KPropertySet &s, KProperty &p)
 {
     if (p.name() == "Name") {
         //For some reason p.oldValue returns an empty string
         if (!m_reportDesigner->isEntityNameUnique(p.value().toString(), this)) {
             p.setValue(m_oldName);
         } else {
             m_oldName = p.value().toString();
         }
     } else if (p.name() == "three-dimensions") {
         set3D(p.value().toBool());
     } else if (p.name() == "antialiased") {
         setAA(p.value().toBool());
     } else if (p.name() == "color-scheme") {
         setColorScheme(p.value().toString());
     } else if (p.name() == "data-source") {
         populateData();
     } else if (p.name() == "title-x-axis" ||   p.name() == "title-y-axis") {
         setAxis(m_xTitle->value().toString(), m_yTitle->value().toString());
     } else if (p.name() == "background-color") {
         setBackgroundColor(p.value().value());
     } else if (p.name() == "display-legend") {
         if (m_chartWidget && p.value().toBool()) {
             populateData();
         }
     } else if (p.name() == "legend-position") {
         if (m_chartWidget) {
             populateData();
         }
     } else if (p.name() == "legend-orientation") {
         if (m_chartWidget) {
             populateData();
         }
     } else if (p.name() == "chart-type") {
         if (m_chartWidget) {
         populateData();
             //m_chartWidget->setType((KDChart::Widget::ChartType) m_chartType->value().toInt());
         }
     } else if (p.name() == "chart-sub-type") {
         if (m_chartWidget) {
             m_chartWidget->setSubType((KDChart::Widget::SubType) m_chartSubType->value().toInt());
         }
     }
 
     KoReportDesignerItemRectBase::propertyChanged(s, p);
     if (m_reportDesigner) m_reportDesigner->setModified(true);
 }
 
-void KoReportDesignerItemChart::mousePressEvent(QGraphicsSceneMouseEvent * event)
+void KReportDesignerItemChart::mousePressEvent(QGraphicsSceneMouseEvent * event)
 {
     if (m_reportDesigner->reportData()) {
         QStringList ql = m_reportDesigner->reportData()->dataSources();
         QStringList qn = m_reportDesigner->reportData()->dataSourceNames();
         m_dataSource->setListData(ql, qn);
     }
     KoReportDesignerItemRectBase::mousePressEvent(event);
 }
 
-void KoReportDesignerItemChart::slotReportDataChanged()
+void KReportDesignerItemChart::slotReportDataChanged()
 {
     setConnection(m_reportDesigner->reportData());
 }
diff --git a/src/plugins/chart/KoReportDesignerItemChart.h b/src/plugins/chart/KReportDesignerItemChart.h
similarity index 78%
rename from src/plugins/chart/KoReportDesignerItemChart.h
rename to src/plugins/chart/KReportDesignerItemChart.h
index cfc6118d..cd0d459d 100644
--- a/src/plugins/chart/KoReportDesignerItemChart.h
+++ b/src/plugins/chart/KReportDesignerItemChart.h
@@ -1,50 +1,50 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 #ifndef REPORTENTITYCHART_H
 #define REPORTENTITYCHART_H
 
 
 #include "KoReportItemChart.h"
 #include "KoReportDesignerItemRectBase.h"
 
 /**
 */
-class KoReportDesignerItemChart : public KoReportItemChart, public KoReportDesignerItemRectBase
+class KReportDesignerItemChart : public KReportItemChart, public KReportDesignerItemRectBase
 {
     Q_OBJECT
 public:
-    KoReportDesignerItemChart(KoReportDesigner *, QGraphicsScene* scene, const QPointF &pos);
-    KoReportDesignerItemChart(QDomNode *element, KoReportDesigner *, QGraphicsScene* scene);
+    KReportDesignerItemChart(KoReportDesigner *, QGraphicsScene* scene, const QPointF &pos);
+    KReportDesignerItemChart(QDomNode *element, KoReportDesigner *, QGraphicsScene* scene);
 
-    virtual ~KoReportDesignerItemChart();
+    virtual ~KReportDesignerItemChart();
     virtual void buildXML(QDomDocument *doc, QDomElement *parent);
     virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0);
-    virtual KoReportDesignerItemChart* clone();
+    virtual KReportDesignerItemChart* clone();
 
 protected:
     virtual void mousePressEvent(QGraphicsSceneMouseEvent * event);
 
 private:
     void init(QGraphicsScene*, KoReportDesigner *d);
 
 private Q_SLOTS:
     void slotPropertyChanged(KPropertySet &, KProperty &);
     void slotReportDataChanged();
 
 };
 
 #endif
diff --git a/src/plugins/chart/KoReportItemChart.cpp b/src/plugins/chart/KReportItemChart.cpp
similarity index 92%
rename from src/plugins/chart/KoReportItemChart.cpp
rename to src/plugins/chart/KReportItemChart.cpp
index c0863eea..bdcbe5ea 100644
--- a/src/plugins/chart/KoReportItemChart.cpp
+++ b/src/plugins/chart/KReportItemChart.cpp
@@ -1,431 +1,431 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2010 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
 #include "KoReportItemChart.h"
 
-#include "renderobjects.h"
+#include "KReportRenderObjects.h"
 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 #include 
 
 #include 
 #include 
 
 #include "kreportplugin_debug.h"
 #include 
 
 typedef QVector datalist;
 
-KoReportItemChart::KoReportItemChart()
+KReportItemChart::KReportItemChart()
 {
     m_reportData = 0;
     createProperties();
 }
 
-KoReportItemChart::KoReportItemChart(QDomNode *element)
+KReportItemChart::KReportItemChart(QDomNode *element)
 {
     m_reportData = 0;
     createProperties();
 
     QDomNodeList nl = element->childNodes();
 
     QString n;
     QDomNode node;
     QDomElement e = element->toElement();
     m_name->setValue(e.attribute("report:name"));
     m_dataSource->setValue(e.attribute("report:data-source"));
     Z = e.attribute("report:z-index").toDouble();
     m_chartType->setValue(e.attribute("report:chart-type").toInt());
     m_chartSubType->setValue(e.attribute("report:chart-sub-type").toInt());
     m_threeD->setValue(e.attribute("report:three-dimensions"));
 
     m_colorScheme->setValue(e.attribute("report:chart-color-scheme"));
     m_aa->setValue(e.attribute("report:antialiased"));
     m_xTitle->setValue(e.attribute("report:title-x-axis"));
     m_yTitle->setValue(e.attribute("report:title-y-axis"));
     m_backgroundColor->setValue(e.attribute("report:background-color"));
     m_displayLegend->setValue(e.attribute("report:display-legend"));
     m_legendPosition->setValue(e.attribute("report:legend-position"));
     m_legendOrientation->setValue(e.attribute("report:legend-orientation"));
     m_linkMaster->setValue(e.attribute("report:link-master"));
     m_linkChild->setValue(e.attribute("report:link-child"));
 
     parseReportRect(e, &m_pos, &m_size);
 
 }
 
 
-KoReportItemChart::~KoReportItemChart()
+KReportItemChart::~KReportItemChart()
 {
     delete m_set;
 }
 
-void KoReportItemChart::createProperties()
+void KReportItemChart::createProperties()
 {
     m_chartWidget = 0;
     m_set = new KPropertySet(0, "Chart");
 
     QStringList strings;
     QList keys;
     QStringList stringkeys;
 
     m_dataSource = new KProperty("data-source", QStringList(), QStringList(), QString(), tr("Data Source"));
 
     m_dataSource->setOption("extraValueAllowed", "true");
 
     m_font = new KProperty("font", QFontDatabase::systemFont(QFontDatabase::GeneralFont), tr("Font"), tr("Field Font"));
 
     keys << 1 << 2 << 3 << 4 << 5;
     strings << tr("Bar") << tr("Line") << tr("Pie") << tr("Ring") << tr("Polar");
     KProperty::ListData *typeData = new KProperty::ListData(keys, strings);
     m_chartType = new KProperty("chart-type", typeData, 1, tr("Chart Type"));
 
     keys.clear();
     strings.clear();
     keys << 0 << 1 << 2 << 3;
     strings << tr("Normal") << tr("Stacked") << tr("Percent") << tr("Rows");
 
     KProperty::ListData *subData = new KProperty::ListData(keys, strings);
 
     m_chartSubType = new KProperty("chart-sub-type", subData, 0, tr("Chart Sub Type"));
 
     keys.clear();
     strings.clear();
     stringkeys << "default" << "rainbow" << "subdued";
     strings << tr("Default") << tr("Rainbow") << tr("Subdued");
     m_colorScheme = new KProperty("chart-color-scheme", stringkeys, strings, "default", tr("Color Scheme"));
 
     m_threeD = new KProperty("three-dimensions", QVariant(false),
         tr("3D", "Three dimensions"));
     m_aa = new KProperty("antialiased", QVariant(false), tr("Antialiased"));
 
     m_xTitle = new KProperty("title-x-axis", QString(), tr("X Axis Title"), tr("X Axis Title"));
     m_yTitle = new KProperty("title-y-axis", QString(), tr("Y Axis Title"), tr("Y Axis Title"));
 
     m_displayLegend = new KProperty("display-legend", true, tr("Display Legend"), tr("Display Legend"));
 
     keys.clear();
     strings.clear();
     keys << (int)KDChartEnums::PositionNorth
             << (int)KDChartEnums::PositionEast
             << (int)KDChartEnums::PositionSouth
             << (int)KDChartEnums::PositionWest;
     QStringList names = KDChart::Position::printableNames();
     foreach (const QVariant &pos, keys) {
         strings << names[pos.toInt()-1];
     }
     subData = new KProperty::ListData(keys, strings);
     m_legendPosition = new KProperty("legend-position", subData, (int)KDChartEnums::PositionEast, tr("Legend Position"));
 
     keys.clear();
     strings.clear();
     keys << Qt::Horizontal << Qt::Vertical;
     strings << tr("Horizontal") << tr("Vertical");
     subData = new KProperty::ListData(keys, strings);
     m_legendOrientation = new KProperty("legend-orientation", subData, Qt::Vertical, tr("Legend Orientation"));
 
     m_backgroundColor = new KProperty("background-color", Qt::white,
         tr("Background Color"), tr("Background Color"));
 
     m_linkMaster = new KProperty("link-master", QString(), tr("Link Master"),
         tr("Fields from master data source"));
     m_linkChild = new KProperty("link-child", QString(), tr("Link Child"),
         tr("Fields from child data source"));
 
     addDefaultProperties();
     m_set->addProperty(m_dataSource);
     m_set->addProperty(m_chartType);
     m_set->addProperty(m_chartSubType);
     m_set->addProperty(m_font);
     m_set->addProperty(m_colorScheme);
     m_set->addProperty(m_threeD);
     m_set->addProperty(m_aa);
     m_set->addProperty(m_xTitle);
     m_set->addProperty(m_yTitle);
     m_set->addProperty(m_backgroundColor);
     m_set->addProperty(m_displayLegend);
     m_set->addProperty(m_legendPosition);
     m_set->addProperty(m_legendOrientation);
     m_set->addProperty(m_linkMaster);
     m_set->addProperty(m_linkChild);
 
     set3D(false);
     setAA(false);
     setColorScheme("default");
 }
 
-void KoReportItemChart::set3D(bool td)
+void KReportItemChart::set3D(bool td)
 {
     if (m_chartWidget && m_chartWidget->barDiagram()) {
         KDChart::BarDiagram *bar = m_chartWidget->barDiagram();
         bar->setPen(QPen(Qt::black));
 
         KDChart::ThreeDBarAttributes threed = bar->threeDBarAttributes();
         threed.setEnabled(td);
         threed.setDepth(10);
         threed.setAngle(15);
         threed.setUseShadowColors(true);
         bar->setThreeDBarAttributes(threed);
     }
 
 }
-void KoReportItemChart::setAA(bool aa)
+void KReportItemChart::setAA(bool aa)
 {
     if (m_chartWidget && m_chartWidget->diagram()) {
         m_chartWidget->diagram()->setAntiAliasing(aa);
     }
 }
 
-void KoReportItemChart::setColorScheme(const QString &cs)
+void KReportItemChart::setColorScheme(const QString &cs)
 {
     if (m_chartWidget && m_chartWidget->diagram()) {
         if (cs == "rainbow") {
             m_chartWidget->diagram()->useRainbowColors();
         } else if (cs == "subdued") {
             m_chartWidget->diagram()->useSubduedColors();
         } else {
             m_chartWidget->diagram()->useDefaultColors();
         }
     }
 }
 
-void KoReportItemChart::setConnection(KoReportData *c)
+void KReportItemChart::setConnection(KReportData *c)
 {
     m_reportData = c;
     populateData();
 }
 
-void KoReportItemChart::populateData()
+void KReportItemChart::populateData()
 {
     QVector data;
     QStringList labels;
 
     QStringList fn;
 
 
     delete m_chartWidget;
     m_chartWidget = 0;
 
     if (m_reportData) {
         QString src = m_dataSource->value().toString();
 
         if (!src.isEmpty()) {
-            KoReportData *curs = m_reportData->data(src);
+            KReportData *curs = m_reportData->data(src);
             if (curs) {
                 const QStringList keys = m_links.keys();
                 foreach(const QString& field, keys) {
                     kreportpluginDebug() << "Adding Expression:" << field << m_links[field];
                     curs->addExpression(field, m_links[field], '=');
                 }
             }
             if (curs && curs->open()) {
                 fn = curs->fieldNames();
                 //resize the data lists to match the number of columns
                 int cols = fn.count() - 1;
                 if ( cols > 0 ) {
                     data.resize(cols);
                 }
 
                 m_chartWidget = new KDChart::Widget();
                 m_chartWidget->setType((KDChart::Widget::ChartType) m_chartType->value().toInt());
                 m_chartWidget->setSubType((KDChart::Widget::SubType) m_chartSubType->value().toInt());
                 set3D(m_threeD->value().toBool());
                 setAA(m_aa->value().toBool());
                 setColorScheme(m_colorScheme->value().toString());
                 setBackgroundColor(m_backgroundColor->value().value());
                 curs->moveFirst();
                 //bool status = true;
                 do {
                     labels << curs->value(0).toString();
                     for (int i = 1; i <= cols; ++i) {
                         data[i - 1] << curs->value(i).toDouble();
                     }
                 } while (curs->moveNext());
 
                 for (int i = 1; i <= cols; ++i) {
                     m_chartWidget->setDataset(i - 1, data[i - 1], fn[i]);
                 }
 
                 setLegend(m_displayLegend->value().toBool(), fn);
 
                 //Add the axis
                 setAxis(m_xTitle->value().toString(), m_yTitle->value().toString());
 
                 //Add the bottom labels
                 if (m_chartWidget->barDiagram() || m_chartWidget->lineDiagram()) {
                     KDChart::AbstractCartesianDiagram *dia = static_cast(m_chartWidget->diagram());
 
                     foreach(KDChart::CartesianAxis* axis, dia->axes()) {
                         if (axis->position() == KDChart::CartesianAxis::Bottom) {
                             axis->setLabels(labels);
                         }
                     }
                 }
             } else {
                 kreportpluginDebug() << "Unable to open data set";
             }
             delete curs;
             curs = 0;
         } else {
             kreportpluginDebug() << "No source set";
         }
     } else {
         kreportpluginDebug() << "No connection!";
     }
 }
 
-QStringList KoReportItemChart::masterFields()
+QStringList KReportItemChart::masterFields()
 {
     return m_linkMaster->value().toString().split(',');
 }
 
-void KoReportItemChart::setLinkData(QString fld, QVariant val)
+void KReportItemChart::setLinkData(QString fld, QVariant val)
 {
     kreportpluginDebug() << "Field: " << fld << "is" << val;
     m_links[fld] = val;
 }
 
-void KoReportItemChart::setAxis(const QString& xa, const QString &ya)
+void KReportItemChart::setAxis(const QString& xa, const QString &ya)
 {
     if (!m_chartWidget) {
         return;
     }
     Q_ASSERT(m_chartWidget);
 
     if (m_chartWidget->barDiagram() || m_chartWidget->lineDiagram()) {
         KDChart::AbstractCartesianDiagram *dia = static_cast(m_chartWidget->diagram());
         KDChart::CartesianAxis *xAxis = 0;
         KDChart::CartesianAxis *yAxis = 0;
 
         //delete existing axis
         foreach(KDChart::CartesianAxis* axis, dia->axes()) {
             if (axis->position() == KDChart::CartesianAxis::Bottom) {
                 xAxis = axis;
             }
             if (axis->position() == KDChart::CartesianAxis::Left) {
                 yAxis = axis;
             }
         }
 
         if (!xAxis) {
             xAxis =  new KDChart::CartesianAxis(static_cast(m_chartWidget->diagram()));
             xAxis->setPosition(KDChart::CartesianAxis::Bottom);
             dia->addAxis(xAxis);
         }
 
         if (!yAxis) {
             yAxis = new KDChart::CartesianAxis(static_cast(m_chartWidget->diagram()));
             yAxis->setPosition(KDChart::CartesianAxis::Left);
             dia->addAxis(yAxis);
         }
 
         xAxis->setTitleText(xa);
         yAxis->setTitleText(ya);
     }
 }
 
-void KoReportItemChart::setBackgroundColor(const QColor&)
+void KReportItemChart::setBackgroundColor(const QColor&)
 {
     //Set the background color
     if (!m_chartWidget) {
         return;
     }
     KDChart::Chart *cht = m_chartWidget->diagram()->coordinatePlane()->parent();
 
     KDChart::BackgroundAttributes ba;
 
     ba.setVisible(true);
     ba.setBrush(m_backgroundColor->value().value());
     cht->setBackgroundAttributes(ba);
 }
 
-void KoReportItemChart::setLegend(bool le, const QStringList &legends)
+void KReportItemChart::setLegend(bool le, const QStringList &legends)
 {
     //Add the legend
     if (m_chartWidget) {
         if (le && ! legends.isEmpty()) {
             m_chartWidget->addLegend(KDChart::Position((KDChartEnums::PositionValue)m_legendPosition->value().toInt()));
             m_chartWidget->legend()->setOrientation((Qt::Orientation) m_legendOrientation->value().toInt());
             m_chartWidget->legend()->setTitleText("Legend");
             for (int i = 1; i < legends.count(); ++i) {
                 m_chartWidget->legend()->setText(i - 1, legends[i]);
             }
 
             m_chartWidget->legend()->setShowLines(true);
         } else {
             if (m_chartWidget->legend()) {
                 m_chartWidget->takeLegend(m_chartWidget->legend());
             }
         }
     }
 }
 
 // RTTI
-QString KoReportItemChart::typeName() const
+QString KReportItemChart::typeName() const
 {
     return "chart";
 }
 
-int KoReportItemChart::renderReportData(OROPage *page, OROSection *section, const QPointF &offset,
-                                        KoReportData *data, KRScriptHandler *script)
+int KReportItemChart::renderReportData(OROPage *page, OROSection *section, const QPointF &offset,
+                                        KReportData *data, KReportScriptHandler *script)
 {
     Q_UNUSED(script);
 
     setConnection(data);
 
     QStringList masters = masterFields();
     for (int i = 0; i < masters.size(); ++i) {
         if (!masters[i].simplified().isEmpty()) {
             setLinkData(masters[i], data->value(masters[i]));
         }
     }
     populateData();
     if (widget()) {
         OROPicture * pic = new OROPicture();
         widget()->setFixedSize(m_size.toScene().toSize());
 
         QPainter p(pic->picture());
 
         widget()->diagram()->coordinatePlane()->parent()->paint(&p, QRect(QPoint(0, 0), m_size.toScene().toSize()));
 
         QPointF pos = m_pos.toScene();
         QSizeF size = m_size.toScene();
 
         pos += offset;
 
         pic->setPosition(pos);
         pic->setSize(size);
         if (page) page->addPrimitive(pic);
 
         OROPicture *p2 = static_cast(pic->clone());
         p2->setPosition(m_pos.toPoint());
         if (section) section->addPrimitive(p2);
     }
 
     return 0;
 }
diff --git a/src/plugins/chart/KoReportItemChart.h b/src/plugins/chart/KReportItemChart.h
similarity index 87%
rename from src/plugins/chart/KoReportItemChart.h
rename to src/plugins/chart/KReportItemChart.h
index 3d9e90f0..a21b9466 100644
--- a/src/plugins/chart/KoReportItemChart.h
+++ b/src/plugins/chart/KReportItemChart.h
@@ -1,116 +1,116 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
 #ifndef KRCHARTDATA_H
 #define KRCHARTDATA_H
 
 #include 
 
-#include "KoReportItemBase.h"
-#include "krsize.h"
-#include "krpos.h"
-#include "KoReportData.h"
+#include "KReportItemBase.h"
+#include "KReportSize.h"
+#include "KReportPosition.h"
+#include "KReportData.h"
 
 namespace Scripting
 {
 class Chart;
 }
 
 /**
 */
-class KoReportItemChart : public KoReportItemBase
+class KReportItemChart : public KReportItemBase
 {
     Q_OBJECT
 public:
-    KoReportItemChart();
-    explicit KoReportItemChart(QDomNode *element);
-    ~KoReportItemChart();
+    KReportItemChart();
+    explicit KReportItemChart(QDomNode *element);
+    ~KReportItemChart();
 
     virtual QString typeName() const;
 
-    virtual int renderReportData(OROPage *page, OROSection *section, const QPointF &offset, KoReportData *data, KRScriptHandler *script);
+    virtual int renderReportData(OROPage *page, OROSection *section, const QPointF &offset, KReportData *data, KReportScriptHandler *script);
 
     KDChart::Widget *widget() {
         return m_chartWidget;
     }
 
     /**
     @brief Perform the query for the chart and set the charts data
     */
     void populateData();
-    void setConnection(KoReportData*);
+    void setConnection(KReportData*);
 
     /**
     @brief Set the value of a field from the master (report) data set
     This data will be used when retrieving the data for the chart
     as the values in a 'where' clause.
     */
     void setLinkData(QString, QVariant);
 
     /**
     @brief Return the list of master fields
     The caller will use this to set the current value for each field
     at that stage in the report
     */
     QStringList masterFields();
 
     /**
     @brief The chart object is a complex object that uses its own data source
     @return true
     */
     virtual bool supportsSubQuery() const { return true; }
 
 protected:
 
     KProperty * m_dataSource;
     KProperty * m_font;
     KProperty * m_chartType;
     KProperty * m_chartSubType;
     KProperty * m_threeD;
     KProperty * m_colorScheme;
     KProperty * m_aa;
     KProperty * m_xTitle;
     KProperty * m_yTitle;
 
     KProperty *m_backgroundColor;
     KProperty *m_displayLegend;
     KProperty *m_legendPosition;
     KProperty *m_legendOrientation;
 
     KProperty *m_linkMaster;
     KProperty *m_linkChild;
 
     KDChart::Widget *m_chartWidget;
 
     void set3D(bool);
     void setAA(bool);
     void setColorScheme(const QString &);
     void setAxis(const QString&, const QString&);
     void setBackgroundColor(const QColor&);
     void setLegend(bool, const QStringList &legends = QStringList());
 
 private:
     virtual void createProperties();
-    KoReportData *m_reportData;
+    KReportData *m_reportData;
 
     friend class Scripting::Chart;
 
     QMap m_links; //Map of field->value for child/master links
 
 };
 
 #endif
diff --git a/src/plugins/chart/krscriptchart.cpp b/src/plugins/chart/KReportScriptChart.cpp
similarity index 98%
rename from src/plugins/chart/krscriptchart.cpp
rename to src/plugins/chart/KReportScriptChart.cpp
index 95f7055f..0f777948 100644
--- a/src/plugins/chart/krscriptchart.cpp
+++ b/src/plugins/chart/KReportScriptChart.cpp
@@ -1,121 +1,121 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
 #include "krscriptchart.h"
 #include "KoReportItemChart.h"
 
 namespace Scripting
 {
 
-Chart::Chart(KoReportItemChart *c)
+Chart::Chart(KReportItemChart *c)
 {
     m_chart = c;
 }
 
 
 Chart::~Chart()
 {
 }
 
 QPointF Chart::position()
 {
     return m_chart->m_pos.toPoint();
 }
 void Chart::setPosition(const QPointF& p)
 {
     m_chart->m_pos.setPointPos(p);
 }
 
 QSizeF Chart::size()
 {
     return m_chart->m_size.toPoint();
 }
 void Chart::setSize(const QSizeF& s)
 {
     m_chart->m_size.setPointSize(s);
 }
 
 QString Chart::dataSource()
 {
     return m_chart->m_dataSource->value().toString();
 }
 
 void Chart::setDataSource(const QString &ds)
 {
     m_chart->m_dataSource->setValue(ds);
 }
 
 bool Chart::threeD()
 {
     return m_chart->m_threeD->value().toBool();
 }
 
 void Chart::setThreeD(bool td)
 {
     m_chart->m_threeD->setValue(td);
 }
 
 bool Chart::legendVisible()
 {
     return m_chart->m_displayLegend->value().toBool();
 }
 
 void Chart::setLegendVisible(bool v)
 {
     m_chart->m_displayLegend->setValue(v);
 }
 
 int Chart::colorScheme()
 {
     return m_chart->m_colorScheme->value().toInt();
 }
 
 void Chart::setColorScheme(int cs)
 {
     m_chart->m_colorScheme->setValue(cs);
 }
 
 QColor Chart::backgroundColor()
 {
     return m_chart->m_backgroundColor->value().value();
 }
 
 void Chart::setBackgroundColor(const QColor &bc)
 {
     m_chart->m_backgroundColor->setValue(bc);
 }
 
 QString Chart::xAxisTitle()
 {
     return m_chart->m_xTitle->value().toString();
 }
 
 void Chart::setXAxisTitle(const QString &t)
 {
     m_chart->m_xTitle->setValue(t);
 }
 
 QString Chart::yAxisTitle()
 {
     return m_chart->m_yTitle->value().toString();
 }
 
 void Chart::setYAxisTitle(const QString &t)
 {
     m_chart->m_yTitle->setValue(t);
 }
 }
diff --git a/src/plugins/chart/krscriptchart.h b/src/plugins/chart/KReportScriptChart.h
similarity index 96%
rename from src/plugins/chart/krscriptchart.h
rename to src/plugins/chart/KReportScriptChart.h
index ea3ee171..a6987460 100644
--- a/src/plugins/chart/krscriptchart.h
+++ b/src/plugins/chart/KReportScriptChart.h
@@ -1,158 +1,158 @@
 /* This file is part of the KDE project
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
 #ifndef SCRIPTINGKRSCRIPTCHART_H
 #define SCRIPTINGKRSCRIPTCHART_H
 
 #include 
 #include 
 #include 
 #include 
 
-class KoReportItemChart;
+class KReportItemChart;
 
 namespace Scripting
 {
 
 /**
 */
 class Chart : public QObject
 {
     Q_OBJECT
 public:
-    explicit Chart(KoReportItemChart *);
+    explicit Chart(KReportItemChart *);
 
     ~Chart();
 public Q_SLOTS:
 
 
     /**
     * Get the position of the barcode
     * @return position in points
      */
     QPointF position();
 
     /**
      * Sets the position of the barcode in points
      * @param Position
      */
     void setPosition(const QPointF&);
 
     /**
      * Get the size of the barcode
      * @return size in points
      */
     QSizeF size();
 
     /**
      * Set the size of the barcode in points
      * @param Size
      */
     void setSize(const QSizeF&);
 
     /**
      * The data source for the chart
      * @return Datasource
      */
     QString dataSource();
 
     /**
      * Set the data source for the chart
      * @param datasource
      */
     void setDataSource(const QString &);
 
     /**
      * The 3d status of the chart
      * @return 3d
      */
     bool threeD();
 
     /**
      * Set the 3d status of the chart
      * @param 3d
      */
     void setThreeD(bool);
 
     /**
      * The visibility status of the legend
      * @return visibility
      */
     bool legendVisible();
 
     /**
      * Sets the visibility of the legend
      * @param visible
      */
     void setLegendVisible(bool);
 
     /**
      * The color scheme used by the chart
      * @return scheme, 0=default, 2=rainbow 3=subdued
      */
     int colorScheme();
 
     /**
      * Sets the colorscheme of the chart
      * @param scheme 0=default, 2=rainbow 3=subdued
      */
     void setColorScheme(int);
 
     /**
      * The background color of the chart
      * @return backgroundcolor
      */
     QColor backgroundColor();
 
     /**
      * Sets the background color of the chart
      * @param backgroundcolor
      */
     void setBackgroundColor(const QColor &);
 
     /**
      * The title of the X Axis
      * @return xTitle
      */
     QString xAxisTitle();
 
     /**
      * Set the title of the X Axis
      * @param xTitle
      */
     void setXAxisTitle(const QString &);
 
     /**
      * The title of the Y Axis
      * @return yTitle
      */
     QString yAxisTitle();
 
     /**
      * Set the title of the Y Axis
      * @param yTitle
      */
     void setYAxisTitle(const QString &);
 
 private:
-    KoReportItemChart* m_chart;
+    KReportItemChart* m_chart;
 
 };
 
 }
 
 #endif
diff --git a/src/plugins/maps/CMakeLists.txt b/src/plugins/maps/CMakeLists.txt
index 24abbcd0..df62b7ba 100644
--- a/src/plugins/maps/CMakeLists.txt
+++ b/src/plugins/maps/CMakeLists.txt
@@ -1,28 +1,28 @@
 ecm_create_qm_loader(koreport_mapsplugin_QM_LOADER kreport_mapsplugin_qt)
 
 #build a shared library
 set(kreport_mapsplugin_LIB_SRCS
     ${PROJECT_SOURCE_DIR}/src/common/kreportplugin_debug.cpp
-    KoReportDesignerItemMaps.cpp
-    KoReportItemMaps.cpp
-    KoReportMapsPlugin.cpp
-    krscriptmaps.cpp
+    KReportDesignerItemMaps.cpp
+    KReportItemMaps.cpp
+    KReportMapsPlugin.cpp
+    KReportScriptMaps.cpp
     MapRenderer.cpp
     ${koreport_mapsplugin_QM_LOADER}
 )
 
 add_library(kreport_mapsplugin MODULE ${kreport_mapsplugin_LIB_SRCS})
 kcoreaddons_desktop_to_json(kreport_mapsplugin kreport_mapsplugin.desktop)
 
 target_link_libraries(kreport_mapsplugin
     PUBLIC
         KReport
     PRIVATE
         ${MARBLE_LIBRARIES}
 )
 
 ########### install files ###############
 
 install(TARGETS kreport_mapsplugin DESTINATION ${KREPORT_PLUGIN_INSTALL_DIR})
 
 add_subdirectory(pics)
diff --git a/src/plugins/maps/KoReportDesignerItemMaps.cpp b/src/plugins/maps/KReportDesignerItemMaps.cpp
similarity index 80%
rename from src/plugins/maps/KoReportDesignerItemMaps.cpp
rename to src/plugins/maps/KReportDesignerItemMaps.cpp
index 27cc698a..8e2222db 100644
--- a/src/plugins/maps/KoReportDesignerItemMaps.cpp
+++ b/src/plugins/maps/KReportDesignerItemMaps.cpp
@@ -1,136 +1,136 @@
 /*
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  * Copyright (C) 2011-2015 by Radoslaw Wicik (radoslaw@wicik.pl)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
 #include "KoReportDesignerItemMaps.h"
 #include "KoReportDesignerItemBase.h"
 #include "KoReportDesigner.h"
 
 #include 
 #include 
 
 #include 
 #include 
 #include 
 #include 
 #include "kreportplugin_debug.h"
 
-void KoReportDesignerItemMaps::init(QGraphicsScene *scene, KoReportDesigner *d)
+void KReportDesignerItemMaps::init(QGraphicsScene *scene, KoReportDesigner *d)
 {
     if (scene)
         scene->addItem(this);
 
     KoReportDesignerItemRectBase::init(&m_pos, &m_size, m_set, d);
 
     connect(m_set, SIGNAL(propertyChanged(KPropertySet&,KProperty&)),
             this, SLOT(slotPropertyChanged(KPropertySet&,KProperty&)));
 
     m_controlSource->setListData(m_reportDesigner->fieldKeys(), m_reportDesigner->fieldNames());
     setZValue(Z);
 }
 
-KoReportDesignerItemMaps::KoReportDesignerItemMaps(KoReportDesigner * rw, QGraphicsScene* scene, const QPointF &pos)
+KReportDesignerItemMaps::KReportDesignerItemMaps(KoReportDesigner * rw, QGraphicsScene* scene, const QPointF &pos)
         : KoReportDesignerItemRectBase(rw)
 {
     Q_UNUSED(pos);
     init(scene, rw);
-    setSceneRect(properRect(*rw, KOREPORT_ITEM_RECT_DEFAULT_WIDTH, KOREPORT_ITEM_RECT_DEFAULT_WIDTH));
+    setSceneRect(properRect(*rw, KREPORT_ITEM_RECT_DEFAULT_WIDTH, KREPORT_ITEM_RECT_DEFAULT_WIDTH));
     m_name->setValue(m_reportDesigner->suggestEntityName(typeName()));
 }
 
-KoReportDesignerItemMaps::KoReportDesignerItemMaps(QDomNode *element, KoReportDesigner * rw, QGraphicsScene* scene)
+KReportDesignerItemMaps::KReportDesignerItemMaps(QDomNode *element, KoReportDesigner * rw, QGraphicsScene* scene)
         : KoReportItemMaps(element), KoReportDesignerItemRectBase(rw)
 {
     init(scene, rw);
     setSceneRect(m_pos.toScene(), m_size.toScene());
 }
 
-KoReportDesignerItemMaps* KoReportDesignerItemMaps::clone()
+KReportDesignerItemMaps* KReportDesignerItemMaps::clone()
 {
     QDomDocument d;
     QDomElement e = d.createElement(QLatin1String("clone"));
     QDomNode n;
     buildXML(&d, &e);
     n = e.firstChild();
-    return new KoReportDesignerItemMaps(n, designer(), 0);
+    return new KReportDesignerItemMaps(n, designer(), 0);
 }
 
-KoReportDesignerItemMaps::~KoReportDesignerItemMaps()
+KReportDesignerItemMaps::~KReportDesignerItemMaps()
 {
     // do we need to clean anything up?
 }
 
-void KoReportDesignerItemMaps::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
+void KReportDesignerItemMaps::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
 {
     Q_UNUSED(option);
     Q_UNUSED(widget);
     // store any values we plan on changing so we can restore them
     QPen  p = painter->pen();
     painter->fillRect(rect(), QColor(0xc2, 0xfc, 0xc7));//C2FCC7
 
     //Draw a border so user knows the object edge
     painter->setPen(QPen(QColor(224, 224, 224)));
     painter->drawRect(rect());
     painter->setPen(Qt::black);
     painter->drawText(rect(), 0, dataSourceAndObjectTypeName(itemDataSource(), QLatin1String("map")));
 
     drawHandles(painter);
 
     // restore an values before we started just in case
     painter->setPen(p);
 }
 
-void KoReportDesignerItemMaps::buildXML(QDomDocument *doc, QDomElement *parent)
+void KReportDesignerItemMaps::buildXML(QDomDocument *doc, QDomElement *parent)
 {
     QDomElement entity = doc->createElement(QLatin1String("report:") + typeName());
 
     // properties
     addPropertyAsAttribute(&entity, m_name);
     addPropertyAsAttribute(&entity, m_controlSource);
     addPropertyAsAttribute(&entity, m_latitudeProperty);
     addPropertyAsAttribute(&entity, m_longitudeProperty);
     addPropertyAsAttribute(&entity, m_zoomProperty);
     addPropertyAsAttribute(&entity, m_themeProperty);
     //addPropertyAsAttribute(&entity, m_resizeMode);
     entity.setAttribute(QLatin1String("report:z-index"), zValue());
     buildXMLRect(doc, &entity, &m_pos, &m_size);
 
     parent->appendChild(entity);
 }
 
-void KoReportDesignerItemMaps::slotPropertyChanged(KPropertySet &s, KProperty &p)
+void KReportDesignerItemMaps::slotPropertyChanged(KPropertySet &s, KProperty &p)
 {
     kreportpluginDebug() << p.name() << ":" << p.value();
     if (p.name().toLower() == "name") {
         //For some reason p.oldValue returns an empty string
         if (!m_reportDesigner->isEntityNameUnique(p.value().toString(), this)) {
             p.setValue(m_oldName);
         } else {
             m_oldName = p.value().toString();
         }
     }
 
     KoReportDesignerItemRectBase::propertyChanged(s, p);
     if (m_reportDesigner) m_reportDesigner->setModified(true);
 }
 
-void KoReportDesignerItemMaps::mousePressEvent(QGraphicsSceneMouseEvent * event)
+void KReportDesignerItemMaps::mousePressEvent(QGraphicsSceneMouseEvent * event)
 {
     m_controlSource->setListData(m_reportDesigner->fieldKeys(), m_reportDesigner->fieldNames());
     KoReportDesignerItemRectBase::mousePressEvent(event);
 }
diff --git a/src/plugins/maps/KoReportDesignerItemMaps.h b/src/plugins/maps/KReportDesignerItemMaps.h
similarity index 77%
rename from src/plugins/maps/KoReportDesignerItemMaps.h
rename to src/plugins/maps/KReportDesignerItemMaps.h
index 9af70f1c..07cca40b 100644
--- a/src/plugins/maps/KoReportDesignerItemMaps.h
+++ b/src/plugins/maps/KReportDesignerItemMaps.h
@@ -1,52 +1,52 @@
 /*
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  * Copyright (C) 2011 by Radoslaw Wicik (radoslaw@wicik.pl)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
 #ifndef __REPORTENTITYIMAGE_H__
 #define __REPORTENTITYIMAGE_H__
 
 
 #include 
 
-#include "wrtembed/KoReportDesignerItemRectBase.h"
+#include 
 #include "KoReportItemMaps.h"
 
-class KoReportDesignerItemMaps : public KoReportItemMaps, public KoReportDesignerItemRectBase
+class KReportDesignerItemMaps : public KReportItemMaps, public KReportDesignerItemRectBase
 {
   Q_OBJECT
 public:
-    KoReportDesignerItemMaps(KoReportDesigner *, QGraphicsScene* scene, const QPointF &pos);
-    KoReportDesignerItemMaps(QDomNode *element, KoReportDesigner *, QGraphicsScene* scene);
+    KReportDesignerItemMaps(KoReportDesigner *, QGraphicsScene* scene, const QPointF &pos);
+    KReportDesignerItemMaps(QDomNode *element, KoReportDesigner *, QGraphicsScene* scene);
 
-    virtual ~KoReportDesignerItemMaps();
+    virtual ~KReportDesignerItemMaps();
     virtual void buildXML(QDomDocument *doc, QDomElement *parent);
     virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0);
-    virtual KoReportDesignerItemMaps* clone();
+    virtual KReportDesignerItemMaps* clone();
 
 protected:
     virtual void mousePressEvent(QGraphicsSceneMouseEvent * event);
 
 private:
     void init(QGraphicsScene*, KoReportDesigner*);
 
 private Q_SLOTS:
     void slotPropertyChanged(KPropertySet &, KProperty &);
 
 };
 
 #endif
diff --git a/src/plugins/maps/KoReportItemMaps.cpp b/src/plugins/maps/KReportItemMaps.cpp
similarity index 87%
rename from src/plugins/maps/KoReportItemMaps.cpp
rename to src/plugins/maps/KReportItemMaps.cpp
index 7ed99f19..40c3c452 100644
--- a/src/plugins/maps/KoReportItemMaps.cpp
+++ b/src/plugins/maps/KReportItemMaps.cpp
@@ -1,228 +1,228 @@
 /*
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  * Copyright (C) 2011-2015 by Radoslaw Wicik (radoslaw@wicik.pl)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 #include "KoReportItemMaps.h"
 
 #include 
 
 #include 
 
-#include 
+#include 
 
 #include 
 
 #define myDebug() if (0) kDebug(44021)
 
-KoReportItemMaps::KoReportItemMaps(QDomNode *element)
+KReportItemMaps::KReportItemMaps(QDomNode *element)
     : m_longtitude(0)
     , m_latitude(0)
     , m_zoom(1200)
     , m_pageId(0)
     , m_sectionId(0)
     , m_oroPicture(0)
     , m_longDataSetFromScript(false)
     , m_latitudeProperty(false)
     , m_zoomDataSetFromScript(false)
 {
     createProperties();
 
     m_name->setValue(element->toElement().attribute(QLatin1String("report:name")));
     m_controlSource->setValue(element->toElement().attribute(QLatin1String("report:item-data-source")));
     Z = element->toElement().attribute(QLatin1String("report:z-index")).toDouble();
     m_latitudeProperty->setValue(element->toElement().attribute(QLatin1String("report:latitude")).toDouble());
     m_longitudeProperty->setValue(element->toElement().attribute(QLatin1String("report:longitude")).toDouble());
     m_zoomProperty->setValue(element->toElement().attribute(QLatin1String("report:zoom")).toInt());
     QString themeId(element->toElement().attribute(QLatin1String("report:theme")));
     themeId = themeId.isEmpty() ? m_themeManager.mapThemeIds()[0] : themeId;
     m_themeProperty->setValue(themeId);
 
     parseReportRect(element->toElement(), &m_pos, &m_size);
 }
 
-KoReportItemMaps::~KoReportItemMaps()
+KReportItemMaps::~KReportItemMaps()
 {
     delete m_set;
 }
 
-void KoReportItemMaps::createProperties()
+void KReportItemMaps::createProperties()
 {
     m_set = new KPropertySet(0, QLatin1String("Maps"));
 
     m_controlSource = new KProperty("item-data-source", QStringList(), QStringList(), QString(), tr("Data Source"));
 
     m_latitudeProperty = new KProperty("latitude", 0.0, tr("Latitude"), tr("Latitude"), KProperty::Double);
     m_latitudeProperty->setOption("min", -90);
     m_latitudeProperty->setOption("max", 90);
     m_latitudeProperty->setOption("unit", QString::fromUtf8("°"));
     m_latitudeProperty->setOption("precision", 7);
 
     m_longitudeProperty = new KProperty("longitude", 0.0, tr("Longitude"), tr("Longitude"), KProperty::Double);
     m_longitudeProperty->setOption("min", -180);
     m_longitudeProperty->setOption("max", 180);
     m_longitudeProperty->setOption("unit", QString::fromUtf8("°"));
     m_longitudeProperty->setOption("precision", 7);
 
     m_zoomProperty     = new KProperty("zoom", 1000, tr("Zoom"), tr("Zoom") );
     m_zoomProperty->setOption("min", 0);
     m_zoomProperty->setOption("max", 4000);
     m_zoomProperty->setOption("step", 100);
     m_zoomProperty->setOption("slider", true);
 
     QStringList mapThemIds(m_themeManager.mapThemeIds());
     m_themeProperty = new KProperty("theme",
                                                     mapThemIds,
                                                     mapThemIds,
                                                     mapThemIds[1]);
 
     if (mapThemIds.contains(QLatin1String("earth/srtm/srtm.dgml"))) {
         m_themeProperty->setValue(QLatin1String("earth/srtm/srtm.dgml"), false);
     }
 
     addDefaultProperties();
     m_set->addProperty(m_controlSource);
     m_set->addProperty(m_latitudeProperty);
     m_set->addProperty(m_longitudeProperty);
     m_set->addProperty(m_zoomProperty);
     m_set->addProperty(m_themeProperty);
 }
 
 
-void KoReportItemMaps::setColumn(const QString &c)
+void KReportItemMaps::setColumn(const QString &c)
 {
     m_controlSource->setValue(c);
 }
 
-QString KoReportItemMaps::itemDataSource() const
+QString KReportItemMaps::itemDataSource() const
 {
     return m_controlSource->value().toString();
 }
 
-QString KoReportItemMaps::typeName() const
+QString KReportItemMaps::typeName() const
 {
     return QLatin1String("maps");
 }
 
-int KoReportItemMaps::renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset,
-                                       const QVariant &data, KRScriptHandler *script)
+int KReportItemMaps::renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset,
+                                       const QVariant &data, KReportScriptHandler *script)
 {
     Q_UNUSED(script)
 
     deserializeData(data);
     m_pageId = page;
     m_sectionId = section;
     m_offset = offset;
 
 
     m_oroPicture = new OROPicture();
     m_oroPicture->setPosition(m_pos.toScene() + m_offset);
     m_oroPicture->setSize(m_size.toScene());
 
     if (m_pageId) {
         m_pageId->addPrimitive(m_oroPicture);
     }
 
     if (m_sectionId) {
         OROPicture *i2 = dynamic_cast(m_oroPicture->clone());
         i2->setPosition(m_pos.toPoint());
     }
 
     m_mapRenderer.renderJob(this);
 
     return 0; //Item doesn't stretch the section height
 }
 
-void KoReportItemMaps::deserializeData(const QVariant& serialized)
+void KReportItemMaps::deserializeData(const QVariant& serialized)
 {
     QStringList dataList = serialized.toString().split(QLatin1Char(';'));
     if (dataList.size() == 3) {
         m_latitude = dataList[0].toDouble();
         m_longtitude = dataList[1].toDouble();
         m_zoom = dataList[2].toInt();
     } else {
         m_latitude = m_latitudeProperty->value().toReal();
         m_longtitude = m_longitudeProperty->value().toReal();
         m_zoom = m_zoomProperty->value().toInt();
     }
 }
 
-void KoReportItemMaps::renderFinished()
+void KReportItemMaps::renderFinished()
 {
     emit finishedRendering();
 }
 
-OROPicture* KoReportItemMaps::oroImage()
+OROPicture* KReportItemMaps::oroImage()
 {
     return m_oroPicture;
 }
 
-qreal KoReportItemMaps::longtitude() const
+qreal KReportItemMaps::longtitude() const
 {
     return m_longtitude;
 }
 
-qreal KoReportItemMaps::latitude() const
+qreal KReportItemMaps::latitude() const
 {
     return m_latitude;
 }
 
-int KoReportItemMaps::zoom() const
+int KReportItemMaps::zoom() const
 {
     return m_zoom;
 }
 
-QSize KoReportItemMaps::size() const
+QSize KReportItemMaps::size() const
 {
     return m_size.toScene().toSize();
 }
 
-QString KoReportItemMaps::themeId() const
+QString KReportItemMaps::themeId() const
 {
     return m_themeProperty->value().toString();
 }
 
-QVariant KoReportItemMaps::realItemData(const QVariant& itemData) const
+QVariant KReportItemMaps::realItemData(const QVariant& itemData) const
 {
     double lat, lon;
     int zoom;
 
     QStringList dataList = itemData.toString().split(QLatin1Char(';'));
 
     if (dataList.size() == 3) {
         lat = dataList[0].toDouble();
         lon = dataList[1].toDouble();
         zoom = dataList[2].toInt();
     } else if (dataList.size() == 2) {
         lat = dataList[0].toDouble();
         lon = dataList[1].toDouble();
         zoom = m_zoomProperty->value().toInt();
     } else {
         lat = m_latitudeProperty->value().toReal();
         lon = m_longitudeProperty->value().toReal();
         zoom = m_zoomProperty->value().toInt();
     }
 
     if (m_longDataSetFromScript) {
         lon = m_longtitude;
     }
     if (m_latDataSetFromScript) {
         lat = m_latitude;
     }
     if (m_zoomDataSetFromScript) {
         zoom = m_zoom;
     }
     return QString(QLatin1String("%1;%2;%3")).arg(lat).arg(lon).arg(zoom);
 }
diff --git a/src/plugins/maps/KoReportItemMaps.h b/src/plugins/maps/KReportItemMaps.h
similarity index 85%
rename from src/plugins/maps/KoReportItemMaps.h
rename to src/plugins/maps/KReportItemMaps.h
index 5acf1836..61b55003 100644
--- a/src/plugins/maps/KoReportItemMaps.h
+++ b/src/plugins/maps/KReportItemMaps.h
@@ -1,100 +1,100 @@
 /*
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  * Copyright (C) 2011-2015 by Radoslaw Wicik (radoslaw@wicik.pl)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
 #ifndef KREPORTITEMMAPS_H
 #define KREPORTITEMMAPS_H
 
-#include "common/KoReportASyncItemBase.h"
+#include "KReportAsyncItemBase.h"
 
 #include 
 #include 
 
 #include 
 
 
-#include "krpos.h"
-#include "krsize.h"
+#include "KReportPosition.h"
+#include "KReportSize.h"
 #include "MapRenderer.h"
 
 class OROImage;
 class OROPicture;
 class OROPage;
 class OROSection;
 
 namespace Scripting
 {
 class Maps;
 }
 
-class KoReportItemMaps : public KoReportASyncItemBase
+class KReportItemMaps : public KReportAsyncItemBase
 {
     Q_OBJECT
 public:
-    KoReportItemMaps() {
+    KReportItemMaps() {
         createProperties();
     }
-    explicit KoReportItemMaps(QDomNode *element);
-    virtual ~KoReportItemMaps();
+    explicit KReportItemMaps(QDomNode *element);
+    virtual ~KReportItemMaps();
 
     virtual QString typeName() const;
-    virtual int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KRScriptHandler *script);
+    virtual int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KReportScriptHandler *script);
 
     virtual QString itemDataSource() const;
     virtual QVariant realItemData(const QVariant &itemData) const;
 
     void renderFinished();
 
     qreal longtitude() const;
     qreal latitude() const;
     int zoom() const;
     QString themeId() const;
 
     QSize size() const;
     OROPicture* oroImage();
 
 protected:
     KProperty* m_controlSource;
     KProperty* m_latitudeProperty;
     KProperty* m_longitudeProperty;
     KProperty* m_zoomProperty;
     KProperty* m_themeProperty;
 
     void setColumn(const QString&);
 
     qreal m_longtitude;
     qreal m_latitude;
     int m_zoom;
     OROPage *m_pageId;
     OROSection *m_sectionId;
     QPointF m_offset;
     OROPicture * m_oroPicture;
-    MapRenderer m_mapRenderer;
+    KReportMapRenderer m_mapRenderer;
     Marble::MapThemeManager m_themeManager;
 
 private:
     virtual void createProperties();
     void deserializeData(const QVariant& serialized);
 
     bool m_longDataSetFromScript;
     bool m_latDataSetFromScript;
     bool m_zoomDataSetFromScript;
 
     friend class Scripting::Maps;
 };
 
 #endif
diff --git a/src/plugins/maps/MapRenderer.cpp b/src/plugins/maps/KReportMapRenderer.cpp
similarity index 89%
rename from src/plugins/maps/MapRenderer.cpp
rename to src/plugins/maps/KReportMapRenderer.cpp
index ae51362d..d6e2b428 100644
--- a/src/plugins/maps/MapRenderer.cpp
+++ b/src/plugins/maps/KReportMapRenderer.cpp
@@ -1,105 +1,105 @@
 /*
  * Copyright (C) 2015  Radosław Wicik 
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 #include "MapRenderer.h"
 #include "KoReportItemMaps.h"
-#include 
+#include 
 
 #include 
 #include 
 #include 
 #include "marble/HttpDownloadManager.h"
 #include 
 
 #include "kreportplugin_debug.h"
 
-MapRenderer::MapRenderer(QObject* parent)
+KReportMapRenderer::KReportMapRenderer(QObject* parent)
     : QObject(parent)
     , m_currentJob(0)
     , m_renderStatusProxy(this)
 {
     m_marble.setMapThemeId(QLatin1String("earth/openstreetmap/openstreetmap.dgml"));
     m_marble.setShowOverviewMap(false);
     m_marble.setMapQualityForViewContext(Marble::PrintQuality, Marble::Still);
     m_marble.setShowCrosshairs(true);
 
     foreach(Marble::AbstractFloatItem* floatItem, m_marble.floatItems()){
         if(floatItem->nameId() == QString(QLatin1String("navigation"))){
             floatItem->setVisible(false);
         }
     }
 
     connect(m_marble.model()->downloadManager(),SIGNAL(progressChanged(int,int)),this,SLOT(downloadProgres(int,int)));
 
     m_renderStatusProxy.setConnection(m_marble);
     connect(&m_renderStatusProxy,SIGNAL(renderStatusChanged(int)),this,SLOT(onRenderStatusChange(int)));
 }
 
-MapRenderer::~MapRenderer()
+KReportMapRenderer::~KReportMapRenderer()
 {
 
 }
 
-void MapRenderer::renderJob(KoReportItemMaps* reportItemMaps)
+void KReportMapRenderer::renderJob(KReportItemMaps* reportItemMaps)
 {
     m_currentJob = reportItemMaps;
     int zoom = m_currentJob->zoom();
     m_marble.setMapThemeId(m_currentJob->themeId());
     //some themes enable overview map, and this must be disabled after theme switch.
     m_marble.setShowOverviewMap(false);
     m_marble.setFixedSize(m_currentJob->size());
     m_marble.centerOn(m_currentJob->longtitude(), m_currentJob->latitude(), false);
     m_marble.setZoom(zoom);
     m_marble.render(m_currentJob->oroImage()->picture());
     m_currentJob->renderFinished();
 }
 
-void MapRenderer::onRenderStatusChange(int renderStatus)
+void KReportMapRenderer::onRenderStatusChange(int renderStatus)
 {
     if(m_currentJob){
         kreportpluginDebug() << m_marble.renderStatus() << "|" << renderStatus;
         Marble::RenderStatus status = static_cast(renderStatus);
         kreportpluginDebug()
             << this
             << m_currentJob
             << m_currentJob->longtitude()
             << m_currentJob->latitude()
             << m_currentJob->zoom()
             << " | status: " << status;
 
         if(status == Marble::Complete){
             m_currentJob->renderFinished();
         }
     }
 }
 
-void MapRenderer::downloadFinished()
+void KReportMapRenderer::downloadFinished()
 {
     kreportpluginDebug() << "job:" << m_currentJob
     << "(" << m_currentJob->latitude() << "," << m_currentJob->longtitude() << ")";
 }
 
-void MapRenderer::downloadProgres(int active, int queued)
+void KReportMapRenderer::downloadProgres(int active, int queued)
 {
     if(m_currentJob){
         kreportpluginDebug() << "job:" << m_currentJob
         << "(" << m_currentJob->latitude() << "," << m_currentJob->longtitude() << ")"
         << "active/queued:" << active << "/" << queued;
     }
 }
 
diff --git a/src/plugins/maps/MapRenderer.h b/src/plugins/maps/KReportMapRenderer.h
similarity index 92%
rename from src/plugins/maps/MapRenderer.h
rename to src/plugins/maps/KReportMapRenderer.h
index c66dfdcb..5e6e2e43 100644
--- a/src/plugins/maps/MapRenderer.h
+++ b/src/plugins/maps/KReportMapRenderer.h
@@ -1,84 +1,84 @@
 /*
  * Copyright (C) 2015  Radosław Wicik 
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 #ifndef MAPRENDERER_H
 #define MAPRENDERER_H
 
 #include 
 #include 
 #include 
 
 #include "kreportplugin_debug.h"
 
-class KoReportItemMaps;
+class KReportItemMaps;
 namespace Marble{
     /**
      * Workaround Marble error in signal specification.
      *
      * renderStatusChange and renderStateChange signals are using params that are in
      * Marble namespace and are not prefixed with Marble:: in their declaration in
      * MarbleWidget.h this class is workaround of the bug.
      */
     class RenderStatusSignalProxy: public QObject{
         Q_OBJECT
     public:
         explicit RenderStatusSignalProxy(QObject* parent):QObject(parent){};
         void setConnection(MarbleWidget* marble){
             connect(marble,SIGNAL(renderStatusChanged(RenderStatus)),this,SLOT(onRenderStatusChange(RenderStatus)));
             connect(marble,SIGNAL(renderStateChanged(RenderState)),this,SLOT(onRenderStateChange(RenderState)));
         };
         void disconnect(MarbleWidget* marble){
             disconnect(marble,SIGNAL(renderStatusChanged(RenderStatus)),this,SLOT(onRenderStatusChange(RenderStatus)));
             disconnect(marble,SIGNAL(renderStateChanged(RenderState)),this,SLOT(onRenderStateChange(RenderState)));
         }
     public Q_SLOTS:
         void onRenderStatusChange(RenderStatus renderStatus){
             kreportpluginDebug() << "!!!!!!!!!!!!!!!!  STATUS change";
             emit renderStatusChanged(static_cast(renderStatus));
         };
         void onRenderStateChange(const RenderState &state){
             kreportpluginDebug() << "################  STATE change";
             emit renderStatusChanged(static_cast(state.status()));
         };
     Q_SIGNALS:
         void renderStatusChanged(int renderStatus);
     };
 }
 
-class MapRenderer : public QObject
+class KReportMapRenderer : public QObject
 {
     Q_OBJECT
     Q_DISABLE_COPY(MapRenderer)
 public:
-    MapRenderer(QObject* parent = 0);
-    virtual ~MapRenderer();
-    void renderJob(KoReportItemMaps* reportItemMaps);
+    KReportMapRenderer(QObject* parent = 0);
+    virtual ~KReportMapRenderer();
+    void renderJob(KReportItemMaps* reportItemMaps);
 Q_SIGNALS:
     void jobFinished();
 private Q_SLOTS:
     void onRenderStatusChange(int renderStatus);
     void downloadProgres(int active, int queued);
     void downloadFinished();
 
 private:
     Marble::MarbleWidget m_marble;
-    KoReportItemMaps* m_currentJob;
+    KReportItemMaps* m_currentJob;
     Marble::RenderStatusSignalProxy m_renderStatusProxy;
 };
 
 #endif // MAPRENDERER_H
diff --git a/src/plugins/maps/KoReportMapsPlugin.cpp b/src/plugins/maps/KReportMapsPlugin.cpp
similarity index 64%
rename from src/plugins/maps/KoReportMapsPlugin.cpp
rename to src/plugins/maps/KReportMapsPlugin.cpp
index 39eabe0e..c0ace393 100644
--- a/src/plugins/maps/KoReportMapsPlugin.cpp
+++ b/src/plugins/maps/KReportMapsPlugin.cpp
@@ -1,67 +1,67 @@
 /*
    Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
    Copyright (C) 2011 by Radoslaw Wicik (radoslaw@wicik.pl)
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
 */
 
 #include "KoReportMapsPlugin.h"
 #include "KoReportItemMaps.h"
 #include "KoReportDesignerItemMaps.h"
-#include 
+#include 
 #ifdef KREPORT_SCRIPTING
 #include "krscriptmaps.h"
 #endif
 
 
 KREPORT_PLUGIN_FACTORY(KoReportMapsPlugin, "kreport_mapsplugin.json")
 
-KoReportMapsPlugin::KoReportMapsPlugin(QObject *parent, const QVariantList &args) : KoReportPluginInterface(parent)
+KReportMapsPlugin::KReportMapsPlugin(QObject *parent, const QVariantList &args) : KReportPluginInterface(parent)
 {
     Q_UNUSED(args)
 }
 
-KoReportMapsPlugin::~KoReportMapsPlugin()
+KReportMapsPlugin::~KReportMapsPlugin()
 {
 }
 
-QObject* KoReportMapsPlugin::createRendererInstance(const QDomNode& element)
+QObject* KReportMapsPlugin::createRendererInstance(const QDomNode& element)
 {
-    return new KoReportItemMaps(element);
+    return new KReportItemMaps(element);
 }
 
-QObject* KoReportMapsPlugin::createDesignerInstance(const QDomNode& element, KoReportDesigner* designer, QGraphicsScene* scene)
+QObject* KReportMapsPlugin::createDesignerInstance(const QDomNode& element, KoReportDesigner* designer, QGraphicsScene* scene)
 {
-    return new KoReportDesignerItemMaps(element, designer, scene);
+    return new KReportDesignerItemMaps(element, designer, scene);
 }
 
-QObject* KoReportMapsPlugin::createDesignerInstance(KoReportDesigner* designer, QGraphicsScene* scene, const QPointF& pos)
+QObject* KReportMapsPlugin::createDesignerInstance(KoReportDesigner* designer, QGraphicsScene* scene, const QPointF& pos)
 {
-    return new KoReportDesignerItemMaps(designer, scene, pos);
+    return new KReportDesignerItemMaps(designer, scene, pos);
 }
 
 #ifdef KREPORT_SCRIPTING
-QObject* KoReportMapsPlugin::createScriptInstance(KoReportItemBase* /*item*/)
+QObject* KoReportMapsPlugin::createScriptInstance(KReportItemBase* /*item*/)
 {
     /*KoReportItemMaps *image = dynamic_cast(item);
     if (image) {
         return new Scripting::Maps(image);
     }*/
     return 0;
 }
 #endif
 
 #include "KoReportMapsPlugin.moc"
diff --git a/src/plugins/maps/KoReportMapsPlugin.h b/src/plugins/maps/KReportMapsPlugin.h
similarity index 78%
rename from src/plugins/maps/KoReportMapsPlugin.h
rename to src/plugins/maps/KReportMapsPlugin.h
index e8e72c61..6b6ad9fd 100644
--- a/src/plugins/maps/KoReportMapsPlugin.h
+++ b/src/plugins/maps/KReportMapsPlugin.h
@@ -1,40 +1,40 @@
 /*
    Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk)
    Copyright (C) 2011 by Radoslaw Wicik (radoslaw@wicik.pl)
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
    Boston, MA 02110-1301, USA.
 */
 
-#ifndef KOREPORTMAPSPLUGIN_H
-#define KOREPORTMAPSPLUGIN_H
+#ifndef KREPORTMAPSPLUGIN_H
+#define KREPORTMAPSPLUGIN_H
 
-#include "KoReportPluginInterface.h"
+#include "KReportPluginInterface.h"
 
-class KoReportMapsPlugin : public KoReportPluginInterface
+class KReportMapsPlugin : public KReportPluginInterface
 {
     public:
-    explicit KoReportMapsPlugin(QObject *parent, const QVariantList &args = QVariantList());
-    virtual ~KoReportMapsPlugin();
+    explicit KReportMapsPlugin(QObject *parent, const QVariantList &args = QVariantList());
+    virtual ~KReportMapsPlugin();
 
     virtual QObject* createRendererInstance(const QDomNode& element);
     virtual QObject* createDesignerInstance(const QDomNode& element, KoReportDesigner* , QGraphicsScene* scene);
     virtual QObject* createDesignerInstance(KoReportDesigner* , QGraphicsScene* scene, const QPointF& pos);
 #ifdef KREPORT_SCRIPTING
-    virtual QObject* createScriptInstance(KoReportItemBase* item);
+    virtual QObject* createScriptInstance(KReportItemBase* item);
 #endif
 };
 
 #endif // KOREPORTMAPSPLUGIN_H
diff --git a/src/plugins/maps/krscriptmaps.cpp b/src/plugins/maps/KReportScriptMaps.cpp
similarity index 98%
rename from src/plugins/maps/krscriptmaps.cpp
rename to src/plugins/maps/KReportScriptMaps.cpp
index ee1a1920..97eae4c8 100644
--- a/src/plugins/maps/krscriptmaps.cpp
+++ b/src/plugins/maps/KReportScriptMaps.cpp
@@ -1,76 +1,76 @@
 /*
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
 #include "krscriptmaps.h"
 
 #include "KoReportItemMaps.h"
 
 
 namespace Scripting
 {
 
-Maps::Maps(KoReportItemMaps *i)
+Maps::Maps(KReportItemMaps *i)
 {
     m_map = i;
     m_map->m_latDataSetFromScript = false;
     m_map->m_longDataSetFromScript = false;
     m_map->m_zoomDataSetFromScript = false;
 }
 
 Maps::~Maps()
 {
 }
 
 QPointF Maps::position() const
 {
     return m_map->m_pos.toPoint();
 }
 
 void Maps::setPosition(const QPointF& p)
 {
     m_map->m_pos.setPointPos(p);
 }
 
 QSizeF Maps::size() const
 {
     return m_map->m_size.toPoint();
 }
 
 void Maps::setSize(const QSizeF& s)
 {
     m_map->m_size.setPointSize(s);
 }
 
 void Maps::setLatitude(qreal latitude)
 {
     m_map->m_latitude = latitude;
     m_map->m_latDataSetFromScript = true;
 }
 
 void Maps::setLongitude(qreal longitude)
 {
     m_map->m_longtitude = longitude;
     m_map->m_longDataSetFromScript = true;
 }
 
 void Maps::setZoom(int zoom)
 {
     m_map->m_zoom = zoom;
     m_map->m_zoomDataSetFromScript = true;
 }
 
 }
diff --git a/src/plugins/maps/krscriptmaps.h b/src/plugins/maps/KReportScriptMaps.h
similarity index 94%
rename from src/plugins/maps/krscriptmaps.h
rename to src/plugins/maps/KReportScriptMaps.h
index fb53089d..8a780dc3 100644
--- a/src/plugins/maps/krscriptmaps.h
+++ b/src/plugins/maps/KReportScriptMaps.h
@@ -1,75 +1,75 @@
 /*
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  * Copyright (C) 2011 by Radoslaw Wicik (rockford@wicik.pl)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 #ifndef SCRIPTINGKRSCRIPTMAPS_H
 #define SCRIPTINGKRSCRIPTMAPS_H
 
 #include 
 #include 
 #include 
 
-class KoReportItemMaps;
+class KReportItemMaps;
 
 namespace Scripting
 {
 
 class Maps : public QObject
 {
     Q_OBJECT
 public:
-    explicit Maps(KoReportItemMaps *i);
+    explicit Maps(KReportItemMaps *i);
 
     ~Maps();
 
 public Q_SLOTS:
     /**
     * Get the position of the map
     * @return position in points
      */
     QPointF position() const;
 
     /**
      * Sets the position of the map in points
      * @param Position
      */
     void setPosition(const QPointF &p);
 
     /**
      * Get the size of the map
      * @return size in points
      */
     QSizeF size() const;
 
     /**
      * Set the size of the map in points
      * @param Size
      */
     void setSize(const QSizeF &s);
 
     void setLatitude(qreal latitude);
 
     void setLongitude(qreal longitude);
 
     void setZoom(int zoom);
 
 private:
-    KoReportItemMaps *m_map;
+    KReportItemMaps *m_map;
 };
 
 }
 
 #endif //SCRIPTINGKRSCRIPTMAPS_H
diff --git a/src/plugins/web/KoReportDesignerItemWeb.cpp b/src/plugins/web/KReportDesignerItemWeb.cpp
similarity index 77%
rename from src/plugins/web/KoReportDesignerItemWeb.cpp
rename to src/plugins/web/KReportDesignerItemWeb.cpp
index bf4f2d30..35ea4c61 100644
--- a/src/plugins/web/KoReportDesignerItemWeb.cpp
+++ b/src/plugins/web/KReportDesignerItemWeb.cpp
@@ -1,126 +1,126 @@
 /* This file is part of the KDE project
    Copyright Shreya Pandit 
    Copyright 2011 Adam Pigg 
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  * Boston, MA 02110-1301, USA.
 */
 
 #include "KoReportDesignerItemWeb.h"
 #include 
 #include 
 
 #include 
 #include 
 
 #include 
 #include 
 #include 
 #include 
 #include "kreportplugin_debug.h"
 
-void KoReportDesignerItemWeb::init(QGraphicsScene *scene, KoReportDesigner *d) //done,compared,add function if necessary
+void KReportDesignerItemWeb::init(QGraphicsScene *scene, KoReportDesigner *d) //done,compared,add function if necessary
 {
     kreportpluginDebug();
     if (scene)
         scene->addItem(this);
 
     connect(m_set, SIGNAL(propertyChanged(KPropertySet&,KProperty&)), this, SLOT(slotPropertyChanged(KPropertySet&,KProperty&)));
     KoReportDesignerItemRectBase::init(&m_pos, &m_size, m_set, d);
     setZValue(Z);
 }
 
-KoReportDesignerItemWeb::KoReportDesignerItemWeb(KoReportDesigner *rw, QGraphicsScene *scene,
+KReportDesignerItemWeb::KReportDesignerItemWeb(KoReportDesigner *rw, QGraphicsScene *scene,
                                                  const QPointF &pos)     //done,compared
     : KoReportDesignerItemRectBase(rw)
 {
     Q_UNUSED(pos);
     init(scene, rw);
-    setSceneRect(properRect(*rw, KOREPORT_ITEM_RECT_DEFAULT_WIDTH, KOREPORT_ITEM_RECT_DEFAULT_WIDTH));
+    setSceneRect(properRect(*rw, KREPORT_ITEM_RECT_DEFAULT_WIDTH, KREPORT_ITEM_RECT_DEFAULT_WIDTH));
     m_name->setValue(m_reportDesigner->suggestEntityName(typeName()));
 }
 
-KoReportDesignerItemWeb::KoReportDesignerItemWeb(QDomNode *element, KoReportDesigner *rw,
+KReportDesignerItemWeb::KReportDesignerItemWeb(QDomNode *element, KoReportDesigner *rw,
                                                  QGraphicsScene *scene)      //done,compared
     : KoReportItemWeb(element), KoReportDesignerItemRectBase(rw)
 {
     init(scene, rw);
     setSceneRect(m_pos.toScene(), m_size.toScene());
 }
 
-KoReportDesignerItemWeb *KoReportDesignerItemWeb::clone() //done,compared
+KReportDesignerItemWeb *KReportDesignerItemWeb::clone() //done,compared
 {
     QDomDocument d;
     QDomElement e = d.createElement("clone");
     QDomNode n;
     buildXML(&d, &e);
     n = e.firstChild();
-    return new KoReportDesignerItemWeb(n, designer(), 0);
+    return new KReportDesignerItemWeb(n, designer(), 0);
 }
 
-KoReportDesignerItemWeb::~KoReportDesignerItemWeb() //done,compared
+KReportDesignerItemWeb::~KReportDesignerItemWeb() //done,compared
 {
     // do we need to clean anything up?
 }
 
-void KoReportDesignerItemWeb::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
+void KReportDesignerItemWeb::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
 {
     Q_UNUSED(option);
     Q_UNUSED(widget);
 
     painter->drawRect(QGraphicsRectItem::rect());
     painter->drawText(rect(), 0, dataSourceAndObjectTypeName(itemDataSource(), "web-view"));
 
     painter->setBackgroundMode(Qt::TransparentMode);
 
     drawHandles(painter);
 }
 
-void KoReportDesignerItemWeb::buildXML(QDomDocument *doc, QDomElement *parent)
+void KReportDesignerItemWeb::buildXML(QDomDocument *doc, QDomElement *parent)
 {
     Q_UNUSED(doc);
     Q_UNUSED(parent);
     QDomElement entity = doc->createElement(QLatin1String("report:") + typeName());
 
     // properties
     addPropertyAsAttribute(&entity, m_controlSource);
     addPropertyAsAttribute(&entity, m_name);
     entity.setAttribute("report:z-index", zValue());
     buildXMLRect(doc, &entity, &m_pos, &m_size);
     parent->appendChild(entity);
 }
 
-void KoReportDesignerItemWeb::slotPropertyChanged(KPropertySet &s, KProperty &p)
+void KReportDesignerItemWeb::slotPropertyChanged(KPropertySet &s, KProperty &p)
 {
     if (p.name() == "Name") {
         if (!m_reportDesigner->isEntityNameUnique(p.value().toString(), this)) {
             p.setValue(m_oldName);
         }
         else {
             m_oldName = p.value().toString();
         }
     }
 
     KoReportDesignerItemRectBase::propertyChanged(s, p);
     if (m_reportDesigner) {
         m_reportDesigner->setModified(true);
     }
 }
 
-void KoReportDesignerItemWeb::mousePressEvent(QGraphicsSceneMouseEvent *event)
+void KReportDesignerItemWeb::mousePressEvent(QGraphicsSceneMouseEvent *event)
 {
     m_controlSource->setListData(m_reportDesigner->fieldKeys(), m_reportDesigner->fieldNames());
     KoReportDesignerItemRectBase::mousePressEvent(event);
 }
diff --git a/src/plugins/web/KoReportDesignerItemWeb.h b/src/plugins/web/KReportDesignerItemWeb.h
similarity index 75%
rename from src/plugins/web/KoReportDesignerItemWeb.h
rename to src/plugins/web/KReportDesignerItemWeb.h
index 1ebc5939..555b888d 100644
--- a/src/plugins/web/KoReportDesignerItemWeb.h
+++ b/src/plugins/web/KReportDesignerItemWeb.h
@@ -1,55 +1,55 @@
 /* This file is part of the KDE project
    Copyright Shreya Pandit 
    Copyright 2011 Adam Pigg 
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  * Boston, MA 02110-1301, USA.
 */
 
-#ifndef KOREPORTDESIGNERITEMWEB_H
-#define KOREPORTDESIGNERITEMWEB_H
+#ifndef KREPORTDESIGNERITEMWEB_H
+#define KREPORTDESIGNERITEMWEB_H
 
-#include "KoReportDesignerItemRectBase.h"
+#include 
 #include "KoReportItemWeb.h"
 
 class QGraphicsScene;
 
 /**
 */
-class KoReportDesignerItemWeb : public KoReportItemWeb, public KoReportDesignerItemRectBase
+class KReportDesignerItemWeb : public KReportItemWeb, public KReportDesignerItemRectBase
 {
     Q_OBJECT
 public:
-    KoReportDesignerItemWeb(KoReportDesigner *rw, QGraphicsScene *scene, const QPointF &pos);
-    KoReportDesignerItemWeb(QDomNode *element, KoReportDesigner *rw, QGraphicsScene *scene);
-    virtual ~KoReportDesignerItemWeb();
+    KReportDesignerItemWeb(KoReportDesigner *rw, QGraphicsScene *scene, const QPointF &pos);
+    KReportDesignerItemWeb(QDomNode *element, KoReportDesigner *rw, QGraphicsScene *scene);
+    virtual ~KReportDesignerItemWeb();
 
     void init(QGraphicsScene *scene);
 
     virtual void buildXML(QDomDocument *doc, QDomElement *parent);
     virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget);
-    virtual KoReportDesignerItemWeb *clone();
+    virtual KReportDesignerItemWeb *clone();
 
 protected:
     virtual void mousePressEvent(QGraphicsSceneMouseEvent *event);
 
 private:
     void init(QGraphicsScene *, KoReportDesigner *r);
 
 private Q_SLOTS:
     void slotPropertyChanged(KPropertySet &, KProperty &);
 };
 
 #endif
diff --git a/src/plugins/web/KoReportItemWeb.cpp b/src/plugins/web/KReportItemWeb.cpp
similarity index 86%
rename from src/plugins/web/KoReportItemWeb.cpp
rename to src/plugins/web/KReportItemWeb.cpp
index 35b2c35d..d8b22209 100644
--- a/src/plugins/web/KoReportItemWeb.cpp
+++ b/src/plugins/web/KReportItemWeb.cpp
@@ -1,139 +1,139 @@
 /* This file is part of the KDE project
    Copyright Shreya Pandit 
    Copyright 2011 Adam Pigg 
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  * Boston, MA 02110-1301, USA.
 */
 
 #include "KoReportItemWeb.h"
-#include 
+#include 
 
 #include 
 #include 
 
 #include 
 #include 
 #include 
 #include "kreportplugin_debug.h"
 
-KoReportItemWeb::KoReportItemWeb(): m_rendering(false)
+KReportItemWeb::KReportItemWeb(): m_rendering(false)
 {
     createProperties();
     init();
 }
 
-KoReportItemWeb::KoReportItemWeb(QDomNode *element)
+KReportItemWeb::KReportItemWeb(QDomNode *element)
 {
     createProperties();
     init();
     QDomNodeList nl = element->childNodes();
     QString n;
     QDomNode node;
     QDomElement e = element->toElement();
 
     m_controlSource->setValue(element->toElement().attribute("report:item-data-source"));
     m_name->setValue(element->toElement().attribute("report:name"));
     Z = element->toElement().attribute("report:z-index").toDouble();
     parseReportRect(element->toElement(), &m_pos, &m_size);
     for (int i = 0; i < nl.count(); i++) {
         node = nl.item(i);
         n = node.nodeName();
     }
 }
 
-void KoReportItemWeb::init()
+void KReportItemWeb::init()
 {
     m_webPage = new QWebPage();
     connect(m_webPage, SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool)));
 }
 
-void KoReportItemWeb::createProperties()
+void KReportItemWeb::createProperties()
 {
     m_set = new KPropertySet(0, "web");
 
     m_controlSource = new KProperty("item-data-source", QStringList(),
                                     QStringList(), QString(), tr("Data Source"));
     m_set->addProperty(m_controlSource);
     addDefaultProperties();
 }
 
-KoReportItemWeb::~KoReportItemWeb()
+KReportItemWeb::~KReportItemWeb()
 {
     delete m_set;
 }
-QString KoReportItemWeb::typeName() const
+QString KReportItemWeb::typeName() const
 {
     return "web";
 }
 
-void KoReportItemWeb::loadFinished(bool)
+void KReportItemWeb::loadFinished(bool)
 {
     kreportpluginDebug() << m_rendering;
     if (m_rendering) {
         OROPicture * pic = new OROPicture();
         m_webPage->setViewportSize(m_size.toScene().toSize());
         m_webPage->mainFrame()->setScrollBarPolicy(Qt::Horizontal, Qt::ScrollBarAlwaysOff);
         m_webPage->mainFrame()->setScrollBarPolicy(Qt::Vertical, Qt::ScrollBarAlwaysOff);
 
         QPainter p(pic->picture());
 
         m_webPage->mainFrame()->render(&p);
 
         QPointF pos = m_pos.toScene();
         QSizeF size = m_size.toScene();
 
         pos += m_targetOffset;
 
         pic->setPosition(pos);
         pic->setSize(size);
         if (m_targetPage) m_targetPage->addPrimitive(pic, false, true);
 
         OROPicture *p2 = dynamic_cast(pic->clone());
         p2->setPosition(m_pos.toPoint());
         if (m_targetSection) m_targetSection->addPrimitive(p2);
 
         m_rendering = false;
         emit(finishedRendering());
     }
 }
 
-int KoReportItemWeb::renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset,
-                                      const QVariant &data, KRScriptHandler *script)
+int KReportItemWeb::renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset,
+                                      const QVariant &data, KReportScriptHandler *script)
 {
     Q_UNUSED(script);
 
     m_rendering = true;
 
     kreportpluginDebug() << data;
 
     m_targetPage = page;
     m_targetSection = section;
     m_targetOffset = offset;
 
     QUrl url = QUrl::fromUserInput(data.toString());
     if (url.isValid()) {
         m_webPage->mainFrame()->load(url);
     } else {
         m_webPage->mainFrame()->setHtml(data.toString());
     }
 
     return 0; //Item doesn't stretch the section height
 }
 
-QString KoReportItemWeb::itemDataSource() const
+QString KReportItemWeb::itemDataSource() const
 {
     return m_controlSource->value().toString();
 }
diff --git a/src/plugins/web/KoReportItemWeb.h b/src/plugins/web/KReportItemWeb.h
similarity index 79%
rename from src/plugins/web/KoReportItemWeb.h
rename to src/plugins/web/KReportItemWeb.h
index 51bdcfa7..2e70212b 100644
--- a/src/plugins/web/KoReportItemWeb.h
+++ b/src/plugins/web/KReportItemWeb.h
@@ -1,74 +1,74 @@
 /* This file is part of the KDE project
    Copyright Shreya Pandit 
    Copyright 2011 Adam Pigg 
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  * Boston, MA 02110-1301, USA.
 */
 
-#ifndef KOREPORTITEMWEB_H
-#define KOREPORTITEMWEB_H
+#ifndef KREPORTITEMWEB_H
+#define KREPORTITEMWEB_H
 
-#include "KoReportASyncItemBase.h"
-#include "krpos.h"
-#include "krsize.h"
-#include "KoReportData.h"
+#include "KReportAsyncItemBase.h"
+#include "KReportPosition.h"
+#include "KReportSize.h"
+#include "KReportData.h"
 
 #include 
 #include 
 
 class QUrl;
 class QWebPage;
 
 namespace Scripting
 {
 class Web;
 }
 
 /**
 */
-class KoReportItemWeb : public KoReportASyncItemBase
+class KReportItemWeb : public KReportAsyncItemBase
 {
     Q_OBJECT
 public:
-    KoReportItemWeb();
-    explicit KoReportItemWeb(QDomNode *element);
-    virtual ~KoReportItemWeb();
+    KReportItemWeb();
+    explicit KReportItemWeb(QDomNode *element);
+    virtual ~KReportItemWeb();
 
     virtual QString typeName() const;
-    virtual int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KRScriptHandler *script);
+    virtual int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KReportScriptHandler *script);
     virtual QString itemDataSource() const;
 
 private Q_SLOTS:
     void loadFinished(bool);
 
 private:
     void init();
 
     bool m_rendering;
     OROPage *m_targetPage;
     OROSection *m_targetSection;
     QPointF m_targetOffset;
 
 protected:
     virtual void createProperties();
 
     KProperty *m_controlSource;
     QWebPage *m_webPage;
 
     friend class Scripting::Web;
 };
 
 #endif
diff --git a/src/plugins/web/KoReportWebPlugin.cpp b/src/plugins/web/KReportWebPlugin.cpp
similarity index 73%
rename from src/plugins/web/KoReportWebPlugin.cpp
rename to src/plugins/web/KReportWebPlugin.cpp
index d0a6970f..7b4aed7a 100644
--- a/src/plugins/web/KoReportWebPlugin.cpp
+++ b/src/plugins/web/KReportWebPlugin.cpp
@@ -1,70 +1,70 @@
 /* This file is part of the KDE project
    Copyright Shreya Pandit 
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  * Boston, MA 02110-1301, USA.
 */
 
 #include "KoReportWebPlugin.h"
 #include "KoReportDesignerItemWeb.h"
 #include "KoReportPluginInfo.h"
 #include 
 
 K_EXPORT_KOREPORT_ITEMPLUGIN(KoReportWebPlugin, webplugin)
 
-KoReportWebPlugin::KoReportWebPlugin(QObject *parent, const QVariantList &args)
-    : KoReportPluginInterface(parent)
+KReportWebPlugin::KReportWebPlugin(QObject *parent, const QVariantList &args)
+    : KReportPluginInterface(parent)
 {
     Q_UNUSED(args)
 
     KoReportPluginInfo *info = new KoReportPluginInfo();
     info->setClassName("web");
     info->setName(tr("Web"));
     info->setIcon(koIcon("report_web_element"));
     info->setPriority(40);
     setInfo(info);
 }
 
-KoReportWebPlugin::~KoReportWebPlugin()
+KReportWebPlugin::~KReportWebPlugin()
 {
 }
 
-QObject *KoReportWebPlugin::createRendererInstance(const QDomNode &element)
+QObject *KReportWebPlugin::createRendererInstance(const QDomNode &element)
 {
     return new KoReportItemWeb(element);
 }
 
-QObject *KoReportWebPlugin::createDesignerInstance(const QDomNode &element, KoReportDesigner *designer,
+QObject *KReportWebPlugin::createDesignerInstance(const QDomNode &element, KoReportDesigner *designer,
                                                    QGraphicsScene *scene)
 {
-    return new KoReportDesignerItemWeb(element, designer, scene);
+    return new KReportDesignerItemWeb(element, designer, scene);
 }
 
-QObject *KoReportWebPlugin::createDesignerInstance(KoReportDesigner *designer,
+QObject *KReportWebPlugin::createDesignerInstance(KoReportDesigner *designer,
                                                    QGraphicsScene *scene,const QPointF &pos)
 {
-    return new KoReportDesignerItemWeb(designer, scene, pos);
+    return new KReportDesignerItemWeb(designer, scene, pos);
 }
 
 #ifdef KREPORT_SCRIPTING
-QObject *KoReportWebPlugin::createScriptInstance(KoReportItemBase *item)
+QObject *KoReportWebPlugin::createScriptInstance(KReportItemBase *item)
 {
     Q_UNUSED(item);
 //   KoReportItemweb *image = dynamic_cast(item);
     // if (image) {
     //   return new Scripting::Web(image);
     return 0;
 }
 #endif
diff --git a/src/plugins/web/KoReportWebPlugin.h b/src/plugins/web/KReportWebPlugin.h
similarity index 79%
rename from src/plugins/web/KoReportWebPlugin.h
rename to src/plugins/web/KReportWebPlugin.h
index ab353c1f..8314f5b7 100644
--- a/src/plugins/web/KoReportWebPlugin.h
+++ b/src/plugins/web/KReportWebPlugin.h
@@ -1,42 +1,42 @@
 /* This file is part of the KDE project
    Copyright Shreya Pandit 
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Library General Public
    License as published by the Free Software Foundation; either
    version 2 of the License, or (at your option) any later version.
 
    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Library General Public License for more details.
 
    You should have received a copy of the GNU Library General Public License
    along with this library; see the file COPYING.LIB.  If not, write to
    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  * Boston, MA 02110-1301, USA.
 */
 
-#ifndef KOREPORTWEBPLUGIN_H
-#define KOREPORTWEBPLUGIN_H
+#ifndef KREPORTWEBPLUGIN_H
+#define KREPORTWEBPLUGIN_H
 
-#include "KoReportPluginInterface.h"
+#include "KReportPluginInterface.h"
 
-class KoReportWebPlugin : public KoReportPluginInterface
+class KReportWebPlugin : public KReportPluginInterface
 {
     Q_OBJECT
 public:
-    explicit KoReportWebPlugin(QObject *parent, const QVariantList &args = QVariantList());
-    virtual ~KoReportWebPlugin();
+    explicit KReportWebPlugin(QObject *parent, const QVariantList &args = QVariantList());
+    virtual ~KReportWebPlugin();
 
     virtual QObject *createRendererInstance(const QDomNode &element);
     virtual QObject *createDesignerInstance(const QDomNode &element, KoReportDesigner *designer,
                                             QGraphicsScene *scene);
     virtual QObject *createDesignerInstance(KoReportDesigner *designer,
                                             QGraphicsScene *scene,const QPointF &pos);
 #ifdef KREPORT_SCRIPTING
-    virtual QObject *createScriptInstance(KoReportItemBase *item);
+    virtual QObject *createScriptInstance(KReportItemBase *item);
 #endif
 };
 
 #endif // KOREPORTWEBPLUGIN_H
diff --git a/src/renderer/KoReportASyncItemManager.cpp b/src/renderer/KReportAsyncItemManager_p.cpp
similarity index 75%
rename from src/renderer/KoReportASyncItemManager.cpp
rename to src/renderer/KReportAsyncItemManager_p.cpp
index 1d99d962..b3619904 100644
--- a/src/renderer/KoReportASyncItemManager.cpp
+++ b/src/renderer/KReportAsyncItemManager_p.cpp
@@ -1,78 +1,91 @@
 /*  This file is part of the KDE project
     Copyright (C) 2011  Adam Pigg 
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     License as published by the Free Software Foundation; either
     version 2.1 of the License, or (at your option) any later version.
 
     This library is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     Lesser General Public License for more details.
 
     You should have received a copy of the GNU Lesser General Public
     License along with this library; if not, write to the Free Software
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
 
-#include "KoReportASyncItemManager.h"
-#include "common/KoReportASyncItemBase.h"
-
+#include "KReportAsyncItemManager_p.h"
+#include "KReportAsyncItemBase.h"
 #include "kreport_debug.h"
 
-KoReportASyncItemManager::KoReportASyncItemManager(QObject* parent): QObject(parent)
+namespace KReportPrivate {
+  
+class RenderData {
+public:
+    KReportAsyncItemBase* item;
+    OROPage* page;
+    OROSection* section;
+    QPointF offset;
+    QVariant data;
+    KReportScriptHandler* script;
+};
+
+AsyncItemManager::AsyncItemManager(QObject* parent): QObject(parent)
 {
 
 }
 
-KoReportASyncItemManager::~KoReportASyncItemManager()
+AsyncItemManager::~AsyncItemManager()
 {
 
 }
 
-void KoReportASyncItemManager::addItem(KoReportASyncItemBase* item, OROPage* page, OROSection* section, QPointF offset, QVariant data, KRScriptHandler* script)
+void AsyncItemManager::addItem(KReportAsyncItemBase* item, OROPage* page, OROSection* section, QPointF offset, QVariant data, KReportScriptHandler* script)
 {
     RenderData *rdata = new RenderData();
     rdata->item = item;
     rdata->page = page;
     rdata->section = section;
     rdata->offset = offset;
     rdata->data = data;
 #ifdef KREPORT_SCRIPTING
     rdata->script = script;
 #else
     Q_UNUSED(script);
 #endif
     m_renderList.enqueue(rdata);
 
     //Just connect the first instance
     if (!m_itemList.contains(item)) {
         m_itemList.append(item);
         connect(item, SIGNAL(finishedRendering()), this, SLOT(itemFinished()));
     }
     //kreportDebug() << m_renderList.count();
 }
 
-void KoReportASyncItemManager::itemFinished()
+void AsyncItemManager::itemFinished()
 {
     //kreportDebug();
     if (m_renderList.count() > 0) {
         RenderData *rdata = m_renderList.dequeue();
         rdata->item->renderSimpleData(rdata->page, rdata->section, rdata->offset, rdata->data, rdata->script);
     } else {
         emit(finished());
     }
 }
 
-void KoReportASyncItemManager::startRendering()
+void AsyncItemManager::startRendering()
 {
     //kreportDebug();
     if (m_renderList.count() > 0) {
         RenderData *rdata = m_renderList.dequeue();
         rdata->item->renderSimpleData(rdata->page, rdata->section, rdata->offset, rdata->data, rdata->script);
     } else {
         emit(finished());
     }
 }
+
+}
diff --git a/src/renderer/KoReportASyncItemManager.h b/src/renderer/KReportAsyncItemManager_p.h
similarity index 62%
rename from src/renderer/KoReportASyncItemManager.h
rename to src/renderer/KReportAsyncItemManager_p.h
index a8bd0a51..094c268e 100644
--- a/src/renderer/KoReportASyncItemManager.h
+++ b/src/renderer/KReportAsyncItemManager_p.h
@@ -1,63 +1,57 @@
 /*  This file is part of the KDE project
     Copyright (C) 2011  Adam Pigg 
 
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     License as published by the Free Software Foundation; either
     version 2.1 of the License, or (at your option) any later version.
 
     This library is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     Lesser General Public License for more details.
 
     You should have received a copy of the GNU Lesser General Public
     License along with this library; if not, write to the Free Software
     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */
 
 
-#ifndef KOREPORTASYNCITEMMANAGER_H
-#define KOREPORTASYNCITEMMANAGER_H
+#ifndef KREPORTASYNCITEMMANAGER_H
+#define KREPORTASYNCITEMMANAGER_H
 
 #include "config-kreport.h"
+#include "KReportAsyncItemBase.h"
 
 #include 
 #include 
 
-#include "KoReportASyncItemBase.h"
+namespace KReportPrivate {
+  
+class RenderData;
 
-class RenderData {
-public:
-    KoReportASyncItemBase* item;
-    OROPage* page;
-    OROSection* section;
-    QPointF offset;
-    QVariant data;
-    KRScriptHandler* script;
-};
-
-class KoReportASyncItemManager : public QObject
+class AsyncItemManager : public QObject
 {
     Q_OBJECT
 
 public:
-    explicit KoReportASyncItemManager(QObject *parent);
-    virtual ~KoReportASyncItemManager();
+    explicit AsyncItemManager(QObject *parent);
+    virtual ~AsyncItemManager();
 
-    void addItem(KoReportASyncItemBase *item, OROPage *page, OROSection *section, QPointF offset, QVariant data, KRScriptHandler *script);
+    void addItem(KReportAsyncItemBase *item, OROPage *page, OROSection *section, QPointF offset, QVariant data, KReportScriptHandler *script);
 
     void startRendering();
 
 Q_SIGNALS:
     void finished();
 
 private Q_SLOTS:
     void itemFinished();
 
 private:
     QQueue m_renderList;
-    QList m_itemList;
+    QList m_itemList;
 };
 
-#endif // KOREPORTASYNCITEMMANAGER_H
+}
+#endif // KREPORTASYNCITEMMANAGER_H
diff --git a/src/renderer/KoReportHTMLCSSRenderer.cpp b/src/renderer/KReportHTMLCSSRenderer_p.cpp
similarity index 89%
rename from src/renderer/KoReportHTMLCSSRenderer.cpp
rename to src/renderer/KReportHTMLCSSRenderer_p.cpp
index 87158243..7ed7cf53 100644
--- a/src/renderer/KoReportHTMLCSSRenderer.cpp
+++ b/src/renderer/KReportHTMLCSSRenderer_p.cpp
@@ -1,218 +1,221 @@
 /* This file is part of the KDE project
  * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com)
  * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
  * License as published by the Free Software Foundation; either
  * version 2.1 of the License, or (at your option) any later version.
  *
  * This library is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library.  If not, see .
  */
 
-#include "KoReportHTMLCSSRenderer.h"
-#include "common/renderobjects.h"
+#include "KReportHTMLCSSRenderer_p.h"
+#include "KReportRenderObjects.h"
+#include "kreport_debug.h"
 
 #include 
-
 #include 
 #include 
 #include 
-#include "kreport_debug.h"
 
-KoReportHTMLCSSRenderer::KoReportHTMLCSSRenderer()
+namespace KReportPrivate {
+  
+HTMLCSSRenderer::HTMLCSSRenderer()
 {
 
 }
 
-KoReportHTMLCSSRenderer::~KoReportHTMLCSSRenderer()
+HTMLCSSRenderer::~HTMLCSSRenderer()
 {
 
 }
 
-bool KoReportHTMLCSSRenderer::render(const KoReportRendererContext& context, ORODocument *document, int page)
+bool HTMLCSSRenderer::render(const KReportRendererContext& context, ORODocument *document, int page)
 {
     Q_UNUSED(page);
     QTemporaryFile tempHtmlFile; // auto removed by default on destruction
     if (!tempHtmlFile.open()) {
         kreportWarning() << "Couldn't create temporary file to write into";
         return false;
     }
 
     QTextStream out(&tempHtmlFile);
 
     QString dirSuffix = QLatin1String(".files");
     QDir tempDir;
     QFileInfo fi(tempHtmlFile);
 
     QString tempFileName = fi.absoluteFilePath();
     m_tempDirName = tempFileName + dirSuffix;
     m_actualDirName = context.destinationUrl.fileName() + dirSuffix;
 
     if (!tempDir.mkpath(m_tempDirName))
         return false;
 
     out << renderCSS(document);
 
     out.flush();
     tempHtmlFile.close();
 
     bool status = true; //!< @todo KIO
 //    if (KIO::NetAccess::upload(tempFileName, context.destinationUrl, 0) && KIO::NetAccess::dircopy(QUrl(m_tempDirName),  QUrl(context.destinationUrl.url() + dirSuffix), 0)) {
 //        status = true;
 //    }
 
     // cleanup the temporary directory
     tempDir.setPath(m_tempDirName);
     QStringList fileList = tempDir.entryList();
     foreach(const QString& fileName, fileList) {
         tempDir.remove(fileName);
     }
     tempDir.rmdir(m_tempDirName);
 
     return status;
 }
 
 //! @todo use QTextStream for efficiency
-QString KoReportHTMLCSSRenderer::renderCSS(ORODocument *document)
+QString HTMLCSSRenderer::renderCSS(ORODocument *document)
 {
     QString html;
     QString body;
     QString style;
     QStringList styles;
     int styleindex;
     bool renderedPageHead = false;
     bool renderedPageFoot = false;
 
     QDir d(m_tempDirName);
     // Render Each Section
     for (long s = 0; s < document->sections(); s++) {
         OROSection *section = document->section(s);
 
-        if (section->type() == KRSectionData::GroupHeader ||
-                section->type() == KRSectionData::GroupFooter ||
-                section->type() == KRSectionData::Detail ||
-                section->type() == KRSectionData::ReportHeader ||
-                section->type() == KRSectionData::ReportFooter ||
-                (section->type() == KRSectionData::PageHeaderAny && !renderedPageHead) ||
-                (section->type() == KRSectionData::PageFooterAny && !renderedPageFoot && s > document->sections() - 2)) { //render the page foot right at the end, it will either be the last or second last section if there is a report footer
-            if (section->type() == KRSectionData::PageHeaderAny)
+        if (section->type() == KReportSectionData::GroupHeader ||
+                section->type() == KReportSectionData::GroupFooter ||
+                section->type() == KReportSectionData::Detail ||
+                section->type() == KReportSectionData::ReportHeader ||
+                section->type() == KReportSectionData::ReportFooter ||
+                (section->type() == KReportSectionData::PageHeaderAny && !renderedPageHead) ||
+                (section->type() == KReportSectionData::PageFooterAny && !renderedPageFoot && s > document->sections() - 2)) { //render the page foot right at the end, it will either be the last or second last section if there is a report footer
+            if (section->type() == KReportSectionData::PageHeaderAny)
                 renderedPageHead = true;
 
-            if (section->type() == KRSectionData::PageFooterAny)
+            if (section->type() == KReportSectionData::PageFooterAny)
                 renderedPageFoot = true;
 
             style = QLatin1String("position: relative; top: 0pt; left: 0pt; background-color: ") + section->backgroundColor().name() + QLatin1String("; height: ") + QString::number(section->height()) + QLatin1String("pt;");
 
             if (!styles.contains(style)) {
                 styles << style;
             }
             styleindex = styles.indexOf(style);
 
             body += QLatin1String("
\n"); //Render the objects in each section for (int i = 0; i < section->primitives(); i++) { OROPrimitive * prim = section->primitive(i); //kreportDebug() << "Got object type" << prim->type(); if (prim->type() == OROTextBox::TextBox) { OROTextBox * tb = (OROTextBox*) prim; QColor bg = tb->textStyle().backgroundColor; style = QLatin1String("position: absolute; ") + QLatin1String("background-color: ") + QString::fromLatin1("rgba(%1,%2,%3,%4)") .arg(bg.red()) .arg(bg.green()) .arg(bg.blue()) .arg(0.01 * tb->textStyle().backgroundOpacity) +QLatin1String( "; ") + QLatin1String("top: ") + QString::number(tb->position().y()) + QLatin1String("pt; ") + QLatin1String("left: ") + QString::number(tb->position().x()) + QLatin1String("pt; ") + QLatin1String("font-size: ") + QString::number(tb->textStyle().font.pointSize()) + QLatin1String("pt; ") + QLatin1String("color: ") + tb->textStyle().foregroundColor.name() + QLatin1String("; ") + QLatin1String("width: ") + QString::number(tb->size().width()) + QLatin1String("px;") + QLatin1String("height: ") + QString::number(tb->size().height()) + QLatin1String("px;") ; //! @todo opaque text + translucent background //it looks a pain to implement //http://developer.mozilla.org/en/docs/Useful_CSS_tips:Color_and_Background //style += "filter:alpha(opacity=" + QString::number((tb->textStyle().bgOpacity / 255) * 100) + ");"; //ie opacity //style += "opacity: " + QString::number(tb->textStyle().bgOpacity / 255.0) + ";"; if (!styles.contains(style)) { styles << style; } styleindex = styles.indexOf(style); body += QLatin1String("
") + tb->text() + QLatin1String("
\n"); } else if (prim->type() == OROImage::Image) { //kreportDebug() << "Saving an image"; OROImage * im = (OROImage*) prim; style = QLatin1String("position: absolute; ") + QLatin1String("top: ") + QString::number(im->position().y()) + QLatin1String("pt; ") + QLatin1String("left: ") + QString::number(im->position().x()) + QLatin1String("pt; "); if (!styles.contains(style)) { styles << style; } styleindex = styles.indexOf(style); body += QLatin1String("
") + QLatin1String("size().width()) + QLatin1String("px") + QLatin1String("\" height=\"") + QString::number(im->size().height()) + QLatin1String("px") + QLatin1String("\" src=\"./") + m_actualDirName + QLatin1String("/object") + QString::number(s) + QString::number(i) + QLatin1String(".png\">") + QLatin1String("
\n"); im->image().save(m_tempDirName + QLatin1String("/object") + QString::number(s) + QString::number(i) + QLatin1String(".png")); } else if (prim->type() == OROPicture::Picture) { //kreportDebug() << "Saving a picture"; OROPicture * im = (OROPicture*) prim; style = QLatin1String("position: absolute; ") + QLatin1String("top: ") + QString::number(im->position().y()) + QLatin1String("pt; ") + QLatin1String("left: ") + QString::number(im->position().x()) + QLatin1String("pt; "); if (!styles.contains(style)) { styles << style; } styleindex = styles.indexOf(style); body += QLatin1String("
") + QLatin1String("size().width()) + QLatin1String("px") + QLatin1String("\" height=\"") + QString::number(im->size().height()) + QLatin1String("px") + QLatin1String("\" src=\"./") + m_actualDirName + QLatin1String("/object") + QString::number(s) + QString::number(i) + QLatin1String(".png\">") + QLatin1String("
\n"); QImage image(im->size().toSize(), QImage::Format_RGB32); QPainter painter(&image); im->picture()->play(&painter); image.save(m_tempDirName + QLatin1String("/object") + QString::number(s) + QString::number(i) + QLatin1String(".png")); } else { kreportWarning() << "unrecognized primitive type" << prim->type(); } } body += QLatin1String("
\n"); } } //! @todo add option for creating separate css file html = QLatin1String("\n" "\n" "\n" "\n") + QLatin1String("") + document->title() + QLatin1String("\n") + QLatin1String("\n") + QLatin1String("\n") + QLatin1String("\n") + QLatin1String("\n") + body + QLatin1String("\n\n") + QLatin1String("\n"); return html; } + +} \ No newline at end of file diff --git a/src/renderer/KoReportHTMLCSSRenderer.h b/src/renderer/KReportHTMLCSSRenderer_p.h similarity index 77% rename from src/renderer/KoReportHTMLCSSRenderer.h rename to src/renderer/KReportHTMLCSSRenderer_p.h index 8c6497f4..ea1995c9 100644 --- a/src/renderer/KoReportHTMLCSSRenderer.h +++ b/src/renderer/KReportHTMLCSSRenderer_p.h @@ -1,45 +1,48 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#ifndef __KOREPORTHTMLCSSRENDERER_H__ -#define __KOREPORTHTMLCSSRENDERER_H__ +#ifndef KREPORTHTMLCSSRENDERER_H +#define KREPORTHTMLCSSRENDERER_H -#include "KoReportRendererBase.h" +#include "KReportRendererBase.h" class ORODocument; -class KoReportHTMLCSSRenderer : public KoReportRendererBase +namespace KReportPrivate { + +class HTMLCSSRenderer : public KReportRendererBase { public: - KoReportHTMLCSSRenderer(); + HTMLCSSRenderer(); - virtual ~KoReportHTMLCSSRenderer(); + virtual ~HTMLCSSRenderer(); - virtual bool render(const KoReportRendererContext&, ORODocument *document, int page = -1); + virtual bool render(const KReportRendererContext&, ORODocument *document, int page = -1); private: QString renderCSS(ORODocument*); //! This is the directory name that will go inside the HTML files QString m_actualDirName; //! This is the directory where the image and other files will be temporarily stored QString m_tempDirName; }; +} #endif diff --git a/src/renderer/KoReportHTMLTableRenderer.cpp b/src/renderer/KReportHTMLTableRenderer_p.cpp similarity index 82% rename from src/renderer/KoReportHTMLTableRenderer.cpp rename to src/renderer/KReportHTMLTableRenderer_p.cpp index 3fd5be36..3ee1ee57 100644 --- a/src/renderer/KoReportHTMLTableRenderer.cpp +++ b/src/renderer/KReportHTMLTableRenderer_p.cpp @@ -1,168 +1,172 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#include "KoReportHTMLTableRenderer.h" -#include "common/renderobjects.h" +#include "KReportHTMLTableRenderer_p.h" +#include "KReportRenderObjects.h" #include #include "kreport_debug.h" #include #include #include -KoReportHTMLTableRenderer::KoReportHTMLTableRenderer() +namespace KReportPrivate { + +HTMLTableRenderer::HTMLTableRenderer() { } -KoReportHTMLTableRenderer::~KoReportHTMLTableRenderer() +HTMLTableRenderer::~HTMLTableRenderer() { } -bool KoReportHTMLTableRenderer::render(const KoReportRendererContext& context, ORODocument *document, int page) +bool HTMLTableRenderer::render(const KReportRendererContext& context, ORODocument *document, int page) { Q_UNUSED(page); QTemporaryFile tempHtmlFile; // auto removed by default on destruction if (!tempHtmlFile.open()) { kreportWarning() << "Couldn't create temporary file to write into"; return false; } QTextStream out(&tempHtmlFile); QString dirSuffix = QLatin1String(".files"); QDir tempDir; QFileInfo fi(tempHtmlFile); QString tempFileName = fi.absoluteFilePath(); m_tempDirName = tempFileName + dirSuffix; m_actualDirName = context.destinationUrl.fileName() + dirSuffix; if (!tempDir.mkpath(m_tempDirName)) return false; out << renderTable(document); out.flush(); tempHtmlFile.close(); bool status = true; //! @todo port KIO; // if (KIO::NetAccess::upload(tempFileName, context.destinationUrl, 0) && KIO::NetAccess::dircopy(QUrl(m_tempDirName), QUrl(context.destinationUrl.url() + dirSuffix), 0)) { // status = true; // } // cleanup the temporary directory tempDir.setPath(m_tempDirName); QStringList fileList = tempDir.entryList(); foreach(const QString& fileName, fileList) { tempDir.remove(fileName); } tempDir.rmdir(m_tempDirName); return status; } -QString KoReportHTMLTableRenderer::renderTable(ORODocument *document) +QString HTMLTableRenderer::renderTable(ORODocument *document) { QString html; QString body; QString tr; bool renderedPageHeader = false; bool renderedPageFooter = false; QDir d(m_tempDirName); // Render Each Section body = QLatin1String("\n"); for (long s = 0; s < document->sections(); s++) { OROSection *section = document->section(s); section->sortPrimatives(OROSection::SortX); - if (section->type() == KRSectionData::GroupHeader || - section->type() == KRSectionData::GroupFooter || - section->type() == KRSectionData::Detail || - section->type() == KRSectionData::ReportHeader || - section->type() == KRSectionData::ReportFooter || - (section->type() == KRSectionData::PageHeaderAny && !renderedPageHeader) || - (section->type() == KRSectionData::PageFooterAny && !renderedPageFooter && s > document->sections() - 2)) { //render the page foot right at the end, it will either be the last or second last section if there is a report footer - if (section->type() == KRSectionData::PageHeaderAny) + if (section->type() == KReportSectionData::GroupHeader || + section->type() == KReportSectionData::GroupFooter || + section->type() == KReportSectionData::Detail || + section->type() == KReportSectionData::ReportHeader || + section->type() == KReportSectionData::ReportFooter || + (section->type() == KReportSectionData::PageHeaderAny && !renderedPageHeader) || + (section->type() == KReportSectionData::PageFooterAny && !renderedPageFooter && s > document->sections() - 2)) { //render the page foot right at the end, it will either be the last or second last section if there is a report footer + if (section->type() == KReportSectionData::PageHeaderAny) renderedPageHeader = true; - if (section->type() == KRSectionData::PageFooterAny) + if (section->type() == KReportSectionData::PageFooterAny) renderedPageFooter = true; tr = QLatin1String("backgroundColor().name() + QLatin1String("\">\n"); //Render the objects in each section for (int i = 0; i < section->primitives(); i++) { OROPrimitive * prim = section->primitive(i); if (prim->type() == OROTextBox::TextBox) { OROTextBox * tb = (OROTextBox*) prim; tr += QLatin1String("\n"); } else if (prim->type() == OROImage::Image) { //kreportDebug() << "Saving an image"; OROImage * im = (OROImage*) prim; tr += QLatin1String("\n"); im->image().save(m_tempDirName + QLatin1String("/object") + QString::number(s) + QString::number(i) + QLatin1String(".png")); } else if (prim->type() == OROPicture::Picture) { //kreportDebug() << "Saving a picture"; OROPicture * im = (OROPicture*) prim; tr += QLatin1String("\n"); QImage image(im->size().toSize(), QImage::Format_RGB32); QPainter painter(&image); im->picture()->play(&painter); image.save(m_tempDirName + QLatin1String("/object") + QString::number(s) + QString::number(i) + QLatin1String(".png")); } else { kreportWarning() << "unhandled primitive type"; } } tr += QLatin1String("\n"); if (tr.contains(QLatin1String("
") + tb->text() + QLatin1String("" "" "" "" "
"))) { body += tr; } } } body += QLatin1String("
\n"); html = QLatin1String("\n" "\n" "\n" "") + document->title() + QLatin1String("\n" "\n" "\n" "\n" "\n") + body + QLatin1String("\n\n" "\n"); return html; } +} + diff --git a/src/renderer/KoReportHTMLTableRenderer.h b/src/renderer/KReportHTMLTableRenderer_p.h similarity index 76% rename from src/renderer/KoReportHTMLTableRenderer.h rename to src/renderer/KReportHTMLTableRenderer_p.h index 92c8c023..f846482f 100644 --- a/src/renderer/KoReportHTMLTableRenderer.h +++ b/src/renderer/KReportHTMLTableRenderer_p.h @@ -1,45 +1,47 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#ifndef __KOREPORTHTMLTABLERENDERER_H__ -#define __KOREPORTHTMLTABLERENDERER_H__ +#ifndef KREPORTHTMLTABLERENDERER_H +#define KREPORTHTMLTABLERENDERER_H -#include "KoReportRendererBase.h" +#include "KReportRendererBase.h" class ORODocument; -class KoReportHTMLTableRenderer : public KoReportRendererBase +namespace KReportPrivate { + +class HTMLTableRenderer : public KReportRendererBase { public: - KoReportHTMLTableRenderer(); + HTMLTableRenderer(); - virtual ~KoReportHTMLTableRenderer(); + virtual ~HTMLTableRenderer(); - virtual bool render(const KoReportRendererContext&, ORODocument *document, int page = -1); + virtual bool render(const KReportRendererContext&, ORODocument *document, int page = -1); private: QString renderTable(ORODocument*); //! This is the directory name that will go inside the HTML files QString m_actualDirName; //! This is the directory where the image and other files will be temporarily stored QString m_tempDirName; }; - +} #endif diff --git a/src/renderer/KoReportKSpreadRenderer.cpp b/src/renderer/KReportKSpreadRenderer.cpp similarity index 81% rename from src/renderer/KoReportKSpreadRenderer.cpp rename to src/renderer/KReportKSpreadRenderer.cpp index 2643e8cb..5baeb581 100644 --- a/src/renderer/KoReportKSpreadRenderer.cpp +++ b/src/renderer/KReportKSpreadRenderer.cpp @@ -1,117 +1,117 @@ /* This file is part of the KDE project * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #include "KoReportKSpreadRenderer.h" #include "ods/KoSimpleOdsDocument.h" #include "ods/KoSimpleOdsCell.h" #include "ods/KoSimpleOdsSheet.h" -#include "common/renderobjects.h" +#include "KReportRenderObjects.h" #include "kreport_debug.h" KoReportKSpreadRenderer::KoReportKSpreadRenderer() { } KoReportKSpreadRenderer::~KoReportKSpreadRenderer() { } bool KoReportKSpreadRenderer::render(const KoReportRendererContext& context, ORODocument* document, int page) { Q_UNUSED(page); KoSimpleOdsDocument *doc = new KoSimpleOdsDocument(); KoSimpleOdsSheet *sht = new KoSimpleOdsSheet(); //kreportDebug() << "Setting name to:" << document->title(); sht->setName(document->title()); bool renderedPageHeader = false; bool renderedPageFooter = false; // Render Each Section for (long s = 0; s < document->sections(); s++) { OROSection *section = document->section(s); section->sortPrimatives(OROSection::SortX); - if (section->type() == KRSectionData::GroupHeader || - section->type() == KRSectionData::GroupFooter || - section->type() == KRSectionData::Detail || - section->type() == KRSectionData::ReportHeader || - section->type() == KRSectionData::ReportFooter || - (section->type() == KRSectionData::PageHeaderAny && !renderedPageHeader) || - (section->type() == KRSectionData::PageFooterAny && !renderedPageFooter && s > document->sections() - 2)) { //render the page foot right at the end, it will either be the last or second last section if there is a report footer - if (section->type() == KRSectionData::PageHeaderAny) + if (section->type() == KReportSectionData::GroupHeader || + section->type() == KReportSectionData::GroupFooter || + section->type() == KReportSectionData::Detail || + section->type() == KReportSectionData::ReportHeader || + section->type() == KReportSectionData::ReportFooter || + (section->type() == KReportSectionData::PageHeaderAny && !renderedPageHeader) || + (section->type() == KReportSectionData::PageFooterAny && !renderedPageFooter && s > document->sections() - 2)) { //render the page foot right at the end, it will either be the last or second last section if there is a report footer + if (section->type() == KReportSectionData::PageHeaderAny) renderedPageHeader = true; - if (section->type() == KRSectionData::PageFooterAny) + if (section->type() == KReportSectionData::PageFooterAny) renderedPageFooter = true; //Render the objects in each section for (int i = 0; i < section->primitives(); i++) { OROPrimitive * prim = section->primitive(i); if (prim->type() == OROTextBox::TextBox) { OROTextBox * tb = (OROTextBox*) prim; sht->addCell(s, i, new KoSimpleOdsCell(tb->text())); } /* else if (prim->type() == OROImage::Image) { kreportDebug() << "Saving an image"; OROImage * im = ( OROImage* ) prim; tr += "" "" "\n"; im->image().save(saveDir + "/object" + QString::number(s) + QString::number(i) + ".png"); } else if (prim->type() == OROPicture::Picture) { kreportDebug() << "Saving a picture"; OROPicture * im = ( OROPicture* ) prim; tr += "" "" "\n"; QImage image(im->size().toSize(), QImage::Format_RGB32); QPainter painter(&image); im->picture()->play(&painter); image.save(saveDir + "/object" + QString::number(s) + QString::number(i) + ".png"); }*/ else { kreportWarning() << "unhandled primitive type"; } } } } doc->addSheet(sht); bool status; if (doc->saveDocument(context.destinationUrl.path()) == QFile::NoError) { status = true; } else { status = false; } delete doc; return status; } diff --git a/src/renderer/KoReportKSpreadRenderer.h b/src/renderer/KReportKSpreadRenderer.h similarity index 72% rename from src/renderer/KoReportKSpreadRenderer.h rename to src/renderer/KReportKSpreadRenderer.h index f7ff288b..f26eae98 100644 --- a/src/renderer/KoReportKSpreadRenderer.h +++ b/src/renderer/KReportKSpreadRenderer.h @@ -1,37 +1,37 @@ /* This file is part of the KDE project * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#ifndef KOREPORTKSPREADRENDERER_H -#define KOREPORTKSPREADRENDERER_H +#ifndef KREPORTKSPREADRENDERER_H +#define KREPORTKSPREADRENDERER_H -#include "KoReportRendererBase.h" +#include "KReportRendererBase.h" /** */ -class KoReportKSpreadRenderer : public KoReportRendererBase +class KReportKSpreadRenderer : public KReportRendererBase { public: - KoReportKSpreadRenderer(); - ~KoReportKSpreadRenderer(); + KReportKSpreadRenderer(); + ~KReportKSpreadRenderer(); - virtual bool render(const KoReportRendererContext&, ORODocument*, int page = -1); + virtual bool render(const KReportRendererContext&, ORODocument*, int page = -1); private: }; #endif diff --git a/src/renderer/KoReportODTRenderer.cpp b/src/renderer/KReportODTRenderer.cpp similarity index 92% rename from src/renderer/KoReportODTRenderer.cpp rename to src/renderer/KReportODTRenderer.cpp index 0bc3bc9d..d04757f9 100644 --- a/src/renderer/KoReportODTRenderer.cpp +++ b/src/renderer/KReportODTRenderer.cpp @@ -1,114 +1,114 @@ /* This file is part of the KDE project * Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #include "KoReportODTRenderer.h" -#include "common/renderobjects.h" +#include "KReportRenderObjects.h" #include #include #include #include #include #include "kreport_debug.h" KoReportODTRenderer::KoReportODTRenderer() : m_document(new QTextDocument()), m_cursor(m_document) { } KoReportODTRenderer::~KoReportODTRenderer() { delete m_document; } bool KoReportODTRenderer::render(const KoReportRendererContext& context, ORODocument* document, int /*page*/) { QTextTableFormat tableFormat; tableFormat.setCellPadding(5); tableFormat.setHeaderRowCount(1); tableFormat.setBorderStyle(QTextFrameFormat::BorderStyle_Solid); tableFormat.setWidth(QTextLength(QTextLength::PercentageLength, 100)); QTextTable *table = m_cursor.insertTable(1, 1, tableFormat); long renderedSections = 0; for (long s = 0; s < document->sections(); s++) { OROSection *section = document->section(s); section->sortPrimatives(OROSection::SortX); - if (section->type() == KRSectionData::GroupHeader || section->type() == KRSectionData::GroupFooter || - section->type() == KRSectionData::ReportHeader || section->type() == KRSectionData::ReportFooter || - section->type() == KRSectionData::Detail){ + if (section->type() == KReportSectionData::GroupHeader || section->type() == KReportSectionData::GroupFooter || + section->type() == KReportSectionData::ReportHeader || section->type() == KReportSectionData::ReportFooter || + section->type() == KReportSectionData::Detail){ //Add this section to the document //Resize the table to accommodate all the primitives in the section if (table->columns() < section->primitives()) { table->appendColumns(section->primitives() - table->columns()); } if (renderedSections > 0) { //We need to back a row, then forward a row to get at the start cell m_cursor.movePosition(QTextCursor::PreviousRow); m_cursor.movePosition(QTextCursor::NextRow); } else { //On the first row, ensure we are in the first cell after expanding the table while (m_cursor.movePosition(QTextCursor::PreviousCell)){} } //Render the objects in each section for (int i = 0; i < section->primitives(); i++) { //Colour the cell using hte section background colour OROPrimitive * prim = section->primitive(i); QTextTableCell cell = table->cellAt(m_cursor); QTextCharFormat format = cell.format(); format.setBackground(section->backgroundColor()); cell.setFormat(format); if (prim->type() == OROTextBox::TextBox) { OROTextBox * tb = (OROTextBox*) prim; m_cursor.insertText(tb->text()); } else if (prim->type() == OROImage::Image) { OROImage * im = (OROImage*) prim; m_cursor.insertImage(im->image().scaled(im->size().width(), im->size().height(), Qt::KeepAspectRatio)); } else if (prim->type() == OROPicture::Picture) { OROPicture * im = (OROPicture*) prim; QImage image(im->size().toSize(), QImage::Format_RGB32); QPainter painter(&image); im->picture()->play(&painter); m_cursor.insertImage(image); } else { kreportWarning() << "unhandled primitive type"; } m_cursor.movePosition(QTextCursor::NextCell); } if (s < document->sections() - 1) { table->appendRows(1); } renderedSections++; } } QTextDocumentWriter writer(context.destinationUrl.toLocalFile()); return writer.write(m_document); } diff --git a/src/renderer/KoReportODTRenderer.h b/src/renderer/KReportODTRenderer.h similarity index 75% rename from src/renderer/KoReportODTRenderer.h rename to src/renderer/KReportODTRenderer.h index 6db91036..54a51e53 100644 --- a/src/renderer/KoReportODTRenderer.h +++ b/src/renderer/KReportODTRenderer.h @@ -1,40 +1,40 @@ /* This file is part of the KDE project * Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#ifndef KOREPORTODTRENDERER_H -#define KOREPORTODTRENDERER_H +#ifndef KREPORTODTRENDERER_H +#define KREPORTODTRENDERER_H -#include +#include "KReportRendererBase.h" -#include "KoReportRendererBase.h" +#include class QTextDocument; -class KoReportODTRenderer : public KoReportRendererBase +class KReportODTRenderer : public KReportRendererBase { public: - KoReportODTRenderer(); - virtual ~KoReportODTRenderer(); - virtual bool render(const KoReportRendererContext& context, ORODocument* document, int page = -1); + KReportODTRenderer(); + virtual ~KReportODTRenderer(); + virtual bool render(const KReportRendererContext& context, ORODocument* document, int page = -1); private: QTextDocument * const m_document; QTextCursor m_cursor; }; #endif // KOREPORTODTRENDERER_H diff --git a/src/renderer/KoOdtFrameReportRenderer.cpp b/src/renderer/KReportOdtFrameReportRenderer.cpp similarity index 98% rename from src/renderer/KoOdtFrameReportRenderer.cpp rename to src/renderer/KReportOdtFrameReportRenderer.cpp index 06d48121..02c80224 100644 --- a/src/renderer/KoOdtFrameReportRenderer.cpp +++ b/src/renderer/KReportOdtFrameReportRenderer.cpp @@ -1,73 +1,73 @@ /* This file is part of the KDE project * Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk) * Copyright (C) 2012 by Dag Andersen (danders@get2net.dk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #include "KoOdtFrameReportRenderer.h" #include "odtframe/KoOdtFrameReportDocument.h" #include "odtframe/KoOdtFrameReportTextBox.h" #include "odtframe/KoOdtFrameReportImage.h" #include "odtframe/KoOdtFrameReportPicture.h" #include "odtframe/KoOdtFrameReportLine.h" #include "odtframe/KoOdtFrameReportCheckBox.h" -#include "common/renderobjects.h" +#include "KReportRenderObjects.h" KoOdtFrameReportRenderer::KoOdtFrameReportRenderer() { } KoOdtFrameReportRenderer::~KoOdtFrameReportRenderer() { } bool KoOdtFrameReportRenderer::render(const KoReportRendererContext& context, ORODocument* document, int /*page*/) { int uid = 1; KoOdtFrameReportDocument doc; doc.setPageOptions(document->pageOptions()); for (int page = 0; page < document->pages(); page++) { OROPage *p = document->page(page); for (int i = 0; i < p->primitives(); i++) { OROPrimitive *prim = p->primitive(i); if (prim->type() == OROTextBox::TextBox) { KoOdtFrameReportPrimitive *sp = new KoOdtFrameReportTextBox(static_cast(prim)); sp->setUID(uid++); doc.addPrimitive(sp); } else if (prim->type() == OROImage::Image) { KoOdtFrameReportPrimitive *sp = new KoOdtFrameReportImage(static_cast(prim)); sp->setUID(uid++); doc.addPrimitive(sp); } else if (prim->type() == OROPicture::Picture) { KoOdtFrameReportPrimitive *sp = new KoOdtFrameReportPicture(static_cast(prim)); sp->setUID(uid++); doc.addPrimitive(sp); } else if (prim->type() == OROLine::Line) { KoOdtFrameReportPrimitive *sp = new KoOdtFrameReportLine(static_cast(prim)); sp->setUID(uid++); doc.addPrimitive(sp); } else if (prim->type() == OROCheck::Check) { KoOdtFrameReportPrimitive *sp = new KoOdtFrameReportCheckBox(static_cast(prim)); sp->setUID(uid++); doc.addPrimitive(sp); } else { kreportWarning() << "unhandled primitive type" << prim->type(); } } } return doc.saveDocument(context.destinationUrl.path()) == QFile::NoError; } diff --git a/src/renderer/KoOdtFrameReportRenderer.h b/src/renderer/KReportOdtFrameReportRenderer.h similarity index 70% rename from src/renderer/KoOdtFrameReportRenderer.h rename to src/renderer/KReportOdtFrameReportRenderer.h index 63df77ab..89992600 100644 --- a/src/renderer/KoOdtFrameReportRenderer.h +++ b/src/renderer/KReportOdtFrameReportRenderer.h @@ -1,35 +1,33 @@ /* This file is part of the KDE project * Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk) * Copyright (C) 2012 by Dag Andersen (danders@get2net.dk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#ifndef KOODTFRAMEREPORTRENDERER_H -#define KOODTFRAMEREPORTRENDERER_H +#ifndef KREPORTODTFRAMEREPORTRENDERER_H +#define KREPORTODTFRAMEREPORTRENDERER_H -#include "KoReportRendererBase.h" +#include "KReportRendererBase.h" - - -class KoOdtFrameReportRenderer : public KoReportRendererBase +class KReportOdtFrameReportRenderer : public KReportRendererBase { public: - KoOdtFrameReportRenderer(); - virtual ~KoOdtFrameReportRenderer(); - virtual bool render(const KoReportRendererContext& context, ORODocument* document, int page = -1); + KReportOdtFrameReportRenderer(); + virtual ~KReportOdtFrameReportRenderer(); + virtual bool render(const KReportRendererContext& context, ORODocument* document, int page = -1); }; #endif // KOODTFRAMEREPORTRENDERER_H diff --git a/src/renderer/KReportOneRecordData.cpp b/src/renderer/KReportOneRecordData_p.cpp similarity index 64% rename from src/renderer/KReportOneRecordData.cpp rename to src/renderer/KReportOneRecordData_p.cpp index 5aa87d96..385855da 100644 --- a/src/renderer/KReportOneRecordData.cpp +++ b/src/renderer/KReportOneRecordData_p.cpp @@ -1,94 +1,98 @@ /* * This file is part of the KDE project * Copyright (C) 2015 by Adam Pigg * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ -#include "KReportOneRecordData.h" +#include "KReportOneRecordData_p.h" -KReportOneRecordData::KReportOneRecordData() +namespace KReportPrivate { + +OneRecordData::OneRecordData() { } -KReportOneRecordData::~KReportOneRecordData() +OneRecordData::~OneRecordData() { } -QVariant KReportOneRecordData::value(const QString& field) const +QVariant OneRecordData::value(const QString& field) const { Q_UNUSED(field); return QVariant(); } -QVariant KReportOneRecordData::value(unsigned int fieldNum) const +QVariant OneRecordData::value(unsigned int fieldNum) const { Q_UNUSED(fieldNum); return QVariant(); } -QStringList KReportOneRecordData::fieldNames() const +QStringList OneRecordData::fieldNames() const { return QStringList(); } -int KReportOneRecordData::fieldNumber(const QString& field) const +int OneRecordData::fieldNumber(const QString& field) const { Q_UNUSED(field); return 0; } -qint64 KReportOneRecordData::recordCount() const +qint64 OneRecordData::recordCount() const { return 1; } -qint64 KReportOneRecordData::at() const +qint64 OneRecordData::at() const { return 0; } -bool KReportOneRecordData::moveLast() +bool OneRecordData::moveLast() { return true; } -bool KReportOneRecordData::moveFirst() +bool OneRecordData::moveFirst() { return true; } -bool KReportOneRecordData::movePrevious() +bool OneRecordData::movePrevious() { return false; } -bool KReportOneRecordData::moveNext() +bool OneRecordData::moveNext() { return false; } -bool KReportOneRecordData::close() +bool OneRecordData::close() { return true; } -bool KReportOneRecordData::open() +bool OneRecordData::open() { return true; } + +} \ No newline at end of file diff --git a/src/renderer/KReportOneRecordData.h b/src/renderer/KReportOneRecordData_p.h similarity index 92% rename from src/renderer/KReportOneRecordData.h rename to src/renderer/KReportOneRecordData_p.h index 0040a00d..5b267733 100644 --- a/src/renderer/KReportOneRecordData.h +++ b/src/renderer/KReportOneRecordData_p.h @@ -1,55 +1,57 @@ /* * This file is part of the KDE project * Copyright (C) 2015 by Adam Pigg * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. * */ #ifndef KREPORTONERECORDDATA_H #define KREPORTONERECORDDATA_H -#include +#include +namespace KReportPrivate { /** * @brief A Report Data provide which returns one record * * When no other data source is specified the pre-renderer * will create this as its data source. This will return * one record of data, and no fields. Useful for creating * a report with a static page of data, or a report page * generated from a script only. */ -class KReportOneRecordData : public KoReportData +class OneRecordData : public KReportData { public: - KReportOneRecordData(); - ~KReportOneRecordData(); + OneRecordData(); + ~OneRecordData(); virtual QVariant value(const QString& field) const; virtual QVariant value(unsigned int fieldNum) const; virtual QStringList fieldNames() const; virtual int fieldNumber(const QString& field) const; virtual qint64 recordCount() const; virtual qint64 at() const; virtual bool moveLast(); virtual bool moveFirst(); virtual bool movePrevious(); virtual bool moveNext(); virtual bool close(); virtual bool open(); }; +} #endif // KREPORTONERECORDDATA_H diff --git a/src/renderer/KoReportPage.cpp b/src/renderer/KReportPage.cpp similarity index 83% rename from src/renderer/KoReportPage.cpp rename to src/renderer/KReportPage.cpp index cc8efe9c..1ffe4a4d 100644 --- a/src/renderer/KoReportPage.cpp +++ b/src/renderer/KReportPage.cpp @@ -1,129 +1,128 @@ /* This file is part of the KDE project * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#include "KoReportPage.h" +#include "KReportPage.h" -#include - -#include "common/KReportPageFormat.h" -#include "common/KReportUnit.h" -#include "common/renderobjects.h" +#include "KReportRendererBase.h" +#include "KReportPageFormat.h" +#include "KReportUnit.h" +#include "KReportRenderObjects.h" +#include "kreport_debug.h" #include -#include "kreport_debug.h" #include #include #include //! @internal -class KoReportPage::Private +class KReportPage::Private { public: explicit Private(ORODocument *document) : reportDocument(document) , page(0) {} ~Private() { delete renderer; } ORODocument *reportDocument; int page; QPixmap pixmap; - KoReportRendererFactory factory; - KoReportRendererBase *renderer; + KReportRendererFactory factory; + KReportRendererBase *renderer; QTimer renderTimer; }; -KoReportPage::KoReportPage(QWidget *parent, ORODocument *document) +KReportPage::KReportPage(QWidget *parent, ORODocument *document) : QObject(parent), QGraphicsRectItem() , d(new Private(document)) { //! @todo setAttribute(Qt::WA_NoBackground); //kreportDebug() << "CREATED PAGE"; int pageWidth = 0; int pageHeight = 0; if (d->reportDocument) { QString pageSize = d->reportDocument->pageOptions().getPageSize(); if (pageSize == QLatin1String("Custom")) { // if this is custom sized sheet of paper we will just use those values pageWidth = (int)(d->reportDocument->pageOptions().getCustomWidth()); pageHeight = (int)(d->reportDocument->pageOptions().getCustomHeight()); } else { // lookup the correct size information for the specified size paper pageWidth = d->reportDocument->pageOptions().widthPx(); pageHeight = d->reportDocument->pageOptions().heightPx(); } } setRect(0,0,pageWidth, pageHeight); //kreportDebug() << "PAGE IS " << pageWidth << "x" << pageHeight; d->pixmap = QPixmap(pageWidth, pageHeight); d->renderer = d->factory.createInstance(QLatin1String("screen")); connect(d->reportDocument, SIGNAL(updated(int)), this, SLOT(pageUpdated(int))); d->renderTimer.setSingleShot(true); connect(&d->renderTimer, SIGNAL(timeout()), this, SLOT(renderCurrentPage())); renderPage(1); } -KoReportPage::~KoReportPage() +KReportPage::~KReportPage() { delete d; } -void KoReportPage::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) +void KReportPage::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) { Q_UNUSED(option); Q_UNUSED(widget); painter->drawPixmap(QPoint(0, 0), d->pixmap); } -void KoReportPage::renderPage(int page) +void KReportPage::renderPage(int page) { d->page = page - 1; d->pixmap.fill(); QPainter qp(&d->pixmap); if (d->reportDocument) { - KoReportRendererContext cxt; + KReportRendererContext cxt; cxt.painter = &qp; d->renderer->render(cxt, d->reportDocument, d->page); } update(); } -void KoReportPage::pageUpdated(int pageNo) +void KReportPage::pageUpdated(int pageNo) { //kreportDebug() << pageNo << d->page; //Refresh this page if it changes if (pageNo == d->page) { //kreportDebug() << "Current page updated"; d->renderTimer.start(100); } } -void KoReportPage::renderCurrentPage() +void KReportPage::renderCurrentPage() { renderPage(d->page + 1); } diff --git a/src/renderer/KoReportPage.h b/src/renderer/KReportPage.h similarity index 84% rename from src/renderer/KoReportPage.h rename to src/renderer/KReportPage.h index 9febb387..60625460 100644 --- a/src/renderer/KoReportPage.h +++ b/src/renderer/KReportPage.h @@ -1,57 +1,57 @@ /* This file is part of the KDE project * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#ifndef KOREPORTPAGE_H -#define KOREPORTPAGE_H +#ifndef KREPORTPAGE_H +#define KREPORTPAGE_H #include "kreport_export.h" #include #include class ORODocument; /** Provides a widget that renders a specific page of and ORODocument The widget is sized to the document size in pixels. */ -class KREPORT_EXPORT KoReportPage : public QObject, public QGraphicsRectItem +class KREPORT_EXPORT KReportPage : public QObject, public QGraphicsRectItem { Q_OBJECT public: - KoReportPage(QWidget *parent, ORODocument *document); + KReportPage(QWidget *parent, ORODocument *document); - ~KoReportPage(); + ~KReportPage(); void renderPage(int page); public Q_SLOTS: virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget = 0); void pageUpdated(int pageNo); private Q_SLOTS: void renderCurrentPage(); private: - Q_DISABLE_COPY(KoReportPage) + Q_DISABLE_COPY(KReportPage) class Private; Private * const d; }; #endif diff --git a/src/renderer/KoReportPreRenderer.cpp b/src/renderer/KReportPreRenderer.cpp similarity index 70% rename from src/renderer/KoReportPreRenderer.cpp rename to src/renderer/KReportPreRenderer.cpp index 925cbbe7..7975161a 100644 --- a/src/renderer/KoReportPreRenderer.cpp +++ b/src/renderer/KReportPreRenderer.cpp @@ -1,668 +1,670 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#include "KoReportPreRenderer.h" -#include "KoReportPreRenderer_p.h" -#include "KoReportASyncItemManager.h" -#include "KReportOneRecordData.h" - -#include "common/renderobjects.h" -#include "common/KoReportData.h" -#include "common/KoReportItemBase.h" -#include "common/krreportdata.h" -#include "common/krdetailsectiondata.h" -#include "common/labelsizeinfo.h" -#include "common/KReportPageFormat.h" +#include "KReportPreRenderer.h" +#include "KReportPreRenderer_p.h" +#include "KReportAsyncItemManager_p.h" +#include "KReportOneRecordData_p.h" + +#include "KReportRenderObjects.h" +#include "KReportData.h" +#include "KReportItemBase.h" +#include "KReportDocument.h" +#include "KReportDetailSectionData.h" +#include "KReportLabelSizeInfo.h" +#include "KReportPageFormat.h" #ifdef KREPORT_SCRIPTING -#include "scripting/krscripthandler.h" -#include "scripting/kreportgrouptracker.h" +#include "scripting/KReportScriptHandler.h" +#include "scripting/KReportGroupTracker.h" #endif #include #include #include #include "kreport_debug.h" -KoReportPreRendererPrivate::KoReportPreRendererPrivate() +KReportPreRendererPrivate::KReportPreRendererPrivate() { m_valid = false; - m_reportData = 0; m_document = 0; + m_reportDocument = 0; m_page = 0; m_yOffset = 0.0; m_topMargin = m_bottomMargin = 0.0; m_leftMargin = m_rightMargin = 0.0; m_pageCounter = 0; m_maxHeight = m_maxWidth = 0.0; - m_oneRecord = new KReportOneRecordData(); + m_oneRecord = new KReportPrivate::OneRecordData(); m_kodata = m_oneRecord; +#ifdef KREPORT_SCRIPTING m_scriptHandler = 0; - asyncManager = new KoReportASyncItemManager(this); +#endif + asyncManager = new KReportPrivate::AsyncItemManager(this); connect(asyncManager, SIGNAL(finished()), this, SLOT(asyncItemsFinished())); } -KoReportPreRendererPrivate::~KoReportPreRendererPrivate() +KReportPreRendererPrivate::~KReportPreRendererPrivate() { - delete m_reportData; + delete m_document; delete m_oneRecord; m_postProcText.clear(); } -void KoReportPreRendererPrivate::createNewPage() +void KReportPreRendererPrivate::createNewPage() { //kreportDebug(); if (m_pageCounter > 0) finishCurPage(); m_pageCounter++; #ifdef KREPORT_SCRIPTING //Update the page count script value m_scriptHandler->setPageNumber(m_pageCounter); m_scriptHandler->newPage(); #endif m_page = new OROPage(0); m_document->addPage(m_page); //! @todo calculate past page bool lastPage = false; m_yOffset = m_topMargin; - if (m_pageCounter == 1 && m_reportData->m_pageHeaderFirst) - renderSection(*(m_reportData->m_pageHeaderFirst)); - else if (lastPage == true && m_reportData->m_pageHeaderLast) - renderSection(*(m_reportData->m_pageHeaderLast)); - else if ((m_pageCounter % 2) == 1 && m_reportData->m_pageHeaderOdd) - renderSection(*(m_reportData->m_pageHeaderOdd)); - else if ((m_pageCounter % 2) == 0 && m_reportData->m_pageHeaderAny) - renderSection(*(m_reportData->m_pageHeaderAny)); - else if (m_reportData->m_pageHeaderAny) - renderSection(*(m_reportData->m_pageHeaderAny)); + if (m_pageCounter == 1 && m_reportDocument->m_pageHeaderFirst) + renderSection(*(m_reportDocument->m_pageHeaderFirst)); + else if (lastPage == true && m_reportDocument->m_pageHeaderLast) + renderSection(*(m_reportDocument->m_pageHeaderLast)); + else if ((m_pageCounter % 2) == 1 && m_reportDocument->m_pageHeaderOdd) + renderSection(*(m_reportDocument->m_pageHeaderOdd)); + else if ((m_pageCounter % 2) == 0 && m_reportDocument->m_pageHeaderAny) + renderSection(*(m_reportDocument->m_pageHeaderAny)); + else if (m_reportDocument->m_pageHeaderAny) + renderSection(*(m_reportDocument->m_pageHeaderAny)); } -qreal KoReportPreRendererPrivate::finishCurPageSize(bool lastPage) +qreal KReportPreRendererPrivate::finishCurPageSize(bool lastPage) { qreal retval = 0.0; - if (lastPage && m_reportData->m_pageFooterLast) - retval = renderSectionSize(* (m_reportData->m_pageFooterLast)); - else if (m_pageCounter == 1 && m_reportData->m_pageFooterFirst) - retval = renderSectionSize(* (m_reportData->m_pageFooterFirst)); - else if ((m_pageCounter % 2) == 1 && m_reportData->m_pageFooterOdd) - retval = renderSectionSize(* (m_reportData->m_pageFooterOdd)); - else if ((m_pageCounter % 2) == 0 && m_reportData->m_pageFooterEven) - retval = renderSectionSize(* (m_reportData->m_pageFooterEven)); - else if (m_reportData->m_pageFooterAny) - retval = renderSectionSize(* (m_reportData->m_pageFooterAny)); + if (lastPage && m_reportDocument->m_pageFooterLast) + retval = renderSectionSize(* (m_reportDocument->m_pageFooterLast)); + else if (m_pageCounter == 1 && m_reportDocument->m_pageFooterFirst) + retval = renderSectionSize(* (m_reportDocument->m_pageFooterFirst)); + else if ((m_pageCounter % 2) == 1 && m_reportDocument->m_pageFooterOdd) + retval = renderSectionSize(* (m_reportDocument->m_pageFooterOdd)); + else if ((m_pageCounter % 2) == 0 && m_reportDocument->m_pageFooterEven) + retval = renderSectionSize(* (m_reportDocument->m_pageFooterEven)); + else if (m_reportDocument->m_pageFooterAny) + retval = renderSectionSize(* (m_reportDocument->m_pageFooterAny)); //kreportDebug() << retval; return retval; } -qreal KoReportPreRendererPrivate::finishCurPage(bool lastPage) +qreal KReportPreRendererPrivate::finishCurPage(bool lastPage) { qreal offset = m_maxHeight - m_bottomMargin; qreal retval = 0.0; //kreportDebug() << offset; - if (lastPage && m_reportData->m_pageFooterLast) { + if (lastPage && m_reportDocument->m_pageFooterLast) { //kreportDebug() << "Last Footer"; - m_yOffset = offset - renderSectionSize(* (m_reportData->m_pageFooterLast)); - retval = renderSection(* (m_reportData->m_pageFooterLast)); - } else if (m_pageCounter == 1 && m_reportData->m_pageFooterFirst) { + m_yOffset = offset - renderSectionSize(* (m_reportDocument->m_pageFooterLast)); + retval = renderSection(* (m_reportDocument->m_pageFooterLast)); + } else if (m_pageCounter == 1 && m_reportDocument->m_pageFooterFirst) { //kreportDebug() << "First Footer"; - m_yOffset = offset - renderSectionSize(* (m_reportData->m_pageFooterFirst)); - retval = renderSection(* (m_reportData->m_pageFooterFirst)); - } else if ((m_pageCounter % 2) == 1 && m_reportData->m_pageFooterOdd) { + m_yOffset = offset - renderSectionSize(* (m_reportDocument->m_pageFooterFirst)); + retval = renderSection(* (m_reportDocument->m_pageFooterFirst)); + } else if ((m_pageCounter % 2) == 1 && m_reportDocument->m_pageFooterOdd) { //kreportDebug() << "Odd Footer"; - m_yOffset = offset - renderSectionSize(* (m_reportData->m_pageFooterOdd)); - retval = renderSection(* (m_reportData->m_pageFooterOdd)); - } else if ((m_pageCounter % 2) == 0 && m_reportData->m_pageFooterEven) { + m_yOffset = offset - renderSectionSize(* (m_reportDocument->m_pageFooterOdd)); + retval = renderSection(* (m_reportDocument->m_pageFooterOdd)); + } else if ((m_pageCounter % 2) == 0 && m_reportDocument->m_pageFooterEven) { //kreportDebug() << "Even Footer"; - m_yOffset = offset - renderSectionSize(* (m_reportData->m_pageFooterEven)); - retval = renderSection(* (m_reportData->m_pageFooterEven)); - } else if (m_reportData->m_pageFooterAny) { + m_yOffset = offset - renderSectionSize(* (m_reportDocument->m_pageFooterEven)); + retval = renderSection(* (m_reportDocument->m_pageFooterEven)); + } else if (m_reportDocument->m_pageFooterAny) { //kreportDebug() << "Any Footer"; - m_yOffset = offset - renderSectionSize(* (m_reportData->m_pageFooterAny)); - retval = renderSection(* (m_reportData->m_pageFooterAny)); + m_yOffset = offset - renderSectionSize(* (m_reportDocument->m_pageFooterAny)); + retval = renderSection(* (m_reportDocument->m_pageFooterAny)); } return retval; } -void KoReportPreRendererPrivate::renderDetailSection(KRDetailSectionData *detailData) +void KReportPreRendererPrivate::renderDetailSection(KReportDetailSectionData *detailData) { if (detailData->m_detailSection) { if (m_kodata/* && !curs->eof()*/) { QStringList keys; QStringList keyValues; QList shownGroups; - ORDetailGroupSectionData * grp = 0; + KReportDetailGroupSectionData * grp = 0; bool status = m_kodata->moveFirst(); m_recordCount = m_kodata->recordCount(); //kreportDebug() << "Record Count:" << m_recordCount; for (int i = 0; i < (int) detailData->m_groupList.count(); ++i) { grp = detailData->m_groupList[i]; //If the group has a header or footer, then emit a change of group value if(grp->m_groupFooter || grp->m_groupHeader) { // we get here only if group is *shown* shownGroups << i; keys.append(grp->m_column); if (!keys.last().isEmpty()) keyValues.append(m_kodata->value(m_kodata->fieldNumber(keys.last())).toString()); else keyValues.append(QString()); //Tell interested parties we're about to render a header emit(enteredGroup(keys.last(), keyValues.last())); } if (grp->m_groupHeader) renderSection(*(grp->m_groupHeader)); } while (status) { long l = m_kodata->at(); //kreportDebug() << "At:" << l << "Y:" << m_yOffset << "Max Height:" << m_maxHeight; if (renderSectionSize(*(detailData->m_detailSection)) + finishCurPageSize((l + 1 == m_recordCount)) + m_bottomMargin + m_yOffset >= m_maxHeight) { //kreportDebug() << "Next section is too big for this page"; if (l > 0) { m_kodata->movePrevious(); createNewPage(); m_kodata->moveNext(); } } renderSection(*(detailData->m_detailSection)); if (m_kodata) status = m_kodata->moveNext(); if (status == true && keys.count() > 0) { // check to see where it is we need to start int pos = -1; // if it's still -1 by the time we are done then no keyValues changed for (int i = 0; i < keys.count(); ++i) { if (keyValues[i] != m_kodata->value(m_kodata->fieldNumber(keys[i])).toString()) { pos = i; break; } } // don't bother if nothing has changed if (pos != -1) { // roll back the query and go ahead if all is good status = m_kodata->movePrevious(); if (status == true) { // print the footers as needed // any changes made in this for loop need to be duplicated // below where the footers are finished. bool do_break = false; for (int i = shownGroups.count() - 1; i >= 0; i--) { if (do_break) createNewPage(); do_break = false; grp = detailData->m_groupList[shownGroups.at(i)]; if (grp->m_groupFooter) { if (renderSectionSize(*(grp->m_groupFooter)) + finishCurPageSize() + m_bottomMargin + m_yOffset >= m_maxHeight) createNewPage(); renderSection(*(grp->m_groupFooter)); } - if (ORDetailGroupSectionData::BreakAfterGroupFooter == grp->m_pagebreak) + if (KReportDetailGroupSectionData::BreakAfterGroupFooter == grp->m_pagebreak) do_break = true; } // step ahead to where we should be and print the needed headers // if all is good status = m_kodata->moveNext(); if (do_break) createNewPage(); if (status == true) { for (int i = 0; i < shownGroups.count(); ++i) { grp = detailData->m_groupList[shownGroups.at(i)]; if (grp->m_groupHeader) { if (renderSectionSize(*(grp->m_groupHeader)) + finishCurPageSize() + m_bottomMargin + m_yOffset >= m_maxHeight) { m_kodata->movePrevious(); createNewPage(); m_kodata->moveNext(); } if (!keys[i].isEmpty()) keyValues[i] = m_kodata->value(m_kodata->fieldNumber(keys[i])).toString(); //Tell interested parties thak key values changed renderSection(*(grp->m_groupHeader)); } } } } } } } if (keys.size() > 0 && m_kodata->movePrevious()) { // finish footers // duplicated changes from above here for (int i = shownGroups.count() - 1; i >= 0; i--) { grp = detailData->m_groupList[shownGroups.at(i)]; if (grp->m_groupFooter) { if (renderSectionSize(*(grp->m_groupFooter)) + finishCurPageSize() + m_bottomMargin + m_yOffset >= m_maxHeight) createNewPage(); renderSection(*(grp->m_groupFooter)); emit(exitedGroup(keys[i], keyValues[i])); } } } } - if (KRDetailSectionData::BreakAtEnd == detailData->m_pageBreak) + if (KReportDetailSectionData::BreakAtEnd == detailData->m_pageBreak) createNewPage(); } } -qreal KoReportPreRendererPrivate::renderSectionSize(const KRSectionData & sectionData) +qreal KReportPreRendererPrivate::renderSectionSize(const KReportSectionData & sectionData) { QScreen *srn = QApplication::screens().at(0); qreal intHeight = POINT_TO_INCH(sectionData.height()) * srn->logicalDotsPerInchX(); int itemHeight = 0; if (sectionData.objects().count() == 0) return intHeight; - QList objects = sectionData.objects(); - foreach(KoReportItemBase *ob, objects) { + QList objects = sectionData.objects(); + foreach(KReportItemBase *ob, objects) { QPointF offset(m_leftMargin, m_yOffset); QVariant itemData = m_kodata->value(ob->itemDataSource()); //ASync objects cannot alter the section height - KoReportASyncItemBase *async_ob = qobject_cast(ob); + KReportAsyncItemBase *async_ob = qobject_cast(ob); if (!async_ob) { itemHeight = ob->renderSimpleData(0, 0, offset, itemData, m_scriptHandler); if (itemHeight > intHeight) { intHeight = itemHeight; } } } return intHeight; } -qreal KoReportPreRendererPrivate::renderSection(const KRSectionData & sectionData) +qreal KReportPreRendererPrivate::renderSection(const KReportSectionData & sectionData) { QScreen *srn = QApplication::screens().at(0); qreal sectionHeight = POINT_TO_INCH(sectionData.height()) * srn->logicalDotsPerInchX(); int itemHeight = 0; //kreportDebug() << "Name: " << sectionData.name() << " Height: " << sectionHeight // << "Objects: " << sectionData.objects().count(); - emit(renderingSection(const_cast(§ionData), m_page, QPointF(m_leftMargin, m_yOffset))); + emit(renderingSection(const_cast(§ionData), m_page, QPointF(m_leftMargin, m_yOffset))); //Create a pre-rendered section for this section and add it to the document OROSection *sec = new OROSection(m_document); sec->setHeight(sectionData.height()); sec->setBackgroundColor(sectionData.backgroundColor()); sec->setType(sectionData.type()); m_document->addSection(sec); //Render section background ORORect* bg = new ORORect(); bg->setPen(QPen(Qt::NoPen)); bg->setBrush(sectionData.backgroundColor()); qreal w = m_page->document()->pageOptions().widthPx() - m_page->document()->pageOptions().getMarginRight() - m_leftMargin; bg->setRect(QRectF(m_leftMargin, m_yOffset, w, sectionHeight)); m_page->addPrimitive(bg, true); - QList objects = sectionData.objects(); - foreach(KoReportItemBase *ob, objects) { + QList objects = sectionData.objects(); + foreach(KReportItemBase *ob, objects) { QPointF offset(m_leftMargin, m_yOffset); QVariant itemData = m_kodata->value(ob->itemDataSource()); if (ob->supportsSubQuery()) { itemHeight = ob->renderReportData(m_page, sec, offset, m_kodata, m_scriptHandler); } else { - KoReportASyncItemBase *async_ob = qobject_cast(ob); + KReportAsyncItemBase *async_ob = qobject_cast(ob); if (async_ob){ //kreportDebug() << "async object"; asyncManager->addItem(async_ob, m_page, sec, offset, itemData, m_scriptHandler); } else { //kreportDebug() << "sync object"; itemHeight = ob->renderSimpleData(m_page, sec, offset, itemData, m_scriptHandler); } } if (itemHeight > sectionHeight) { sectionHeight = itemHeight; } } for (int i = 0; i < m_page->primitives(); ++i) { OROPrimitive *prim = m_page->primitive(i); if (prim->type() == OROTextBox::TextBox) { OROTextBox *text = static_cast(prim); if (text->requiresPostProcessing()) { m_postProcText.append(text); } } } m_yOffset += sectionHeight; return sectionHeight; } #ifdef KREPORT_SCRIPTING -void KoReportPreRendererPrivate::initEngine() +void KReportPreRendererPrivate::initEngine() { delete m_scriptHandler; - m_scriptHandler = new KRScriptHandler(m_kodata, m_reportData); + m_scriptHandler = new KReportScriptHandler(m_kodata, m_reportDocument); connect(this, SIGNAL(enteredGroup(QString,QVariant)), m_scriptHandler, SLOT(slotEnteredGroup(QString,QVariant))); connect(this, SIGNAL(exitedGroup(QString,QVariant)), m_scriptHandler, SLOT(slotExitedGroup(QString,QVariant))); - connect(this, SIGNAL(renderingSection(KRSectionData*,OROPage*,QPointF)), m_scriptHandler, SLOT(slotEnteredSection(KRSectionData*,OROPage*,QPointF))); + connect(this, SIGNAL(renderingSection(KReportSectionData*,OROPage*,QPointF)), m_scriptHandler, SLOT(slotEnteredSection(KReportSectionData*,OROPage*,QPointF))); } #endif -void KoReportPreRendererPrivate::asyncItemsFinished() +void KReportPreRendererPrivate::asyncItemsFinished() { //kreportDebug() << "Finished rendering async items"; delete asyncManager; } -//===========================KoReportPreRenderer=============================== +//===========================KReportPreRenderer=============================== -KoReportPreRenderer::KoReportPreRenderer(const QDomElement & document) - : d(new KoReportPreRendererPrivate()) +KReportPreRenderer::KReportPreRenderer(const QDomElement & document) + : d(new KReportPreRendererPrivate()) { setDocument(document); } -KoReportPreRenderer::~KoReportPreRenderer() +KReportPreRenderer::~KReportPreRenderer() { delete d; } -void KoReportPreRenderer::setName(const QString &n) +void KReportPreRenderer::setName(const QString &n) { - d->m_reportData->setName(n); + d->m_reportDocument->setName(n); } -ORODocument* KoReportPreRenderer::generate() +ORODocument* KReportPreRenderer::generate() { QScreen *srn = QApplication::screens().at(0); int dpiX = srn->logicalDotsPerInchX(); int dpiY = srn->logicalDotsPerInchY(); - if (d == 0 || !d->m_valid || d->m_reportData == 0 || d->m_kodata == 0) + if (d == 0 || !d->m_valid || d->m_reportDocument == 0 || d->m_kodata == 0) return 0; // Do this check now so we don't have to undo a lot of work later if it fails - LabelSizeInfo label; - if (d->m_reportData->page.getPageSize() == QLatin1String("Labels")) { - label = LabelSizeInfo::find(d->m_reportData->page.getLabelType()); + KReportLabelSizeInfo label; + if (d->m_reportDocument->page.getPageSize() == QLatin1String("Labels")) { + label = KReportLabelSizeInfo::find(d->m_reportDocument->page.getLabelType()); if (label.isNull()) return 0; } //kreportDebug() << "Creating Document"; - d->m_document = new ORODocument(d->m_reportData->m_title); + d->m_document = new ORODocument(d->m_reportDocument->m_title); d->m_pageCounter = 0; d->m_yOffset = 0.0; //kreportDebug() << "Calculating Margins"; if (!label.isNull()) { - if (d->m_reportData->page.isPortrait()) { + if (d->m_reportDocument ->page.isPortrait()) { d->m_topMargin = (label.startY() / 100.0); d->m_bottomMargin = 0; d->m_rightMargin = 0; d->m_leftMargin = (label.startX() / 100.0); } else { d->m_topMargin = (label.startX() / 100.0); d->m_bottomMargin = 0; d->m_rightMargin = 0; d->m_leftMargin = (label.startY() / 100.0); } } else { - d->m_topMargin = d->m_reportData->page.getMarginTop(); - d->m_bottomMargin = d->m_reportData->page.getMarginBottom(); - d->m_rightMargin = d->m_reportData->page.getMarginRight(); - d->m_leftMargin = d->m_reportData->page.getMarginLeft(); + d->m_topMargin = d->m_reportDocument->page.getMarginTop(); + d->m_bottomMargin = d->m_reportDocument->page.getMarginBottom(); + d->m_rightMargin = d->m_reportDocument->page.getMarginRight(); + d->m_leftMargin = d->m_reportDocument->page.getMarginLeft(); //kreportDebug() << "Margins:" << d->m_topMargin << d->m_bottomMargin << d->m_rightMargin << d->m_leftMargin; } //kreportDebug() << "Calculating Page Size"; - ReportPageOptions rpo(d->m_reportData->page); + KReportPageOptions rpo(d->m_reportDocument->page); // This should reflect the information of the report page size - if (d->m_reportData->page.getPageSize() == QLatin1String("Custom")) { - d->m_maxWidth = d->m_reportData->page.getCustomWidth(); - d->m_maxHeight = d->m_reportData->page.getCustomHeight(); + if (d->m_reportDocument->page.getPageSize() == QLatin1String("Custom")) { + d->m_maxWidth = d->m_reportDocument->page.getCustomWidth(); + d->m_maxHeight = d->m_reportDocument->page.getCustomHeight(); } else { if (!label.isNull()) { d->m_maxWidth = label.width(); d->m_maxHeight = label.height(); rpo.setPageSize(label.paper()); } else { // lookup the correct size information for the specified size paper - d->m_maxWidth = KReportPageFormat::width(KReportPageFormat::formatFromString(d->m_reportData->page.getPageSize()), KReportPageFormat::Portrait); - d->m_maxHeight = KReportPageFormat::height(KReportPageFormat::formatFromString(d->m_reportData->page.getPageSize()), KReportPageFormat::Portrait); + d->m_maxWidth = KReportPageFormat::width(KReportPageFormat::formatFromString(d->m_reportDocument->page.getPageSize()), KReportPageFormat::Portrait); + d->m_maxHeight = KReportPageFormat::height(KReportPageFormat::formatFromString(d->m_reportDocument->page.getPageSize()), KReportPageFormat::Portrait); KReportUnit pageUnit(KReportUnit::Millimeter); d->m_maxWidth = KReportUnit::toInch(pageUnit.fromUserValue(d->m_maxWidth)) * dpiX; d->m_maxHeight = KReportUnit::toInch(pageUnit.fromUserValue(d->m_maxHeight)) * dpiY; } } - if (!d->m_reportData->page.isPortrait()) { + if (!d->m_reportDocument->page.isPortrait()) { qreal tmp = d->m_maxWidth; d->m_maxWidth = d->m_maxHeight; d->m_maxHeight = tmp; } //kreportDebug() << "Page Size:" << d->m_maxWidth << d->m_maxHeight; d->m_document->setPageOptions(rpo); - d->m_kodata->setSorting(d->m_reportData->m_detailSection->m_sortedFields); + d->m_kodata->setSorting(d->m_reportDocument->m_detailSection->m_sortedFields); d->m_kodata->open(); #ifdef KREPORT_SCRIPTING d->initEngine(); connect(d->m_scriptHandler, SIGNAL(groupChanged(QMap)), this, SIGNAL(groupChanged(QMap))); //Loop through all abjects that have been registered, and register them with the script handler if (d->m_scriptHandler) { QMapIterator i(d->m_scriptObjects); while (i.hasNext()) { i.next(); d->m_scriptHandler->registerScriptObject(i.value(), i.key()); } //execute the script, if it fails, abort and return the empty document if (!d->m_scriptHandler->trigger()) { d->m_scriptHandler->displayErrors(); return d->m_document; } } #endif d->createNewPage(); if (!label.isNull()) { // Label Print Run // remember the initial margin setting as we will be modifying // the value and restoring it as we move around qreal margin = d->m_leftMargin; d->m_yOffset = d->m_topMargin; qreal w = (label.width() / 100.0); qreal wg = (label.xGap() / 100.0); qreal h = (label.height() / 100.0); qreal hg = (label.yGap() / 100.0); int numCols = label.columns(); int numRows = label.rows(); qreal tmp; // flip the value around if we are printing landscape - if (!d->m_reportData->page.isPortrait()) { + if (!d->m_reportDocument->page.isPortrait()) { w = (label.height() / 100.0); wg = (label.yGap() / 100.0); h = (label.width() / 100.0); hg = (label.xGap() / 100.0); numCols = label.rows(); numRows = label.columns(); } - KRDetailSectionData * detailData = d->m_reportData->m_detailSection; + KReportDetailSectionData * detailData = d->m_reportDocument->m_detailSection; if (detailData->m_detailSection) { - KoReportData *mydata = d->m_kodata; + KReportData *mydata = d->m_kodata; if (mydata && mydata->recordCount() > 0) { /* && !((query = orqThis->getQuery())->eof()))*/ mydata->moveFirst(); int row = 0; int col = 0; do { tmp = d->m_yOffset; // store the value as renderSection changes it d->renderSection(*(detailData->m_detailSection)); d->m_yOffset = tmp; // restore the value that renderSection modified col++; d->m_leftMargin += w + wg; if (col >= numCols) { d->m_leftMargin = margin; // reset back to original value col = 0; row++; d->m_yOffset += h + hg; if (row >= numRows) { d->m_yOffset = d->m_topMargin; row = 0; d->createNewPage(); } } } while (mydata->moveNext()); } } } else { // Normal Print Run - if (d->m_reportData->m_reportHeader) { - d->renderSection(*(d->m_reportData->m_reportHeader)); + if (d->m_reportDocument->m_reportHeader) { + d->renderSection(*(d->m_reportDocument->m_reportHeader)); } - if (d->m_reportData->m_detailSection) { - d->renderDetailSection(d->m_reportData->m_detailSection); + if (d->m_reportDocument->m_detailSection) { + d->renderDetailSection(d->m_reportDocument->m_detailSection); } - if (d->m_reportData->m_reportFooter) { - if (d->renderSectionSize(*(d->m_reportData->m_reportFooter)) + d->finishCurPageSize(true) + d->m_bottomMargin + d->m_yOffset >= d->m_maxHeight) { + if (d->m_reportDocument->m_reportFooter) { + if (d->renderSectionSize(*(d->m_reportDocument->m_reportFooter)) + d->finishCurPageSize(true) + d->m_bottomMargin + d->m_yOffset >= d->m_maxHeight) { d->createNewPage(); } - d->renderSection(*(d->m_reportData->m_reportFooter)); + d->renderSection(*(d->m_reportDocument->m_reportFooter)); } } d->finishCurPage(true); #ifdef KREPORT_SCRIPTING // _postProcText contains those text boxes that need to be updated // with information that wasn't available at the time it was added to the document d->m_scriptHandler->setPageTotal(d->m_document->pages()); for (int i = 0; i < d->m_postProcText.size(); i++) { OROTextBox * tb = d->m_postProcText.at(i); d->m_scriptHandler->setPageNumber(tb->page()->page() + 1); tb->setText(d->m_scriptHandler->evaluate(tb->text()).toString()); } #endif d->asyncManager->startRendering(); #ifdef KREPORT_SCRIPTING d->m_scriptHandler->displayErrors(); #endif d->m_kodata->close(); #ifdef KREPORT_SCRIPTING delete d->m_scriptHandler; d->m_scriptHandler = 0; #endif //! @todo check ownership delete d->m_kodata; d->m_postProcText.clear(); return d->m_document; } -void KoReportPreRenderer::setSourceData(KoReportData *data) +void KReportPreRenderer::setSourceData(KReportData *data) { if (data) { d->m_kodata = data; } } -bool KoReportPreRenderer::setDocument(const QDomElement &document) +bool KReportPreRenderer::setDocument(const QDomElement &document) { - delete d->m_reportData; + delete d->m_document; d->m_valid = false; if (document.tagName() != QLatin1String("report:content")) { kreportWarning() << "report schema is invalid"; return false; } - d->m_reportData = new KoReportReportData(document); - d->m_valid = d->m_reportData->isValid(); + d->m_reportDocument = new KReportDocument(document); + d->m_valid = d->m_reportDocument->isValid(); return isValid(); } -bool KoReportPreRenderer::isValid() const +bool KReportPreRenderer::isValid() const { if (d && d->m_valid) return true; return false; } #ifdef KREPORT_SCRIPTING -void KoReportPreRenderer::registerScriptObject(QObject* obj, const QString& name) +void KReportPreRenderer::registerScriptObject(QObject* obj, const QString& name) { //kreportDebug() << name; d->m_scriptObjects[name] = obj; } -KRScriptHandler *KoReportPreRenderer::scriptHandler() +KReportScriptHandler *KReportPreRenderer::scriptHandler() { return d->m_scriptHandler; } #endif -const KoReportReportData* KoReportPreRenderer::reportData() const +const KReportDocument* KReportPreRenderer::reportData() const { - return d->m_reportData; + return d->m_reportDocument; } diff --git a/src/renderer/KoReportPreRenderer.h b/src/renderer/KReportPreRenderer.h similarity index 74% rename from src/renderer/KoReportPreRenderer.h rename to src/renderer/KReportPreRenderer.h index cb42cf41..0e1b477c 100644 --- a/src/renderer/KoReportPreRenderer.h +++ b/src/renderer/KReportPreRenderer.h @@ -1,79 +1,79 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#ifndef __KOREPORTPRERENDERER_H__ -#define __KOREPORTPRERENDERER_H__ +#ifndef KREPORTPRERENDERER_H +#define KREPORTPRERENDERER_H #include "config-kreport.h" #include "kreport_export.h" #include #ifdef KREPORT_SCRIPTING -class KRScriptHandler; +class KReportScriptHandler; #else -#define KRScriptHandler void +#define KReportScriptHandler void #endif -class KoReportPreRendererPrivate; +class KReportPreRendererPrivate; class ORODocument; -class KoReportData; -class KoReportReportData; +class KReportData; +class KReportDocument; class QDomElement; // // ORPreRender // This class takes a report definition and prerenders the result to // an ORODocument that can be used to pass to any number of renderers. // -class KREPORT_EXPORT KoReportPreRenderer : public QObject +class KREPORT_EXPORT KReportPreRenderer : public QObject { Q_OBJECT public: - explicit KoReportPreRenderer(const QDomElement& document); + explicit KReportPreRenderer(const QDomElement& document); - virtual ~KoReportPreRenderer(); + virtual ~KReportPreRenderer(); - void setSourceData(KoReportData*); + void setSourceData(KReportData*); #ifdef KREPORT_SCRIPTING - KRScriptHandler *scriptHandler(); + KReportScriptHandler *scriptHandler(); void registerScriptObject(QObject*, const QString&); #endif ORODocument * generate(); /** @brief Set the name of the report so that it can be used internally by the script engine */ void setName(const QString &); bool isValid() const; - const KoReportReportData *reportData() const; + const KReportDocument *reportData() const; Q_SIGNALS: void groupChanged(const QMap &groupData); private: bool setDocument(const QDomElement &document); private: - KoReportPreRendererPrivate *const d; + KReportPreRendererPrivate *const d; }; -#endif // __KOREPORTPRERENDERER_H__ +#endif // KREPORTPRERENDERER_H diff --git a/src/renderer/KoReportPreRenderer_p.h b/src/renderer/KReportPreRenderer_p.h similarity index 73% rename from src/renderer/KoReportPreRenderer_p.h rename to src/renderer/KReportPreRenderer_p.h index e7be4d4d..6d3acd3e 100644 --- a/src/renderer/KoReportPreRenderer_p.h +++ b/src/renderer/KReportPreRenderer_p.h @@ -1,92 +1,95 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#ifndef __KOREPORTPRERENDERER_P_H__ -#define __KOREPORTPRERENDERER_P_H__ +#ifndef KREPORTPRERENDERER_P_H +#define KREPORTPRERENDERER_P_H #include "config-kreport.h" -#include "renderobjects.h" -#include "KoReportASyncItemManager.h" +#include "KReportRenderObjects.h" +#include "KReportAsyncItemManager_p.h" +#include "KReportDetailSectionData.h" #include -class KReportOneRecordData; +namespace KReportPrivate{ + class OneRecordData; +} /*! This class is the private class that houses all the internal variables so we can provide a cleaner interface to the user without presenting to them things that they don't need to see and may change over time. */ -class KoReportPreRendererPrivate : public QObject +class KReportPreRendererPrivate : public QObject { Q_OBJECT public: - KoReportPreRendererPrivate(); - virtual ~KoReportPreRendererPrivate(); + KReportPreRendererPrivate(); + virtual ~KReportPreRendererPrivate(); bool m_valid; ORODocument* m_document; OROPage* m_page; - KoReportReportData* m_reportData; + KReportDocument* m_reportDocument; qreal m_yOffset; // how far down the current page are we qreal m_topMargin; // value stored in the correct units qreal m_bottomMargin; // -- same as above -- qreal m_leftMargin; // -- same as above -- qreal m_rightMargin; // -- same as above -- qreal m_maxHeight; // -- same as above -- qreal m_maxWidth; // -- same as above -- int m_pageCounter; // what page are we currently on? int m_recordCount; - KoReportData* m_kodata; - KReportOneRecordData *m_oneRecord; + KReportData* m_kodata; + KReportPrivate::OneRecordData *m_oneRecord; QList m_postProcText; #ifdef KREPORT_SCRIPTING QMap m_scriptObjects; #endif void createNewPage(); qreal finishCurPage(bool = false); qreal finishCurPageSize(bool = false); - void renderDetailSection(KRDetailSectionData *detailData); - qreal renderSection(const KRSectionData &); - qreal renderSectionSize(const KRSectionData &); + void renderDetailSection(KReportDetailSectionData *detailData); + qreal renderSection(const KReportSectionData &); + qreal renderSectionSize(const KReportSectionData &); ///Scripting Stuff - KRScriptHandler *m_scriptHandler; + KReportScriptHandler *m_scriptHandler; #ifdef KREPORT_SCRIPTING void initEngine(); #endif - KoReportASyncItemManager* asyncManager; + KReportPrivate::AsyncItemManager* asyncManager; private Q_SLOTS: void asyncItemsFinished(); Q_SIGNALS: void enteredGroup(const QString&, const QVariant&); void exitedGroup(const QString&, const QVariant&); - void renderingSection(KRSectionData*, OROPage*, QPointF); + void renderingSection(KReportSectionData*, OROPage*, QPointF); }; #endif // __KOREPORTPRERENDERER_P_H__ diff --git a/src/renderer/KoReportPrintRenderer.cpp b/src/renderer/KReportPrintRenderer_p.cpp similarity index 92% rename from src/renderer/KoReportPrintRenderer.cpp rename to src/renderer/KReportPrintRenderer_p.cpp index 9fc6b9a5..496545ad 100644 --- a/src/renderer/KoReportPrintRenderer.cpp +++ b/src/renderer/KReportPrintRenderer_p.cpp @@ -1,255 +1,260 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#include "KoReportPrintRenderer.h" -#include "common/renderobjects.h" -#include "common/KReportPageFormat.h" +#include "kreport_debug.h" +#include "KReportPrintRenderer_p.h" +#include "KReportRenderObjects.h" +#include "KReportPageFormat.h" + #include #include -#include "kreport_debug.h" #include #include -KoReportPrintRenderer::KoReportPrintRenderer() +namespace KReportPrivate { + +PrintRenderer::PrintRenderer() { } -KoReportPrintRenderer::~KoReportPrintRenderer() +PrintRenderer::~PrintRenderer() { } -bool KoReportPrintRenderer::setupPrinter( ORODocument * document, QPrinter * pPrinter) +bool PrintRenderer::setupPrinter( ORODocument * document, QPrinter * pPrinter) { if (document == 0 || pPrinter == 0) return false; - pPrinter->setCreator(QLatin1String("KoReport Print Renderer")); + pPrinter->setCreator(QLatin1String("KReport Print Renderer")); pPrinter->setDocName(document->title()); pPrinter->setFullPage(true); pPrinter->setOrientation((document->pageOptions().isPortrait() ? QPrinter::Portrait : QPrinter::Landscape)); pPrinter->setPageOrder(QPrinter::FirstPageFirst); if (document->pageOptions().getPageSize().isEmpty()) pPrinter->setPageSize(QPrinter::Custom); else pPrinter->setPageSize(KReportPageFormat::printerPageSize(KReportPageFormat::formatFromString(document->pageOptions().getPageSize()))); return true; } -bool KoReportPrintRenderer::render(const KoReportRendererContext &context, ORODocument *document, int page) +bool PrintRenderer::render(const KReportRendererContext &context, ORODocument *document, int page) { Q_UNUSED(page); if (document == 0 || context.printer == 0 || context.painter == 0) return false; setupPrinter(document, context.printer); bool endWhenComplete = false; if (!context.painter->isActive()) { endWhenComplete = true; if (!context.painter->begin(context.printer)) return false; } int fromPage = context.printer->fromPage(); if (fromPage > 0) fromPage -= 1; int toPage = context.printer->toPage(); if (toPage == 0 || toPage > document->pages()) toPage = document->pages(); QScreen *srn = QApplication::screens().at(0); qreal scale = context.printer->resolution() / qreal(srn->logicalDotsPerInchX()); for (int copy = 0; copy < context.printer->numCopies(); copy++) { for (int page = fromPage; page < toPage; page++) { if (page > fromPage) context.printer->newPage(); OROPage * p = document->page(page); if (context.printer->pageOrder() == QPrinter::LastPageFirst) p = document->page(toPage - 1 - page); // Render Page Objects for (int i = 0; i < p->primitives(); i++) { OROPrimitive * prim = p->primitive(i); prim->setPosition(prim->position() * scale); prim->setSize(prim->size() * scale); //kreportDebug() << "Rendering object" << i << "type" << prim->type(); if (prim->type() == OROTextBox::TextBox) { //kreportDebug() << "Text Box"; OROTextBox * tb = (OROTextBox*) prim; QPointF ps = tb->position(); QSizeF sz = tb->size(); QRectF rc = QRectF(ps.x(), ps.y(), sz.width(), sz.height()); context.painter->save(); //Background QColor bg = tb->textStyle().backgroundColor; bg.setAlphaF(0.01 * tb->textStyle().backgroundOpacity); //_painter->setBackgroundMode(Qt::OpaqueMode); context.painter->fillRect(rc, bg); //Text context.painter->setBackgroundMode(Qt::TransparentMode); context.painter->setFont(tb->textStyle().font); context.painter->setPen(tb->textStyle().foregroundColor); context.painter->drawText(rc, tb->flags(), tb->text()); //outer line - context.painter->setPen(QPen(tb->lineStyle().lineColor, tb->lineStyle().weight * scale, tb->lineStyle().style)); + context.painter->setPen(QPen(tb->lineStyle().color(), tb->lineStyle().width() * scale, tb->lineStyle().penStyle())); context.painter->drawRect(rc); //Reset back to defaults for next element context.painter->restore(); } else if (prim->type() == OROLine::Line) { //kreportDebug() << "Line"; OROLine * ln = (OROLine*) prim; QPointF s = ln->startPoint(); QPointF e = ln->endPoint() * scale; //QPen pen ( _painter->pen() ); - QPen pen(ln->lineStyle().lineColor, ln->lineStyle().weight * scale, ln->lineStyle().style); + QPen pen(ln->lineStyle().color(), ln->lineStyle().width() * scale, ln->lineStyle().penStyle()); context.painter->save(); context.painter->setRenderHint(QPainter::Antialiasing, true); context.painter->setPen(pen); context.painter->drawLine(QLineF(s.x(), s.y(), e.x(), e.y())); context.painter->setRenderHint(QPainter::Antialiasing, false); context.painter->restore(); } else if (prim->type() == OROImage::Image) { //kreportDebug() << "Image"; OROImage * im = (OROImage*) prim; QPointF ps = im->position(); QSizeF sz = im->size(); QRectF rc = QRectF(ps.x(), ps.y(), sz.width(), sz.height()); QImage img = im->image(); if (im->scaled()) img = img.scaled(rc.size().toSize(), (Qt::AspectRatioMode) im->aspectRatioMode(), (Qt::TransformationMode) im->transformationMode()); QRectF sr = QRectF(QPointF(0.0, 0.0), rc.size().boundedTo(img.size())); context.painter->drawImage(rc.topLeft(), img, sr); } else if (prim->type() == ORORect::Rect) { //kreportDebug() << "Rect"; ORORect * re = (ORORect*) prim; QPointF ps = re->position(); QSizeF sz = re->size(); QRectF rc = QRectF(ps.x(), ps.y(), sz.width(), sz.height()); context.painter->save(); context.painter->setPen(re->pen()); context.painter->setBrush(re->brush()); context.painter->drawRect(rc); context.painter->restore(); } else if (prim->type() == OROEllipse::Ellipse) { OROEllipse * re = (OROEllipse*) prim; QPointF ps = re->position(); QSizeF sz = re->size(); QRectF rc = QRectF(ps.x(), ps.y(), sz.width(), sz.height()); context.painter->save(); context.painter->setPen(re->pen()); context.painter->setBrush(re->brush()); context.painter->drawEllipse(rc); context.painter->restore(); } else if (prim->type() == OROPicture::Picture) { OROPicture * im = (OROPicture*) prim; QPointF ps = im->position(); QSizeF sz = im->size(); QRectF rc = QRectF(ps.x(), ps.y(), sz.width(), sz.height()); context.painter->drawPicture(rc.topLeft(), *(im->picture())); } else if (prim->type() == OROCheck::Check) { OROCheck * chk = (OROCheck*) prim; QPointF ps = chk->position(); QSizeF sz = chk->size(); QRectF rc = QRectF(ps.x(), ps.y(), sz.width(), sz.height()); context.painter->save(); context.painter->setBackgroundMode(Qt::OpaqueMode); context.painter->setRenderHint(QPainter::Antialiasing); context.painter->setPen(chk->foregroundColor()); - if (chk->lineStyle().style == Qt::NoPen || chk->lineStyle().weight <= 0) { + if (chk->lineStyle().penStyle() == Qt::NoPen || chk->lineStyle().width() <= 0) { context.painter->setPen(QPen(Qt::lightGray)); } else { - context.painter->setPen(QPen(chk->lineStyle().lineColor, chk->lineStyle().weight * scale, chk->lineStyle().style)); + context.painter->setPen(QPen(chk->lineStyle().color(), chk->lineStyle().width() * scale, chk->lineStyle().penStyle())); } qreal ox = sz.width() / 5; qreal oy = sz.height() / 5; //Checkbox Style if (chk->checkType() == QLatin1String("Cross")) { context.painter->drawRoundedRect(rc, sz.width() / 10 , sz.height() / 10); if (chk->value()) { QPen lp; lp.setColor(chk->foregroundColor()); lp.setWidth(ox > oy ? oy : ox); context.painter->setPen(lp); context.painter->drawLine(QPointF(ox, oy) + ps, QPointF(sz.width() - ox, sz.height() - oy) + ps); context.painter->drawLine(QPointF(ox, sz.height() - oy) + ps, QPoint(sz.width() - ox, oy) + ps); } } else if (chk->checkType() == QLatin1String("Dot")) { //Radio Style context.painter->drawEllipse(rc); if (chk->value()) { QBrush lb(chk->foregroundColor()); context.painter->setBrush(lb); context.painter->setPen(Qt::NoPen); context.painter->drawEllipse(rc.center(), sz.width() / 2 - ox, sz.height() / 2 - oy); } } else { //Tickbox Style context.painter->drawRoundedRect(rc, sz.width() / 10 , sz.height() / 10); if (chk->value()) { QPen lp; lp.setColor(chk->foregroundColor()); lp.setWidth(ox > oy ? oy : ox); context.painter->setPen(lp); context.painter->drawLine(QPointF(ox, sz.height() / 2) + ps, QPointF(sz.width() / 2, sz.height() - oy) + ps); context.painter->drawLine(QPointF(sz.width() / 2, sz.height() - oy) + ps, QPointF(sz.width() - ox, oy) + ps); } } context.painter->restore(); } } } } if (endWhenComplete) context.painter->end(); return true; } + +} diff --git a/src/renderer/KoReportPrintRenderer.h b/src/renderer/KReportPrintRenderer_p.h similarity index 72% rename from src/renderer/KoReportPrintRenderer.h rename to src/renderer/KReportPrintRenderer_p.h index 45f45a07..f7cd7b12 100644 --- a/src/renderer/KoReportPrintRenderer.h +++ b/src/renderer/KReportPrintRenderer_p.h @@ -1,39 +1,43 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#ifndef __KOREPORTPRINTRENDERER_H__ -#define __KOREPORTPRINTRENDERER_H__ -#include "KoReportRendererBase.h" +#ifndef KREPORTPRINTRENDERER_H +#define KREPORTPRINTRENDERER_H + +#include "KReportRendererBase.h" class ORODocument; -class KoReportPrintRenderer : public KoReportRendererBase +namespace KReportPrivate { + +class PrintRenderer : public KReportRendererBase { public: - KoReportPrintRenderer(); - virtual ~KoReportPrintRenderer(); - virtual bool render(const KoReportRendererContext&, ORODocument*, int page = -1); + PrintRenderer(); + virtual ~PrintRenderer(); + virtual bool render(const KReportRendererContext&, ORODocument*, int page = -1); private: bool setupPrinter(ORODocument *, QPrinter *); }; -#endif // __KOREPORTPRINTRENDERER_H__ +} +#endif // KREPORTPRINTRENDERER_H diff --git a/src/renderer/KoReportRendererBase.cpp b/src/renderer/KReportRendererBase.cpp similarity index 60% rename from src/renderer/KoReportRendererBase.cpp rename to src/renderer/KReportRendererBase.cpp index ed521837..82713b11 100644 --- a/src/renderer/KoReportRendererBase.cpp +++ b/src/renderer/KReportRendererBase.cpp @@ -1,77 +1,77 @@ /* This file is part of the KDE project Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "KoReportRendererBase.h" -#include "KoReportScreenRenderer.h" -#include "KoReportPrintRenderer.h" -#include "KoReportKSpreadRenderer.h" -#include "KoReportHTMLTableRenderer.h" -#include "KoReportHTMLCSSRenderer.h" -//! @todo port #include "KoReportODTRenderer.h" -//! @todo port #include "KoOdtFrameReportRenderer.h" +#include "KReportRendererBase.h" +#include "KReportScreenRenderer_p.h" +#include "KReportPrintRenderer_p.h" +#include "KReportKSpreadRenderer.h" +#include "KReportHTMLTableRenderer_p.h" +#include "KReportHTMLCSSRenderer_p.h" +//! @todo port #include "KReportODTRenderer.h" +//! @todo port #include "KOdtFrameReportRenderer.h" -KoReportRendererContext::KoReportRendererContext() +KReportRendererContext::KReportRendererContext() : painter(0), printer(0) { } -KoReportRendererBase::KoReportRendererBase() +KReportRendererBase::KReportRendererBase() { } -KoReportRendererBase::~KoReportRendererBase() +KReportRendererBase::~KReportRendererBase() { } -KoReportRendererFactory::KoReportRendererFactory() +KReportRendererFactory::KReportRendererFactory() { } -KoReportRendererBase* KoReportRendererFactory::createInstance(const QString& key) +KReportRendererBase* KReportRendererFactory::createInstance(const QString& key) { const QString lowerKey = key.toLower(); if (lowerKey == QLatin1String("screen")) { - return new KoReportScreenRenderer(); + return new KReportPrivate::ScreenRenderer(); } if (lowerKey == QLatin1String("print")) { - return new KoReportPrintRenderer(); + return new KReportPrivate::PrintRenderer(); } //! @todo port #if 0 if (lowerKey == QLatin1String("ods")) { - return new KoReportKSpreadRenderer(); + return new KReportKSpreadRenderer(); } #endif if (lowerKey == QLatin1String("htmltable")) { - return new KoReportHTMLTableRenderer(); + return new KReportPrivate::HTMLTableRenderer(); } if (lowerKey == QLatin1String("htmlcss")) { - return new KoReportHTMLCSSRenderer(); + return new KReportPrivate::HTMLCSSRenderer(); } //! @todo port #if 0 if (lowerKey == QLatin1String("odttable") || lowerKey == QLatin1String("odt")) { - return new KoReportODTRenderer(); + return new KReportODTRenderer(); } if (lowerKey == QLatin1String("odtframes")) { - return new KoOdtFrameReportRenderer(); + return new KReportOdtFrameReportRenderer(); } #endif return 0; } diff --git a/src/renderer/KoReportRendererBase.h b/src/renderer/KReportRendererBase.h similarity index 71% rename from src/renderer/KoReportRendererBase.h rename to src/renderer/KReportRendererBase.h index 5e080150..cf5975eb 100644 --- a/src/renderer/KoReportRendererBase.h +++ b/src/renderer/KReportRendererBase.h @@ -1,64 +1,64 @@ /* This file is part of the KDE project Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef KOREPORTRENDERERBASE_H -#define KOREPORTRENDERERBASE_H +#ifndef KREPORTRENDERERBASE_H +#define KREPORTRENDERERBASE_H #include #include "kreport_export.h" class QPainter; class QPrinter; class ORODocument; //! Context for executing rendering. -class KREPORT_EXPORT KoReportRendererContext +class KREPORT_EXPORT KReportRendererContext { public: - KoReportRendererContext(); + KReportRendererContext(); QUrl destinationUrl; QPainter *painter; QPrinter *printer; }; //! Base class for report renderers. -class KREPORT_EXPORT KoReportRendererBase +class KREPORT_EXPORT KReportRendererBase { public: - KoReportRendererBase(); + KReportRendererBase(); - virtual ~KoReportRendererBase(); + virtual ~KReportRendererBase(); //! Render the page of the given document within the given context. //! If page == -1, renders the entire document. - virtual bool render(const KoReportRendererContext& context, ORODocument *document, int page = -1) = 0; + virtual bool render(const KReportRendererContext& context, ORODocument *document, int page = -1) = 0; }; //! Factory for creating renderers //! @todo make it use plugins -class KREPORT_EXPORT KoReportRendererFactory +class KREPORT_EXPORT KReportRendererFactory { public: - KoReportRendererFactory(); + KReportRendererFactory(); - KoReportRendererBase* createInstance(const QString& key); + KReportRendererBase* createInstance(const QString& key); }; -#endif // KOREPORTRENDERERBASE_H +#endif // KREPORTRENDERERBASE_H diff --git a/src/renderer/KoReportScreenRenderer.cpp b/src/renderer/KReportScreenRenderer_p.cpp similarity index 90% rename from src/renderer/KoReportScreenRenderer.cpp rename to src/renderer/KReportScreenRenderer_p.cpp index 742f8c3d..5520ac1e 100644 --- a/src/renderer/KoReportScreenRenderer.cpp +++ b/src/renderer/KReportScreenRenderer_p.cpp @@ -1,221 +1,225 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#include "KoReportScreenRenderer.h" -#include "common/renderobjects.h" -#include "common/KReportPageFormat.h" -#include "common/KReportUnit.h" +#include "KReportScreenRenderer_p.h" +#include "KReportRenderObjects.h" +#include "KReportPageFormat.h" +#include "KReportUnit.h" #include "kreport_debug.h" -KoReportScreenRenderer::KoReportScreenRenderer() +namespace KReportPrivate { + +ScreenRenderer::ScreenRenderer() { } -KoReportScreenRenderer::~KoReportScreenRenderer() +ScreenRenderer::~ScreenRenderer() { } //void KRScreenRender::setPainter(QPainter * pPainter) //{ // context.painter = pPainter; //} -bool KoReportScreenRenderer::render(const KoReportRendererContext& context, ORODocument *document, int page) +bool ScreenRenderer::render(const KReportRendererContext& context, ORODocument *document, int page) { if (!document) return false; if (!context.painter) return false; OROPage *p = document->page(page); if (!p) { return false; } // Render Page Objects for (int i = 0; i < p->primitives(); i++) { OROPrimitive *prim = p->primitive(i); if (prim->type() == OROTextBox::TextBox) { OROTextBox *tb = dynamic_cast(prim); QPointF ps = tb->position(); QSizeF sz = tb->size(); QRectF rc = QRectF(ps.x(), ps.y(), sz.width(), sz.height()); context.painter->save(); //Background context.painter->setBackgroundMode(Qt::TransparentMode); QColor bg = tb->textStyle().backgroundColor; bg.setAlphaF(0.01 * tb->textStyle().backgroundOpacity); context.painter->fillRect(rc, bg); //Text context.painter->setFont(tb->textStyle().font); context.painter->setPen(tb->textStyle().foregroundColor); context.painter->drawText(rc.adjusted(2, 2, 0, 0), tb->flags(), tb->text()); //outer line - context.painter->setPen(QPen(tb->lineStyle().lineColor, tb->lineStyle().weight, tb->lineStyle().style)); + context.painter->setPen(QPen(tb->lineStyle().color(), tb->lineStyle().width(), tb->lineStyle().penStyle())); context.painter->drawRect(rc); //Reset back to defaults for next element context.painter->restore(); } else if (prim->type() == OROLine::Line) { OROLine * ln = dynamic_cast(prim); QPointF s = ln->startPoint(); QPointF e = ln->endPoint(); //QPen pen ( _painter->pen() ); - QPen pen(ln->lineStyle().lineColor, ln->lineStyle().weight, ln->lineStyle().style); + QPen pen(ln->lineStyle().color(), ln->lineStyle().width(), ln->lineStyle().penStyle()); context.painter->save(); context.painter->setRenderHint(QPainter::Antialiasing, true); context.painter->setPen(pen); context.painter->drawLine(QLineF(s.x(), s.y(), e.x(), e.y())); context.painter->setRenderHint(QPainter::Antialiasing, false); context.painter->restore(); } else if (prim->type() == ORORect::Rect) { ORORect * re = dynamic_cast(prim); QPointF ps = re->position(); QSizeF sz = re->size(); QRectF rc = QRectF(ps.x(), ps.y(), sz.width(), sz.height()); context.painter->save(); context.painter->setPen(re->pen()); context.painter->setBrush(re->brush()); context.painter->drawRect(rc); context.painter->restore(); } else if (prim->type() == OROEllipse::Ellipse) { OROEllipse * re = dynamic_cast(prim); QPointF ps = re->position(); QSizeF sz = re->size(); QRectF rc = QRectF(ps.x(), ps.y(), sz.width(), sz.height()); context.painter->save(); context.painter->setPen(re->pen()); context.painter->setBrush(re->brush()); context.painter->drawEllipse(rc); context.painter->restore(); } else if (prim->type() == OROImage::Image) { OROImage * im = dynamic_cast(prim); QPointF ps = im->position(); QSizeF sz = im->size(); QRectF rc = QRectF(ps.x(), ps.y(), sz.width(), sz.height()); QImage img = im->image(); if (im->scaled()) img = img.scaled(rc.size().toSize(), (Qt::AspectRatioMode) im->aspectRatioMode(), (Qt::TransformationMode) im->transformationMode()); QRectF sr = QRectF(QPointF(0.0, 0.0), rc.size().boundedTo(img.size())); context.painter->drawImage(rc.topLeft(), img, sr); } else if (prim->type() == OROPicture::Picture) { OROPicture * im = dynamic_cast(prim); QPointF ps = im->position(); QSizeF sz = im->size(); QRectF rc = QRectF(ps.x(), ps.y(), sz.width(), sz.height()); context.painter->save(); context.painter->drawPicture(rc.topLeft(), *(im->picture())); context.painter->restore(); } else if (prim->type() == OROCheck::Check) { OROCheck * chk = dynamic_cast(prim); QPointF ps = chk->position(); QSizeF sz = chk->size(); QRectF rc = QRectF(ps.x(), ps.y(), sz.width(), sz.height()); context.painter->save(); context.painter->setBackgroundMode(Qt::OpaqueMode); context.painter->setRenderHint(QPainter::Antialiasing); context.painter->setPen(chk->foregroundColor()); - if (chk->lineStyle().style == Qt::NoPen || chk->lineStyle().weight <= 0) { + if (chk->lineStyle().penStyle() == Qt::NoPen || chk->lineStyle().width() <= 0) { context.painter->setPen(QPen(Qt::lightGray)); } else { - context.painter->setPen(QPen(chk->lineStyle().lineColor, chk->lineStyle().weight, chk->lineStyle().style)); + context.painter->setPen(QPen(chk->lineStyle().color(), chk->lineStyle().width(), chk->lineStyle().penStyle())); } qreal ox = sz.width() / 5; qreal oy = sz.height() / 5; //Checkbox Style if (chk->checkType() == QLatin1String("Cross")) { context.painter->drawRoundedRect(rc, sz.width() / 10 , sz.height() / 10); if (chk->value()) { QPen lp; lp.setColor(chk->foregroundColor()); lp.setWidth(ox > oy ? oy : ox); context.painter->setPen(lp); context.painter->drawLine(QPointF(ox, oy) + ps, QPointF(sz.width() - ox, sz.height() - oy) + ps); context.painter->drawLine(QPointF(ox, sz.height() - oy) + ps, QPoint(sz.width() - ox, oy) + ps); } } else if (chk->checkType() == QLatin1String("Dot")) { //Radio Style context.painter->drawEllipse(rc); if (chk->value()) { QBrush lb(chk->foregroundColor()); context.painter->setBrush(lb); context.painter->setPen(Qt::NoPen); context.painter->drawEllipse(rc.center(), sz.width() / 2 - ox, sz.height() / 2 - oy); } } else { //Tickbox Style context.painter->drawRoundedRect(rc, sz.width() / 10 , sz.height() / 10); if (chk->value()) { QPen lp; lp.setColor(chk->foregroundColor()); lp.setWidth(ox > oy ? oy : ox); context.painter->setPen(lp); context.painter->drawLine( QPointF(ox, sz.height() / 2) + ps, QPointF(sz.width() / 2, sz.height() - oy) + ps); context.painter->drawLine( QPointF(sz.width() / 2, sz.height() - oy) + ps, QPointF(sz.width() - ox, oy) + ps); } } context.painter->restore(); } else { kreportWarning() << "unrecognized primitive type"; } } return true; } + +} diff --git a/src/renderer/KoReportScreenRenderer.h b/src/renderer/KReportScreenRenderer_p.h similarity index 73% rename from src/renderer/KoReportScreenRenderer.h rename to src/renderer/KReportScreenRenderer_p.h index 9991941c..468906df 100644 --- a/src/renderer/KoReportScreenRenderer.h +++ b/src/renderer/KReportScreenRenderer_p.h @@ -1,44 +1,49 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#ifndef __KOREPORTSCREENRENDERER_H__ -#define __KOREPORTSCREENRENDERER_H__ + +#ifndef KREPORTSCREENRENDERER_H +#define KREPORTSCREENRENDERER_H #include -#include "KoReportRendererBase.h" +#include "KReportRendererBase.h" class ORODocument; -class KoReportScreenRenderer : public KoReportRendererBase +namespace KReportPrivate { + +class ScreenRenderer : public KReportRendererBase { public: - KoReportScreenRenderer(); - virtual ~KoReportScreenRenderer(); + ScreenRenderer(); + virtual ~ScreenRenderer(); //void setPainter(QPainter *); //QPainter * painter() { // return m_painter; //} - virtual bool render(const KoReportRendererContext& context, ORODocument *document, int page); + virtual bool render(const KReportRendererContext& context, ORODocument *document, int page); protected: //QPainter* m_painter; }; -#endif // __KOREPORTSCREENRENDERER_H__ +} + +#endif // KREPORTSCREENRENDERER_H diff --git a/src/renderer/KReportView.cpp b/src/renderer/KReportView.cpp index 4de185d5..08edaa98 100644 --- a/src/renderer/KReportView.cpp +++ b/src/renderer/KReportView.cpp @@ -1,158 +1,157 @@ /* This file is part of the KDE project Copyright (C) 2015 by Adam Pigg (adam@piggz.co.uk) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "KReportView.h" -#include +#include "KReportPage.h" +#include "KReportRenderObjects.h" +#include "KReportPreRenderer.h" +#include "KReportRendererBase.h" +#include "kreport_debug.h" #include #include #include #include #include #include #include #include #include #include -#include -#include -#include -#include "kreport_debug.h" - //! @internal class KReportView::Private { public: explicit Private() : reportDocument(0) , reportPage(0) , currentPage(0) , pageCount(0) {} ~Private() {} ORODocument *reportDocument; QGraphicsView *reportView; QGraphicsScene *reportScene; - KoReportPage *reportPage; + KReportPage *reportPage; int currentPage; int pageCount; - KoReportRendererFactory factory; + KReportRendererFactory factory; }; KReportView::KReportView(QWidget *parent) : QWidget(parent), d(new Private()) { setObjectName(QLatin1String("KReportView")); d->reportView = new QGraphicsView(this); // page selector should be always visible: d->reportView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn); QVBoxLayout *l = new QVBoxLayout; setLayout(l); layout()->addWidget(d->reportView); d->reportScene = new QGraphicsScene(this); d->reportScene->setSceneRect(0,0,1000,2000); d->reportView->setScene(d->reportScene); d->reportScene->setBackgroundBrush(palette().brush(QPalette::Dark)); } KReportView::~KReportView() { kreportDebug(); delete d; } void KReportView::moveToFirstPage() { if (d->currentPage != 1) { d->currentPage = 1; d->reportPage->renderPage(d->currentPage); } } void KReportView::moveToLastPage() { if (d->currentPage != d->pageCount) { d->currentPage = d->pageCount; d->reportPage->renderPage(d->currentPage); } } void KReportView::moveToNextPage() { if (d->currentPage < d->pageCount) { d->currentPage++; d->reportPage->renderPage(d->currentPage); } } void KReportView::moveToPreviousPage() { if (d->currentPage > 1) { d->currentPage--; d->reportPage->renderPage(d->currentPage); } } int KReportView::currentPage() const { return d->currentPage; } int KReportView::pageCount() const { return d->pageCount; } void KReportView::setDocument(ORODocument* doc) { d->reportDocument = doc; if (d->reportPage) { delete d->reportPage; } d->pageCount = doc->pages(); - d->reportPage = new KoReportPage(this, d->reportDocument); + d->reportPage = new KReportPage(this, d->reportDocument); d->reportPage->setObjectName(QLatin1String("KReportPage")); d->reportScene->setSceneRect(0,0,d->reportPage->rect().width() + 40, d->reportPage->rect().height() + 40); d->reportScene->addItem(d->reportPage); d->reportPage->setPos(20,20); d->reportView->centerOn(0,0); } QAbstractScrollArea* KReportView::scrollArea() { return d->reportView; } diff --git a/src/renderer/odtframe/KoOdtFrameReportCheckBox.cpp b/src/renderer/odtframe/KoOdtFrameReportCheckBox.cpp index fee2a55f..b2e460eb 100644 --- a/src/renderer/odtframe/KoOdtFrameReportCheckBox.cpp +++ b/src/renderer/odtframe/KoOdtFrameReportCheckBox.cpp @@ -1,180 +1,180 @@ /* This file is part of the KDE project Copyright (C) 2011, 2012 by Dag Andersen (danders@get2net.dk) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "KoOdtFrameReportCheckBox.h" #include #include #include #include #include #include #include -#include "renderobjects.h" +#include "KReportRenderObjects.h" #include #include #include #include "kreport_debug.h" #include #include KoOdtFrameReportCheckBox::KoOdtFrameReportCheckBox(OROCheck *primitive) : KoOdtFrameReportPrimitive(primitive) { } KoOdtFrameReportCheckBox::~KoOdtFrameReportCheckBox() { } OROCheck *KoOdtFrameReportCheckBox::checkBox() const { return static_cast(m_primitive); } void KoOdtFrameReportCheckBox::createStyle(KoGenStyles *coll) { KoGenStyle gs(KoGenStyle::GraphicStyle, "graphic"); gs.addProperty("draw:fill", "none"); gs.addPropertyPt("fo:margin", 0); gs.addProperty("style:horizontal-pos", "from-left"); gs.addProperty("style:horizontal-rel", "page"); gs.addProperty("style:vertical-pos", "from-top"); gs.addProperty("style:vertical-rel", "page"); gs.addProperty("style:wrap", "dynamic"); gs.addPropertyPt("style:wrap-dynamic-threshold", 0); QPen pen; qreal weight = checkBox()->lineStyle().weight; if (weight < 1.0) { weight = 1.0; } pen.setWidthF(weight); pen.setColor(checkBox()->lineStyle().lineColor); pen.setStyle(checkBox()->lineStyle().style); KoOdfGraphicStyles::saveOdfStrokeStyle(gs, coll, pen); m_frameStyleName = coll->insert(gs, "F"); } void KoOdtFrameReportCheckBox::createBody(KoXmlWriter *bodyWriter) const { bodyWriter->startElement("draw:frame"); bodyWriter->addAttribute("draw:id", itemName()); bodyWriter->addAttribute("xml:id", itemName()); bodyWriter->addAttribute("draw:name", itemName()); bodyWriter->addAttribute("text:anchor-type", "page"); bodyWriter->addAttribute("text:anchor-page-number", pageNumber()); bodyWriter->addAttribute("draw:style-name", m_frameStyleName); commonAttributes(bodyWriter); bodyWriter->startElement("draw:image"); bodyWriter->addAttribute("xlink:href", "Pictures/" + imageName()); bodyWriter->addAttribute("xlink:type", "simple"); bodyWriter->addAttribute("xlink:show", "embed"); bodyWriter->addAttribute("xlink:actuate", "onLoad"); bodyWriter->endElement(); // draw:image bodyWriter->endElement(); // draw:frame } QString KoOdtFrameReportCheckBox::imageName() const { return QString("Checkbox_%1.png").arg(m_uid); } bool KoOdtFrameReportCheckBox::saveData(KoStore* store, KoXmlWriter* manifestWriter) const { QString name = "Pictures/" + imageName(); if (!store->open(name)) { return false; } OROCheck * chk = checkBox(); QSizeF sz = chk->size(); QPen fpen; // frame pen if (chk->lineStyle().style == Qt::NoPen || chk->lineStyle().weight <= 0) { fpen = QPen(Qt::lightGray); } else { fpen = QPen(chk->lineStyle().lineColor, chk->lineStyle().weight, chk->lineStyle().style); } QPointF ps(fpen.widthF(), fpen.widthF()); QRectF rc = QRectF(0, 0, sz.width() + (ps.x()*2), sz.height() + (ps.y()*2)); QPainter painter; QImage image(rc.size().toSize(), QImage::Format_ARGB32); image.fill(0); painter.begin(&image); painter.setBackgroundMode(Qt::OpaqueMode); painter.setRenderHint(QPainter::Antialiasing); qreal ox = sz.width() / 5; qreal oy = sz.height() / 5; //Checkbox Style if (chk->checkType() == "Cross") { painter.drawRoundedRect(rc.adjusted(ps.x(), ps.y(), -ps.x(), -ps.y()), sz.width() / 10 , sz.height() / 10); if (chk->value()) { QPen lp; lp.setColor(chk->foregroundColor()); lp.setWidth(ox > oy ? oy : ox); painter.setPen(lp); QRectF r = rc.adjusted(ox + ps.x(), oy + ps.y(), -(ox + ps.x()), -(oy + ps.y())); painter.drawLine(r.topLeft(), r.bottomRight()); painter.drawLine(r.bottomLeft(), r.topRight()); } } else if (chk->checkType() == "Dot") { //Radio Style painter.drawEllipse(rc); if (chk->value()) { QBrush lb(chk->foregroundColor()); painter.setBrush(lb); painter.setPen(Qt::NoPen); painter.drawEllipse(rc.center(), sz.width() / 2 - ox, sz.height() / 2 - oy); } } else { //Tickbox Style painter.drawRoundedRect(rc.adjusted(ps.x(), ps.y(), -ps.x(), -ps.y()), sz.width() / 10 , sz.height() / 10); if (chk->value()) { QPen lp; lp.setColor(chk->foregroundColor()); lp.setWidth(ox > oy ? oy : ox); painter.setPen(lp); painter.drawLine(QPointF(ox, sz.height() / 2) + ps, QPointF(sz.width() / 2, sz.height() - oy) + ps); painter.drawLine(QPointF(sz.width() / 2, sz.height() - oy) + ps, QPointF(sz.width() - ox, oy) + ps); } } painter.end(); KoStoreDevice device(store); bool ok = image.save(&device, "PNG"); if (ok) { QMimeDatabase db; const QString mimetype(db.mimeTypeForFile(name, QMimeDatabase::MatchExtension).name()); manifestWriter->addManifestEntry(name, mimetype); //kreportDebug() << "manifest:" << mimetype; } bool cl = store->close(); //kreportDebug()< #include #include #include #include #include #include #include #include "kreport_debug.h" KoOdtFrameReportDocument::KoOdtFrameReportDocument() : manifestWriter(0) { } KoOdtFrameReportDocument::~KoOdtFrameReportDocument() { foreach (const QList &lst, m_pagemap) { foreach(KoOdtFrameReportPrimitive *p, lst) { delete p; } } } void KoOdtFrameReportDocument::setPageOptions(const ReportPageOptions &pageOptions) { m_pageOptions = pageOptions; } void KoOdtFrameReportDocument::startTable(OROSection* section) { Q_UNUSED(section); } void KoOdtFrameReportDocument::addPrimitive(KoOdtFrameReportPrimitive *data) { m_pagemap[data->pageNumber()].append( data); } QFile::FileError KoOdtFrameReportDocument::saveDocument(const QString& path) { // create output store KoStore *store = KoStore::createStore(path, KoStore::Write, "application/vnd.oasis.opendocument.text", KoStore::Zip); if (!store) { kreportWarning() << "Couldn't open the requested file."; return QFile::OpenError; } KoOdfWriteStore oasisStore(store); manifestWriter = oasisStore.manifestWriter("application/vnd.oasis.opendocument.text"); if (!manifestWriter) { return QFile::NoError; } // save extra data like images... foreach (const QList &lst, m_pagemap) { foreach(KoOdtFrameReportPrimitive *p, lst) { p->saveData(store, manifestWriter); } } //kreportDebug()<<"data saved"; KoGenStyles coll; createStyles(&coll); // create basic styles bool ok = createContent(&oasisStore, coll); if (ok) { // save styles to styles.xml ok = coll.saveOdfStylesDotXml(store, manifestWriter); } ok = oasisStore.closeManifestWriter() && ok; delete oasisStore.store(); return ok ? QFile::NoError : QFile::WriteError; } void KoOdtFrameReportDocument::createStyles(KoGenStyles *coll) { // convert to inches qreal pw = m_pageOptions.widthPx() / KReportDpi::dpiX(); qreal ph = m_pageOptions.heightPx() / KReportDpi::dpiY(); qreal topMargin = m_pageOptions.getMarginTop() / KReportDpi::dpiY(); qreal bottomMargin = m_pageOptions.getMarginBottom() / KReportDpi::dpiY(); qreal leftMargin = m_pageOptions.getMarginLeft() / KReportDpi::dpiX(); qreal rightMargin = m_pageOptions.getMarginRight() / KReportDpi::dpiX(); QString orientation = m_pageOptions.isPortrait() ? "portrait" : "landscape"; //kreportDebug()<<"Page:"<insert(page, "pm"); KoGenStyle master(KoGenStyle::MasterPageStyle, "master-page"); master.addAttribute("style:page-layout-name", pagename); coll->insert(master, "Standard", KoGenStyles::DontAddNumberToName); KoGenStyle fs(KoGenStyle::GraphicStyle, "graphic"); fs.addProperty("vertical-pos", "from-top"); fs.addProperty("vertical-rel", "page"); fs.addProperty("horizontal-pos", "from-left"); fs.addProperty("horizontal-rel", "page"); coll->insert(fs, "Frame", KoGenStyles::DontAddNumberToName); KoGenStyle ps(KoGenStyle::ParagraphStyle, "paragraph"); ps.addAttribute("style:parent-style-name", "Standard"); coll->insert(ps, "P1", KoGenStyles::DontAddNumberToName); } bool KoOdtFrameReportDocument::createContent(KoOdfWriteStore* store, KoGenStyles *coll) { KoXmlWriter* bodyWriter = store->bodyWriter(); KoXmlWriter* contentWriter = store->contentWriter(); if (!bodyWriter || !contentWriter || !manifestWriter) { kreportWarning()<<"Failed to created odt writer"; return false; } // OpenDocument spec requires the manifest to include a list of the files in this package manifestWriter->addManifestEntry("content.xml", "text/xml"); // manifestWriter->addManifestEntry("styles.xml", "text/xml"); contentWriter->startElement("office:automatic-styles"); //new page contentWriter->startElement("style:style"); contentWriter->addAttribute("style:name", "NewPage"); contentWriter->addAttribute("style:master-page-name", "Standard"); contentWriter->addAttribute("style:family", "paragraph"); contentWriter->startElement("style:paragraph-properties"); contentWriter->addAttribute("fo:font-family", "Arial"); contentWriter->addAttribute("fo:break-before", "page"); // needed by LibreOffice contentWriter->endElement(); // style:paragraph-properties contentWriter->endElement(); // style:style contentWriter->startElement("text:sequence-decls"); contentWriter->startElement("text:sequence-decl"); contentWriter->addAttribute("text:display-outline-level", "0"); contentWriter->addAttribute("text:name", "Illustration"); contentWriter->endElement(); //text:sequence-decl contentWriter->startElement("text:sequence-decl"); contentWriter->addAttribute("text:display-outline-level", "0"); contentWriter->addAttribute("text:name", "Table"); contentWriter->endElement(); //text:sequence-decl contentWriter->startElement("text:sequence-decl"); contentWriter->addAttribute("text:display-outline-level", "0"); contentWriter->addAttribute("text:name", "Text"); contentWriter->endElement(); //text:sequence-decl contentWriter->startElement("text:sequence-decl"); contentWriter->addAttribute("text:display-outline-level", "0"); contentWriter->addAttribute("text:name", "Drawing"); contentWriter->endElement(); //text:sequence-decl contentWriter->endElement(); //text:sequence-decls contentWriter->endElement(); // office:automatic-styles // office:body bodyWriter->startElement("office:body"); bodyWriter->startElement("office:text"); createPages(bodyWriter, coll); bodyWriter->endElement(); // office:text bodyWriter->endElement(); // office:body return store->closeContentWriter(); } void KoOdtFrameReportDocument::createPages(KoXmlWriter* bodyWriter, KoGenStyles *coll) { QMap >::const_iterator it; for (it = m_pagemap.constBegin(); it != m_pagemap.constEnd(); ++it) { bodyWriter->startElement("text:p"); bodyWriter->addAttribute("text:style-name", "NewPage"); // all frames need to be *inside* or else LibreWriter shows nothing foreach (KoOdtFrameReportPrimitive *data, it.value()) { data->createStyle(coll); data->createBody(bodyWriter); } bodyWriter->endElement(); // text:p } if (m_pagemap.isEmpty()) { // words crashes if there is no text element bodyWriter->startElement("text:p"); bodyWriter->addAttribute("text:style-name", "P1"); bodyWriter->endElement(); // text:p } } diff --git a/src/renderer/odtframe/KoOdtFrameReportImage.cpp b/src/renderer/odtframe/KoOdtFrameReportImage.cpp index 49aaee37..a6bbcc7c 100644 --- a/src/renderer/odtframe/KoOdtFrameReportImage.cpp +++ b/src/renderer/odtframe/KoOdtFrameReportImage.cpp @@ -1,86 +1,86 @@ /* This file is part of the KDE project Copyright (C) 2011, 2012 by Dag Andersen (danders@get2net.dk) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "KoOdtFrameReportImage.h" #include #include #include #include #include -#include "renderobjects.h" +#include "KReportRenderObjects.h" KoOdtFrameReportImage::KoOdtFrameReportImage(OROImage *primitive) : KoOdtFrameReportPrimitive(primitive) { } KoOdtFrameReportImage::~KoOdtFrameReportImage() { } OROImage *KoOdtFrameReportImage::image() const { return static_cast(m_primitive); } void KoOdtFrameReportImage::setImageName(const QString &name) { m_name = name; } void KoOdtFrameReportImage::createBody(KoXmlWriter *bodyWriter) const { bodyWriter->startElement("draw:frame"); bodyWriter->addAttribute("draw:style-name", "picture"); bodyWriter->addAttribute("draw:id", itemName()); bodyWriter->addAttribute("draw:name", itemName()); bodyWriter->addAttribute("text:anchor-type", "page"); bodyWriter->addAttribute("text:anchor-page-number", pageNumber()); bodyWriter->addAttribute("draw:style-name", m_frameStyleName); commonAttributes(bodyWriter); bodyWriter->startElement("draw:image"); bodyWriter->addAttribute("xlink:href", "Pictures/" + imageName()); bodyWriter->addAttribute("xlink:type", "simple"); bodyWriter->addAttribute("xlink:show", "embed"); bodyWriter->addAttribute("xlink:actuate", "onLoad"); bodyWriter->endElement(); bodyWriter->endElement(); // draw:frame } bool KoOdtFrameReportImage::saveData(KoStore* store, KoXmlWriter* manifestWriter) const { QString name = "Pictures/" + imageName(); if (!store->open(name)) { return false; } KoStoreDevice device(store); bool ok = image()->image().save(&device, "PNG"); if (ok) { QMimeDatabase db; const QString mimetype(db.mimeTypeForFile(name, QMimeDatabase::MatchExtension).name()); manifestWriter->addManifestEntry(name, mimetype); } ok = store->close() && ok; return ok; } diff --git a/src/renderer/odtframe/KoOdtFrameReportLine.cpp b/src/renderer/odtframe/KoOdtFrameReportLine.cpp index 8f34360d..5b557b83 100644 --- a/src/renderer/odtframe/KoOdtFrameReportLine.cpp +++ b/src/renderer/odtframe/KoOdtFrameReportLine.cpp @@ -1,115 +1,115 @@ /* This file is part of the KDE project Copyright (C) 2011, 2012 by Dag Andersen (danders@get2net.dk) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "KoOdtFrameReportLine.h" -#include "renderobjects.h" +#include "KReportRenderObjects.h" #include #include #include #include #include #include #include #include "kreport_debug.h" KoOdtFrameReportLine::KoOdtFrameReportLine(OROLine *primitive) : KoOdtFrameReportPrimitive(primitive) { } KoOdtFrameReportLine::~KoOdtFrameReportLine() { } OROLine *KoOdtFrameReportLine::line() const { return static_cast(m_primitive); } void KoOdtFrameReportLine::createStyle(KoGenStyles *coll) { KoGenStyle ps(KoGenStyle::ParagraphStyle, "paragraph"); m_paragraphStyleName = coll->insert(ps, "P"); KoGenStyle gs(KoGenStyle::GraphicStyle, "graphic"); gs.addProperty("draw:fill", "none"); gs.addPropertyPt("fo:margin", 0); gs.addProperty("style:horizontal-pos", "from-left"); gs.addProperty("style:horizontal-rel", "page"); gs.addProperty("style:vertical-pos", "from-top"); gs.addProperty("style:vertical-rel", "page"); gs.addProperty("style:wrap", "dynamic"); gs.addPropertyPt("style:wrap-dynamic-threshold", 0); QPen pen; qreal weight = line()->lineStyle().weight; if (weight < 1.0) { weight = 1.0; } pen.setWidthF(weight); pen.setColor(line()->lineStyle().lineColor); pen.setStyle(line()->lineStyle().style); KoOdfGraphicStyles::saveOdfStrokeStyle(gs, coll, pen); m_frameStyleName = coll->insert(gs, "F"); //kreportDebug()<<*coll; } void KoOdtFrameReportLine::createBody(KoXmlWriter *bodyWriter) const { // convert to inches qreal sx = INCH_TO_POINT(line()->startPoint().x() / KReportDpi::dpiX()); qreal sy = INCH_TO_POINT(line()->startPoint().y() / KReportDpi::dpiY()); qreal ex = INCH_TO_POINT(line()->endPoint().x() / KReportDpi::dpiX()); qreal ey = INCH_TO_POINT(line()->endPoint().y() / KReportDpi::dpiY()); qreal width = ex - sx; qreal height = ey - sy; //kreportDebug()<startPoint()<endPoint(); bodyWriter->startElement("draw:rect"); bodyWriter->addAttribute("draw:id", itemName()); bodyWriter->addAttribute("xml:id", itemName()); bodyWriter->addAttribute("draw:name", itemName()); bodyWriter->addAttribute("text:anchor-type", "page"); bodyWriter->addAttribute("text:anchor-page-number", pageNumber()); bodyWriter->addAttribute("draw:style-name", m_frameStyleName); bodyWriter->addAttribute("draw:z-index", "3"); if (height == 0.0 && width >= 0.0) { // just a horizontal line bodyWriter->addAttributePt("svg:x", sx); bodyWriter->addAttributePt("svg:y", sy); bodyWriter->addAttributePt("svg:width", width); bodyWriter->addAttributePt("svg:height", 0.0); } else { // rotate qreal l = sqrt(width*width + height*height); bodyWriter->addAttributePt("svg:width", l); bodyWriter->addAttributePt("svg:height", 0.0); qreal sina = height / l; qreal cosa = width / l; QTransform rotate(cosa, sina, -sina, cosa, sx, sy); bodyWriter->addAttribute("draw:transform", KoOdfGraphicStyles::saveTransformation(rotate)); } bodyWriter->endElement(); // draw:frame } diff --git a/src/renderer/odtframe/KoOdtFrameReportPicture.cpp b/src/renderer/odtframe/KoOdtFrameReportPicture.cpp index b676a208..15208e73 100644 --- a/src/renderer/odtframe/KoOdtFrameReportPicture.cpp +++ b/src/renderer/odtframe/KoOdtFrameReportPicture.cpp @@ -1,95 +1,95 @@ /* This file is part of the KDE project Copyright (C) 2011, 2012 by Dag Andersen (danders@get2net.dk) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "KoOdtFrameReportPicture.h" -#include "renderobjects.h" +#include "KReportRenderObjects.h" #include #include #include #include #include #include #include #include #include "kreport_debug.h" #include #include KoOdtFrameReportPicture::KoOdtFrameReportPicture(OROPrimitive *primitive) : KoOdtFrameReportPrimitive(primitive) { } KoOdtFrameReportPicture::~KoOdtFrameReportPicture() { } OROPicture *KoOdtFrameReportPicture::picture() const { return dynamic_cast(m_primitive); } void KoOdtFrameReportPicture::createBody(KoXmlWriter *bodyWriter) const { bodyWriter->startElement("draw:frame"); bodyWriter->addAttribute("draw:id", itemName()); bodyWriter->addAttribute("xml:id", itemName()); bodyWriter->addAttribute("draw:name", itemName()); bodyWriter->addAttribute("text:anchor-type", "page"); bodyWriter->addAttribute("text:anchor-page-number", pageNumber()); bodyWriter->addAttribute("draw:style-name", m_frameStyleName); commonAttributes(bodyWriter); bodyWriter->startElement("draw:image"); bodyWriter->addAttribute("xlink:href", "Pictures/" + pictureName()); bodyWriter->addAttribute("xlink:type", "simple"); bodyWriter->addAttribute("xlink:show", "embed"); bodyWriter->addAttribute("xlink:actuate", "onLoad"); bodyWriter->endElement(); bodyWriter->endElement(); // draw:frame } bool KoOdtFrameReportPicture::saveData(KoStore* store, KoXmlWriter* manifestWriter) const { QString name = "Pictures/" + pictureName(); if (!store->open(name)) { return false; } KoStoreDevice device(store); QImage image(m_primitive->size().toSize(), QImage::Format_ARGB32); image.fill(0); QPainter painter; painter.begin(&image); painter.setRenderHint(QPainter::Antialiasing); painter.drawPicture(0, 0, *(picture()->picture())); painter.end(); kreportDebug()<addManifestEntry(name, mimetype); } ok = store->close() && ok; return ok; } diff --git a/src/renderer/odtframe/KoOdtFrameReportPrimitive.cpp b/src/renderer/odtframe/KoOdtFrameReportPrimitive.cpp index 4db969cf..b2e577d8 100644 --- a/src/renderer/odtframe/KoOdtFrameReportPrimitive.cpp +++ b/src/renderer/odtframe/KoOdtFrameReportPrimitive.cpp @@ -1,107 +1,107 @@ /* This file is part of the KDE project Copyright (C) 2011, 2012 by Dag Andersen (danders@get2net.dk) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "KoOdtFrameReportPrimitive.h" -#include "renderobjects.h" +#include "KReportRenderObjects.h" #include #include #include #include KoOdtFrameReportPrimitive::KoOdtFrameReportPrimitive(OROPrimitive *primitive) : m_primitive(primitive) , m_uid(0) { } KoOdtFrameReportPrimitive::~KoOdtFrameReportPrimitive() { } bool KoOdtFrameReportPrimitive::isValid() const { return (bool)m_primitive; } void KoOdtFrameReportPrimitive::setPrimitive(OROPrimitive *primitive) { m_primitive = primitive; } int KoOdtFrameReportPrimitive::pageNumber() const { return isValid() && m_primitive->page() ? m_primitive->page()->page() + 1 : 0; } void KoOdtFrameReportPrimitive::setUID(int uid) { m_uid = uid; } int KoOdtFrameReportPrimitive::uid() const { return m_uid; } QString KoOdtFrameReportPrimitive::itemName() const { return QString("Item_%1").arg(m_uid); } void KoOdtFrameReportPrimitive::createStyle(KoGenStyles *coll) { KoGenStyle gs(KoGenStyle::GraphicStyle, "graphic"); gs.addProperty("draw:fill", "none"); gs.addPropertyPt("fo:margin", 0); gs.addProperty("style:horizontal-pos", "from-left"); gs.addProperty("style:horizontal-rel", "page"); gs.addProperty("style:vertical-pos", "from-top"); gs.addProperty("style:vertical-rel", "page"); gs.addProperty("style:wrap", "dynamic"); gs.addPropertyPt("style:wrap-dynamic-threshold", 0); m_frameStyleName = coll->insert(gs, "F"); } void KoOdtFrameReportPrimitive::createBody(KoXmlWriter *bodyWriter) const { Q_UNUSED(bodyWriter); } void KoOdtFrameReportPrimitive::commonAttributes(KoXmlWriter *bodyWriter) const { // convert to inches qreal x = m_primitive->position().x() / KReportDpi::dpiX(); qreal y = m_primitive->position().y() / KReportDpi::dpiX(); qreal w = m_primitive->size().width() / KReportDpi::dpiX(); qreal h = m_primitive->size().height() / KReportDpi::dpiY(); bodyWriter->addAttribute("svg:x", QString("%1in").arg(x)); bodyWriter->addAttribute("svg:y", QString("%1in").arg(y)); bodyWriter->addAttribute("svg:width", QString("%1in").arg(w)); bodyWriter->addAttribute("svg:height", QString("%1in").arg(h)); bodyWriter->addAttribute("draw:z-index", "3"); } bool KoOdtFrameReportPrimitive::saveData(KoStore */*store*/, KoXmlWriter*) const { return true; } diff --git a/src/renderer/odtframe/KoOdtFrameReportTextBox.cpp b/src/renderer/odtframe/KoOdtFrameReportTextBox.cpp index 54ae82d6..3d3be1f7 100644 --- a/src/renderer/odtframe/KoOdtFrameReportTextBox.cpp +++ b/src/renderer/odtframe/KoOdtFrameReportTextBox.cpp @@ -1,105 +1,105 @@ /* This file is part of the KDE project Copyright (C) 2011, 2012 by Dag Andersen (danders@get2net.dk) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "KoOdtFrameReportTextBox.h" -#include "renderobjects.h" +#include "KReportRenderObjects.h" #include #include #include #include #include #include KoOdtFrameReportTextBox::KoOdtFrameReportTextBox(OROTextBox *primitive) : KoOdtFrameReportPrimitive(primitive) { } KoOdtFrameReportTextBox::~KoOdtFrameReportTextBox() { } OROTextBox *KoOdtFrameReportTextBox::textBox() const { return dynamic_cast(m_primitive); } void KoOdtFrameReportTextBox::createStyle(KoGenStyles *coll) { QFont font = textBox()->textStyle().font; KoGenStyle ps(KoGenStyle::ParagraphStyle, "paragraph"); m_paragraphStyleName = coll->insert(ps, "P"); // text style KoGenStyle ts(KoGenStyle::TextStyle, "text"); ts.addProperty("fo:font-family", font.family()); ts.addPropertyPt("fo:font-size", font.pointSizeF()); ts.addProperty("fo:font-weight", font.weight() * 10); ts.addProperty("fo:color", textBox()->textStyle().foregroundColor.name()); QString fs; switch (font.style()) { case QFont::StyleNormal: fs = "normal"; break; case QFont::StyleItalic: fs = "italic"; break; case QFont::StyleOblique: fs = "oblique"; break; } ts.addProperty("fo:font-style", fs); m_textStyleName = coll->insert(ts, "T"); KoGenStyle gs(KoGenStyle::GraphicStyle, "graphic"); QPen pen; pen.setColor(textBox()->lineStyle().lineColor); pen.setWidthF(textBox()->lineStyle().weight); pen.setStyle(textBox()->lineStyle().style); KoOdfGraphicStyles::saveOdfStrokeStyle(gs, coll, pen); gs.addProperty("style:horizontal-pos", "from-left"); gs.addProperty("style:horizontal-rel", "page"); gs.addProperty("style:vertical-pos", "from-top"); gs.addProperty("style:vertical-rel", "page"); gs.addProperty("fo:background-color", textBox()->textStyle().backgroundColor.name()); m_frameStyleName = coll->insert(gs, "F"); } void KoOdtFrameReportTextBox::createBody(KoXmlWriter *bodyWriter) const { bodyWriter->startElement("draw:frame"); bodyWriter->addAttribute("draw:id", itemName()); bodyWriter->addAttribute("xml:id", itemName()); bodyWriter->addAttribute("draw:name", itemName()); bodyWriter->addAttribute("text:anchor-type", "page"); bodyWriter->addAttribute("text:anchor-page-number", pageNumber()); bodyWriter->addAttribute("draw:style-name", m_frameStyleName); commonAttributes(bodyWriter); bodyWriter->startElement("draw:text-box"); bodyWriter->startElement("text:p"); bodyWriter->addAttribute("text:style-name", m_paragraphStyleName); bodyWriter->startElement("text:span"); bodyWriter->addAttribute("text:style-name", m_textStyleName); bodyWriter->addTextNode(textBox()->text()); bodyWriter->endElement(); // text:span bodyWriter->endElement(); // text:p bodyWriter->endElement(); // draw:text-box bodyWriter->endElement(); // draw:frame } diff --git a/src/renderer/scripting/kreportgrouptracker.h b/src/renderer/scripting/KReportGroupTracker.h similarity index 100% rename from src/renderer/scripting/kreportgrouptracker.h rename to src/renderer/scripting/KReportGroupTracker.h diff --git a/src/renderer/scripting/krscriptconstants.cpp b/src/renderer/scripting/KReportScriptConstants.cpp similarity index 86% rename from src/renderer/scripting/krscriptconstants.cpp rename to src/renderer/scripting/KReportScriptConstants.cpp index f812e907..4de4e1a4 100644 --- a/src/renderer/scripting/krscriptconstants.cpp +++ b/src/renderer/scripting/KReportScriptConstants.cpp @@ -1,33 +1,33 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#include "krscriptconstants.h" +#include "KReportScriptConstants.h" -KRScriptConstants::KRScriptConstants(QObject *parent) +KReportScriptConstants::KReportScriptConstants(QObject *parent) : QObject(parent) , m_currentPage(0) , m_totalPages(0) { } -KRScriptConstants::~KRScriptConstants() +KReportScriptConstants::~KReportScriptConstants() { } diff --git a/src/renderer/scripting/krscriptconstants.h b/src/renderer/scripting/KReportScriptConstants.h similarity index 91% rename from src/renderer/scripting/krscriptconstants.h rename to src/renderer/scripting/KReportScriptConstants.h index 70763636..56be7a57 100644 --- a/src/renderer/scripting/krscriptconstants.h +++ b/src/renderer/scripting/KReportScriptConstants.h @@ -1,58 +1,58 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #ifndef KRSCRIPTCONSTANTS_H #define KRSCRIPTCONSTANTS_H #include /** */ -class KRScriptConstants : public QObject +class KReportScriptConstants : public QObject { Q_OBJECT public: - explicit KRScriptConstants(QObject *parent = 0); + explicit KReportScriptConstants(QObject *parent = 0); - ~KRScriptConstants(); + ~KReportScriptConstants(); Q_ENUMS(PenStyle) enum PenStyle {QtNoPen = 0, QtSolidLine, QtDashLine, QtDotLine, QtDashDotLine, QtDashDotDotLine}; void setPageNumber(int p) { m_currentPage = p; } void setPageTotal(int t) { m_totalPages = t; }; public Q_SLOTS: int PageNumber() { return m_currentPage; }; int PageTotal() { return m_totalPages; }; private: int m_currentPage; int m_totalPages; }; #endif diff --git a/src/renderer/scripting/krscriptdebug.cpp b/src/renderer/scripting/KReportScriptDebug.cpp similarity index 79% rename from src/renderer/scripting/krscriptdebug.cpp rename to src/renderer/scripting/KReportScriptDebug.cpp index 4345ecb2..5789deb5 100644 --- a/src/renderer/scripting/krscriptdebug.cpp +++ b/src/renderer/scripting/KReportScriptDebug.cpp @@ -1,42 +1,41 @@ /* This file is part of the KDE project * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#include "krscriptdebug.h" +#include "KReportScriptDebug.h" +#include "kreport_debug.h" #include -#include "kreport_debug.h" - -KRScriptDebug::KRScriptDebug(QObject *parent) +KReportScriptDebug::KReportScriptDebug(QObject *parent) : QObject(parent) { } -KRScriptDebug::~KRScriptDebug() +KReportScriptDebug::~KReportScriptDebug() { } -void KRScriptDebug::print(const QString& s) +void KReportScriptDebug::print(const QString& s) { kreportDebug() << s; } -void KRScriptDebug::message(const QString &t, const QString &m) +void KReportScriptDebug::message(const QString &t, const QString &m) { KMessageBox::information(0, m, t); } diff --git a/src/renderer/scripting/krscriptdebug.h b/src/renderer/scripting/KReportScriptDebug.h similarity index 88% rename from src/renderer/scripting/krscriptdebug.h rename to src/renderer/scripting/KReportScriptDebug.h index 7ec6ad14..4052b0c8 100644 --- a/src/renderer/scripting/krscriptdebug.h +++ b/src/renderer/scripting/KReportScriptDebug.h @@ -1,39 +1,39 @@ /* This file is part of the KDE project * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #ifndef KRSCRIPTDEBUG_H #define KRSCRIPTDEBUG_H #include /** */ -class KRScriptDebug : public QObject +class KReportScriptDebug : public QObject { Q_OBJECT public: - explicit KRScriptDebug(QObject *parent = 0); + explicit KReportScriptDebug(QObject *parent = 0); - ~KRScriptDebug(); + ~KReportScriptDebug(); public Q_SLOTS: void print(const QString&); void message(const QString &, const QString&); }; #endif diff --git a/src/renderer/scripting/krscriptdraw.cpp b/src/renderer/scripting/KReportScriptDraw.cpp similarity index 67% rename from src/renderer/scripting/krscriptdraw.cpp rename to src/renderer/scripting/KReportScriptDraw.cpp index 7f5ecc02..c9d0ace1 100644 --- a/src/renderer/scripting/krscriptdraw.cpp +++ b/src/renderer/scripting/KReportScriptDraw.cpp @@ -1,149 +1,147 @@ /* This file is part of the KDE project * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#include "krscriptdraw.h" -#include -#include -#include +#include "KReportScriptDraw.h" +#include "KReportRenderObjects.h" +#include "KReportPosition.h" +#include "KReportSize.h" + #include #include -KRScriptDraw::KRScriptDraw(QObject *parent) +KReportScriptDraw::KReportScriptDraw(QObject *parent) : QObject(parent) { m_curPage = 0; } -KRScriptDraw::~KRScriptDraw() +KReportScriptDraw::~KReportScriptDraw() { } -void KRScriptDraw::setPage(OROPage *p) +void KReportScriptDraw::setPage(OROPage *p) { m_curPage = p; } -void KRScriptDraw::setOffset(QPointF off) +void KReportScriptDraw::setOffset(QPointF off) { m_curOffset = off; } -void KRScriptDraw::rectangle(qreal x, qreal y, qreal w, qreal h, const QString& lc, const QString& fc, qreal lw, int a) +void KReportScriptDraw::rectangle(qreal x, qreal y, qreal w, qreal h, const QString& lc, const QString& fc, qreal lw, int a) { if (m_curPage) { ORORect *r = new ORORect(); - KRPos p; - KRSize s; + KReportPosition p; + KReportSize s; p.setPointPos(QPointF(x, y)); s.setPointSize(QSizeF(w, h)); r->setRect(QRectF(p.toScene() + m_curOffset, s.toScene())); QPen pen(QColor(lc), lw); QColor c(fc); c.setAlpha(a); QBrush bru(c); r->setBrush(bru); r->setPen(pen); m_curPage->addPrimitive(r); } } -void KRScriptDraw::ellipse(qreal x, qreal y, qreal w, qreal h, const QString& lc, const QString& fc, qreal lw, int a) +void KReportScriptDraw::ellipse(qreal x, qreal y, qreal w, qreal h, const QString& lc, const QString& fc, qreal lw, int a) { if (m_curPage) { OROEllipse *e = new OROEllipse(); - KRPos p; - KRSize s; + KReportPosition p; + KReportSize s; p.setPointPos(QPointF(x, y)); s.setPointSize(QSizeF(w, h)); e->setRect(QRectF(p.toScene() + m_curOffset, s.toScene())); QPen pen(QColor(lc), lw); QColor c(fc); c.setAlpha(a); QBrush bru(c); e->setBrush(bru); e->setPen(pen); m_curPage->addPrimitive(e); } } -void KRScriptDraw::line(qreal x1, qreal y1, qreal x2, qreal y2, const QString& lc) +void KReportScriptDraw::line(qreal x1, qreal y1, qreal x2, qreal y2, const QString& lc) { if (m_curPage) { OROLine *ln = new OROLine(); - KRPos s; - KRPos e; + KReportPosition s; + KReportPosition e; s.setPointPos(QPointF(x1, y1)); e.setPointPos(QPointF(x2, y2)); ln->setStartPoint(s.toScene() + m_curOffset); ln->setEndPoint(e.toScene() + m_curOffset); - KRLineStyleData ls; - ls.lineColor = QColor(lc); - ls.weight = 1; - if (ls.weight <= 0) - ls.style = Qt::NoPen; - else - ls.style = Qt::SolidLine; + KReportLineStyle ls; + ls.setColor(QColor(lc)); + ls.setWidth(1); + ls.setPenStyle(Qt::SolidLine); ln->setLineStyle(ls); m_curPage->addPrimitive(ln); } } -void KRScriptDraw::text(qreal x, qreal y, const QString &txt, const QString &fnt, int pt, const QString &fc, const QString&bc, const QString &lc, qreal lw, int o) +void KReportScriptDraw::text(qreal x, qreal y, const QString &txt, const QString &fnt, int pt, const QString &fc, const QString&bc, const QString &lc, qreal lw, int o) { if (m_curPage) { QFont f(fnt, pt); QRectF r = QFontMetrics(f).boundingRect(txt); KRTextStyleData ts; ts.font = f; ts.backgroundColor = QColor(bc); ts.foregroundColor = QColor(fc); ts.backgroundOpacity = o; - KRLineStyleData ls; - ls.lineColor = QColor(lc); - ls.weight = lw; + KReportLineStyle ls; + ls.setColor(QColor(lc)); + ls.setWidth(lw); if (lw <= 0) - ls.style = Qt::NoPen; + ls.setPenStyle(Qt::NoPen); else - ls.style = Qt::SolidLine; + ls.setPenStyle(Qt::SolidLine); OROTextBox *tb = new OROTextBox(); tb->setPosition(QPointF(x, y) + m_curOffset); tb->setSize(r.size()); tb->setTextStyle(ts); tb->setLineStyle(ls); tb->setText(txt); m_curPage->addPrimitive(tb); } } diff --git a/src/renderer/scripting/krscriptdraw.h b/src/renderer/scripting/KReportScriptDraw.h similarity index 95% rename from src/renderer/scripting/krscriptdraw.h rename to src/renderer/scripting/KReportScriptDraw.h index 0192befa..e1828c8e 100644 --- a/src/renderer/scripting/krscriptdraw.h +++ b/src/renderer/scripting/KReportScriptDraw.h @@ -1,96 +1,96 @@ /* This file is part of the KDE project * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #ifndef KRSCRIPTDRAW_H #define KRSCRIPTDRAW_H #include #include class OROPage; /** */ -class KRScriptDraw : public QObject +class KReportScriptDraw : public QObject { Q_OBJECT public: - explicit KRScriptDraw(QObject *parent = 0); + explicit KReportScriptDraw(QObject *parent = 0); - ~KRScriptDraw(); + ~KReportScriptDraw(); void setPage(OROPage*); void setOffset(QPointF); public Q_SLOTS: /** Draw a rectangle \param x X posistion \param y Y position \param w Width \param h Height \param lc Line Color \param fc Fill Color \param lw Line Width \param o Opacity (0=transparent, 100=opaque) */ void rectangle(qreal, qreal, qreal, qreal, const QString&, const QString&, qreal, int); /** Draw an ellipse \param x X posistion \param y Y position \param w Width \param h Height \param lc Line Color \param fc Fill Color \param lw Line Width \param o Opacity (0=transparent, 100=opaque) */ void ellipse(qreal, qreal, qreal, qreal, const QString&, const QString&, qreal, int); /** Draw a line \param x1 Start X position \param y1 Start Y Position \param x2 End X position \param y2 End Y position \param lc Line Color */ void line(qreal, qreal, qreal, qreal, const QString&); /** Draw some text \param x X Position \param y Y Position \param txt The text \param fnt The font \param pt Point size \param fc Foreground color \param bc Background color \param lc Line color \param lw Line width \param o Opacity (0=transparent, 100=opaque) */ void text(qreal, qreal, const QString &, const QString &fnt = QLatin1String("Helvetica"), int pt = 12, const QString &fc = QLatin1String("#000000"), const QString &bc = QLatin1String("#ffffff"), const QString &lc = QLatin1String("#ffffff"), qreal lw = 0, int o = 0); private: OROPage *m_curPage; QPointF m_curOffset; }; #endif diff --git a/src/renderer/scripting/krscripthandler.cpp b/src/renderer/scripting/KReportScriptHandler.cpp similarity index 73% rename from src/renderer/scripting/krscripthandler.cpp rename to src/renderer/scripting/KReportScriptHandler.cpp index e7d8d5f9..f403de0c 100644 --- a/src/renderer/scripting/krscripthandler.cpp +++ b/src/renderer/scripting/KReportScriptHandler.cpp @@ -1,184 +1,184 @@ /* This file is part of the KDE project * Copyright (C) 2007-2008 by Adam Pigg * Copyright (C) 2012 Jarosław Staniek * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#include "krscripthandler.h" - -#include "krscriptsection.h" -#include "krscriptdebug.h" -#include "krscriptreport.h" -#include "krscriptdraw.h" -#include "krscriptconstants.h" -#include "krsectiondata.h" -#include "KoReportItemBase.h" -#include "krreportdata.h" -#include "krdetailsectiondata.h" -#include "renderobjects.h" +#include "KReportScriptHandler.h" + +#include "KReportScriptSection.h" +#include "KReportScriptDebug.h" +#include "KReportScriptReport.h" +#include "KReportScriptDraw.h" +#include "KReportScriptConstants.h" +#include "KReportSectionData.h" +#include "KReportItemBase.h" +#include "KReportDocument.h" +#include "KReportDetailSectionData.h" +#include "KReportRenderObjects.h" #include "kreport_debug.h" #include #include #include -KRScriptHandler::KRScriptHandler(const KoReportData* kodata, KoReportReportData* d) +KReportScriptHandler::KReportScriptHandler(const KReportData* kodata, KReportDocument* d) { m_reportData = d; - m_koreportData = kodata; + m_kreportData = kodata; m_engine = 0; m_constants = 0; m_debug = 0; m_draw = 0; // Create the script engine instance . m_engine = new QJSEngine(this); //Add constants object - m_constants = new KRScriptConstants(); + m_constants = new KReportScriptConstants(); registerScriptObject(m_constants, QLatin1String("constants")); //A simple debug function to allow printing from functions - m_debug = new KRScriptDebug(); + m_debug = new KReportScriptDebug(); registerScriptObject(m_debug, QLatin1String("debug")); //A simple drawing object - m_draw = new KRScriptDraw(); + m_draw = new KReportScriptDraw(); registerScriptObject(m_draw, QLatin1String("draw")); //Add a general report object m_report = new Scripting::Report(m_reportData); QJSValue r = registerScriptObject(m_report, m_reportData->name()); //Add the sections - QList secs = m_reportData->sections(); - foreach(KRSectionData *sec, secs) { + QList secs = m_reportData->sections(); + foreach(KReportSectionData *sec, secs) { m_sectionMap[sec] = new Scripting::Section(sec); m_sectionMap[sec]->setParent(m_report); m_sectionMap[sec]->setObjectName(sec->name().replace(QLatin1Char('-'), QLatin1Char('_')) .remove(QLatin1String("report:"))); QJSValue s = m_engine->newQObject(m_sectionMap[sec]); r.setProperty(m_sectionMap[sec]->objectName(), s); kreportDebug() << "Added" << m_sectionMap[sec]->objectName() << "to report" << m_reportData->name(); } kreportDebug() << "Report name is" << m_reportData->name(); } -bool KRScriptHandler::trigger() +bool KReportScriptHandler::trigger() { - QString code = m_koreportData->scriptCode(m_reportData->script()); + QString code = m_kreportData->scriptCode(m_reportData->script()); kreportDebug() << code; if (code.isEmpty()) { return true; } m_scriptValue = m_engine->evaluate(code, m_reportData->script()); if (m_scriptValue.isError()) { return false; }/*TODO else { kreportDebug() << "Function Names:" << m_engine->functionNames(); }*/ m_report->eventOnOpen(); return true; } -KRScriptHandler::~KRScriptHandler() +KReportScriptHandler::~KReportScriptHandler() { delete m_report; delete m_engine; } -void KRScriptHandler::newPage() +void KReportScriptHandler::newPage() { if (m_report) { m_report->eventOnNewPage(); } } -void KRScriptHandler::slotEnteredGroup(const QString &key, const QVariant &value) +void KReportScriptHandler::slotEnteredGroup(const QString &key, const QVariant &value) { //kreportDebug() << key << value; m_groups[key] = value; emit(groupChanged(m_groups)); } -void KRScriptHandler::slotExitedGroup(const QString &key, const QVariant &value) +void KReportScriptHandler::slotExitedGroup(const QString &key, const QVariant &value) { Q_UNUSED(value); //kreportDebug() << key << value; m_groups.remove(key); emit(groupChanged(m_groups)); } -void KRScriptHandler::slotEnteredSection(KRSectionData *section, OROPage* cp, QPointF off) +void KReportScriptHandler::slotEnteredSection(KReportSectionData *section, OROPage* cp, QPointF off) { if (cp) m_draw->setPage(cp); m_draw->setOffset(off); Scripting::Section *ss = m_sectionMap[section]; if (ss) { ss->eventOnRender(); } } -QVariant KRScriptHandler::evaluate(const QString &code) +QVariant KReportScriptHandler::evaluate(const QString &code) { if (!m_scriptValue.isError()) { QJSValue result = m_engine->evaluate(code); if (!result.isError()) { return result.toVariant(); } else { QMessageBox::warning(0, tr("Script Error"), m_scriptValue.toString()); } } return QVariant(); } -void KRScriptHandler::displayErrors() +void KReportScriptHandler::displayErrors() { if (m_scriptValue.isError()) { QMessageBox::warning(0, tr("Script Error"), m_scriptValue.toString()); } } //! @todo KEXI3 move to kexi #if 0 -QString KRScriptHandler::where() +QString KReportScriptHandler::where() { QString w; QMap::const_iterator i = m_groups.constBegin(); while (i != m_groups.constEnd()) { w += QLatin1Char('(') + i.key() + QLatin1String(" = '") + i.value().toString() + QLatin1String("') AND "); ++i; } w.chop(4); //kreportDebug() << w; return w; } #endif -QJSValue KRScriptHandler::registerScriptObject(QObject* obj, const QString& name) +QJSValue KReportScriptHandler::registerScriptObject(QObject* obj, const QString& name) { QJSValue val; val = m_engine->newQObject(obj); m_engine->globalObject().setProperty(name, val); return val; } diff --git a/src/renderer/scripting/krscripthandler.h b/src/renderer/scripting/KReportScriptHandler.h similarity index 73% rename from src/renderer/scripting/krscripthandler.h rename to src/renderer/scripting/KReportScriptHandler.h index fc88dde7..7242b68e 100644 --- a/src/renderer/scripting/krscripthandler.h +++ b/src/renderer/scripting/KReportScriptHandler.h @@ -1,94 +1,93 @@ /* This file is part of the KDE project * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #ifndef KRSCRIPTHANDLER_H #define KRSCRIPTHANDLER_H #include "kreport_export.h" #include "config-kreport.h" -class KoReportReportData; -class OROPage; - #ifdef KREPORT_SCRIPTING -#include "krscriptconstants.h" -#include "KoReportData.h" +#include "KReportScriptConstants.h" +#include "KReportData.h" #include -class KRScriptDebug; -class KRScriptDraw; -class KRSectionData; +class KReportScriptDebug; +class KReportScriptDraw; +class KReportSectionData; class QJSEngine; +class KReportDocument; +class OROPage; namespace Scripting { class Report; class Section; } -class KREPORT_EXPORT KRScriptHandler : public QObject +class KREPORT_EXPORT KReportScriptHandler : public QObject { Q_OBJECT public: - KRScriptHandler(const KoReportData *, KoReportReportData*); - ~KRScriptHandler(); + KReportScriptHandler(const KReportData *, KReportDocument*); + ~KReportScriptHandler(); QVariant evaluate(const QString&); void displayErrors(); QJSValue registerScriptObject(QObject*, const QString&); bool trigger(); public Q_SLOTS: - void slotEnteredSection(KRSectionData*, OROPage*, QPointF); + void slotEnteredSection(KReportSectionData*, OROPage*, QPointF); void slotEnteredGroup(const QString&, const QVariant&); void slotExitedGroup(const QString&, const QVariant&); void setPageNumber(int p) { m_constants->setPageNumber(p); } void setPageTotal(int t) { m_constants->setPageTotal(t); } void newPage(); Q_SIGNALS: void groupChanged(const QMap &groupData); private: - KRScriptConstants *m_constants; - KRScriptDebug *m_debug; - KRScriptDraw *m_draw; + KReportScriptConstants *m_constants; + KReportScriptDebug *m_debug; + KReportScriptDraw *m_draw; Scripting::Report *m_report; - const KoReportData *m_koreportData; + const KReportData *m_kreportData; QString m_source; - KoReportReportData *m_reportData; + KReportDocument *m_reportData; QJSEngine* m_engine; QJSValue m_scriptValue; QMap m_groups; - QMap m_sectionMap; + QMap m_sectionMap; //! @todo KEXI3 QString where(); }; #else // !KREPORT_SCRIPTING -#define KRScriptHandler void +#define KReportScriptHandler void #endif #endif diff --git a/src/renderer/scripting/krscriptline.cpp b/src/renderer/scripting/KReportScriptLine.cpp similarity index 94% rename from src/renderer/scripting/krscriptline.cpp rename to src/renderer/scripting/KReportScriptLine.cpp index 9a2c205a..25e229bd 100644 --- a/src/renderer/scripting/krscriptline.cpp +++ b/src/renderer/scripting/KReportScriptLine.cpp @@ -1,87 +1,87 @@ /* This file is part of the KDE project * Copyright (C) 2007-2010 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#include "krscriptline.h" -#include "KoReportItemLine.h" +#include "KReportScriptLine.h" +#include "KReportItemLine.h" #include namespace Scripting { -Line::Line(KoReportItemLine* l) +Line::Line(KReportItemLine* l) { m_line = l; } Line::~Line() { } QColor Line::lineColor() { return m_line->m_lineColor->value().value(); } void Line::setLineColor(const QColor& c) { m_line->m_lineColor->setValue(c); } int Line::lineWeight() { return m_line->m_lineWeight->value().toInt(); } void Line::setLineWeight(int w) { m_line->m_lineWeight->setValue(w); } int Line::lineStyle() { return m_line->m_lineStyle->value().toInt(); } void Line::setLineStyle(int s) { if (s < 0 || s > 5) { s = 1; } m_line->m_lineStyle->setValue(s); } QPointF Line::startPosition() { return m_line->m_start.toPoint(); } void Line::setStartPosition(const QPointF& p) { m_line->m_start.setPointPos(p); } QPointF Line::endPosition() { return m_line->m_end.toPoint(); } void Line::setEndPosition(const QPointF& p) { m_line->m_end.setPointPos(p); } } diff --git a/src/renderer/scripting/krscriptline.h b/src/renderer/scripting/KReportScriptLine.h similarity index 95% rename from src/renderer/scripting/krscriptline.h rename to src/renderer/scripting/KReportScriptLine.h index e155c40c..c4879ca9 100644 --- a/src/renderer/scripting/krscriptline.h +++ b/src/renderer/scripting/KReportScriptLine.h @@ -1,109 +1,109 @@ /* This file is part of the KDE project * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #ifndef SCRIPTINGKRSCRIPTLINE_H #define SCRIPTINGKRSCRIPTLINE_H #include #include #include -class KoReportItemLine; +class KReportItemLine; namespace Scripting { /** */ class Line : public QObject { Q_OBJECT public: - explicit Line(KoReportItemLine *); + explicit Line(KReportItemLine *); ~Line(); public Q_SLOTS: /** * Return the start position of the line * @return start position */ QPointF startPosition(); /** * Set the start position of the line * @param StartPosition */ void setStartPosition(const QPointF&); /** * Return the end position of the line * @return end position */ QPointF endPosition(); /** * Set the end position of the line * @param EndPosition */ void setEndPosition(const QPointF&); /** * Return the color of the line * @return line color */ QColor lineColor(); /** * Sets the line color * @param LineColor */ void setLineColor(const QColor&); /** * Return the weight (width) of the line * @return Weight */ int lineWeight(); /** * Set the weight (width) of the line * @param Weight */ void setLineWeight(int); /** * Return the line style. Valid values are those from Qt::PenStyle (0-5) * @return Style */ int lineStyle(); /** * Set the style of the line * @param Style From Qt::PenStyle (0-5) */ void setLineStyle(int); private: - KoReportItemLine *m_line; + KReportItemLine *m_line; }; } #endif diff --git a/src/renderer/scripting/krscriptreport.cpp b/src/renderer/scripting/KReportScriptReport.cpp similarity index 80% rename from src/renderer/scripting/krscriptreport.cpp rename to src/renderer/scripting/KReportScriptReport.cpp index 20fb966b..e9a6a6ca 100644 --- a/src/renderer/scripting/krscriptreport.cpp +++ b/src/renderer/scripting/KReportScriptReport.cpp @@ -1,118 +1,118 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#include "krscriptreport.h" -#include "krreportdata.h" -#include "KoReportItemBase.h" -#include "KoReportPluginManager.h" -#include "KoReportPluginInterface.h" -#include "krscriptline.h" -#include "krscriptsection.h" -#include "KoReportItemLine.h" +#include "KReportScriptReport.h" +#include "KReportDocument.h" +#include "KReportItemBase.h" +#include "KReportPluginManager.h" +#include "KReportPluginInterface.h" +#include "KReportScriptLine.h" +#include "KReportScriptSection.h" +#include "KReportItemLine.h" #include "kreport_debug.h" namespace Scripting { -Report::Report(KoReportReportData *r) +Report::Report(KReportDocument *r) { m_reportData = r; m_scriptObject = 0; } Report::~Report() { } QString Report::title() { return m_reportData->m_title; } QString Report::name() { return m_reportData->name(); } QString Report::recordSource() { return m_reportData->query(); } QObject* Report::objectByName(const QString &n) { - QListobs = m_reportData->objects(); - foreach(KoReportItemBase *o, obs) { + QListobs = m_reportData->objects(); + foreach(KReportItemBase *o, obs) { if (o->entityName() == n) { if (o->typeName() == QLatin1String("line")) { - return new Scripting::Line(dynamic_cast(o)); + return new Scripting::Line(dynamic_cast(o)); } else { - KoReportPluginManager* manager = KoReportPluginManager::self(); - KoReportPluginInterface *plugin = manager->plugin(o->typeName()); + KReportPluginManager* manager = KReportPluginManager::self(); + KReportPluginInterface *plugin = manager->plugin(o->typeName()); if (plugin) { QObject *obj = plugin->createScriptInstance(o); if (obj) { return obj; } } else { kreportWarning() << "Encountered unknown node while parsing section: " << o->typeName(); } } } } return 0; } QObject* Report::sectionByName(const QString &n) { - KRSectionData *sec = m_reportData->section(n); + KReportSectionData *sec = m_reportData->section(n); if (sec) { return new Scripting::Section(sec); } else { return new QObject(); } } void Report::initialize(const QJSValue &val) { m_scriptObject = val; } void Report::eventOnOpen() { if (m_scriptObject.isObject() && m_scriptObject.hasProperty(QLatin1String("OnOpen"))) m_scriptObject.property(QLatin1String("OnOpen")).call(); } void Report::eventOnComplete() { if (m_scriptObject.isObject() && m_scriptObject.hasProperty(QLatin1String("OnComlete"))) m_scriptObject.property(QLatin1String("OnComplete")).call(); } void Report::eventOnNewPage() { if (m_scriptObject.isObject() && m_scriptObject.hasProperty(QLatin1String("OnNewPage"))) m_scriptObject.property(QLatin1String("OnNewPage")).call(); } } diff --git a/src/renderer/scripting/krscriptreport.h b/src/renderer/scripting/KReportScriptReport.h similarity index 92% rename from src/renderer/scripting/krscriptreport.h rename to src/renderer/scripting/KReportScriptReport.h index d16ba976..58b4a393 100644 --- a/src/renderer/scripting/krscriptreport.h +++ b/src/renderer/scripting/KReportScriptReport.h @@ -1,58 +1,58 @@ /* This file is part of the KDE project * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #ifndef SCRIPTINGKRSCRIPTREPORT_H #define SCRIPTINGKRSCRIPTREPORT_H #include #include -class KoReportReportData; +class KReportDocument; namespace Scripting { /** */ class Report : public QObject { Q_OBJECT public: - explicit Report(KoReportReportData*); + explicit Report(KReportDocument*); ~Report(); public Q_SLOTS: QString title(); QString name(); QString recordSource(); QObject* objectByName(const QString &); QObject* sectionByName(const QString &); void initialize(const QJSValue &val); void eventOnOpen(); void eventOnComplete(); void eventOnNewPage(); private: - KoReportReportData *m_reportData; + KReportDocument *m_reportData; QJSValue m_scriptObject; }; } #endif diff --git a/src/renderer/scripting/krscriptsection.cpp b/src/renderer/scripting/KReportScriptSection.cpp similarity index 81% rename from src/renderer/scripting/krscriptsection.cpp rename to src/renderer/scripting/KReportScriptSection.cpp index 3e29b289..f18190e3 100644 --- a/src/renderer/scripting/krscriptsection.cpp +++ b/src/renderer/scripting/KReportScriptSection.cpp @@ -1,108 +1,108 @@ /* This file is part of the KDE project * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#include "krscriptsection.h" +#include "KReportScriptSection.h" -#include "krscriptline.h" -#include "KoReportItemBase.h" -#include "KoReportPluginManager.h" -#include "KoReportPluginInterface.h" -#include "KoReportItemLine.h" +#include "KReportScriptLine.h" +#include "KReportItemBase.h" +#include "KReportPluginManager.h" +#include "KReportPluginInterface.h" +#include "KReportItemLine.h" +#include "KReportSectionData.h" #include "kreport_debug.h" -#include "krsectiondata.h" namespace Scripting { -Section::Section(KRSectionData* sec) +Section::Section(KReportSectionData* sec) { m_section = sec; m_scriptObject = 0; } Section::~Section() { } QColor Section::backgroundColor() { return m_section->m_backgroundColor->value().value(); } void Section::setBackgroundColor(const QColor &c) { //kreportDebug() << c.name(); m_section->m_backgroundColor->setValue(c); } qreal Section::height() { return m_section->m_height->value().toDouble(); } void Section::setHeight(qreal h) { m_section->m_height->setValue(h); } QString Section::name() { return m_section->objectName(); } QObject* Section::objectByNumber(int i) { if (m_section->m_objects[i]->typeName() == QLatin1String("line")) { - return new Scripting::Line(dynamic_cast(m_section->m_objects[i])); + return new Scripting::Line(dynamic_cast(m_section->m_objects[i])); } else { - KoReportPluginManager* manager = KoReportPluginManager::self(); - KoReportPluginInterface *plugin = manager->plugin(m_section->m_objects[i]->typeName()); + KReportPluginManager* manager = KReportPluginManager::self(); + KReportPluginInterface *plugin = manager->plugin(m_section->m_objects[i]->typeName()); if (plugin) { QObject *obj = plugin->createScriptInstance(m_section->m_objects[i]); if (obj) { return obj; } } else { kreportWarning() << "Encountered unknown node while parsing section: " << m_section->m_objects[i]->typeName(); } } return new QObject(); } QObject* Section::objectByName(const QString& n) { for (int i = 0; i < m_section->objects().count(); ++i) { if (m_section->m_objects[i]->entityName() == n) { return objectByNumber(i); } } return 0; } void Section::initialize(const QJSValue &s) { m_scriptObject = s; } void Section::eventOnRender() { if (m_scriptObject.isObject() && m_scriptObject.hasProperty(QLatin1String("OnRender"))) m_scriptObject.property(QLatin1String("OnRender")).call(); } } diff --git a/src/renderer/scripting/krscriptsection.h b/src/renderer/scripting/KReportScriptSection.h similarity index 94% rename from src/renderer/scripting/krscriptsection.h rename to src/renderer/scripting/KReportScriptSection.h index a72172e4..6c79ef7f 100644 --- a/src/renderer/scripting/krscriptsection.h +++ b/src/renderer/scripting/KReportScriptSection.h @@ -1,66 +1,66 @@ /* This file is part of the KDE project * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #ifndef KRSCRIPTSECTION_H #define KRSCRIPTSECTION_H #include #include -class KRSectionData; +class KReportSectionData; /** */ namespace Scripting { class Section : public QObject { Q_OBJECT public: - explicit Section(KRSectionData*); + explicit Section(KReportSectionData*); ~Section(); public Q_SLOTS: /**Returns the background color of the section*/ QColor backgroundColor(); /**Sets the background color of the section to the given color */ void setBackgroundColor(const QColor&); /**Returns the section height as a real number, in points*/ qreal height(); /**Sets the section height to the given value in points*/ void setHeight(qreal); /**Returns the name of the section*/ QString name(); /**Returns an object in the section, by number*/ QObject* objectByNumber(int); /**Returns an object in the section, by name*/ QObject* objectByName(const QString&); void initialize(const QJSValue &s); void eventOnRender(); private: - KRSectionData *m_section; + KReportSectionData *m_section; QJSValue m_scriptObject; }; } #endif diff --git a/src/wrtembed/KoReportDesigner.cpp b/src/wrtembed/KReportDesigner.cpp similarity index 82% rename from src/wrtembed/KoReportDesigner.cpp rename to src/wrtembed/KReportDesigner.cpp index 8304756c..836ba1f9 100644 --- a/src/wrtembed/KoReportDesigner.cpp +++ b/src/wrtembed/KReportDesigner.cpp @@ -1,1534 +1,1535 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC * Copyright (C) 2007-2010 by Adam Pigg * Copyright (C) 2011 Jarosław Staniek * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#include "KoReportDesigner.h" -#include "reportsection.h" -#include "reportscene.h" -#include "reportsceneview.h" -#include "reportsectiondetailgroup.h" -#include "reportpropertiesbutton.h" -#include "sectioneditor.h" -#include "reportsectiondetail.h" -#include "KoReportDesignerItemLine.h" +#include "KReportDesigner.h" +#include "KReportDesignerSection.h" +#include "KReportDesignerScene.h" +#include "KReportDesignerView.h" +#include "KReportDesignerSectionDetailGroup.h" +#include "KReportPropertiesButton.h" +#include "KReportSectionEditor.h" +#include "KReportDesignerSectionDetail.h" +#include "KReportDesignerItemLine.h" #include "KReportRuler_p.h" #include "KReportZoomHandler.h" -#include "common/KReportPageFormat.h" +#include "KReportPageFormat.h" #include "KReportDpi.h" #include "KReportUtils.h" -#include "common/KoReportPluginInterface.h" -#include "common/KoReportPluginManager.h" +#include "KReportPluginInterface.h" +#include "KReportPluginManager.h" +#include "KReportSection.h" #include "kreport_debug.h" #include #include #include #include #include #include #include #include #include #include #include #include #include //! Also add public method for runtime? const char ns[] = "http://kexi-project.org/report/2.0"; static QDomElement propertyToElement(QDomDocument* d, KProperty* p) { QDomElement e = d->createElement(QLatin1String("report:" + p->name().toLower())); e.appendChild(d->createTextNode(p->value().toString())); return e; } // // define and implement the ReportWriterSectionData class // a simple class to hold/hide data in the ReportHandler class // class ReportWriterSectionData { public: ReportWriterSectionData() { selected_x_offset = 0; selected_y_offset = 0; mouseAction = ReportWriterSectionData::MA_None; } virtual ~ReportWriterSectionData() { } enum MouseAction { MA_None = 0, MA_Insert = 1, MA_Grab = 2, MA_MoveStartPoint, MA_MoveEndPoint, MA_ResizeNW = 8, MA_ResizeN, MA_ResizeNE, MA_ResizeE, MA_ResizeSE, MA_ResizeS, MA_ResizeSW, MA_ResizeW }; int selected_x_offset; int selected_y_offset; MouseAction mouseAction; QString insertItem; - QList copy_list; - QList cut_list; + QList copy_list; + QList cut_list; }; //! @internal -class KoReportDesigner::Private +class KReportDesigner::Private { public: Private() : activeScene(0) , reportHeader(0) , pageHeaderFirst(0) , pageHeaderOdd(0) , pageHeaderEven(0) , pageHeaderLast(0) , pageHeaderAny(0) , pageFooterFirst(0) , pageFooterOdd(0) , pageFooterEven(0) , pageFooterLast(0) , pageFooterAny(0) , reportFooter(0) , detail(0) , pressX(-1) , pressY(-1) , releaseX(-1) , releaseY(-1) , modified(false) , kordata(0) {} ~Private() { delete zoom; delete sectionData; delete set; } QGridLayout *grid; KReportRuler *hruler; KReportZoomHandler *zoom; QVBoxLayout *vboxlayout; - ReportPropertiesButton *pageButton; + KReportPropertiesButton *pageButton; QGraphicsScene *activeScene; ReportWriterSectionData *sectionData; - ReportSection *reportHeader; - ReportSection *pageHeaderFirst; - ReportSection *pageHeaderOdd; - ReportSection *pageHeaderEven; - ReportSection *pageHeaderLast; - ReportSection *pageHeaderAny; - - ReportSection *pageFooterFirst; - ReportSection *pageFooterOdd; - ReportSection *pageFooterEven; - ReportSection *pageFooterLast; - ReportSection *pageFooterAny; - ReportSection *reportFooter; - ReportSectionDetail *detail; + KReportDesignerSection *reportHeader; + KReportDesignerSection *pageHeaderFirst; + KReportDesignerSection *pageHeaderOdd; + KReportDesignerSection *pageHeaderEven; + KReportDesignerSection *pageHeaderLast; + KReportDesignerSection *pageHeaderAny; + + KReportDesignerSection *pageFooterFirst; + KReportDesignerSection *pageFooterOdd; + KReportDesignerSection *pageFooterEven; + KReportDesignerSection *pageFooterLast; + KReportDesignerSection *pageFooterAny; + KReportDesignerSection *reportFooter; + KReportDesignerSectionDetail *detail; //Properties KPropertySet *set; KPropertySet *itmset; KProperty *title; KProperty *pageSize; KProperty *orientation; KProperty *unit; KProperty *customHeight; KProperty *customWidth; KProperty *leftMargin; KProperty *rightMargin; KProperty *topMargin; KProperty *bottomMargin; KProperty *showGrid; KProperty *gridDivisions; KProperty *gridSnap; KProperty *labelType; #ifdef KREPORT_SCRIPTING KProperty *script; #endif //Actions QAction *editCutAction; QAction *editCopyAction; QAction *editPasteAction; QAction *editDeleteAction; QAction *sectionEdit; QAction *parameterEdit; QAction *itemRaiseAction; QAction *itemLowerAction; qreal pressX; qreal pressY; qreal releaseX; qreal releaseY; bool modified; // true if this document has been modified, false otherwise QString originalInterpreter; //Value of the script interpreter at load time QString originalScript; //Value of the script at load time - KoReportData *kordata; + KReportData *kordata; }; -KoReportDesigner::KoReportDesigner(QWidget * parent) +KReportDesigner::KReportDesigner(QWidget * parent) : QWidget(parent), d(new Private()) { init(); } -void KoReportDesigner::init() +void KReportDesigner::init() { d->sectionData = new ReportWriterSectionData(); createProperties(); createActions(); d->grid = new QGridLayout(this); d->grid->setSpacing(0); d->grid->setMargin(0); d->grid->setColumnStretch(1, 1); d->grid->setRowStretch(1, 1); d->grid->setSizeConstraint(QLayout::SetFixedSize); d->vboxlayout = new QVBoxLayout(); d->vboxlayout->setSpacing(0); d->vboxlayout->setMargin(0); d->vboxlayout->setSizeConstraint(QLayout::SetFixedSize); //Create nice rulers d->zoom = new KReportZoomHandler(); d->hruler = new KReportRuler(this, Qt::Horizontal, d->zoom); - d->pageButton = new ReportPropertiesButton(this); + d->pageButton = new KReportPropertiesButton(this); d->hruler->setUnit(KReportUnit(KReportUnit::Centimeter)); d->grid->addWidget(d->pageButton, 0, 0); d->grid->addWidget(d->hruler, 0, 1); d->grid->addLayout(d->vboxlayout, 1, 0, 1, 2); d->pageButton->setMaximumSize(QSize(19, 22)); d->pageButton->setMinimumSize(QSize(19, 22)); - d->detail = new ReportSectionDetail(this); + d->detail = new KReportDesignerSectionDetail(this); d->vboxlayout->insertWidget(0, d->detail); setLayout(d->grid); connect(d->pageButton, SIGNAL(released()), this, SLOT(slotPageButton_Pressed())); emit pagePropertyChanged(*d->set); connect(d->set, SIGNAL(propertyChanged(KPropertySet&,KProperty&)), this, SLOT(slotPropertyChanged(KPropertySet&,KProperty&))); changeSet(d->set); } -KoReportDesigner::~KoReportDesigner() +KReportDesigner::~KReportDesigner() { delete d; } ///The loading Code -KoReportDesigner::KoReportDesigner(QWidget *parent, const QDomElement &data) +KReportDesigner::KReportDesigner(QWidget *parent, const QDomElement &data) : QWidget(parent), d(new Private()) { init(); if (data.tagName() != QLatin1String("report:content")) { // arg we got an xml file but not one i know of kreportWarning() << "root element was not "; } //kreportDebug() << data.text(); deleteDetail(); QDomNodeList nlist = data.childNodes(); QDomNode it; for (int i = 0; i < nlist.count(); ++i) { it = nlist.item(i); // at this level all the children we get should be Elements if (it.isElement()) { QString n = it.nodeName().toLower(); //kreportDebug() << n; if (n == QLatin1String("report:title")) { setReportTitle(it.firstChild().nodeValue()); #ifdef KREPORT_SCRIPTING } else if (n == QLatin1String("report:script")) { d->originalInterpreter = it.toElement().attribute(QLatin1String("report:script-interpreter")); d->originalScript = it.firstChild().nodeValue(); d->script->setValue(d->originalScript); if (d->originalInterpreter != QLatin1String("javascript") && d->originalInterpreter != QLatin1String("qtscript")) { QString msg = tr("This report contains scripts of type \"%1\". " "Only scripts written in JavaScript language are " "supported. To prevent losing the scripts, their type " "and content will not be changed unless you change these scripts." ).arg(d->originalInterpreter); QMessageBox::warning(this, tr("Unsupported Script Type"), msg); } #endif } else if (n == QLatin1String("report:grid")) { d->showGrid->setValue(it.toElement().attribute(QLatin1String("report:grid-visible"), QString::number(1)).toInt() != 0); d->gridSnap->setValue(it.toElement().attribute(QLatin1String("report:grid-snap"), QString::number(1)).toInt() != 0); d->gridDivisions->setValue(it.toElement().attribute(QLatin1String("report:grid-divisions"), QString::number(4)).toInt()); d->unit->setValue(it.toElement().attribute(QLatin1String("report:page-unit"), QLatin1String("cm"))); } //! @todo Load page options else if (n == QLatin1String("report:page-style")) { QString pagetype = it.firstChild().nodeValue(); if (pagetype == QLatin1String("predefined")) { d->pageSize->setValue(it.toElement().attribute(QLatin1String("report:page-size"), QLatin1String("A4"))); } else if (pagetype == QLatin1String("custom")) { d->pageSize->setValue(QLatin1String("custom")); d->customHeight->setValue(KReportUnit::parseValue(it.toElement().attribute(QLatin1String("report:custom-page-height"), QLatin1String("")))); d->customWidth->setValue(KReportUnit::parseValue(it.toElement().attribute(QLatin1String("report:custom-page-widtht"), QLatin1String("")))); } else if (pagetype == QLatin1String("label")) { //! @todo } d->rightMargin->setValue(KReportUnit::parseValue(it.toElement().attribute(QLatin1String("fo:margin-right"), QLatin1String("1.0cm")))); d->leftMargin->setValue(KReportUnit::parseValue(it.toElement().attribute(QLatin1String("fo:margin-left"), QLatin1String("1.0cm")))); d->topMargin->setValue(KReportUnit::parseValue(it.toElement().attribute(QLatin1String("fo:margin-top"), QLatin1String("1.0cm")))); d->bottomMargin->setValue(KReportUnit::parseValue(it.toElement().attribute(QLatin1String("fo:margin-bottom"), QLatin1String("1.0cm")))); d->orientation->setValue(it.toElement().attribute(QLatin1String("report:print-orientation"), QLatin1String("portrait"))); } else if (n == QLatin1String("report:body")) { QDomNodeList sectionlist = it.childNodes(); QDomNode sec; for (int s = 0; s < sectionlist.count(); ++s) { sec = sectionlist.item(s); if (sec.isElement()) { QString sn = sec.nodeName().toLower(); //kreportDebug() << sn; if (sn == QLatin1String("report:section")) { QString sectiontype = sec.toElement().attribute(QLatin1String("report:section-type")); - if (section(KRSectionData::sectionTypeFromString(sectiontype)) == 0) { - insertSection(KRSectionData::sectionTypeFromString(sectiontype)); - section(KRSectionData::sectionTypeFromString(sectiontype))->initFromXML(sec); + if (section(KReportSectionData::sectionTypeFromString(sectiontype)) == 0) { + insertSection(KReportSectionData::sectionTypeFromString(sectiontype)); + section(KReportSectionData::sectionTypeFromString(sectiontype))->initFromXML(sec); } } else if (sn == QLatin1String("report:detail")) { - ReportSectionDetail * rsd = new ReportSectionDetail(this); + KReportDesignerSectionDetail * rsd = new KReportDesignerSectionDetail(this); rsd->initFromXML(&sec); setDetail(rsd); } } else { kreportWarning() << "Encountered an unknown Element: " << n; } } } } else { kreportWarning() << "Encountered a child node of root that is not an Element"; } } this->slotPageButton_Pressed(); emit reportDataChanged(); slotPropertyChanged(*d->set, *d->unit); // set unit for all items setModified(false); } ///The saving code -QDomElement KoReportDesigner::document() const +QDomElement KReportDesigner::document() const { QDomDocument doc; QString saveInterpreter; QDomElement content = doc.createElement(QLatin1String("report:content")); content.setAttribute(QLatin1String("xmlns:report"), QLatin1String(ns)); content.setAttribute(QLatin1String("xmlns:fo"), QLatin1String("urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0")); content.setAttribute(QLatin1String("xmlns:svg"), QLatin1String("urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0")); doc.appendChild(content); //title content.appendChild(propertyToElement(&doc, d->title)); #ifdef KREPORT_SCRIPTING if (!d->script->value().toString().isEmpty()) { if (d->script->value().toString() != d->originalScript || d->originalInterpreter == QLatin1String("qtscript")) { //The script has changed so force interpreter to 'javascript'. Also set if was using qtscript saveInterpreter = QLatin1String("javascript"); } else { saveInterpreter = d->originalInterpreter; } QDomElement scr = propertyToElement(&doc, d->script); scr.setAttribute(QLatin1String("report:script-interpreter"), saveInterpreter); content.appendChild(scr); } #endif QDomElement grd = doc.createElement(QLatin1String("report:grid")); KReportUtils::addPropertyAsAttribute(&grd, d->showGrid); KReportUtils::addPropertyAsAttribute(&grd, d->gridDivisions); KReportUtils::addPropertyAsAttribute(&grd, d->gridSnap); KReportUtils::addPropertyAsAttribute(&grd, d->unit); content.appendChild(grd); // pageOptions // -- size QDomElement pagestyle = doc.createElement(QLatin1String("report:page-style")); if (d->pageSize->value().toString() == QLatin1String("Custom")) { pagestyle.appendChild(doc.createTextNode(QLatin1String("custom"))); KReportUtils::setAttribute(&pagestyle, QLatin1String("report:custom-page-width"), d->customWidth->value().toDouble()); KReportUtils::setAttribute(&pagestyle, QLatin1String("report:custom-page-height"), d->customHeight->value().toDouble()); } else if (d->pageSize->value().toString() == QLatin1String("Label")) { pagestyle.appendChild(doc.createTextNode(QLatin1String("label"))); pagestyle.setAttribute(QLatin1String("report:page-label-type"), d->labelType->value().toString()); } else { pagestyle.appendChild(doc.createTextNode(QLatin1String("predefined"))); KReportUtils::addPropertyAsAttribute(&pagestyle, d->pageSize); //pagestyle.setAttribute("report:page-size", d->pageSize->value().toString()); } // -- orientation KReportUtils::addPropertyAsAttribute(&pagestyle, d->orientation); // -- margins: save as points, and not localized KReportUtils::setAttribute(&pagestyle, QLatin1String("fo:margin-top"), d->topMargin->value().toDouble()); KReportUtils::setAttribute(&pagestyle, QLatin1String("fo:margin-bottom"), d->bottomMargin->value().toDouble()); KReportUtils::setAttribute(&pagestyle, QLatin1String("fo:margin-right"), d->rightMargin->value().toDouble()); KReportUtils::setAttribute(&pagestyle, QLatin1String("fo:margin-left"), d->leftMargin->value().toDouble()); content.appendChild(pagestyle); QDomElement body = doc.createElement(QLatin1String("report:body")); QDomElement domsection; - for (int i = KRSectionData::PageHeaderFirst; i <= KRSectionData::PageFooterAny; ++i) { - ReportSection *sec = section((KRSectionData::Section)i); + for (int i = KReportSectionData::PageHeaderFirst; i <= KReportSectionData::PageFooterAny; ++i) { + KReportDesignerSection *sec = section((KReportSectionData::Section)i); if (sec) { domsection = doc.createElement(QLatin1String("report:section")); - domsection.setAttribute(QLatin1String("report:section-type"), KRSectionData::sectionTypeString(KRSectionData::Section(i))); + domsection.setAttribute(QLatin1String("report:section-type"), KReportSectionData::sectionTypeString(KReportSectionData::Section(i))); sec->buildXML(&doc, &domsection); body.appendChild(domsection); } } QDomElement detail = doc.createElement(QLatin1String("report:detail")); d->detail->buildXML(&doc, &detail); body.appendChild(detail); content.appendChild(body); return content; } -void KoReportDesigner::slotSectionEditor() +void KReportDesigner::slotSectionEditor() { - QPointer se = new SectionEditor(this); + QPointer se = new KReportSectionEditor(this); se->init(this); se->exec(); delete se; } -void KoReportDesigner::setReportData(KoReportData* kodata) +void KReportDesigner::setReportData(KReportData* kodata) { //kreportDebug(); if (kodata) { d->kordata = kodata; slotPageButton_Pressed(); setModified(true); emit reportDataChanged(); } } -ReportSection * KoReportDesigner::section(KRSectionData::Section s) const +KReportDesignerSection * KReportDesigner::section(KReportSectionData::Section s) const { - ReportSection *sec; + KReportDesignerSection *sec; switch (s) { - case KRSectionData::PageHeaderAny: + case KReportSectionData::PageHeaderAny: sec = d->pageHeaderAny; break; - case KRSectionData::PageHeaderEven: + case KReportSectionData::PageHeaderEven: sec = d->pageHeaderEven; break; - case KRSectionData::PageHeaderOdd: + case KReportSectionData::PageHeaderOdd: sec = d->pageHeaderOdd; break; - case KRSectionData::PageHeaderFirst: + case KReportSectionData::PageHeaderFirst: sec = d->pageHeaderFirst; break; - case KRSectionData::PageHeaderLast: + case KReportSectionData::PageHeaderLast: sec = d->pageHeaderLast; break; - case KRSectionData::PageFooterAny: + case KReportSectionData::PageFooterAny: sec = d->pageFooterAny; break; - case KRSectionData::PageFooterEven: + case KReportSectionData::PageFooterEven: sec = d->pageFooterEven; break; - case KRSectionData::PageFooterOdd: + case KReportSectionData::PageFooterOdd: sec = d->pageFooterOdd; break; - case KRSectionData::PageFooterFirst: + case KReportSectionData::PageFooterFirst: sec = d->pageFooterFirst; break; - case KRSectionData::PageFooterLast: + case KReportSectionData::PageFooterLast: sec = d->pageFooterLast; break; - case KRSectionData::ReportHeader: + case KReportSectionData::ReportHeader: sec = d->reportHeader; break; - case KRSectionData::ReportFooter: + case KReportSectionData::ReportFooter: sec = d->reportFooter; break; default: sec = 0; } return sec; } -void KoReportDesigner::removeSection(KRSectionData::Section s) +void KReportDesigner::removeSection(KReportSectionData::Section s) { - ReportSection* sec = section(s); + KReportDesignerSection* sec = section(s); if (sec) { delete sec; switch (s) { - case KRSectionData::PageHeaderAny: + case KReportSectionData::PageHeaderAny: d->pageHeaderAny = 0; break; - case KRSectionData::PageHeaderEven: + case KReportSectionData::PageHeaderEven: sec = d->pageHeaderEven = 0; break; - case KRSectionData::PageHeaderOdd: + case KReportSectionData::PageHeaderOdd: d->pageHeaderOdd = 0; break; - case KRSectionData::PageHeaderFirst: + case KReportSectionData::PageHeaderFirst: d->pageHeaderFirst = 0; break; - case KRSectionData::PageHeaderLast: + case KReportSectionData::PageHeaderLast: d->pageHeaderLast = 0; break; - case KRSectionData::PageFooterAny: + case KReportSectionData::PageFooterAny: d->pageFooterAny = 0; break; - case KRSectionData::PageFooterEven: + case KReportSectionData::PageFooterEven: d->pageFooterEven = 0; break; - case KRSectionData::PageFooterOdd: + case KReportSectionData::PageFooterOdd: d->pageFooterOdd = 0; break; - case KRSectionData::PageFooterFirst: + case KReportSectionData::PageFooterFirst: d->pageFooterFirst = 0; break; - case KRSectionData::PageFooterLast: + case KReportSectionData::PageFooterLast: d->pageFooterLast = 0; break; - case KRSectionData::ReportHeader: + case KReportSectionData::ReportHeader: d->reportHeader = 0; break; - case KRSectionData::ReportFooter: + case KReportSectionData::ReportFooter: d->reportFooter = 0; break; default: sec = 0; } setModified(true); adjustSize(); } } -void KoReportDesigner::insertSection(KRSectionData::Section s) +void KReportDesigner::insertSection(KReportSectionData::Section s) { - ReportSection* sec = section(s); + KReportDesignerSection* sec = section(s); if (!sec) { int idx = 0; for (int i = 1; i <= s; ++i) { - if (section((KRSectionData::Section)i)) + if (section((KReportSectionData::Section)i)) idx++; } - if (s > KRSectionData::ReportHeader) + if (s > KReportSectionData::ReportHeader) idx++; //kreportDebug() << idx; - ReportSection *rs = new ReportSection(this); + KReportDesignerSection *rs = new KReportDesignerSection(this); d->vboxlayout->insertWidget(idx, rs); switch (s) { - case KRSectionData::PageHeaderAny: + case KReportSectionData::PageHeaderAny: rs->setTitle(tr("Page Header (Any)")); d->pageHeaderAny = rs; break; - case KRSectionData::PageHeaderEven: + case KReportSectionData::PageHeaderEven: rs->setTitle(tr("Page Header (Even)")); d->pageHeaderEven = rs; break; - case KRSectionData::PageHeaderOdd: + case KReportSectionData::PageHeaderOdd: rs->setTitle(tr("Page Header (Odd)")); d->pageHeaderOdd = rs; break; - case KRSectionData::PageHeaderFirst: + case KReportSectionData::PageHeaderFirst: rs->setTitle(tr("Page Header (First)")); d->pageHeaderFirst = rs; break; - case KRSectionData::PageHeaderLast: + case KReportSectionData::PageHeaderLast: rs->setTitle(tr("Page Header (Last)")); d->pageHeaderLast = rs; break; - case KRSectionData::PageFooterAny: + case KReportSectionData::PageFooterAny: rs->setTitle(tr("Page Footer (Any)")); d->pageFooterAny = rs; break; - case KRSectionData::PageFooterEven: + case KReportSectionData::PageFooterEven: rs->setTitle(tr("Page Footer (Even)")); d->pageFooterEven = rs; break; - case KRSectionData::PageFooterOdd: + case KReportSectionData::PageFooterOdd: rs->setTitle(tr("Page Footer (Odd)")); d->pageFooterOdd = rs; break; - case KRSectionData::PageFooterFirst: + case KReportSectionData::PageFooterFirst: rs->setTitle(tr("Page Footer (First)")); d->pageFooterFirst = rs; break; - case KRSectionData::PageFooterLast: + case KReportSectionData::PageFooterLast: rs->setTitle(tr("Page Footer (Last)")); d->pageFooterLast = rs; break; - case KRSectionData::ReportHeader: + case KReportSectionData::ReportHeader: rs->setTitle(tr("Report Header")); d->reportHeader = rs; break; - case KRSectionData::ReportFooter: + case KReportSectionData::ReportFooter: rs->setTitle(tr("Report Footer")); d->reportFooter = rs; break; //These sections cannot be inserted this way - case KRSectionData::None: - case KRSectionData::GroupHeader: - case KRSectionData::GroupFooter: - case KRSectionData::Detail: + case KReportSectionData::None: + case KReportSectionData::GroupHeader: + case KReportSectionData::GroupFooter: + case KReportSectionData::Detail: break; } rs->show(); setModified(true); adjustSize(); emit pagePropertyChanged(*d->set); } } -void KoReportDesigner::setReportTitle(const QString & str) +void KReportDesigner::setReportTitle(const QString & str) { if (reportTitle() != str) { d->title->setValue(str); setModified(true); } } -KPropertySet * KoReportDesigner::propertySet() const +KPropertySet * KReportDesigner::propertySet() const { return d->set; } -KPropertySet* KoReportDesigner::itemPropertySet() const +KPropertySet* KReportDesigner::itemPropertySet() const { return d->itmset; } -KoReportData *KoReportDesigner::reportData() const +KReportData *KReportDesigner::reportData() const { return d->kordata; } -ReportSectionDetail * KoReportDesigner::detailSection() const +KReportDesignerSectionDetail * KReportDesigner::detailSection() const { return d->detail; } -QString KoReportDesigner::reportTitle() const +QString KReportDesigner::reportTitle() const { return d->title->value().toString(); } -bool KoReportDesigner::isModified() const +bool KReportDesigner::isModified() const { return d->modified; } -void KoReportDesigner::setModified(bool mod) +void KReportDesigner::setModified(bool mod) { d->modified = mod; if (d->modified) { emit dirty(); } } -QStringList KoReportDesigner::fieldNames() const +QStringList KReportDesigner::fieldNames() const { QStringList qs; qs << QString(); if (d->kordata) qs << d->kordata->fieldNames(); return qs; } -QStringList KoReportDesigner::fieldKeys() const +QStringList KReportDesigner::fieldKeys() const { QStringList qs; qs << QString(); if (d->kordata) qs << d->kordata->fieldKeys(); return qs; } -void KoReportDesigner::createProperties() +void KReportDesigner::createProperties() { QStringList keys, strings; d->set = new KPropertySet(0, QLatin1String("Report")); connect(d->set, SIGNAL(propertyChanged(KPropertySet&,KProperty&)), this, SLOT(slotPropertyChanged(KPropertySet&,KProperty&))); d->title = new KProperty("title", QLatin1String("Report"), tr("Title"), tr("Report Title")); keys.clear(); keys = KReportPageFormat::pageFormatNames(); strings = KReportPageFormat::localizedPageFormatNames(); QString defaultKey = KReportPageFormat::formatString(KReportPageFormat::defaultFormat()); d->pageSize = new KProperty("page-size", keys, strings, defaultKey, tr("Page Size")); keys.clear(); strings.clear(); keys << QLatin1String("portrait") << QLatin1String("landscape"); strings << tr("Portrait") << tr("Landscape"); d->orientation = new KProperty("print-orientation", keys, strings, QLatin1String("portrait"), tr("Page Orientation")); keys.clear(); strings.clear(); strings = KReportUnit::listOfUnitNameForUi(KReportUnit::HidePixel); QString unit; foreach(const QString &un, strings) { unit = un.mid(un.indexOf(QLatin1String("(")) + 1, 2); keys << unit; } d->unit = new KProperty("page-unit", keys, strings, QLatin1String("cm"), tr("Page Unit")); d->showGrid = new KProperty("grid-visible", true, tr("Show Grid")); d->gridSnap = new KProperty("grid-snap", true, tr("Snap to Grid")); d->gridDivisions = new KProperty("grid-divisions", 4, tr("Grid Divisions")); d->leftMargin = new KProperty("margin-left", KReportUnit(KReportUnit::Centimeter).fromUserValue(1.0), tr("Left Margin"), tr("Left Margin"), KProperty::Double); d->rightMargin = new KProperty("margin-right", KReportUnit(KReportUnit::Centimeter).fromUserValue(1.0), tr("Right Margin"), tr("Right Margin"), KProperty::Double); d->topMargin = new KProperty("margin-top", KReportUnit(KReportUnit::Centimeter).fromUserValue(1.0), tr("Top Margin"), tr("Top Margin"), KProperty::Double); d->bottomMargin = new KProperty("margin-bottom", KReportUnit(KReportUnit::Centimeter).fromUserValue(1.0), tr("Bottom Margin"), tr("Bottom Margin"), KProperty::Double); d->leftMargin->setOption("unit", QLatin1String("cm")); d->rightMargin->setOption("unit", QLatin1String("cm")); d->topMargin->setOption("unit", QLatin1String("cm")); d->bottomMargin->setOption("unit", QLatin1String("cm")); d->set->addProperty(d->title); d->set->addProperty(d->pageSize); d->set->addProperty(d->orientation); d->set->addProperty(d->unit); d->set->addProperty(d->gridSnap); d->set->addProperty(d->showGrid); d->set->addProperty(d->gridDivisions); d->set->addProperty(d->leftMargin); d->set->addProperty(d->rightMargin); d->set->addProperty(d->topMargin); d->set->addProperty(d->bottomMargin); #ifdef KREPORT_SCRIPTING d->script = new KProperty("script", QStringList(), QStringList(), QString(), tr("Object Script")); d->set->addProperty(d->script); #endif // KProperty* _customHeight; // KProperty* _customWidth; } /** @brief Handle property changes */ -void KoReportDesigner::slotPropertyChanged(KPropertySet &s, KProperty &p) +void KReportDesigner::slotPropertyChanged(KPropertySet &s, KProperty &p) { setModified(true); emit pagePropertyChanged(s); if (p.name() == "page-unit") { d->hruler->setUnit(pageUnit()); QString newstr = d->set->property("page-unit").value().toString(); d->set->property("margin-left").setOption("unit", newstr); d->set->property("margin-right").setOption("unit", newstr); d->set->property("margin-top").setOption("unit", newstr); d->set->property("margin-bottom").setOption("unit", newstr); } } -void KoReportDesigner::slotPageButton_Pressed() +void KReportDesigner::slotPageButton_Pressed() { #ifdef KREPORT_SCRIPTING if (d->kordata) { QStringList sl = d->kordata->scriptList(); sl.prepend(QLatin1String("")); d->script->setListData(sl, sl); } changeSet(d->set); #endif } -QSize KoReportDesigner::sizeHint() const +QSize KReportDesigner::sizeHint() const { int w = 0; int h = 0; if (d->pageFooterAny) h += d->pageFooterAny->sizeHint().height(); if (d->pageFooterEven) h += d->pageFooterEven->sizeHint().height(); if (d->pageFooterFirst) h += d->pageFooterFirst->sizeHint().height(); if (d->pageFooterLast) h += d->pageFooterLast->sizeHint().height(); if (d->pageFooterOdd) h += d->pageFooterOdd->sizeHint().height(); if (d->pageHeaderAny) h += d->pageHeaderAny->sizeHint().height(); if (d->pageHeaderEven) h += d->pageHeaderEven->sizeHint().height(); if (d->pageHeaderFirst) h += d->pageHeaderFirst->sizeHint().height(); if (d->pageHeaderLast) h += d->pageHeaderLast->sizeHint().height(); if (d->pageHeaderOdd) h += d->pageHeaderOdd->sizeHint().height(); if (d->reportHeader) h += d->reportHeader->sizeHint().height(); if (d->reportFooter) { h += d->reportFooter->sizeHint().height(); } if (d->detail) { h += d->detail->sizeHint().height(); w += d->detail->sizeHint().width(); } h += d->hruler->height(); return QSize(w, h); } -int KoReportDesigner::pageWidthPx() const +int KReportDesigner::pageWidthPx() const { int cw = 0; int ch = 0; int width = 0; KReportPageFormat::Format pf = KReportPageFormat::formatFromString(d->set->property("page-size").value().toString()); cw = POINT_TO_INCH(MM_TO_POINT(KReportPageFormat::width(pf, KReportPageFormat::Portrait))) * KReportDpi::dpiX(); ch = POINT_TO_INCH(MM_TO_POINT(KReportPageFormat::height(pf, KReportPageFormat::Portrait))) * KReportDpi::dpiY(); width = (d->set->property("print-orientation").value().toString() == QLatin1String("portrait") ? cw : ch); width = width - POINT_TO_INCH(d->set->property("margin-left").value().toDouble()) * KReportDpi::dpiX(); width = width - POINT_TO_INCH(d->set->property("margin-right").value().toDouble()) * KReportDpi::dpiX(); return width; } -void KoReportDesigner::resizeEvent(QResizeEvent * event) +void KReportDesigner::resizeEvent(QResizeEvent * event) { Q_UNUSED(event); //hruler->setRulerLength ( vboxlayout->geometry().width() ); d->hruler->setRulerLength(pageWidthPx()); } -void KoReportDesigner::setDetail(ReportSectionDetail *rsd) +void KReportDesigner::setDetail(KReportDesignerSectionDetail *rsd) { if (!d->detail) { int idx = 0; if (d->pageHeaderFirst) idx++; if (d->pageHeaderOdd) idx++; if (d->pageHeaderEven) idx++; if (d->pageHeaderLast) idx++; if (d->pageHeaderAny) idx++; if (d->reportHeader) idx++; d->detail = rsd; d->vboxlayout->insertWidget(idx, d->detail); } } -void KoReportDesigner::deleteDetail() +void KReportDesigner::deleteDetail() { delete d->detail; d->detail = 0; } -KReportUnit KoReportDesigner::pageUnit() const +KReportUnit KReportDesigner::pageUnit() const { QString u; bool found; u = d->unit->value().toString(); KReportUnit unit = KReportUnit::fromSymbol(u, &found); if (!found) { unit = KReportUnit(KReportUnit::Centimeter); } return unit; } -void KoReportDesigner::setGridOptions(bool vis, int div) +void KReportDesigner::setGridOptions(bool vis, int div) { d->showGrid->setValue(QVariant(vis)); d->gridDivisions->setValue(div); } // // methods for the sectionMouse*Event() // -void KoReportDesigner::sectionContextMenuEvent(ReportScene * s, QGraphicsSceneContextMenuEvent * e) +void KReportDesigner::sectionContextMenuEvent(KReportDesignerScene * s, QGraphicsSceneContextMenuEvent * e) { Q_UNUSED(s); QMenu pop; bool itemsSelected = selectionCount() > 0; if (itemsSelected) { //! @todo KF5 use KStandardAction QAction *a = new QAction(QIcon::fromTheme(QLatin1String("edit-cut")), tr("Cut"), this); connect(a, SIGNAL(triggered()), this, SLOT(slotEditCut())); pop.addAction(a); //! @todo KF5 use KStandardAction a = new QAction(QIcon::fromTheme(QLatin1String("edit-copy")), tr("Copy"), this); connect(a, SIGNAL(triggered()), this, SLOT(slotEditCopy())); pop.addAction(a); } if (!d->sectionData->copy_list.isEmpty()) { QAction *a = new QAction(QIcon::fromTheme(QLatin1String("edit-paste")), tr("Paste"), this); connect(a, SIGNAL(triggered()), this, SLOT(slotEditPaste())); pop.addAction(a); } if (itemsSelected) { pop.addSeparator(); //! @todo KF5 use KStandard* //const KGuiItem del = KStandardGuiItem::del(); //a->setToolTip(del.toolTip()); //a->setShortcut(QKeySequence(QKeySequence::Delete)); QAction *a = new QAction(QIcon::fromTheme(QLatin1String("edit-delete")), tr("Delete"), this); connect(a, SIGNAL(triggered()), SLOT(slotEditDelete())); pop.addAction(a); } if (!pop.actions().isEmpty()) { pop.exec(e->screenPos()); } } -void KoReportDesigner::sectionMousePressEvent(ReportSceneView * v, QMouseEvent * e) +void KReportDesigner::sectionMousePressEvent(KReportDesignerView * v, QMouseEvent * e) { Q_UNUSED(v); d->pressX = e->pos().x(); d->pressY = e->pos().y(); } -void KoReportDesigner::sectionMouseReleaseEvent(ReportSceneView * v, QMouseEvent * e) +void KReportDesigner::sectionMouseReleaseEvent(KReportDesignerView * v, QMouseEvent * e) { e->accept(); d->releaseX = e->pos().x(); d->releaseY = e->pos().y(); if (e->button() == Qt::LeftButton) { QPointF pos(d->pressX, d->pressY); QPointF end(d->releaseX, d->releaseY); if (d->releaseY >= v->scene()->height()) { d->releaseY = v->scene()->height(); end.setY(v->scene()->height()); } if (d->releaseX >= v->scene()->width()) { d->releaseX = v->scene()->width(); end.setX(v->scene()->width()); } if (d->sectionData->mouseAction == ReportWriterSectionData::MA_Insert) { QGraphicsItem * item = 0; if (d->sectionData->insertItem == QLatin1String("org.kde.kreport.line")) { - item = new KoReportDesignerItemLine(v->designer(), v->scene(), pos, end); + item = new KReportDesignerItemLine(v->designer(), v->scene(), pos, end); } else { - KoReportPluginManager* pluginManager = KoReportPluginManager::self(); - KoReportPluginInterface *plug = pluginManager->plugin(d->sectionData->insertItem); + KReportPluginManager* pluginManager = KReportPluginManager::self(); + KReportPluginInterface *plug = pluginManager->plugin(d->sectionData->insertItem); if (plug) { QObject *obj = plug->createDesignerInstance(v->designer(), v->scene(), pos); if (obj) { item = dynamic_cast(obj); } } else { kreportWarning() << "attempted to insert an unknown item"; } } if (item) { item->setVisible(true); item->setSelected(true); - KoReportItemBase* baseReportItem = dynamic_cast(item); + KReportItemBase* baseReportItem = dynamic_cast(item); if (baseReportItem) { changeSet(baseReportItem->propertySet()); if (v && v->designer()) { v->designer()->setModified(true); } emit itemInserted(d->sectionData->insertItem); } } d->sectionData->mouseAction = ReportWriterSectionData::MA_None; d->sectionData->insertItem.clear(); unsetSectionCursor(); } } } -unsigned int KoReportDesigner::selectionCount() const +unsigned int KReportDesigner::selectionCount() const { if (activeScene()) return activeScene()->selectedItems().count(); else return 0; } -void KoReportDesigner::changeSet(KPropertySet *s) +void KReportDesigner::changeSet(KPropertySet *s) { //Set the checked state of the report properties button if (s == d->set) d->pageButton->setCheckState(Qt::Checked); else d->pageButton->setCheckState(Qt::Unchecked); d->itmset = s; emit propertySetChanged(); } // // Actions // -void KoReportDesigner::slotItem(const QString &entity) +void KReportDesigner::slotItem(const QString &entity) { kreportDebug() << entity; d->sectionData->mouseAction = ReportWriterSectionData::MA_Insert; d->sectionData->insertItem = entity; setSectionCursor(QCursor(Qt::CrossCursor)); } -void KoReportDesigner::slotEditDelete() +void KReportDesigner::slotEditDelete() { QGraphicsItem * item = 0; bool modified = false; while (selectionCount() > 0) { item = activeScene()->selectedItems().value(0); if (item) { QGraphicsScene * scene = item->scene(); delete item; scene->update(); d->sectionData->mouseAction = ReportWriterSectionData::MA_None; modified = true; } } activeScene()->selectedItems().clear(); /*! @todo temporary: clears cut and copy lists to make sure we do not crash if weve deleted something in the list should really check if an item is in the list first and remove it. */ d->sectionData->cut_list.clear(); d->sectionData->copy_list.clear(); if (modified) { setModified(true); } } -void KoReportDesigner::slotEditCut() +void KReportDesigner::slotEditCut() { if (selectionCount() > 0) { //First delete any items that are curerntly in the list //so as not to leak memory qDeleteAll(d->sectionData->cut_list); d->sectionData->cut_list.clear(); QGraphicsItem * item = activeScene()->selectedItems().first(); bool modified = false; if (item) { d->sectionData->copy_list.clear(); foreach(QGraphicsItem *item, activeScene()->selectedItems()) { - d->sectionData->cut_list.append(dynamic_cast(item)); - d->sectionData->copy_list.append(dynamic_cast(item)); + d->sectionData->cut_list.append(dynamic_cast(item)); + d->sectionData->copy_list.append(dynamic_cast(item)); } foreach(QGraphicsItem *item, activeScene()->selectedItems()) { activeScene()->removeItem(item); activeScene()->update(); modified = true; } d->sectionData->selected_x_offset = 10; d->sectionData->selected_y_offset = 10; } if (modified) { setModified(true); } } } -void KoReportDesigner::slotEditCopy() +void KReportDesigner::slotEditCopy() { if (selectionCount() < 1) return; QGraphicsItem * item = activeScene()->selectedItems().first(); if (item) { d->sectionData->copy_list.clear(); foreach(QGraphicsItem *item, activeScene()->selectedItems()) { - d->sectionData->copy_list.append(dynamic_cast(item)); + d->sectionData->copy_list.append(dynamic_cast(item)); } d->sectionData->selected_x_offset = 10; d->sectionData->selected_y_offset = 10; } } -void KoReportDesigner::slotEditPaste() +void KReportDesigner::slotEditPaste() { // call the editPaste function passing it a reportsection slotEditPaste(activeScene()); } -void KoReportDesigner::slotEditPaste(QGraphicsScene * canvas) +void KReportDesigner::slotEditPaste(QGraphicsScene * canvas) { // paste a new item of the copy we have in the specified location if (!d->sectionData->copy_list.isEmpty()) { QList activeItems = canvas->selectedItems(); QGraphicsItem *activeItem = 0; if (activeItems.count() == 1) { activeItem = activeItems.first(); } canvas->clearSelection(); d->sectionData->mouseAction = ReportWriterSectionData::MA_None; //! @todo this code sucks :) //! The setPos calls only work AFTER the name has been set ?!?!? - foreach(KoReportDesignerItemBase *item, d->sectionData->copy_list) { - KoReportItemBase *obj = dynamic_cast(item); + foreach(KReportDesignerItemBase *item, d->sectionData->copy_list) { + KReportItemBase *obj = dynamic_cast(item); const QString type = obj ? obj->typeName() : QLatin1String("object"); //kreportDebug() << type; - KoReportDesignerItemBase *ent = item->clone(); - KoReportItemBase *new_obj = dynamic_cast(ent); + KReportDesignerItemBase *ent = item->clone(); + KReportItemBase *new_obj = dynamic_cast(ent); new_obj->setEntityName(suggestEntityName(type)); if (activeItem) { new_obj->position().setScenePos(QPointF(activeItem->x() + 10, activeItem->y() + 10)); } else { new_obj->position().setScenePos(QPointF(0, 0)); } changeSet(new_obj->propertySet()); QGraphicsItem *pasted_ent = dynamic_cast(ent); if (pasted_ent) { pasted_ent->setSelected(true); canvas->addItem(pasted_ent); pasted_ent->show(); d->sectionData->mouseAction = ReportWriterSectionData::MA_Grab; setModified(true); } } } } -void KoReportDesigner::slotRaiseSelected() +void KReportDesigner::slotRaiseSelected() { - dynamic_cast(activeScene())->raiseSelected(); + dynamic_cast(activeScene())->raiseSelected(); } -void KoReportDesigner::slotLowerSelected() +void KReportDesigner::slotLowerSelected() { - dynamic_cast(activeScene())->lowerSelected(); + dynamic_cast(activeScene())->lowerSelected(); } -QGraphicsScene* KoReportDesigner::activeScene() const +QGraphicsScene* KReportDesigner::activeScene() const { return d->activeScene; } -void KoReportDesigner::setActiveScene(QGraphicsScene* a) +void KReportDesigner::setActiveScene(QGraphicsScene* a) { if (d->activeScene && d->activeScene != a) d->activeScene->clearSelection(); d->activeScene = a; //Trigger an update so that the last scene redraws its title; update(); } -KReportZoomHandler* KoReportDesigner::zoomHandler() const +KReportZoomHandler* KReportDesigner::zoomHandler() const { return d->zoom; } -QString KoReportDesigner::suggestEntityName(const QString &n) const +QString KReportDesigner::suggestEntityName(const QString &n) const { - ReportSection *sec; + KReportDesignerSection *sec; int itemCount = 0; //Count items in the main sections - for (int i = 1; i <= KRSectionData::PageFooterAny; i++) { - sec = section((KRSectionData::Section) i); + for (int i = 1; i <= KReportSectionData::PageFooterAny; i++) { + sec = section((KReportSectionData::Section) i); if (sec) { const QGraphicsItemList l = sec->items(); itemCount += l.count(); } } if (d->detail) { //Count items in the group headers/footers for (int i = 0; i < d->detail->groupSectionCount(); i++) { sec = d->detail->groupSection(i)->groupHeader(); if (sec) { const QGraphicsItemList l = sec->items(); itemCount += l.count(); } sec = d->detail->groupSection(i)->groupFooter(); if (sec) { const QGraphicsItemList l = sec->items(); itemCount += l.count(); } } sec = d->detail->detailSection(); if (sec) { const QGraphicsItemList l = sec->items(); itemCount += l.count(); } } while (!isEntityNameUnique(n + QString::number(itemCount))) { itemCount++; } return n + QString::number(itemCount); } -bool KoReportDesigner::isEntityNameUnique(const QString &n, KoReportItemBase* ignore) const +bool KReportDesigner::isEntityNameUnique(const QString &n, KReportItemBase* ignore) const { - ReportSection *sec; + KReportDesignerSection *sec; bool unique = true; //Check items in the main sections - for (int i = 1; i <= KRSectionData::PageFooterAny; i++) { - sec = section((KRSectionData::Section)i); + for (int i = 1; i <= KReportSectionData::PageFooterAny; i++) { + sec = section((KReportSectionData::Section)i); if (sec) { const QGraphicsItemList l = sec->items(); for (QGraphicsItemList::const_iterator it = l.constBegin(); it != l.constEnd(); ++it) { - KoReportItemBase* itm = dynamic_cast(*it); + KReportItemBase* itm = dynamic_cast(*it); if (itm && itm->entityName() == n && itm != ignore) { unique = false; break; } } if (!unique) break; } } //Count items in the group headers/footers if (unique && d->detail) { for (int i = 0; i < d->detail->groupSectionCount(); ++i) { sec = d->detail->groupSection(i)->groupHeader(); if (sec) { const QGraphicsItemList l = sec->items(); for (QGraphicsItemList::const_iterator it = l.constBegin(); it != l.constEnd(); ++it) { - KoReportItemBase* itm = dynamic_cast(*it); + KReportItemBase* itm = dynamic_cast(*it); if (itm && itm->entityName() == n && itm != ignore) { unique = false; break; } } } sec = d->detail->groupSection(i)->groupFooter(); if (unique && sec) { const QGraphicsItemList l = sec->items(); for (QGraphicsItemList::const_iterator it = l.constBegin(); it != l.constEnd(); ++it) { - KoReportItemBase* itm = dynamic_cast(*it); + KReportItemBase* itm = dynamic_cast(*it); if (itm && itm->entityName() == n && itm != ignore) { unique = false; break; } } } } } if (unique && d->detail) { sec = d->detail->detailSection(); if (sec) { const QGraphicsItemList l = sec->items(); for (QGraphicsItemList::const_iterator it = l.constBegin(); it != l.constEnd(); ++it) { - KoReportItemBase* itm = dynamic_cast(*it); + KReportItemBase* itm = dynamic_cast(*it); if (itm && itm && itm->entityName() == n && itm != ignore) { unique = false; break; } } } } return unique; } static bool actionPriortyLessThan(QAction* act1, QAction* act2) { if (act1->data().toInt() > 0 && act2->data().toInt() > 0) { return act1->data().toInt() < act2->data().toInt(); } return false; } -QList KoReportDesigner::itemActions(QActionGroup* group) +QList KReportDesigner::itemActions(QActionGroup* group) { - KoReportPluginManager* manager = KoReportPluginManager::self(); + KReportPluginManager* manager = KReportPluginManager::self(); QList actList = manager->actions(); //! @todo make line a real plugin so this isn't needed: QAction *act = new QAction(QIcon::fromTheme(QLatin1String("kreport_line_element")), tr("Line"), group); act->setObjectName(QLatin1String("org.kde.kreport.line")); act->setData(9); act->setCheckable(true); actList << act; qSort(actList.begin(), actList.end(), actionPriortyLessThan); int i = 0; /*! @todo maybe this is a bit hackish It finds the first plugin based on the priority in userdata The lowest oriority a plugin can have is 10 And inserts a separator before it. */ bool sepInserted = false; foreach(QAction *a, actList) { ++i; if (!sepInserted && a->data().toInt() >= 10) { QAction *sep = new QAction(QLatin1String("separator"), group); sep->setSeparator(true); actList.insert(i-1, sep); sepInserted = true; } if (group) { group->addAction(a); } } return actList; } -QList< QAction* > KoReportDesigner::designerActions() +QList< QAction* > KReportDesigner::designerActions() { QList al; QAction *sep = new QAction(QString(), this); sep->setSeparator(true); al << d->editCutAction << d->editCopyAction << d->editPasteAction << d->editDeleteAction << sep << d->sectionEdit << sep << d->itemLowerAction << d->itemRaiseAction; return al; } -void KoReportDesigner::createActions() +void KReportDesigner::createActions() { d->editCutAction = new QAction(QIcon::fromTheme(QLatin1String("edit-cut")), tr("Cu&t"), this); d->editCutAction->setObjectName(QLatin1String("edit_cut")); d->editCutAction->setToolTip(tr("Cut selection to clipboard")); d->editCutAction->setShortcuts(KStandardShortcut::cut()); d->editCutAction->setProperty("iconOnly", true); d->editCopyAction = new QAction(QIcon::fromTheme(QLatin1String("edit-copy")), tr("&Copy"), this); d->editCopyAction->setObjectName(QLatin1String("edit_copy")); d->editCopyAction->setToolTip(tr("Copy selection to clipboard")); d->editCopyAction->setShortcuts(KStandardShortcut::copy()); d->editCopyAction->setProperty("iconOnly", true); d->editPasteAction = new QAction(QIcon::fromTheme(QLatin1String("edit-paste")), tr("&Paste"), this); d->editPasteAction->setObjectName(QLatin1String("edit_paste")); d->editPasteAction->setToolTip(tr("Paste clipboard content")); d->editPasteAction->setShortcuts(KStandardShortcut::paste()); d->editPasteAction->setProperty("iconOnly", true); const KGuiItem del = KStandardGuiItem::del(); d->editDeleteAction = new QAction(del.icon(), del.text(), this); d->editDeleteAction->setObjectName(QLatin1String("edit_delete")); d->editDeleteAction->setToolTip(del.toolTip()); d->editDeleteAction->setWhatsThis(del.whatsThis()); d->editDeleteAction->setProperty("iconOnly", true); d->sectionEdit = new QAction(tr("Edit Sections"), this); d->sectionEdit->setObjectName(QLatin1String("section_edit")); d->itemRaiseAction = new QAction(QIcon::fromTheme(QLatin1String("arrow-up")), tr("Raise"), this); d->itemRaiseAction->setObjectName(QLatin1String("item_raise")); d->itemLowerAction = new QAction(QIcon::fromTheme(QLatin1String("arrow-down")), tr("Lower"), this); d->itemLowerAction->setObjectName(QLatin1String("item_lower")); //Edit Actions connect(d->editCutAction, SIGNAL(triggered(bool)), this, SLOT(slotEditCut())); connect(d->editCopyAction, SIGNAL(triggered(bool)), this, SLOT(slotEditCopy())); connect(d->editPasteAction, SIGNAL(triggered(bool)), this, SLOT(slotEditPaste())); connect(d->editDeleteAction, SIGNAL(triggered(bool)), this, SLOT(slotEditDelete())); connect(d->sectionEdit, SIGNAL(triggered(bool)), this, SLOT(slotSectionEditor())); //Raise/Lower connect(d->itemRaiseAction, SIGNAL(triggered(bool)), this, SLOT(slotRaiseSelected())); connect(d->itemLowerAction, SIGNAL(triggered(bool)), this, SLOT(slotLowerSelected())); } -void KoReportDesigner::setSectionCursor(const QCursor& c) +void KReportDesigner::setSectionCursor(const QCursor& c) { if (d->pageFooterAny) d->pageFooterAny->setSectionCursor(c); if (d->pageFooterEven) d->pageFooterEven->setSectionCursor(c); if (d->pageFooterFirst) d->pageFooterFirst->setSectionCursor(c); if (d->pageFooterLast) d->pageFooterLast->setSectionCursor(c); if (d->pageFooterOdd) d->pageFooterOdd->setSectionCursor(c); if (d->pageHeaderAny) d->pageHeaderAny->setSectionCursor(c); if (d->pageHeaderEven) d->pageHeaderEven->setSectionCursor(c); if (d->pageHeaderFirst) d->pageHeaderFirst->setSectionCursor(c); if (d->pageHeaderLast) d->pageHeaderLast->setSectionCursor(c); if (d->pageHeaderOdd) d->pageHeaderOdd->setSectionCursor(c); if (d->detail) d->detail->setSectionCursor(c); } -void KoReportDesigner::unsetSectionCursor() +void KReportDesigner::unsetSectionCursor() { if (d->pageFooterAny) d->pageFooterAny->unsetSectionCursor(); if (d->pageFooterEven) d->pageFooterEven->unsetSectionCursor(); if (d->pageFooterFirst) d->pageFooterFirst->unsetSectionCursor(); if (d->pageFooterLast) d->pageFooterLast->unsetSectionCursor(); if (d->pageFooterOdd) d->pageFooterOdd->unsetSectionCursor(); if (d->pageHeaderAny) d->pageHeaderAny->unsetSectionCursor(); if (d->pageHeaderEven) d->pageHeaderEven->unsetSectionCursor(); if (d->pageHeaderFirst) d->pageHeaderFirst->unsetSectionCursor(); if (d->pageHeaderLast) d->pageHeaderLast->unsetSectionCursor(); if (d->pageHeaderOdd) d->pageHeaderOdd->unsetSectionCursor(); if (d->detail) d->detail->unsetSectionCursor(); } -qreal KoReportDesigner::countSelectionHeight() const +qreal KReportDesigner::countSelectionHeight() const { if (d->releaseY == -1 || d->pressY == -1) { return -1; } return qAbs(d->releaseY - d->pressY); } -qreal KoReportDesigner::countSelectionWidth() const +qreal KReportDesigner::countSelectionWidth() const { if (d->releaseX == -1 || d->pressX == -1) { return -1; } return qAbs(d->releaseX - d->pressX); } -qreal KoReportDesigner::getSelectionPressX() const +qreal KReportDesigner::getSelectionPressX() const { return d->pressX; } -qreal KoReportDesigner::getSelectionPressY() const +qreal KReportDesigner::getSelectionPressY() const { return d->pressY; } -QPointF KoReportDesigner::getPressPoint() const +QPointF KReportDesigner::getPressPoint() const { return QPointF(d->pressX, d->pressY); } -QPointF KoReportDesigner::getReleasePoint() const +QPointF KReportDesigner::getReleasePoint() const { return QPointF(d->releaseX, d->releaseY); } -void KoReportDesigner::plugItemActions(const QList &actList) +void KReportDesigner::plugItemActions(const QList &actList) { foreach(QAction *a, actList) { connect(a, SIGNAL(triggered(bool)), this, SLOT(slotItemTriggered(bool))); } } -void KoReportDesigner::slotItemTriggered(bool checked) +void KReportDesigner::slotItemTriggered(bool checked) { if (!checked) { return; } QObject *theSender = sender(); if (!theSender) { return; } slotItem(theSender->objectName()); } diff --git a/src/wrtembed/KoReportDesigner.h b/src/wrtembed/KReportDesigner.h similarity index 82% rename from src/wrtembed/KoReportDesigner.h rename to src/wrtembed/KReportDesigner.h index 5309d6b6..92b28129 100644 --- a/src/wrtembed/KoReportDesigner.h +++ b/src/wrtembed/KReportDesigner.h @@ -1,337 +1,337 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC * Copyright (C) 2007-2008 by Adam Pigg * Copyright (C) 2011 Jarosław Staniek * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#ifndef REPORTDESIGNER_H -#define REPORTDESIGNER_H +#ifndef KREPORTDESIGNER_H +#define KREPORTDESIGNER_H #include -#include "krreportdata.h" -#include "KoReportData.h" +#include "KReportDocument.h" +#include "KReportData.h" class KProperty; class KPropertySet; -class KoReportItemBase; +class KReportItemBase; class QGraphicsScene; class QActionGroup; class QGraphicsSceneContextMenuEvent; class QString; class KReportZoomHandler; -class ReportSectionDetail; -class ReportSection; +class KReportDesignerSectionDetail; +class KReportDesignerSection; class KReportUnit; -class ReportScene; -class ReportSceneView; +class KReportDesignerScene; +class KReportDesignerView; class QAction; // // Class ReportDesigner // The ReportDesigner is the main widget for designing a report // -class KREPORT_EXPORT KoReportDesigner : public QWidget +class KREPORT_EXPORT KReportDesigner : public QWidget { Q_OBJECT public: /** @brief Constructor that create a blank designer @param widget QWidget parent */ - explicit KoReportDesigner(QWidget *parent = 0); + explicit KReportDesigner(QWidget *parent = 0); /** @brief Constructor that create a designer, and loads the report described in the QDomElement @param widget QWidget parent @param element Report structure XML element */ - KoReportDesigner(QWidget *, const QDomElement &data); + KReportDesigner(QWidget *, const QDomElement &data); /** @brief Desctructor */ - ~KoReportDesigner(); + ~KReportDesigner(); /** @brief Sets the report data The report data interface contains functions to retrieve data and information about the fields. - @param kodata Pointer to KoReportData instance + @param kodata Pointer to KReportData instance */ - void setReportData(KoReportData* kodata); + void setReportData(KReportData* kodata); /** @brief Return a pointer to the reports data @return Pointer to report data */ - KoReportData *reportData() const; + KReportData *reportData() const; /** @brief Return a pointer to the section specified - @param section KRSectionData::Section enum value of the section to return + @param section KReportSectionData::Section enum value of the section to return @return Pointer to report section object, or 0 if no section exists */ - ReportSection* section(KRSectionData::Section) const; + KReportDesignerSection* section(KReportSectionData::Section) const; /** @brief Deletes the section specified - @param section KRSectionData::Section enum value of the section to return + @param section KReportSectionData::Section enum value of the section to return */ - void removeSection(KRSectionData::Section); + void removeSection(KReportSectionData::Section); /** @brief Create a new section and insert it into the report - @param section KRSectionData::Section enum value of the section to return + @param section KReportSectionData::Section enum value of the section to return */ - void insertSection(KRSectionData::Section); + void insertSection(KReportSectionData::Section); /** @brief Return a pointer to the detail section. The detail section contains the actual detail section and related group sections @return Pointer to detail section */ - ReportSectionDetail* detailSection() const; + KReportDesignerSectionDetail* detailSection() const; /** @brief Sets the title of the reportData @param title Report Title */ void setReportTitle(const QString &); /** @brief Sets the parameters for the display of the background gridpoints @param visible Grid visibility @param divisions Number of minor divisions between major points */ void setGridOptions(bool visible, int divisions); /** @brief Return the title of the report */ QString reportTitle() const; /** @brief Return an XML description of the report @return QDomElement describing the report definition */ QDomElement document() const; /** @brief Return true if the design has been modified @return modified status */ bool isModified() const; /** - @return a list of field names in the selected KoReportData + @return a list of field names in the selected KReportData */ QStringList fieldNames() const; /** - @return a list of field keys in the selected KoReportData + @return a list of field keys in the selected KReportData The keys can be used to reference the names */ QStringList fieldKeys() const; /** @brief Calculate the width of the page in pixels given the paper size, orientation, dpi and margin @return integer value of width in pixels */ int pageWidthPx() const; /** @return the scene (section) that is currently active */ QGraphicsScene* activeScene() const; /** @brief Sets the active Scene @param scene The scene to make active */ void setActiveScene(QGraphicsScene* scene); /** @return the property set for the general report properties */ KPropertySet* propertySet() const; /** @brief Give a hint on the size of the widget */ virtual QSize sizeHint() const; /** @brief Return a pointer to the zoom handler */ KReportZoomHandler* zoomHandler() const; /** @brief Return the current unit assigned to the report */ KReportUnit pageUnit() const; /** @brief Handle the context menu event for a report section @param scene The associated scene (section) */ - void sectionContextMenuEvent(ReportScene *, QGraphicsSceneContextMenuEvent * e); + void sectionContextMenuEvent(KReportDesignerScene *, QGraphicsSceneContextMenuEvent * e); /** @brief Handle the mouse release event for a report section */ - void sectionMouseReleaseEvent(ReportSceneView *, QMouseEvent * e); + void sectionMouseReleaseEvent(KReportDesignerView *, QMouseEvent * e); - void sectionMousePressEvent(ReportSceneView *, QMouseEvent * e); + void sectionMousePressEvent(KReportDesignerView *, QMouseEvent * e); /** @brief Sets the property set for the currently selected item @param set Property set of item */ void changeSet(KPropertySet *); /** @brief Return the property set for the curently selected item */ KPropertySet* itemPropertySet() const; /** @brief Sets the modified status, defaulting to true for modified @param modified Modified status */ void setModified(bool = true); /** @brief Return a unique name that can be used by the entity @param entity Name of entity */ QString suggestEntityName(const QString &) const; /** @brief Checks if the supplied name is unique among all entities */ - bool isEntityNameUnique(const QString &, KoReportItemBase* = 0) const; + bool isEntityNameUnique(const QString &, KReportItemBase* = 0) const; /** @brief Returns a list of actions that represent the entities that can be inserted into the report. Actions are created as children of @a group and belong to the group. @return list of actions */ static QList itemActions(QActionGroup* group = 0); /** @brief Populates the toolbar with actions that can be applied to the report Actions are created as children of @a group and belong to the group. @return list of actions */ QList designerActions(); /** @return X position of mouse when mouse press occurs */ qreal getSelectionPressX() const; /** @return Y position of mouse when mouse press occurs */ qreal getSelectionPressY() const; /** @return difference between X position of mouse release and press */ qreal countSelectionWidth() const; /** @return difference between Y position of mouse release and press */ qreal countSelectionHeight() const; /** @return point that contains X,Y coordinates of mouse press */ QPointF getPressPoint() const; /** @return point that contains X,Y coordinates of mouse press */ QPointF getReleasePoint() const; void plugItemActions(const QList &actList); public Q_SLOTS: void slotEditDelete(); void slotEditCut(); void slotEditCopy(); void slotEditPaste(); void slotEditPaste(QGraphicsScene *); void slotItem(const QString&); void slotSectionEditor(); void slotRaiseSelected(); void slotLowerSelected(); private: void init(); /** @brief Sets the detail section to the given section */ - void setDetail(ReportSectionDetail *rsd); + void setDetail(KReportDesignerSectionDetail *rsd); /** @brief Deletes the detail section */ void deleteDetail(); virtual void resizeEvent(QResizeEvent * event); //Properties void createProperties(); unsigned int selectionCount() const; void setSectionCursor(const QCursor&); void unsetSectionCursor(); void createActions(); private Q_SLOTS: void slotPropertyChanged(KPropertySet &s, KProperty &p); /** @brief When the 'page' button in the top left is pressed, change the property set to the reports properties. */ void slotPageButton_Pressed(); void slotItemTriggered(bool checked); Q_SIGNALS: void pagePropertyChanged(KPropertySet &s); void propertySetChanged(); void dirty(); void reportDataChanged(); void itemInserted(const QString& entity); private: - Q_DISABLE_COPY(KoReportDesigner) + Q_DISABLE_COPY(KReportDesigner) class Private; Private * const d; }; #endif diff --git a/src/wrtembed/KoReportDesignerItemBase.cpp b/src/wrtembed/KReportDesignerItemBase.cpp similarity index 59% rename from src/wrtembed/KoReportDesignerItemBase.cpp rename to src/wrtembed/KReportDesignerItemBase.cpp index d1070f93..9e310cc2 100644 --- a/src/wrtembed/KoReportDesignerItemBase.cpp +++ b/src/wrtembed/KReportDesignerItemBase.cpp @@ -1,76 +1,75 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#include "KoReportDesignerItemBase.h" +#include "KReportDesignerItemBase.h" +#include "KReportItemBase.h" +#include "KReportUtils.h" #include #include #include -#include "common/KoReportItemBase.h" -#include "KReportUtils.h" - // // ReportEntity // -KoReportDesignerItemBase::~KoReportDesignerItemBase() +KReportDesignerItemBase::~KReportDesignerItemBase() { } -KoReportDesignerItemBase::KoReportDesignerItemBase(KoReportDesigner* r) +KReportDesignerItemBase::KReportDesignerItemBase(KReportDesigner* r) { m_reportDesigner = r; } -void KoReportDesignerItemBase::buildXML(QGraphicsItem * item, QDomDocument *doc, QDomElement *parent) +void KReportDesignerItemBase::buildXML(QGraphicsItem * item, QDomDocument *doc, QDomElement *parent) { - KoReportDesignerItemBase *re = 0; - re = dynamic_cast(item); + KReportDesignerItemBase *re = 0; + re = dynamic_cast(item); if (re) { re->buildXML(doc, parent); } } -void KoReportDesignerItemBase::buildXMLRect(QDomDocument *doc, QDomElement *entity, KRPos *pos, KRSize *size) +void KReportDesignerItemBase::buildXMLRect(QDomDocument *doc, QDomElement *entity, KReportPosition *pos, KReportSize *size) { Q_UNUSED(doc); KReportUtils::buildXMLRect(entity, pos, size); } -void KoReportDesignerItemBase::buildXMLTextStyle(QDomDocument *doc, QDomElement *entity, const KRTextStyleData &ts) +void KReportDesignerItemBase::buildXMLTextStyle(QDomDocument *doc, QDomElement *entity, const KRTextStyleData &ts) { KReportUtils::buildXMLTextStyle(doc, entity, ts); } -void KoReportDesignerItemBase::buildXMLLineStyle(QDomDocument *doc, QDomElement *entity, const KRLineStyleData &ls) +void KReportDesignerItemBase::buildXMLLineStyle(QDomDocument *doc, QDomElement *entity, const KReportLineStyle &ls) { KReportUtils::buildXMLLineStyle(doc, entity, ls); } -QString KoReportDesignerItemBase::dataSourceAndObjectTypeName(const QString& dataSource, const QString& objectTypeName) const +QString KReportDesignerItemBase::dataSourceAndObjectTypeName(const QString& dataSource, const QString& objectTypeName) const { return QString::fromLatin1("%1: %2").arg(dataSource).arg(objectTypeName); } // static -void KoReportDesignerItemBase::addPropertyAsAttribute(QDomElement* e, KProperty* p) +void KReportDesignerItemBase::addPropertyAsAttribute(QDomElement* e, KProperty* p) { KReportUtils::addPropertyAsAttribute(e, p); } diff --git a/src/wrtembed/KoReportDesignerItemBase.h b/src/wrtembed/KReportDesignerItemBase.h similarity index 81% rename from src/wrtembed/KoReportDesignerItemBase.h rename to src/wrtembed/KReportDesignerItemBase.h index a2a89153..5ab4af8b 100644 --- a/src/wrtembed/KoReportDesignerItemBase.h +++ b/src/wrtembed/KReportDesignerItemBase.h @@ -1,92 +1,92 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ /* * This file contains all the Report Entity classes. Each one is a * derivative of ReportEntity, which in turn is derived from QCanvasItem. */ -#ifndef __KOREPORTDESIGNERITEMBASE_H__ -#define __KOREPORTDESIGNERITEMBASE_H__ +#ifndef KREPORTDESIGNERITEMBASE_H +#define KREPORTDESIGNERITEMBASE_H #include -#include "KoReportItemBase.h" +#include "KReportItemBase.h" class QDomDocument; class QDomElement; -class KoReportDesigner; -class KRPos; -class KRSize; +class KReportDesigner; +class KReportPosition; +class KReportSize; // // ReportEntity // -class KREPORT_EXPORT KoReportDesignerItemBase +class KREPORT_EXPORT KReportDesignerItemBase { public: - virtual ~KoReportDesignerItemBase(); + virtual ~KReportDesignerItemBase(); static void buildXML(QGraphicsItem * item, QDomDocument *doc, QDomElement *parent); virtual void buildXML(QDomDocument *doc, QDomElement *parent) = 0; - static void buildXMLRect(QDomDocument *doc, QDomElement *entity, KRPos *pos, KRSize *size); + static void buildXMLRect(QDomDocument *doc, QDomElement *entity, KReportPosition *pos, KReportSize *size); static void buildXMLTextStyle(QDomDocument *doc, QDomElement *entity, const KRTextStyleData &ts); - static void buildXMLLineStyle(QDomDocument *doc, QDomElement *entity, const KRLineStyleData &ls); + static void buildXMLLineStyle(QDomDocument *doc, QDomElement *entity, const KReportLineStyle &ls); static QFont getDefaultEntityFont(); static void setDefaultEntityFont(const QFont &); - virtual KoReportDesignerItemBase* clone() = 0; + virtual KReportDesignerItemBase* clone() = 0; virtual void move(const QPointF&) = 0; - KoReportDesigner* designer() const { + KReportDesigner* designer() const { return m_reportDesigner; } - void setDesigner(KoReportDesigner* rd) { + void setDesigner(KReportDesigner* rd) { m_reportDesigner = rd; } static void addPropertyAsAttribute(QDomElement* e, KProperty* p); protected: - explicit KoReportDesignerItemBase(KoReportDesigner*); - KoReportDesigner* m_reportDesigner; + explicit KReportDesignerItemBase(KReportDesigner*); + KReportDesigner* m_reportDesigner; QString dataSourceAndObjectTypeName(const QString& dataSource, const QString& objectTypeName) const; /** * @brief Updates the text that is shown for the item in the report designer * If itemDataSource is set then it is preferred over itemStaticValue * itemType is appended to the end of the text * * @param itemDataSource source field property * @param itemStaticValue value property * @param itemType type of item * @return void */ void updateRenderText(const QString &itemDataSource, const QString &itemStaticValue, const QString &itemType); QString m_renderText; private: static bool m_readDefaultFont; static QFont m_defaultFont; }; #endif diff --git a/src/wrtembed/KoReportDesignerItemLine.cpp b/src/wrtembed/KReportDesignerItemLine.cpp similarity index 72% rename from src/wrtembed/KoReportDesignerItemLine.cpp rename to src/wrtembed/KReportDesignerItemLine.cpp index ad24d187..8f545e3b 100644 --- a/src/wrtembed/KoReportDesignerItemLine.cpp +++ b/src/wrtembed/KReportDesignerItemLine.cpp @@ -1,251 +1,251 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#include "KoReportDesignerItemLine.h" - -#include "KoReportDesignerItemBase.h" -#include "KoReportDesigner.h" -#include "reportscene.h" +#include "KReportDesignerItemLine.h" +#include "KReportDesignerItemBase.h" +#include "KReportDesigner.h" +#include "KReportDesignerScene.h" #include "KReportUtils.h" +#include "KReportLineStyle.h" #include #include #include #include // // class ReportEntityLine // -void KoReportDesignerItemLine::init(QGraphicsScene* s, KoReportDesigner *r) +void KReportDesignerItemLine::init(QGraphicsScene* s, KReportDesigner *r) { m_reportDesigner = r; setPos(0, 0); setUnit(r->pageUnit()); setFlags(ItemIsSelectable | ItemIsMovable | ItemSendsGeometryChanges); setPen(QPen(Qt::black, 5)); setAcceptHoverEvents(true); if (s) s->addItem(this); connect(m_set, SIGNAL(propertyChanged(KPropertySet&,KProperty&)), this, SLOT(slotPropertyChanged(KPropertySet&,KProperty&))); setZValue(Z); } -KoReportDesignerItemLine::KoReportDesignerItemLine(KoReportDesigner * d, QGraphicsScene * scene, const QPointF &pos) - : KoReportDesignerItemBase(d) +KReportDesignerItemLine::KReportDesignerItemLine(KReportDesigner * d, QGraphicsScene * scene, const QPointF &pos) + : KReportDesignerItemBase(d) { init(scene, d); setLineScene(QLineF(pos, QPointF(20,20)+pos)); m_name->setValue(m_reportDesigner->suggestEntityName(typeName())); } -KoReportDesignerItemLine::KoReportDesignerItemLine(KoReportDesigner * d, QGraphicsScene * scene, const QPointF &startPos, const QPointF &endPos) - : KoReportDesignerItemBase(d) +KReportDesignerItemLine::KReportDesignerItemLine(KReportDesigner * d, QGraphicsScene * scene, const QPointF &startPos, const QPointF &endPos) + : KReportDesignerItemBase(d) { init(scene, d); setLineScene(QLineF(startPos, endPos)); m_name->setValue(m_reportDesigner->suggestEntityName(typeName())); } -KoReportDesignerItemLine::KoReportDesignerItemLine(const QDomNode & entity, KoReportDesigner * d, QGraphicsScene * scene) - : KoReportItemLine(entity), KoReportDesignerItemBase(d) +KReportDesignerItemLine::KReportDesignerItemLine(const QDomNode & entity, KReportDesigner * d, QGraphicsScene * scene) + : KReportItemLine(entity), KReportDesignerItemBase(d) { init(scene, d); setLine ( m_start.toScene().x(), m_start.toScene().y(), m_end.toScene().x(), m_end.toScene().y() ); } -KoReportDesignerItemLine* KoReportDesignerItemLine::clone() +KReportDesignerItemLine* KReportDesignerItemLine::clone() { QDomDocument d; QDomElement e = d.createElement(QLatin1String("clone")); QDomNode n; buildXML(&d, &e); n = e.firstChild(); - return new KoReportDesignerItemLine(n, designer(), 0); + return new KReportDesignerItemLine(n, designer(), 0); } -void KoReportDesignerItemLine::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, +void KReportDesignerItemLine::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget *widget) { Q_UNUSED(option); Q_UNUSED(widget); painter->setRenderHint(QPainter::Antialiasing, true); QPen p = painter->pen(); painter->setPen(QPen(m_lineColor->value().value(), m_lineWeight->value().toInt(), (Qt::PenStyle)m_lineStyle->value().toInt())); painter->drawLine(line()); if (isSelected()) { // draw a selected border for visual purposes painter->setPen(QPen(QColor(128, 128, 255), 0, Qt::DotLine)); QPointF pt = line().p1(); painter->fillRect(pt.x(), pt.y() - 2, 5, 5, QColor(128, 128, 255)); pt = line().p2(); painter->fillRect(pt.x() - 4, pt.y() - 2, 5, 5, QColor(128, 128, 255)); painter->setPen(p); } } -void KoReportDesignerItemLine::buildXML(QDomDocument *doc, QDomElement *parent) +void KReportDesignerItemLine::buildXML(QDomDocument *doc, QDomElement *parent) { QDomElement entity = doc->createElement(QLatin1String("report:") + typeName()); // properties addPropertyAsAttribute(&entity, m_name); entity.setAttribute(QLatin1String("report:z-index"), zValue()); KReportUtils::setAttribute(&entity, QLatin1String("svg:x1"), m_start.toPoint().x()); KReportUtils::setAttribute(&entity, QLatin1String("svg:y1"), m_start.toPoint().y()); KReportUtils::setAttribute(&entity, QLatin1String("svg:x2"), m_end.toPoint().x()); KReportUtils::setAttribute(&entity, QLatin1String("svg:y2"), m_end.toPoint().y()); buildXMLLineStyle(doc, &entity, lineStyle()); parent->appendChild(entity); } -void KoReportDesignerItemLine::slotPropertyChanged(KPropertySet &s, KProperty &p) +void KReportDesignerItemLine::slotPropertyChanged(KPropertySet &s, KProperty &p) { Q_UNUSED(s); if (p.name() == "Start" || p.name() == "End") { if (p.name() == "Start") - m_start.setUnitPos(p.value().toPointF(), KRPos::DontUpdateProperty); + m_start.setUnitPos(p.value().toPointF(), KReportPosition::DontUpdateProperty); if (p.name() == "End") - m_end.setUnitPos(p.value().toPointF(), KRPos::DontUpdateProperty); + m_end.setUnitPos(p.value().toPointF(), KReportPosition::DontUpdateProperty); setLine(m_start.toScene().x(), m_start.toScene().y(), m_end.toScene().x(), m_end.toScene().y()); } else if (p.name() == "Name") { //For some reason p.oldValue returns an empty string if (!m_reportDesigner->isEntityNameUnique(p.value().toString(), this)) { p.setValue(m_oldName); } else { m_oldName = p.value().toString(); } } if (m_reportDesigner) m_reportDesigner->setModified(true); update(); } -void KoReportDesignerItemLine::mousePressEvent(QGraphicsSceneMouseEvent * event) +void KReportDesignerItemLine::mousePressEvent(QGraphicsSceneMouseEvent * event) { m_reportDesigner->changeSet(m_set); setSelected(true); QGraphicsLineItem::mousePressEvent(event); } -QVariant KoReportDesignerItemLine::itemChange(GraphicsItemChange change, const QVariant &value) +QVariant KReportDesignerItemLine::itemChange(GraphicsItemChange change, const QVariant &value) { return QGraphicsItem::itemChange(change, value); } -void KoReportDesignerItemLine::mouseReleaseEvent(QGraphicsSceneMouseEvent * event) +void KReportDesignerItemLine::mouseReleaseEvent(QGraphicsSceneMouseEvent * event) { QGraphicsLineItem::mouseReleaseEvent(event); } -void KoReportDesignerItemLine::mouseMoveEvent(QGraphicsSceneMouseEvent * event) +void KReportDesignerItemLine::mouseMoveEvent(QGraphicsSceneMouseEvent * event) { int x; int y; - QPointF p = dynamic_cast(scene())->gridPoint(event->scenePos()); + QPointF p = dynamic_cast(scene())->gridPoint(event->scenePos()); //kreportDebug() << p; x = p.x(); y = p.y(); if (x < 0) x = 0; if (y < 0) y = 0; if (x > scene()->width()) x = scene()->width(); if (y > scene()->height()) y = scene()->height(); switch (m_grabAction) { case 1: m_start.setScenePos(QPointF(x,y)); break; case 2: m_end.setScenePos(QPointF(x,y)); break; default: - QPointF d = mapToItem(this, dynamic_cast(scene())->gridPoint(event->scenePos())) - mapToItem(this, dynamic_cast(scene())->gridPoint(event->lastScenePos())); + QPointF d = mapToItem(this, dynamic_cast(scene())->gridPoint(event->scenePos())) - mapToItem(this, dynamic_cast(scene())->gridPoint(event->lastScenePos())); if (((line().p1() + d).x() >= 0) && ((line().p2() + d).x() >= 0) && ((line().p1() + d).y() >= 0) && ((line().p2() + d).y() >= 0) && ((line().p1() + d).x() <= scene()->width()) && ((line().p2() + d).x() <= scene()->width()) && ((line().p1() + d).y() <= scene()->height()) && ((line().p2() + d).y() <= scene()->height())) setLineScene(QLineF(line().p1() + d, line().p2() + d)); break; } } -int KoReportDesignerItemLine::grabHandle(QPointF pos) +int KReportDesignerItemLine::grabHandle(QPointF pos) { if (QRectF(line().p1().x(), line().p1().y() - 2, 5, 5).contains(pos)) { // we are over point 1 return 1; } else if (QRectF(line().p2().x() - 4, line().p2().y() - 2, 5, 5).contains(pos)) { // we are over point 2 return 2; } else { return 0; } } -void KoReportDesignerItemLine::hoverMoveEvent(QGraphicsSceneHoverEvent * event) +void KReportDesignerItemLine::hoverMoveEvent(QGraphicsSceneHoverEvent * event) { if (isSelected()) { m_grabAction = grabHandle(event->pos()); switch (m_grabAction) { case 1: //Point 1 setCursor(Qt::SizeAllCursor); break; case 2: //Point 2 setCursor(Qt::SizeAllCursor); break; default: unsetCursor(); } } } -void KoReportDesignerItemLine::setLineScene(QLineF l) +void KReportDesignerItemLine::setLineScene(QLineF l) { - m_start.setScenePos(l.p1(), KRPos::DontUpdateProperty); + m_start.setScenePos(l.p1(), KReportPosition::DontUpdateProperty); m_end.setScenePos(l.p2()); } -void KoReportDesignerItemLine::move(const QPointF& m) +void KReportDesignerItemLine::move(const QPointF& m) { QPointF original = m_pos.toScene(); original += m; m_pos.setScenePos(original); } diff --git a/src/wrtembed/KoReportDesignerItemLine.h b/src/wrtembed/KReportDesignerItemLine.h similarity index 69% rename from src/wrtembed/KoReportDesignerItemLine.h rename to src/wrtembed/KReportDesignerItemLine.h index 0ff03f4b..8ba86d2a 100644 --- a/src/wrtembed/KoReportDesignerItemLine.h +++ b/src/wrtembed/KReportDesignerItemLine.h @@ -1,65 +1,64 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#ifndef __KOREPORTDESIGNERITEMLINE_H__ -#define __KOREPORTDESIGNERITEMLINE_H__ +#ifndef KREPORTDESIGNERITEMLINE_H +#define KREPORTDESIGNERITEMLINE_H -#include - -#include "KoReportDesignerItemBase.h" -#include "KoReportItemLine.h" +#include "KReportDesignerItemBase.h" +#include "KReportItemLine.h" -class KoReportDesigner; +#include +class KReportDesigner; class KPropertySet; -class KoReportDesignerItemLine : public KoReportItemLine, public QGraphicsLineItem, public KoReportDesignerItemBase +class KReportDesignerItemLine : public KReportItemLine, public QGraphicsLineItem, public KReportDesignerItemBase { Q_OBJECT public: - KoReportDesignerItemLine(KoReportDesigner *, QGraphicsScene * scene, const QPointF &pos); - KoReportDesignerItemLine(KoReportDesigner * d, QGraphicsScene * scene, const QPointF &startPos, const QPointF &endPos); - KoReportDesignerItemLine(const QDomNode & element, KoReportDesigner *, QGraphicsScene * scene); + KReportDesignerItemLine(KReportDesigner *, QGraphicsScene * scene, const QPointF &pos); + KReportDesignerItemLine(KReportDesigner * d, QGraphicsScene * scene, const QPointF &startPos, const QPointF &endPos); + KReportDesignerItemLine(const QDomNode & element, KReportDesigner *, QGraphicsScene * scene); virtual void buildXML(QDomDocument *doc, QDomElement *parent); virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget *widget = 0); - virtual KoReportDesignerItemLine* clone(); + virtual KReportDesignerItemLine* clone(); void setLineScene(QLineF); virtual void move(const QPointF&); private: - KoReportDesigner* m_rd; - void init(QGraphicsScene*, KoReportDesigner *); + KReportDesigner* m_rd; + void init(QGraphicsScene*, KReportDesigner *); int grabHandle(QPointF pos); int m_grabAction; protected: virtual void hoverMoveEvent(QGraphicsSceneHoverEvent * event); virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * event); virtual void mousePressEvent(QGraphicsSceneMouseEvent * event); virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent * event); virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value); private Q_SLOTS: void slotPropertyChanged(KPropertySet &, KProperty &); }; #endif diff --git a/src/wrtembed/KoReportDesignerItemRectBase.cpp b/src/wrtembed/KReportDesignerItemRectBase.cpp similarity index 80% rename from src/wrtembed/KoReportDesignerItemRectBase.cpp rename to src/wrtembed/KReportDesignerItemRectBase.cpp index b1868777..4bf5da7f 100644 --- a/src/wrtembed/KoReportDesignerItemRectBase.cpp +++ b/src/wrtembed/KReportDesignerItemRectBase.cpp @@ -1,388 +1,388 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#include "KoReportDesignerItemRectBase.h" -#include "reportsceneview.h" -#include "KoReportDesigner.h" -#include "common/krpos.h" -#include "common/krsize.h" -#include "reportscene.h" +#include "KReportDesignerItemRectBase.h" +#include "KReportDesignerView.h" +#include "KReportDesigner.h" +#include "KReportPosition.h" +#include "KReportSize.h" +#include "KReportDesignerScene.h" #include #include #include #include -KoReportDesignerItemRectBase::KoReportDesignerItemRectBase(KoReportDesigner *r) - : QGraphicsRectItem(), KoReportDesignerItemBase(r) +KReportDesignerItemRectBase::KReportDesignerItemRectBase(KReportDesigner *r) + : QGraphicsRectItem(), KReportDesignerItemBase(r) { QScreen *srn = QApplication::screens().at(0); m_dpiX = srn->logicalDotsPerInchX(); m_dpiY = srn->logicalDotsPerInchY(); m_ppos = 0; m_psize = 0; m_grabAction = 0; setAcceptHoverEvents(true); #if QT_VERSION >= 0x040600 setFlags(ItemIsSelectable | ItemIsMovable | ItemSendsGeometryChanges); #else setFlags(ItemIsSelectable | ItemIsMovable); #endif } -void KoReportDesignerItemRectBase::init(KRPos* p, KRSize* s, KPropertySet* se, KoReportDesigner *d) +void KReportDesignerItemRectBase::init(KReportPosition* p, KReportSize* s, KPropertySet* se, KReportDesigner *d) { Q_UNUSED(d); m_ppos = p; m_psize = s; m_pset = se; } -KoReportDesignerItemRectBase::~KoReportDesignerItemRectBase() +KReportDesignerItemRectBase::~KReportDesignerItemRectBase() { } -QRectF KoReportDesignerItemRectBase::sceneRect() +QRectF KReportDesignerItemRectBase::sceneRect() { return QRectF(m_ppos->toScene(), m_psize->toScene()); } -QRectF KoReportDesignerItemRectBase::pointRect() const +QRectF KReportDesignerItemRectBase::pointRect() const { if (m_ppos && m_psize) return QRectF(m_ppos->toPoint(), m_psize->toPoint()); else return QRectF(0, 0, 0, 0); } -void KoReportDesignerItemRectBase::setSceneRect(const QPointF& topLeft, const QSizeF& size, UpdatePropertyFlag update) +void KReportDesignerItemRectBase::setSceneRect(const QPointF& topLeft, const QSizeF& size, UpdatePropertyFlag update) { setSceneRect(QRectF(topLeft, size), update); } -void KoReportDesignerItemRectBase::setSceneRect(const QRectF& rect, UpdatePropertyFlag update) +void KReportDesignerItemRectBase::setSceneRect(const QRectF& rect, UpdatePropertyFlag update) { QGraphicsRectItem::setPos(rect.x(), rect.y()); setRect(0, 0, rect.width(), rect.height()); if (update == UpdateProperty) { m_ppos->setScenePos(QPointF(rect.x(), rect.y())); m_psize->setSceneSize(QSizeF(rect.width(), rect.height())); } this->update(); } -void KoReportDesignerItemRectBase::mousePressEvent(QGraphicsSceneMouseEvent * event) +void KReportDesignerItemRectBase::mousePressEvent(QGraphicsSceneMouseEvent * event) { //Update and show properties m_ppos->setScenePos(QPointF(sceneRect().x(), sceneRect().y())); m_reportDesigner->changeSet(m_pset); setSelected(true); scene()->update(); QGraphicsItem::mousePressEvent(event); } -void KoReportDesignerItemRectBase::mouseReleaseEvent(QGraphicsSceneMouseEvent * event) +void KReportDesignerItemRectBase::mouseReleaseEvent(QGraphicsSceneMouseEvent * event) { //Keep the size and position in sync m_ppos->setScenePos(pos()); m_psize->setSceneSize(QSizeF(rect().width(), rect().height())); QGraphicsItem::mouseReleaseEvent(event); } -void KoReportDesignerItemRectBase::mouseMoveEvent(QGraphicsSceneMouseEvent * event) +void KReportDesignerItemRectBase::mouseMoveEvent(QGraphicsSceneMouseEvent * event) { //kreportDebug() << m_grabAction; qreal w, h; - QPointF p = dynamic_cast(scene())->gridPoint(event->scenePos()); + QPointF p = dynamic_cast(scene())->gridPoint(event->scenePos()); w = p.x() - scenePos().x(); h = p.y() - scenePos().y(); //! @todo use an enum for the directions switch (m_grabAction) { case 1: if (sceneRect().y() - p.y() + rect().height() > 0 && sceneRect().x() - p.x() + rect().width() >= 0) setSceneRect(QPointF(p.x(), p.y()), QSizeF(sceneRect().x() - p.x() + rect().width(), sceneRect().y() - p.y() + rect().height())); break; case 2: if (sceneRect().y() - p.y() + rect().height() >= 0) setSceneRect(QPointF(sceneRect().x(), p.y()), QSizeF(rect().width(), sceneRect().y() - p.y() + rect().height())); break; case 3: if (sceneRect().y() - p.y() + rect().height() >= 0 && w >= 0) setSceneRect(QPointF(sceneRect().x(), p.y()), QSizeF(w, sceneRect().y() - p.y() + rect().height())); break; case 4: if (w >= 0) setSceneRect(QPointF(sceneRect().x(), sceneRect().y()), QSizeF(w, (rect().height()))); break; case 5: if (h >= 0 && w >= 0) setSceneRect(QPointF(sceneRect().x(), sceneRect().y()), QSizeF(w, h)); break; case 6: if (h >= 0) setSceneRect(QPointF(sceneRect().x(), sceneRect().y()), QSizeF((rect().width()), h)); break; case 7: if (sceneRect().x() - p.x() + rect().width() >= 0 && h >= 0) setSceneRect(QPointF(p.x(), sceneRect().y()), QSizeF(sceneRect().x() - p.x() + rect().width(), h)); break; case 8: if (sceneRect().x() - p.x() + rect().width() >= 0) setSceneRect(QPointF(p.x(), sceneRect().y()), QSizeF(sceneRect().x() - p.x() + rect().width(), rect().height())); break; default: QGraphicsItem::mouseMoveEvent(event); } } -void KoReportDesignerItemRectBase::hoverMoveEvent(QGraphicsSceneHoverEvent * event) +void KReportDesignerItemRectBase::hoverMoveEvent(QGraphicsSceneHoverEvent * event) { //m_grabAction = 0; if (isSelected()) { m_grabAction = grabHandle(event->pos()); switch (m_grabAction) { case 1: setCursor(Qt::SizeFDiagCursor); break; case 2: setCursor(Qt::SizeVerCursor); break; case 3: setCursor(Qt::SizeBDiagCursor); break; case 4: setCursor(Qt::SizeHorCursor); break; case 5: setCursor(Qt::SizeFDiagCursor); break; case 6: setCursor(Qt::SizeVerCursor); break; case 7: setCursor(Qt::SizeBDiagCursor); break; case 8: setCursor(Qt::SizeHorCursor); break; default: unsetCursor(); } } //kreportDebug() << m_grabAction; } -void KoReportDesignerItemRectBase::drawHandles(QPainter *painter) +void KReportDesignerItemRectBase::drawHandles(QPainter *painter) { if (isSelected()) { // draw a selected border for visual purposes painter->setPen(QPen(QColor(128, 128, 255), 0, Qt::DotLine)); painter->drawRect(rect()); const QRectF r = rect(); double halfW = (r.width() / 2); double halfH = (r.height() / 2); QPointF center = r.center(); center += QPointF(0.75,0.75); painter->fillRect(center.x() - halfW, center.y() - halfH , 5, 5, QColor(128, 128, 255)); painter->fillRect(center.x() - 2, center.y() - halfH , 5, 5, QColor(128, 128, 255)); painter->fillRect(center.x() + halfW - 4, center.y() - halfH, 5, 5, QColor(128, 128, 255)); painter->fillRect(center.x() + (halfW - 4), center.y() - 2, 5, 5, QColor(128, 128, 255)); painter->fillRect(center.x() + halfW - 4 , center.y() + halfH - 4 , 5, 5, QColor(128, 128, 255)); painter->fillRect(center.x() - 2, center.y() + halfH - 4, 5, 5, QColor(128, 128, 255)); painter->fillRect(center.x() - halfW, center.y() + halfH - 4 , 5, 5, QColor(128, 128, 255)); painter->fillRect(center.x() - halfW, center.y() - 2, 5, 5, QColor(128, 128, 255)); } } /** @return 1 2 3 8 0 4 7 6 5 */ -int KoReportDesignerItemRectBase::grabHandle(QPointF pos) +int KReportDesignerItemRectBase::grabHandle(QPointF pos) { QRectF r = boundingRect(); int halfW = (int)(r.width() / 2); int halfH = (int)(r.height() / 2); QPointF center = r.center(); if (QRectF(center.x() - (halfW), center.y() - (halfH), 5, 5).contains(pos)) { // we are over the top-left handle return 1; } else if (QRectF(center.x() - 2, center.y() - (halfH), 5, 5).contains(pos)) { // top-middle handle return 2; } else if (QRectF(center.x() + (halfW - 4), center.y() - (halfH), 5, 5).contains(pos)) { // top-right return 3; } else if (QRectF(center.x() + (halfW - 4), center.y() - 2, 5, 5).contains(pos)) { // middle-right return 4; } else if (QRectF(center.x() + (halfW - 4), center.y() + (halfH - 4), 5, 5).contains(pos)) { // bottom-left return 5; } else if (QRectF(center.x() - 2, center.y() + (halfH - 4), 5, 5).contains(pos)) { // bottom-middle return 6; } else if (QRectF(center.x() - (halfW), center.y() + (halfH - 4), 5, 5).contains(pos)) { // bottom-right return 7; } else if (QRectF(center.x() - (halfW), center.y() - 2, 5, 5).contains(pos)) { // middle-right return 8; } return 0; } -QVariant KoReportDesignerItemRectBase::itemChange(GraphicsItemChange change, const QVariant &value) +QVariant KReportDesignerItemRectBase::itemChange(GraphicsItemChange change, const QVariant &value) { if (change == ItemPositionChange && scene()) { QPointF newPos = value.toPointF(); - newPos = dynamic_cast(scene())->gridPoint(newPos); + newPos = dynamic_cast(scene())->gridPoint(newPos); if (newPos.x() < 0) newPos.setX(0); else if (newPos.x() > (scene()->width() - rect().width())) newPos.setX(scene()->width() - rect().width()); if (newPos.y() < 0) newPos.setY(0); else if (newPos.y() > (scene()->height() - rect().height())) newPos.setY(scene()->height() - rect().height()); return newPos; } else if (change == ItemPositionHasChanged && scene()) { - m_ppos->setScenePos(value.toPointF(), KRPos::DontUpdateProperty); + m_ppos->setScenePos(value.toPointF(), KReportPosition::DontUpdateProperty); } else if (change == ItemSceneHasChanged && scene() && m_psize) { QPointF newPos = pos(); - newPos = dynamic_cast(scene())->gridPoint(newPos); + newPos = dynamic_cast(scene())->gridPoint(newPos); if (newPos.x() < 0) newPos.setX(0); else if (newPos.x() > (scene()->width() - rect().width())) newPos.setX(scene()->width() - rect().width()); if (newPos.y() < 0) newPos.setY(0); else if (newPos.y() > (scene()->height() - rect().height())) newPos.setY(scene()->height() - rect().height()); - setSceneRect(newPos, m_psize->toScene(), KoReportDesignerItemRectBase::DontUpdateProperty); + setSceneRect(newPos, m_psize->toScene(), KReportDesignerItemRectBase::DontUpdateProperty); } return QGraphicsItem::itemChange(change, value); } -void KoReportDesignerItemRectBase::propertyChanged(const KPropertySet &s, const KProperty &p) +void KReportDesignerItemRectBase::propertyChanged(const KPropertySet &s, const KProperty &p) { Q_UNUSED(s) if (p.name() == "position") { - m_ppos->setUnitPos(p.value().toPointF(), KRPos::DontUpdateProperty); + m_ppos->setUnitPos(p.value().toPointF(), KReportPosition::DontUpdateProperty); } else if (p.name() == "size") { - m_psize->setUnitSize(p.value().toSizeF(), KRSize::DontUpdateProperty); + m_psize->setUnitSize(p.value().toSizeF(), KReportSize::DontUpdateProperty); } setSceneRect(m_ppos->toScene(), m_psize->toScene(), DontUpdateProperty); } -void KoReportDesignerItemRectBase::move(const QPointF& /*m*/) +void KReportDesignerItemRectBase::move(const QPointF& /*m*/) { //! @todo } -QPointF KoReportDesignerItemRectBase::properPressPoint(const KoReportDesigner &d) const +QPointF KReportDesignerItemRectBase::properPressPoint(const KReportDesigner &d) const { const QPointF pressPoint = d.getPressPoint(); const QPointF releasePoint = d.getReleasePoint(); if (releasePoint.x() < pressPoint.x() && releasePoint.y() < pressPoint.y()) { return releasePoint; } if (releasePoint.x() < pressPoint.x() && releasePoint.y() > pressPoint.y()) { return QPointF(releasePoint.x(), pressPoint.y()); } if (releasePoint.x() > pressPoint.x() && releasePoint.y() < pressPoint.y()) { return QPointF(pressPoint.x(), releasePoint.y()); } return QPointF(pressPoint); } -QRectF KoReportDesignerItemRectBase::properRect(const KoReportDesigner &d, qreal minWidth, qreal minHeight) const +QRectF KReportDesignerItemRectBase::properRect(const KReportDesigner &d, qreal minWidth, qreal minHeight) const { QPointF tempPressPoint = properPressPoint(d); qreal currentPressX = tempPressPoint.x(); qreal currentPressY = tempPressPoint.y(); const qreal width = qMax(d.countSelectionWidth(), minWidth); const qreal height = qMax(d.countSelectionHeight(), minHeight); qreal tempReleasePointX = tempPressPoint.x() + width; qreal tempReleasePointY = tempPressPoint.y() + height; if (tempReleasePointX > scene()->width()) { int offsetWidth = tempReleasePointX - scene()->width(); currentPressX = tempPressPoint.x() - offsetWidth; } if (tempReleasePointY > scene()->height()) { int offsetHeight = tempReleasePointY - scene()->height(); currentPressY = tempPressPoint.y() - offsetHeight; } return (QRectF(QPointF(currentPressX, currentPressY), QSizeF(width, height))); } -void KoReportDesignerItemRectBase::enterInlineEditingMode() +void KReportDesignerItemRectBase::enterInlineEditingMode() { } -void KoReportDesignerItemRectBase::exitInlineEditingMode() +void KReportDesignerItemRectBase::exitInlineEditingMode() { } -void KoReportDesignerItemBase::updateRenderText(const QString &itemDataSource, const QString &itemStaticValue, const QString &itemType) +void KReportDesignerItemBase::updateRenderText(const QString &itemDataSource, const QString &itemStaticValue, const QString &itemType) { if (itemDataSource.isEmpty()) { if (itemType.isEmpty()) { m_renderText = itemStaticValue; } else { m_renderText = dataSourceAndObjectTypeName(itemStaticValue, itemType); } } else { if (itemType.isEmpty()) { m_renderText = itemDataSource; } else { m_renderText = dataSourceAndObjectTypeName(itemDataSource, itemType); } } } diff --git a/src/wrtembed/KoReportDesignerItemRectBase.h b/src/wrtembed/KReportDesignerItemRectBase.h similarity index 72% rename from src/wrtembed/KoReportDesignerItemRectBase.h rename to src/wrtembed/KReportDesignerItemRectBase.h index 00d6daa1..69df0118 100644 --- a/src/wrtembed/KoReportDesignerItemRectBase.h +++ b/src/wrtembed/KReportDesignerItemRectBase.h @@ -1,92 +1,92 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#ifndef KOREPORTDESIGNERITEMRECTBASE_H -#define KOREPORTDESIGNERITEMRECTBASE_H +#ifndef KREPORTDESIGNERITEMRECTBASE_H +#define KREPORTDESIGNERITEMRECTBASE_H #include -#include "KoReportDesignerItemBase.h" +#include "KReportDesignerItemBase.h" #include "kreport_export.h" -class KoReportDesigner; -class KRPos; -class KRSize; +class KReportDesigner; +class KReportPosition; +class KReportSize; class KPropertySet; -const int KOREPORT_ITEM_RECT_DEFAULT_WIDTH = 100; -const int KOREPORT_ITEM_RECT_DEFAULT_HEIGHT = 100; +const int KREPORT_ITEM_RECT_DEFAULT_WIDTH = 100; +const int KREPORT_ITEM_RECT_DEFAULT_HEIGHT = 100; /** */ -class KREPORT_EXPORT KoReportDesignerItemRectBase : public QGraphicsRectItem, public KoReportDesignerItemBase +class KREPORT_EXPORT KReportDesignerItemRectBase : public QGraphicsRectItem, public KReportDesignerItemBase { public: - explicit KoReportDesignerItemRectBase(KoReportDesigner*); + explicit KReportDesignerItemRectBase(KReportDesigner*); - virtual ~KoReportDesignerItemRectBase(); + virtual ~KReportDesignerItemRectBase(); QRectF pointRect() const; virtual void enterInlineEditingMode(); virtual void exitInlineEditingMode(); protected: - void init(KRPos*, KRSize*, KPropertySet*, KoReportDesigner *r); + void init(KReportPosition*, KReportSize*, KPropertySet*, KReportDesigner *r); int m_dpiX; int m_dpiY; qreal m_userHeight; qreal m_userWidth; qreal m_pressX; qreal m_pressY; enum UpdatePropertyFlag { UpdateProperty, DontUpdateProperty }; void setSceneRect(const QPointF& topLeft, const QSizeF& size, UpdatePropertyFlag update = UpdateProperty); void setSceneRect(const QRectF& rect, UpdatePropertyFlag update = UpdateProperty); void drawHandles(QPainter*); QRectF sceneRect(); virtual void mousePressEvent(QGraphicsSceneMouseEvent * event); virtual void mouseReleaseEvent(QGraphicsSceneMouseEvent * event); virtual void mouseMoveEvent(QGraphicsSceneMouseEvent * event); virtual void hoverMoveEvent(QGraphicsSceneHoverEvent * event); virtual QVariant itemChange(GraphicsItemChange change, const QVariant &value); void propertyChanged(const KPropertySet &s, const KProperty &p); virtual void move(const QPointF&); - QRectF properRect(const KoReportDesigner &d, qreal minWidth, qreal minHeight) const; + QRectF properRect(const KReportDesigner &d, qreal minWidth, qreal minHeight) const; private: int grabHandle(QPointF); - QPointF properPressPoint(const KoReportDesigner &d) const; + QPointF properPressPoint(const KReportDesigner &d) const; int m_grabAction; - KRPos* m_ppos; - KRSize* m_psize; + KReportPosition* m_ppos; + KReportSize* m_psize; KPropertySet* m_pset; }; #endif diff --git a/src/wrtembed/reportscene.cpp b/src/wrtembed/KReportDesignerScene.cpp similarity index 86% rename from src/wrtembed/reportscene.cpp rename to src/wrtembed/KReportDesignerScene.cpp index d2b69924..47591dd4 100644 --- a/src/wrtembed/reportscene.cpp +++ b/src/wrtembed/KReportDesignerScene.cpp @@ -1,267 +1,267 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#include "reportscene.h" -#include "common/reportpageoptions.h" -#include "KoReportDesignerItemRectBase.h" -#include "KoReportDesigner.h" -#include "common/labelsizeinfo.h" -#include "common/KReportPageFormat.h" +#include "KReportDesignerScene.h" +#include "KReportPageOptions.h" +#include "KReportDesignerItemRectBase.h" +#include "KReportDesigner.h" +#include "KReportLabelSizeInfo.h" +#include "KReportPageFormat.h" +#include "kreport_debug.h" #include #include #include -#include "kreport_debug.h" #include #include -ReportScene::ReportScene(qreal w, qreal h, KoReportDesigner *rd) +KReportDesignerScene::KReportDesignerScene(qreal w, qreal h, KReportDesigner *rd) : QGraphicsScene(0, 0, w, h, rd) { m_rd = rd; m_minorSteps = 0; QScreen *srn = QApplication::screens().at(0); m_dpiX = srn->logicalDotsPerInchX(); m_dpiY = srn->logicalDotsPerInchY(); if (m_unit.type() != m_rd->pageUnit().type()) { m_unit = m_rd->pageUnit(); if (m_unit.type() == KReportUnit::Cicero || m_unit.type() == KReportUnit::Pica || m_unit.type() == KReportUnit::Millimeter) { m_majorX = POINT_TO_INCH(m_unit.fromUserValue(10)) * m_dpiX; m_majorY = POINT_TO_INCH(m_unit.fromUserValue(10)) * m_dpiY; } else if (m_unit.type() == KReportUnit::Point) { m_majorX = POINT_TO_INCH(m_unit.fromUserValue(100)) * m_dpiX; m_majorY = POINT_TO_INCH(m_unit.fromUserValue(100)) * m_dpiY; } else { m_majorX = POINT_TO_INCH(m_unit.fromUserValue(1)) * m_dpiX; m_majorY = POINT_TO_INCH(m_unit.fromUserValue(1)) * m_dpiY; } } } -ReportScene::~ReportScene() +KReportDesignerScene::~KReportDesignerScene() { // Qt should be handling everything for us } -void ReportScene::drawBackground(QPainter* painter, const QRectF & clip) +void KReportDesignerScene::drawBackground(QPainter* painter, const QRectF & clip) { //Draw the default background colour QGraphicsScene::drawBackground(painter, clip); painter->setRenderHint(QPainter::Antialiasing, false); if (m_rd->propertySet()->property("grid-visible").value().toBool()) { if (m_unit.type() != m_rd->pageUnit().type()) { m_unit = m_rd->pageUnit(); if (m_unit.type() == KReportUnit::Cicero || m_unit.type() == KReportUnit::Pica || m_unit.type() == KReportUnit::Millimeter) { m_majorX = POINT_TO_INCH(m_unit.fromUserValue(10)) * m_dpiX; m_majorY = POINT_TO_INCH(m_unit.fromUserValue(10)) * m_dpiY; } else if (m_unit.type() == KReportUnit::Point) { m_majorX = POINT_TO_INCH(m_unit.fromUserValue(100)) * m_dpiX; m_majorY = POINT_TO_INCH(m_unit.fromUserValue(100)) * m_dpiY; } else { m_majorX = POINT_TO_INCH(m_unit.fromUserValue(1)) * m_dpiX; m_majorY = POINT_TO_INCH(m_unit.fromUserValue(1)) * m_dpiY; } } m_minorSteps = m_rd->propertySet()->property("grid-divisions").value().toInt(); m_pixelIncrementX = (m_majorX / m_minorSteps); m_pixelIncrementY = (m_majorY / m_minorSteps); QPen pen = painter->pen(); painter->setPen(Qt::lightGray); //kreportDebug() << "dpix" << KReportDpi::dpiX() << "dpiy" << KReportDpi::dpiY() << "mayorx:" << majorx << "majory" << majory << "pix:" << pixel_incrementx << "piy:" << pixel_incrementy; QVector lines; QVector points; if (m_pixelIncrementX > 2) { // do not bother painting points if increments are so small int wpoints = qRound(sceneRect().width() / m_pixelIncrementX); int hpoints = qRound(sceneRect().height() / m_pixelIncrementY); for (int i = 0; i < wpoints; ++i) { for (int j = 0; j < hpoints; ++j) { //if (clip.contains(i * pixel_incrementx, j * pixel_incrementy)){ if (i % m_minorSteps == 0 && j % m_minorSteps == 0) { lines << QLine(QPoint(i * m_pixelIncrementX, j * m_pixelIncrementY), QPoint(i * m_pixelIncrementX, j * m_pixelIncrementY + m_majorX)); //painter->drawLine(); lines << QLine(QPoint(i * m_pixelIncrementX, j * m_pixelIncrementY), QPoint(i * m_pixelIncrementX + m_majorY, j * m_pixelIncrementY)); //painter->drawLine(); } else { points << QPoint(i * m_pixelIncrementX, j * m_pixelIncrementY); //painter->drawPoint(); } //} } } painter->drawPoints(points); painter->drawLines(lines); } pen.setWidth(1); //update ( clip ); } } -void ReportScene::mousePressEvent(QGraphicsSceneMouseEvent * e) +void KReportDesignerScene::mousePressEvent(QGraphicsSceneMouseEvent * e) { // clear the selection if Shift Key has not been pressed and it's a left mouse button and // if the right mouse button has been pressed over an item which is not part of selected items if (((e->modifiers() & Qt::ShiftModifier) == 0 && e->button() == Qt::LeftButton) || (!(selectedItems().contains(itemAt(e->scenePos(), QTransform()))) && e->button() == Qt::RightButton)) clearSelection(); //This will be caught by the section to display its properties, if an item is under the cursor then they will display their properties QGraphicsItem* itemUnderCursor = itemAt(e->scenePos(), QTransform()); if (!itemUnderCursor) { emit clicked(); } - KoReportDesignerItemRectBase *rectUnderCursor = qgraphicsitem_cast< KoReportDesignerItemRectBase* >(itemUnderCursor); + KReportDesignerItemRectBase *rectUnderCursor = qgraphicsitem_cast< KReportDesignerItemRectBase* >(itemUnderCursor); if (itemUnderCursor && !rectUnderCursor) { - rectUnderCursor = qgraphicsitem_cast< KoReportDesignerItemRectBase* >(itemUnderCursor->parentItem()); + rectUnderCursor = qgraphicsitem_cast< KReportDesignerItemRectBase* >(itemUnderCursor->parentItem()); } exitInlineEditingModeInItems(rectUnderCursor); QGraphicsScene::mousePressEvent(e); } -void ReportScene::contextMenuEvent(QGraphicsSceneContextMenuEvent * e) +void KReportDesignerScene::contextMenuEvent(QGraphicsSceneContextMenuEvent * e) { m_rd->sectionContextMenuEvent(this, e); } -QPointF ReportScene::gridPoint(const QPointF& p) +QPointF KReportDesignerScene::gridPoint(const QPointF& p) { if (!m_rd->propertySet()->property("grid-snap").value().toBool()) { return p; } if (m_unit.type() != m_rd->pageUnit().type()) { m_unit = m_rd->pageUnit(); //! @todo Again? Copy&Paste error? if (m_unit.type() != m_rd->pageUnit().type()) { m_unit = m_rd->pageUnit(); if (m_unit.type() == KReportUnit::Cicero || m_unit.type() == KReportUnit::Pica || m_unit.type() == KReportUnit::Millimeter) { m_majorX = POINT_TO_INCH(m_unit.fromUserValue(10)) * m_dpiX; m_majorY = POINT_TO_INCH(m_unit.fromUserValue(10)) * m_dpiY; } else if (m_unit.type() == KReportUnit::Point) { m_majorX = POINT_TO_INCH(m_unit.fromUserValue(100)) * m_dpiX; m_majorY = POINT_TO_INCH(m_unit.fromUserValue(100)) * m_dpiY; } else { m_majorX = POINT_TO_INCH(m_unit.fromUserValue(1)) * m_dpiX; m_majorY = POINT_TO_INCH(m_unit.fromUserValue(1)) * m_dpiY; } } } m_minorSteps = m_rd->propertySet()->property("grid-divisions").value().toInt(); m_pixelIncrementX = (m_majorX / m_minorSteps); m_pixelIncrementY = (m_majorY / m_minorSteps); return QPointF(qRound((p.x() / m_pixelIncrementX)) * m_pixelIncrementX, qRound((p.y() / m_pixelIncrementY)) * m_pixelIncrementY); } -void ReportScene::focusOutEvent(QFocusEvent * focusEvent) +void KReportDesignerScene::focusOutEvent(QFocusEvent * focusEvent) { exitInlineEditingModeInItems(0); emit lostFocus(); QGraphicsScene::focusOutEvent(focusEvent); } -qreal ReportScene::lowestZValue() +qreal KReportDesignerScene::lowestZValue() { qreal z; qreal zz; z = 0; QGraphicsItemList list = items(); for (QGraphicsItemList::iterator it = list.begin(); it != list.end(); ++it) { zz = (*it)->zValue(); if (zz < z) { z = zz; } } return z; } -qreal ReportScene::highestZValue() +qreal KReportDesignerScene::highestZValue() { qreal z; qreal zz; z = 0; QGraphicsItemList list = items(); for (QGraphicsItemList::iterator it = list.begin(); it != list.end(); ++it) { zz = (*it)->zValue(); if (zz > z) { z = zz; } } return z; } -void ReportScene::lowerSelected() +void KReportDesignerScene::lowerSelected() { QGraphicsItemList list = selectedItems(); for (QGraphicsItemList::iterator it = list.begin(); it != list.end(); ++it) { (*it)->setZValue(lowestZValue() - 1); } } -void ReportScene::raiseSelected() +void KReportDesignerScene::raiseSelected() { QGraphicsItemList list = selectedItems(); for (QGraphicsItemList::iterator it = list.begin(); it != list.end(); ++it) { (*it)->setZValue(highestZValue() + 1); } } -QGraphicsItemList ReportScene::itemsOrdered() const +QGraphicsItemList KReportDesignerScene::itemsOrdered() const { QGraphicsItemList r; QGraphicsItemList list = items(); for (QGraphicsItemList::iterator it = list.begin(); it != list.end(); ++it) { for (QGraphicsItemList::iterator rit = r.begin(); rit != r.end(); ++rit) { } } return r; } -void ReportScene::exitInlineEditingModeInItems(KoReportDesignerItemRectBase *rectUnderCursor) +void KReportDesignerScene::exitInlineEditingModeInItems(KReportDesignerItemRectBase *rectUnderCursor) { foreach(QGraphicsItem *it, items()) { - KoReportDesignerItemRectBase *itm = qgraphicsitem_cast< KoReportDesignerItemRectBase* >(it); + KReportDesignerItemRectBase *itm = qgraphicsitem_cast< KReportDesignerItemRectBase* >(it); if (itm && itm != rectUnderCursor) { itm->exitInlineEditingMode(); } } } diff --git a/src/wrtembed/reportscene.h b/src/wrtembed/KReportDesignerScene.h similarity index 82% rename from src/wrtembed/reportscene.h rename to src/wrtembed/KReportDesignerScene.h index aa9409f8..19f64fb5 100644 --- a/src/wrtembed/reportscene.h +++ b/src/wrtembed/KReportDesignerScene.h @@ -1,82 +1,82 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ // // Class ReportCanvas // // Overrides the drawForeground() method to do the grid. // -#ifndef __REPORTSCENE_H__ -#define __REPORTSCENE_H__ +#ifndef KREPORTSCENE_H +#define KREPORTSCENE_H #include #include "KReportUnit.h" typedef QList QGraphicsItemList; -class KoReportDesigner; +class KReportDesigner; class QGraphicsSceneContextMenuEvent; class QGraphicsSceneMouseEvent; -class KoReportDesignerItemRectBase; +class KReportDesignerItemRectBase; -class ReportScene : public QGraphicsScene +class KReportDesignerScene : public QGraphicsScene { Q_OBJECT public: - ReportScene(qreal w, qreal h, KoReportDesigner* rd); - virtual ~ReportScene(); - KoReportDesigner* document() const { + KReportDesignerScene(qreal w, qreal h, KReportDesigner* rd); + virtual ~KReportDesignerScene(); + KReportDesigner* document() const { return m_rd; } QPointF gridPoint(const QPointF&); void raiseSelected(); void lowerSelected(); QGraphicsItemList itemsOrdered() const; qreal gridSize() const { return m_pixelIncrementX; } protected: virtual void drawBackground(QPainter* painter, const QRectF & clip); virtual void mousePressEvent(QGraphicsSceneMouseEvent * e); virtual void focusOutEvent(QFocusEvent * focusEvent); virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent * contextMenuEvent); Q_SIGNALS: void clicked(); void lostFocus(); private: qreal lowestZValue(); qreal highestZValue(); - void exitInlineEditingModeInItems(KoReportDesignerItemRectBase *rectUnderCursor); + void exitInlineEditingModeInItems(KReportDesignerItemRectBase *rectUnderCursor); - KoReportDesigner * m_rd; + KReportDesigner * m_rd; KReportUnit m_unit; int m_minorSteps; qreal m_majorX; qreal m_majorY; qreal m_pixelIncrementX; qreal m_pixelIncrementY; int m_dpiX; int m_dpiY; }; #endif diff --git a/src/wrtembed/reportsection.cpp b/src/wrtembed/KReportDesignerSection.cpp similarity index 79% rename from src/wrtembed/reportsection.cpp rename to src/wrtembed/KReportDesignerSection.cpp index 3764c069..825330a4 100644 --- a/src/wrtembed/reportsection.cpp +++ b/src/wrtembed/KReportDesignerSection.cpp @@ -1,416 +1,416 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * Copyright (C) 2014 Jarosław Staniek * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#include "reportsection.h" +#include "KReportDesignerSection.h" -#include "reportscene.h" -#include "reportsceneview.h" -#include "KoReportDesigner.h" -#include "KoReportDesignerItemBase.h" +#include "KReportDesignerScene.h" +#include "KReportDesignerView.h" +#include "KReportDesigner.h" +#include "KReportDesignerItemBase.h" #include "KReportUtils.h" -#include "common/KoReportPluginInterface.h" -#include "common/KoReportPluginManager.h" -#include "KoReportDesignerItemRectBase.h" -#include "KoReportDesignerItemLine.h" +#include "KReportPluginInterface.h" +#include "KReportPluginManager.h" +#include "KReportDesignerItemRectBase.h" +#include "KReportDesignerItemLine.h" #include "KReportRuler_p.h" #include "KReportZoomHandler.h" - #include "kreport_debug.h" + #include #include #include #include #include #include #include #include #include #include //! @internal class ReportResizeBar : public QFrame { Q_OBJECT public: explicit ReportResizeBar(QWidget * parent = 0, Qt::WindowFlags f = 0); Q_SIGNALS: void barDragged(int delta); protected: void mouseMoveEvent(QMouseEvent * e); }; //! @internal -class ReportSectionTitle : public QLabel +class KReportDesignerSectionTitle : public QLabel { Q_OBJECT public: - explicit ReportSectionTitle(QWidget *parent = 0); - ~ReportSectionTitle(); + explicit KReportDesignerSectionTitle(QWidget *parent = 0); + ~KReportDesignerSectionTitle(); Q_SIGNALS: void clicked(); protected: virtual void paintEvent(QPaintEvent* event); virtual void mousePressEvent(QMouseEvent *event); }; //! @internal -class ReportSection::Private +class KReportDesignerSection::Private { public: explicit Private() {} ~Private() {} - ReportSectionTitle *title; - ReportScene *scene; + KReportDesignerSectionTitle *title; + KReportDesignerScene *scene; ReportResizeBar *resizeBar; - ReportSceneView *sceneView; - KoReportDesigner*reportDesigner; + KReportDesignerView *sceneView; + KReportDesigner*reportDesigner; KReportRuler *sectionRuler; - KRSectionData *sectionData; + KReportSectionData *sectionData; int dpiY; }; -ReportSection::ReportSection(KoReportDesigner * rptdes) +KReportDesignerSection::KReportDesignerSection(KReportDesigner * rptdes) : QWidget(rptdes) , d(new Private()) { - d->sectionData = new KRSectionData(this); + d->sectionData = new KReportSectionData(this); connect(d->sectionData->propertySet(), SIGNAL(propertyChanged(KPropertySet&,KProperty&)), this, SLOT(slotPropertyChanged(KPropertySet&,KProperty&))); QScreen *srn = QApplication::screens().at(0); d->dpiY = srn->logicalDotsPerInchY(); d->reportDesigner = rptdes; setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); QGridLayout * glayout = new QGridLayout(this); glayout->setSpacing(0); glayout->setMargin(0); glayout->setColumnStretch(1, 1); glayout->setRowStretch(1, 1); glayout->setSizeConstraint(QLayout::SetFixedSize); // ok create the base interface - d->title = new ReportSectionTitle(this); + d->title = new KReportDesignerSectionTitle(this); d->title->setObjectName(QLatin1String("detail")); d->title->setText(tr("Detail")); d->sectionRuler = new KReportRuler(this, Qt::Vertical, d->reportDesigner->zoomHandler()); d->sectionRuler->setUnit(d->reportDesigner->pageUnit()); - d->scene = new ReportScene(d->reportDesigner->pageWidthPx(), d->dpiY, rptdes); - d->sceneView = new ReportSceneView(rptdes, d->scene, this); + d->scene = new KReportDesignerScene(d->reportDesigner->pageWidthPx(), d->dpiY, rptdes); + d->sceneView = new KReportDesignerView(rptdes, d->scene, this); d->sceneView->setObjectName(QLatin1String("scene view")); d->sceneView->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); d->resizeBar = new ReportResizeBar(this); connect(d->resizeBar, SIGNAL(barDragged(int)), this, SLOT(slotResizeBarDragged(int))); connect(d->reportDesigner, SIGNAL(pagePropertyChanged(KPropertySet&)), this, SLOT(slotPageOptionsChanged(KPropertySet&))); connect(d->scene, SIGNAL(clicked()), this, (SLOT(slotSceneClicked()))); connect(d->scene, SIGNAL(lostFocus()), d->title, SLOT(update())); connect(d->title, SIGNAL(clicked()), this, (SLOT(slotSceneClicked()))); glayout->addWidget(d->title, 0, 0, 1, 2); glayout->addWidget(d->sectionRuler, 1, 0); glayout->addWidget(d->sceneView , 1, 1); glayout->addWidget(d->resizeBar, 2, 0, 1, 2); d->sectionRuler->setFixedWidth(d->sectionRuler->sizeHint().width()); setLayout(glayout); slotResizeBarDragged(0); } -ReportSection::~ReportSection() +KReportDesignerSection::~KReportDesignerSection() { delete d; } -void ReportSection::setTitle(const QString & s) +void KReportDesignerSection::setTitle(const QString & s) { d->title->setText(s); } -void ReportSection::slotResizeBarDragged(int delta) +void KReportDesignerSection::slotResizeBarDragged(int delta) { if (d->sceneView->designer() && d->sceneView->designer()->propertySet()->property("page-size").value().toString() == QLatin1String("Labels")) { return; // we don't want to allow this on reports that are for labels } slotSceneClicked(); // switches property set to this section qreal h = d->scene->height() + delta; if (h < 1) h = 1; h = d->scene->gridPoint(QPointF(0, h)).y(); d->sectionData->m_height->setValue(INCH_TO_POINT(h/d->dpiY)); d->sectionRuler->setRulerLength(h); d->scene->setSceneRect(0, 0, d->scene->width(), h); d->sceneView->resizeContents(QSize(d->scene->width(), h)); d->reportDesigner->setModified(true); } -void ReportSection::buildXML(QDomDocument *doc, QDomElement *section) +void KReportDesignerSection::buildXML(QDomDocument *doc, QDomElement *section) { KReportUtils::setAttribute(section, QLatin1String("svg:height"), d->sectionData->m_height->value().toDouble()); section->setAttribute(QLatin1String("fo:background-color"), d->sectionData->backgroundColor().name()); // now get a list of all the QGraphicsItems on this scene and output them. QGraphicsItemList list = d->scene->items(); for (QGraphicsItemList::iterator it = list.begin(); it != list.end(); ++it) { - KoReportDesignerItemBase::buildXML((*it), doc, section); + KReportDesignerItemBase::buildXML((*it), doc, section); } } -void ReportSection::initFromXML(const QDomNode & section) +void KReportDesignerSection::initFromXML(const QDomNode & section) { QDomNodeList nl = section.childNodes(); QDomNode node; QString n; qreal h = KReportUnit::parseValue(section.toElement().attribute(QLatin1String("svg:height"), QLatin1String("2.0cm"))); d->sectionData->m_height->setValue(h); h = POINT_TO_INCH(h) * d->dpiY; //kreportDebug() << "Section Height: " << h; d->scene->setSceneRect(0, 0, d->scene->width(), h); slotResizeBarDragged(0); d->sectionData->m_backgroundColor->setValue(QColor(section.toElement().attribute(QLatin1String("fo:background-color"), QLatin1String("#ffffff")))); for (int i = 0; i < nl.count(); ++i) { node = nl.item(i); n = node.nodeName(); if (n.startsWith(QLatin1String("report:"))) { //Load objects //report:line is a special case as it is not a plugin QString reportItemName = n.mid(qstrlen("report:")); if (reportItemName == QLatin1String("line")) { - (new KoReportDesignerItemLine(node, d->sceneView->designer(), d->scene))->setVisible(true); + (new KReportDesignerItemLine(node, d->sceneView->designer(), d->scene))->setVisible(true); continue; } - KoReportPluginManager* manager = KoReportPluginManager::self(); - KoReportPluginInterface *plugin = manager->plugin(reportItemName); + KReportPluginManager* manager = KReportPluginManager::self(); + KReportPluginInterface *plugin = manager->plugin(reportItemName); if (plugin) { QObject *obj = plugin->createDesignerInstance(node, d->reportDesigner, d->scene); if (obj) { - KoReportDesignerItemRectBase *entity = dynamic_cast(obj); + KReportDesignerItemRectBase *entity = dynamic_cast(obj); if (entity) { entity->setVisible(true); } continue; } } } kreportWarning() << "Encountered unknown node while parsing section: " << n; } } -QSize ReportSection::sizeHint() const +QSize KReportDesignerSection::sizeHint() const { return QSize(d->scene->width() + d->sectionRuler->frameSize().width(), d->title->frameSize().height() + d->sceneView->sizeHint().height() + d->resizeBar->frameSize().height()); } -void ReportSection::slotPageOptionsChanged(KPropertySet &set) +void KReportDesignerSection::slotPageOptionsChanged(KPropertySet &set) { Q_UNUSED(set) KReportUnit unit = d->reportDesigner->pageUnit(); d->sectionData->m_height->setOption("unit", unit.symbol()); //update items position with unit QList itms = d->scene->items(); for (int i = 0; i < itms.size(); ++i) { - KoReportItemBase *obj = dynamic_cast(itms[i]); + KReportItemBase *obj = dynamic_cast(itms[i]); if (obj) { obj->setUnit(unit); } } d->scene->setSceneRect(0, 0, d->reportDesigner->pageWidthPx(), d->scene->height()); d->title->setMinimumWidth(d->reportDesigner->pageWidthPx() + d->sectionRuler->frameSize().width()); d->sectionRuler->setUnit(d->reportDesigner->pageUnit()); //Trigger a redraw of the background d->sceneView->resetCachedContent(); d->reportDesigner->adjustSize(); d->reportDesigner->repaint(); slotResizeBarDragged(0); } -void ReportSection::slotSceneClicked() +void KReportDesignerSection::slotSceneClicked() { d->reportDesigner->setActiveScene(d->scene); d->reportDesigner->changeSet(d->sectionData->propertySet()); } -void ReportSection::slotPropertyChanged(KPropertySet &s, KProperty &p) +void KReportDesignerSection::slotPropertyChanged(KPropertySet &s, KProperty &p) { Q_UNUSED(s) //kreportDebug() << p.name(); //Handle Background Color if (p.name() == "background-color") { d->scene->setBackgroundBrush(p.value().value()); } if (p.name() == "height") { d->scene->setSceneRect(0, 0, d->scene->width(), POINT_TO_INCH(p.value().toDouble()) * d->dpiY); slotResizeBarDragged(0); } if (d->reportDesigner) d->reportDesigner->setModified(true); d->sceneView->resetCachedContent(); d->scene->update(); } -void ReportSection::setSectionCursor(const QCursor& c) +void KReportDesignerSection::setSectionCursor(const QCursor& c) { if (d->sceneView) d->sceneView->setCursor(c); } -void ReportSection::unsetSectionCursor() +void KReportDesignerSection::unsetSectionCursor() { if (d->sceneView) d->sceneView->unsetCursor(); } -QGraphicsItemList ReportSection::items() const +QGraphicsItemList KReportDesignerSection::items() const { QGraphicsItemList items; if (d->scene) { foreach (QGraphicsItem *itm, d->scene->items()) { if (itm->parentItem() == 0) { items << itm; } } } return items; } // // class ReportResizeBar // ReportResizeBar::ReportResizeBar(QWidget * parent, Qt::WindowFlags f) : QFrame(parent, f) { setCursor(QCursor(Qt::SizeVerCursor)); setFrameStyle(QFrame::HLine); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); } void ReportResizeBar::mouseMoveEvent(QMouseEvent * e) { e->accept(); emit barDragged(e->y()); } //============================================================================= -ReportSectionTitle::ReportSectionTitle(QWidget*parent) : QLabel(parent) +KReportDesignerSectionTitle::KReportDesignerSectionTitle(QWidget*parent) : QLabel(parent) { setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); setAlignment(Qt::AlignLeft | Qt::AlignTop); setMinimumHeight(qMax(fontMetrics().lineSpacing(),16 + 2)); //16 = Small icon size } -ReportSectionTitle::~ReportSectionTitle() +KReportDesignerSectionTitle::~KReportDesignerSectionTitle() { } //! \return true if \a o has parent \a par. static bool hasParent(QObject* par, QObject* o) { if (!o || !par) return false; while (o && o != par) o = o->parent(); return o == par; } static void replaceColors(QPixmap* original, const QColor& color) { QImage dest(original->toImage()); QPainter p(&dest); p.setCompositionMode(QPainter::CompositionMode_SourceIn); p.fillRect(dest.rect(), color); *original = QPixmap::fromImage(dest); } -void ReportSectionTitle::paintEvent(QPaintEvent * event) +void KReportDesignerSectionTitle::paintEvent(QPaintEvent * event) { QPainter painter(this); - ReportSection* _section = dynamic_cast(parent()); + KReportDesignerSection* _section = dynamic_cast(parent()); const bool current = _section->d->scene == _section->d->reportDesigner->activeScene(); QPalette::ColorGroup cg = QPalette::Inactive; QWidget *activeWindow = QApplication::activeWindow(); if (activeWindow) { QWidget *par = activeWindow->focusWidget(); - if (qobject_cast(par)) { + if (qobject_cast(par)) { par = par->parentWidget(); // we're close, pick common parent } if (hasParent(par, this)) { cg = QPalette::Active; } } if (current) { painter.fillRect(rect(), palette().brush(cg, QPalette::Highlight)); } painter.setPen(palette().color(cg, current ? QPalette::HighlightedText : QPalette::WindowText)); QPixmap pixmap(QIcon::fromTheme(QLatin1String("arrow-down")).pixmap(16,16)); replaceColors(&pixmap, painter.pen().color()); const int left = 25; painter.drawPixmap(QPoint(left, (height() - pixmap.height()) / 2), pixmap); painter.drawText(rect().adjusted(left + pixmap.width() + 4, 0, 0, 0), Qt::AlignLeft | Qt::AlignVCenter, text()); QFrame::paintEvent(event); } -void ReportSectionTitle::mousePressEvent(QMouseEvent *event) +void KReportDesignerSectionTitle::mousePressEvent(QMouseEvent *event) { QLabel::mousePressEvent(event); if (event->button() == Qt::LeftButton) { emit clicked(); } } -#include "reportsection.moc" +#include "KReportDesignerSection.moc" diff --git a/src/wrtembed/reportsection.h b/src/wrtembed/KReportDesignerSection.h similarity index 89% rename from src/wrtembed/reportsection.h rename to src/wrtembed/KReportDesignerSection.h index 6602b751..d71f1da6 100644 --- a/src/wrtembed/reportsection.h +++ b/src/wrtembed/KReportDesignerSection.h @@ -1,86 +1,86 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * Copyright (C) 2014 Jarosław Staniek * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #ifndef __REPORTSECTION_H__ #define __REPORTSECTION_H__ #include #include "kreport_export.h" // forward declarations class QDomNode; class QDomDocument; class QDomElement; class QGraphicsItem; typedef QList QGraphicsItemList; class KPropertySet; class KProperty; -class KoReportDesigner; +class KReportDesigner; // // Class ReportSection // // This class is the base to all Report Section's visual representation. // It contains the basic data and interface that all the sections need to work. // -class KREPORT_EXPORT ReportSection : public QWidget +class KREPORT_EXPORT KReportDesignerSection : public QWidget { Q_OBJECT public: - explicit ReportSection(KoReportDesigner * rptdes); - virtual ~ReportSection(); + explicit KReportDesignerSection(KReportDesigner * rptdes); + virtual ~KReportDesignerSection(); void setTitle(const QString & s); void buildXML(QDomDocument *doc, QDomElement *section); void initFromXML(const QDomNode & section); virtual QSize sizeHint() const; /** * @brief Return the items in the section * Only return top-level items ... ie, items with no parent item * because child items are not full report-items, they are implementation * details of a report item and do not need to be counted individually * * @return QGraphicsItemList */ QGraphicsItemList items() const; void setSectionCursor(const QCursor&); void unsetSectionCursor(); protected Q_SLOTS: void slotResizeBarDragged(int delta); private Q_SLOTS: void slotPageOptionsChanged(KPropertySet &); void slotSceneClicked(); void slotPropertyChanged(KPropertySet &, KProperty &); private: - Q_DISABLE_COPY(ReportSection) + Q_DISABLE_COPY(KReportDesignerSection) class Private; Private * const d; - friend class ReportSectionTitle; + friend class KReportDesignerSectionTitle; }; #endif diff --git a/src/wrtembed/reportsectiondetail.cpp b/src/wrtembed/KReportDesignerSectionDetail.cpp similarity index 69% rename from src/wrtembed/reportsectiondetail.cpp rename to src/wrtembed/KReportDesignerSectionDetail.cpp index de7e4d3d..95a9cb2e 100644 --- a/src/wrtembed/reportsectiondetail.cpp +++ b/src/wrtembed/KReportDesignerSectionDetail.cpp @@ -1,237 +1,236 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#include "reportsectiondetail.h" -#include "reportsectiondetailgroup.h" -#include "reportsection.h" - -#include "KoReportDesigner.h" +#include "KReportDesignerSectionDetail.h" +#include "KReportDesignerSectionDetailGroup.h" +#include "KReportDesignerSection.h" +#include "KReportDesigner.h" +#include "kreport_debug.h" #include #include -#include "kreport_debug.h" //! @internal -class ReportSectionDetail::Private +class KReportDesignerSectionDetail::Private { public: explicit Private() - : pageBreak(ReportSectionDetail::BreakNone) + : pageBreak(KReportDesignerSectionDetail::BreakNone) {} ~Private() { } QString name; - ReportSection *detail; - KoReportDesigner *reportDesigner; + KReportDesignerSection *detail; + KReportDesigner *reportDesigner; - QList groupList; + QList groupList; QVBoxLayout *vboxlayout; int pageBreak; }; -ReportSectionDetail::ReportSectionDetail(KoReportDesigner * rptdes) +KReportDesignerSectionDetail::KReportDesignerSectionDetail(KReportDesigner * rptdes) : QWidget(rptdes) , d(new Private()) { setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); d->vboxlayout = new QVBoxLayout(this); d->vboxlayout->setSpacing(0); d->vboxlayout->setMargin(0); d->reportDesigner = rptdes; - d->detail = new ReportSection(rptdes /*, this*/); + d->detail = new KReportDesignerSection(rptdes /*, this*/); d->vboxlayout->addWidget(d->detail); this->setLayout(d->vboxlayout); } -ReportSectionDetail::~ReportSectionDetail() +KReportDesignerSectionDetail::~KReportDesignerSectionDetail() { delete d; } -int ReportSectionDetail::pageBreak() const +int KReportDesignerSectionDetail::pageBreak() const { return d->pageBreak; } -void ReportSectionDetail::setPageBreak(int pb) +void KReportDesignerSectionDetail::setPageBreak(int pb) { d->pageBreak = pb; } -ReportSection * ReportSectionDetail::detailSection() const +KReportDesignerSection * KReportDesignerSectionDetail::detailSection() const { return d->detail; } -void ReportSectionDetail::buildXML(QDomDocument *doc, QDomElement *section) +void KReportDesignerSectionDetail::buildXML(QDomDocument *doc, QDomElement *section) { - if (pageBreak() != ReportSectionDetail::BreakNone) { + if (pageBreak() != KReportDesignerSectionDetail::BreakNone) { QDomElement spagebreak = doc->createElement(QLatin1String("pagebreak")); - if (pageBreak() == ReportSectionDetail::BreakAtEnd) + if (pageBreak() == KReportDesignerSectionDetail::BreakAtEnd) spagebreak.setAttribute(QLatin1String("when"), QLatin1String("at end")); section->appendChild(spagebreak); } - foreach(ReportSectionDetailGroup* rsdg, d->groupList) { + foreach(KReportDesignerSectionDetailGroup* rsdg, d->groupList) { rsdg->buildXML(doc, section); } // detail section QDomElement gdetail = doc->createElement(QLatin1String("report:section")); gdetail.setAttribute(QLatin1String("report:section-type"), QLatin1String("detail")); d->detail->buildXML(doc, &gdetail); section->appendChild(gdetail); } -void ReportSectionDetail::initFromXML(QDomNode *section) +void KReportDesignerSectionDetail::initFromXML(QDomNode *section) { QDomNodeList nl = section->childNodes(); QDomNode node; QString n; for (int i = 0; i < nl.count(); i++) { node = nl.item(i); n = node.nodeName(); //kreportDebug() << n; if (n == QLatin1String("pagebreak")) { QDomElement eThis = node.toElement(); if (eThis.attribute(QLatin1String("when")) == QLatin1String("at end")) setPageBreak(BreakAtEnd); } else if (n == QLatin1String("report:group")) { - ReportSectionDetailGroup * rsdg = new ReportSectionDetailGroup(QLatin1String("unnamed"), this, this); + KReportDesignerSectionDetailGroup * rsdg = new KReportDesignerSectionDetailGroup(QLatin1String("unnamed"), this, this); rsdg->initFromXML( node.toElement() ); insertGroupSection(groupSectionCount(), rsdg); } else if (n == QLatin1String("report:section") && node.toElement().attribute(QLatin1String("report:section-type")) == QLatin1String("detail")) { //kreportDebug() << "Creating detail section"; d->detail->initFromXML(node); } else { // unknown element kreportWarning() << "while parsing section encountered and unknown element: " << n; } } } -KoReportDesigner * ReportSectionDetail::reportDesigner() const +KReportDesigner * KReportDesignerSectionDetail::reportDesigner() const { return d->reportDesigner; } -int ReportSectionDetail::groupSectionCount() const +int KReportDesignerSectionDetail::groupSectionCount() const { return d->groupList.count(); } -ReportSectionDetailGroup * ReportSectionDetail::groupSection(int i) const +KReportDesignerSectionDetailGroup * KReportDesignerSectionDetail::groupSection(int i) const { return d->groupList.at(i); } -void ReportSectionDetail::insertGroupSection(int idx, ReportSectionDetailGroup * rsd) +void KReportDesignerSectionDetail::insertGroupSection(int idx, KReportDesignerSectionDetailGroup * rsd) { d->groupList.insert(idx, rsd); rsd->groupHeader()->setParent(this); rsd->groupFooter()->setParent(this); idx = 0; int gi = 0; for (gi = 0; gi < (int) d->groupList.count(); gi++) { rsd = d->groupList.at(gi); d->vboxlayout->removeWidget(rsd->groupHeader()); d->vboxlayout->insertWidget(idx, rsd->groupHeader()); idx++; } d->vboxlayout->removeWidget(d->detail); d->vboxlayout->insertWidget(idx, d->detail); idx++; for (gi = ((int) d->groupList.count() - 1); gi >= 0; --gi) { rsd = d->groupList.at(gi); d->vboxlayout->removeWidget(rsd->groupFooter()); d->vboxlayout->insertWidget(idx, rsd->groupFooter()); idx++; } if (d->reportDesigner) d->reportDesigner->setModified(true); adjustSize(); } -int ReportSectionDetail::indexOfGroupSection(const QString & column) const +int KReportDesignerSectionDetail::indexOfGroupSection(const QString & column) const { // find the item by its name for (uint i = 0; i < (uint)d->groupList.count(); i++) { - ReportSectionDetailGroup * rsd = d->groupList.at(i); + KReportDesignerSectionDetailGroup * rsd = d->groupList.at(i); if (column == rsd->column()) return i; } return -1; } -void ReportSectionDetail::removeGroupSection(int idx, bool del) +void KReportDesignerSectionDetail::removeGroupSection(int idx, bool del) { - ReportSectionDetailGroup * rsd = d->groupList.at(idx); + KReportDesignerSectionDetailGroup * rsd = d->groupList.at(idx); d->vboxlayout->removeWidget(rsd->groupHeader()); d->vboxlayout->removeWidget(rsd->groupFooter()); d->groupList.removeAt(idx); if (d->reportDesigner) d->reportDesigner->setModified(true); if (del) delete rsd; adjustSize(); } -QSize ReportSectionDetail::sizeHint() const +QSize KReportDesignerSectionDetail::sizeHint() const { QSize s; - foreach(ReportSectionDetailGroup* rsdg, d->groupList) { + foreach(KReportDesignerSectionDetailGroup* rsdg, d->groupList) { if (rsdg->groupHeaderVisible()) s += rsdg->groupHeader()->size(); if (rsdg->groupFooterVisible()) s += rsdg->groupFooter()->size(); } return s += d->detail->size(); } -void ReportSectionDetail::setSectionCursor(const QCursor& c) +void KReportDesignerSectionDetail::setSectionCursor(const QCursor& c) { if (d->detail) d->detail->setSectionCursor(c); - foreach(ReportSectionDetailGroup* rsdg, d->groupList) { + foreach(KReportDesignerSectionDetailGroup* rsdg, d->groupList) { if (rsdg->groupHeader()) rsdg->groupHeader()->setSectionCursor(c); if (rsdg->groupFooter()) rsdg->groupFooter()->setSectionCursor(c); } } -void ReportSectionDetail::unsetSectionCursor() +void KReportDesignerSectionDetail::unsetSectionCursor() { if (d->detail) d->detail->unsetSectionCursor(); - foreach(ReportSectionDetailGroup* rsdg, d->groupList) { + foreach(KReportDesignerSectionDetailGroup* rsdg, d->groupList) { if (rsdg->groupHeader()) rsdg->groupHeader()->unsetSectionCursor(); if (rsdg->groupFooter()) rsdg->groupFooter()->unsetSectionCursor(); } } diff --git a/src/wrtembed/reportsectiondetail.h b/src/wrtembed/KReportDesignerSectionDetail.h similarity index 70% rename from src/wrtembed/reportsectiondetail.h rename to src/wrtembed/KReportDesignerSectionDetail.h index a6cd70c5..3766dcd2 100644 --- a/src/wrtembed/reportsectiondetail.h +++ b/src/wrtembed/KReportDesignerSectionDetail.h @@ -1,74 +1,74 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#ifndef REPORTSECTIONDETAIL_H -#define REPORTSECTIONDETAIL_H +#ifndef KREPORTSECTIONDETAIL_H +#define KREPORTSECTIONDETAIL_H #include #include "kreport_export.h" class QDomNode; class QDomElement; class QDomDocument; -class ReportSection; -class KoReportDesigner; -class ReportSectionDetailGroup; +class KReportDesignerSection; +class KReportDesigner; +class KReportDesignerSectionDetailGroup; /** */ -class KREPORT_EXPORT ReportSectionDetail : public QWidget +class KREPORT_EXPORT KReportDesignerSectionDetail : public QWidget { Q_OBJECT public: - explicit ReportSectionDetail(KoReportDesigner * rptdes); - virtual ~ReportSectionDetail(); + explicit KReportDesignerSectionDetail(KReportDesigner * rptdes); + virtual ~KReportDesignerSectionDetail(); enum PageBreak { BreakNone = 0, BreakAtEnd = 1 }; void setPageBreak(int); int pageBreak() const; - ReportSection * detailSection() const; + KReportDesignerSection * detailSection() const; void buildXML(QDomDocument *doc, QDomElement *section); void initFromXML(QDomNode *node); - KoReportDesigner * reportDesigner() const; + KReportDesigner * reportDesigner() const; int groupSectionCount() const; - ReportSectionDetailGroup * groupSection(int i) const; - void insertGroupSection(int idx, ReportSectionDetailGroup * rsd); + KReportDesignerSectionDetailGroup * groupSection(int i) const; + void insertGroupSection(int idx, KReportDesignerSectionDetailGroup * rsd); int indexOfGroupSection(const QString & column) const; void removeGroupSection(int idx, bool del = false); virtual QSize sizeHint() const; void setSectionCursor(const QCursor&); void unsetSectionCursor(); private: - Q_DISABLE_COPY(ReportSectionDetail) + Q_DISABLE_COPY(KReportDesignerSectionDetail) class Private; Private * const d; }; #endif diff --git a/src/wrtembed/reportsectiondetailgroup.cpp b/src/wrtembed/KReportDesignerSectionDetailGroup.cpp similarity index 69% rename from src/wrtembed/reportsectiondetailgroup.cpp rename to src/wrtembed/KReportDesignerSectionDetailGroup.cpp index a15de479..c7084725 100644 --- a/src/wrtembed/reportsectiondetailgroup.cpp +++ b/src/wrtembed/KReportDesignerSectionDetailGroup.cpp @@ -1,227 +1,227 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#include "reportsectiondetailgroup.h" -#include "KoReportDesigner.h" -#include "reportsection.h" -#include "reportsectiondetail.h" +#include "KReportDesignerSectionDetailGroup.h" +#include "KReportDesigner.h" +#include "KReportDesignerSection.h" +#include "KReportDesignerSectionDetail.h" #include "kreport_debug.h" #include #include //! @internal -class ReportSectionDetailGroup::Private +class KReportDesignerSectionDetailGroup::Private { public: explicit Private() - : pageBreak(ReportSectionDetailGroup::BreakNone) + : pageBreak(KReportDesignerSectionDetailGroup::BreakNone) , sort(Qt::AscendingOrder) {} ~Private() { // I delete these here so that there are no widgets //left floating around delete groupHeader; delete groupFooter; } QString column; - ReportSection *groupHeader; - ReportSection *groupFooter; + KReportDesignerSection *groupHeader; + KReportDesignerSection *groupFooter; - ReportSectionDetail * reportSectionDetail; + KReportDesignerSectionDetail * reportSectionDetail; PageBreak pageBreak; Qt::SortOrder sort; }; -ReportSectionDetailGroup::ReportSectionDetailGroup(const QString & column, ReportSectionDetail * rsd, +KReportDesignerSectionDetailGroup::KReportDesignerSectionDetailGroup(const QString & column, KReportDesignerSectionDetail * rsd, QWidget * parent) : QObject(parent) , d(new Private()) { - KoReportDesigner * rd = 0; + KReportDesigner * rd = 0; d->reportSectionDetail = rsd; if (d->reportSectionDetail) { rd = rsd->reportDesigner(); } else { kreportWarning() << "Error: ReportSectionDetail is null"; } - d->groupHeader = new ReportSection(rd /*, _rsd*/); - d->groupFooter = new ReportSection(rd /*, _rsd*/); + d->groupHeader = new KReportDesignerSection(rd /*, _rsd*/); + d->groupFooter = new KReportDesignerSection(rd /*, _rsd*/); setGroupHeaderVisible(false); setGroupFooterVisible(false); setColumn(column); } -ReportSectionDetailGroup::~ReportSectionDetailGroup() +KReportDesignerSectionDetailGroup::~KReportDesignerSectionDetailGroup() { delete d; } -void ReportSectionDetailGroup::buildXML(QDomDocument *doc, QDomElement *section) const +void KReportDesignerSectionDetailGroup::buildXML(QDomDocument *doc, QDomElement *section) const { QDomElement grp = doc->createElement(QLatin1String("report:group")); grp.setAttribute(QLatin1String("report:group-column"), column()); - if (pageBreak() == ReportSectionDetailGroup::BreakAfterGroupFooter) { + if (pageBreak() == KReportDesignerSectionDetailGroup::BreakAfterGroupFooter) { grp.setAttribute(QLatin1String("report:group-page-break"), QLatin1String("after-footer")); - } else if (pageBreak() == ReportSectionDetailGroup::BreakBeforeGroupHeader) { + } else if (pageBreak() == KReportDesignerSectionDetailGroup::BreakBeforeGroupHeader) { grp.setAttribute(QLatin1String("report:group-page-break"), QLatin1String("before-header")); } if (d->sort == Qt::AscendingOrder) { grp.setAttribute(QLatin1String("report:group-sort"), QLatin1String("ascending")); } else { grp.setAttribute(QLatin1String("report:group-sort"), QLatin1String("descending")); } //group head if (groupHeaderVisible()) { QDomElement gheader = doc->createElement(QLatin1String("report:section")); gheader.setAttribute(QLatin1String("report:section-type"), QLatin1String("group-header")); groupHeader()->buildXML(doc, &gheader); grp.appendChild(gheader); } // group foot if (groupFooterVisible()) { QDomElement gfooter = doc->createElement(QLatin1String("report:section")); gfooter.setAttribute(QLatin1String("report:section-type"), QLatin1String("group-footer")); groupFooter()->buildXML(doc, &gfooter); grp.appendChild(gfooter); } section->appendChild(grp); } -void ReportSectionDetailGroup::initFromXML( const QDomElement &element ) +void KReportDesignerSectionDetailGroup::initFromXML( const QDomElement &element ) { if ( element.hasAttribute(QLatin1String("report:group-column") ) ) { setColumn( element.attribute( QLatin1String("report:group-column") ) ); } if ( element.hasAttribute( QLatin1String("report:group-page-break") ) ) { QString s = element.attribute( QLatin1String("report:group-page-break") ); if ( s == QLatin1String("after-footer") ) { - setPageBreak( ReportSectionDetailGroup::BreakAfterGroupFooter ); + setPageBreak( KReportDesignerSectionDetailGroup::BreakAfterGroupFooter ); } else if ( s == QLatin1String("before-header") ) { - setPageBreak( ReportSectionDetailGroup::BreakBeforeGroupHeader ); + setPageBreak( KReportDesignerSectionDetailGroup::BreakBeforeGroupHeader ); } } if (element.attribute(QLatin1String("report:group-sort"), QLatin1String("ascending")) == QLatin1String("ascending")) { setSort(Qt::AscendingOrder); } else { setSort(Qt::DescendingOrder); } for ( QDomElement e = element.firstChildElement( QLatin1String("report:section") ); ! e.isNull(); e = e.nextSiblingElement( QLatin1String("report:section") ) ) { QString s = e.attribute( QLatin1String("report:section-type") ); if ( s == QLatin1String("group-header") ) { setGroupHeaderVisible( true ); d->groupHeader->initFromXML( e ); } else if ( s == QLatin1String("group-footer") ) { setGroupFooterVisible( true ); d->groupFooter->initFromXML( e ); } } } -void ReportSectionDetailGroup::setGroupHeaderVisible(bool yes) +void KReportDesignerSectionDetailGroup::setGroupHeaderVisible(bool visible) { - if (groupHeaderVisible() != yes) { + if (groupHeaderVisible() != visible) { if (d->reportSectionDetail && d->reportSectionDetail->reportDesigner()) d->reportSectionDetail->reportDesigner()->setModified(true); } - if (yes) d->groupHeader->show(); + if (visible) d->groupHeader->show(); else d->groupHeader->hide(); d->reportSectionDetail->adjustSize(); } -void ReportSectionDetailGroup::setGroupFooterVisible(bool yes) +void KReportDesignerSectionDetailGroup::setGroupFooterVisible(bool visible) { - if (groupFooterVisible() != yes) { + if (groupFooterVisible() != visible) { if (d->reportSectionDetail && d->reportSectionDetail->reportDesigner()) d->reportSectionDetail->reportDesigner()->setModified(true); } - if (yes) d->groupFooter->show(); + if (visible) d->groupFooter->show(); else d->groupFooter->hide(); d->reportSectionDetail->adjustSize(); } -void ReportSectionDetailGroup::setPageBreak(ReportSectionDetailGroup::PageBreak pb) +void KReportDesignerSectionDetailGroup::setPageBreak(KReportDesignerSectionDetailGroup::PageBreak pb) { d->pageBreak = pb; } -void ReportSectionDetailGroup::setSort(Qt::SortOrder s) +void KReportDesignerSectionDetailGroup::setSort(Qt::SortOrder s) { d->sort = s; } -Qt::SortOrder ReportSectionDetailGroup::sort() +Qt::SortOrder KReportDesignerSectionDetailGroup::sort() { return d->sort; } -bool ReportSectionDetailGroup::groupHeaderVisible() const +bool KReportDesignerSectionDetailGroup::groupHeaderVisible() const { // Check *explicitly* hidden return ! d->groupHeader->isHidden(); } -bool ReportSectionDetailGroup::groupFooterVisible() const +bool KReportDesignerSectionDetailGroup::groupFooterVisible() const { // Check *explicitly* hidden return ! d->groupFooter->isHidden(); } -ReportSectionDetailGroup::PageBreak ReportSectionDetailGroup::pageBreak() const +KReportDesignerSectionDetailGroup::PageBreak KReportDesignerSectionDetailGroup::pageBreak() const { return d->pageBreak; } -QString ReportSectionDetailGroup::column() const +QString KReportDesignerSectionDetailGroup::column() const { return d->column; } -void ReportSectionDetailGroup::setColumn(const QString & s) +void KReportDesignerSectionDetailGroup::setColumn(const QString & s) { if (d->column != s) { d->column = s; if (d->reportSectionDetail && d->reportSectionDetail->reportDesigner()) d->reportSectionDetail->reportDesigner()->setModified(true); } d->groupHeader->setTitle(d->column + QLatin1String(" Group Header")); d->groupFooter->setTitle(d->column + QLatin1String(" Group Footer")); } -ReportSection * ReportSectionDetailGroup::groupHeader() const +KReportDesignerSection * KReportDesignerSectionDetailGroup::groupHeader() const { return d->groupHeader; } -ReportSection * ReportSectionDetailGroup::groupFooter() const +KReportDesignerSection * KReportDesignerSectionDetailGroup::groupFooter() const { return d->groupFooter; } diff --git a/src/wrtembed/reportsectiondetailgroup.h b/src/wrtembed/KReportDesignerSectionDetailGroup.h similarity index 76% rename from src/wrtembed/reportsectiondetailgroup.h rename to src/wrtembed/KReportDesignerSectionDetailGroup.h index e59624fc..478d99a1 100644 --- a/src/wrtembed/reportsectiondetailgroup.h +++ b/src/wrtembed/KReportDesignerSectionDetailGroup.h @@ -1,77 +1,77 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#ifndef REPORTSECTIONDETAILGROUP_H -#define REPORTSECTIONDETAILGROUP_H +#ifndef KREPORTSECTIONDETAILGROUP_H +#define KREPORTSECTIONDETAILGROUP_H #include #include "kreport_export.h" class QDomElement; class QDomDocument; class QString; class QWidget; -class ReportSection; -class ReportSectionDetail; +class KReportDesignerSection; +class KReportDesignerSectionDetail; /** */ -class KREPORT_EXPORT ReportSectionDetailGroup : public QObject +class KREPORT_EXPORT KReportDesignerSectionDetailGroup : public QObject { Q_OBJECT public: - ReportSectionDetailGroup(const QString &column, ReportSectionDetail *, QWidget * parent = 0); - ~ReportSectionDetailGroup(); + KReportDesignerSectionDetailGroup(const QString &column, KReportDesignerSectionDetail *, QWidget * parent = 0); + ~KReportDesignerSectionDetailGroup(); enum PageBreak { BreakNone = 0, BreakAfterGroupFooter = 1, BreakBeforeGroupHeader = 2 }; void setColumn(const QString &); QString column() const; void setGroupHeaderVisible(bool yes = true); bool groupHeaderVisible() const; void setGroupFooterVisible(bool yes = true); bool groupFooterVisible() const; void setPageBreak(PageBreak); PageBreak pageBreak() const; void setSort(Qt::SortOrder); Qt::SortOrder sort(); - ReportSection * groupHeader() const; - ReportSection * groupFooter() const; + KReportDesignerSection * groupHeader() const; + KReportDesignerSection * groupFooter() const; void buildXML(QDomDocument *doc, QDomElement *section) const; void initFromXML( const QDomElement &element ); private: - Q_DISABLE_COPY(ReportSectionDetailGroup) + Q_DISABLE_COPY(KReportDesignerSectionDetailGroup) class Private; Private * const d; }; #endif diff --git a/src/wrtembed/reportsceneview.cpp b/src/wrtembed/KReportDesignerView.cpp similarity index 78% rename from src/wrtembed/reportsceneview.cpp rename to src/wrtembed/KReportDesignerView.cpp index e10435ca..9b44fdc4 100644 --- a/src/wrtembed/reportsceneview.cpp +++ b/src/wrtembed/KReportDesignerView.cpp @@ -1,78 +1,78 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ // // ReportSceneView method implementations // -#include "reportsceneview.h" -#include "KoReportDesigner.h" +#include "KReportDesignerView.h" +#include "KReportDesigner.h" #include "kreport_debug.h" -ReportSceneView::ReportSceneView(KoReportDesigner * designer, QGraphicsScene *scene, QWidget * parent) +KReportDesignerView::KReportDesignerView(KReportDesigner * designer, QGraphicsScene *scene, QWidget * parent) : QGraphicsView(scene, parent) { m_reportDesigner = designer; viewport()->setMouseTracking(true); setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); setCacheMode(QGraphicsView::CacheBackground); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setDragMode(QGraphicsView::RubberBandDrag); setFrameStyle(0); m_reportDesigner->setActiveScene(scene); } -ReportSceneView::~ReportSceneView() +KReportDesignerView::~KReportDesignerView() { viewport()->setMouseTracking(false); } //! @todo check -void ReportSceneView::resizeContents(const QSize &s) +void KReportDesignerView::resizeContents(const QSize &s) { setMinimumSize(s); setMaximumSize(s); } -KoReportDesigner * ReportSceneView::designer() const +KReportDesigner * KReportDesignerView::designer() const { return m_reportDesigner; } -void ReportSceneView::mousePressEvent(QMouseEvent * e) +void KReportDesignerView::mousePressEvent(QMouseEvent * e) { m_reportDesigner->sectionMousePressEvent(this, e); QGraphicsView::mousePressEvent(e); } -void ReportSceneView::mouseReleaseEvent(QMouseEvent * e) +void KReportDesignerView::mouseReleaseEvent(QMouseEvent * e) { m_reportDesigner->sectionMouseReleaseEvent(this, e); QGraphicsView::mouseReleaseEvent(e); } -QSize ReportSceneView::sizeHint() const +QSize KReportDesignerView::sizeHint() const { //kreportDebug() << scene()->width() << "x" << scene()->height(); return QSize(scene()->width(), scene()->height()); } diff --git a/src/wrtembed/reportsceneview.h b/src/wrtembed/KReportDesignerView.h similarity index 76% rename from src/wrtembed/reportsceneview.h rename to src/wrtembed/KReportDesignerView.h index a72de051..f2415191 100644 --- a/src/wrtembed/reportsceneview.h +++ b/src/wrtembed/KReportDesignerView.h @@ -1,46 +1,46 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#ifndef __REPORTSCENEVIEW_H__ -#define __REPORTSCENEVIEW_H__ +#ifndef KREPORTSCENEVIEW_H +#define KREPORTSCENEVIEW_H #include -class KoReportDesigner; +class KReportDesigner; -class ReportSceneView : public QGraphicsView +class KReportDesignerView : public QGraphicsView { Q_OBJECT public: - ReportSceneView(KoReportDesigner *, QGraphicsScene * scene, QWidget * parent = 0); - virtual ~ReportSceneView(); + KReportDesignerView(KReportDesigner *, QGraphicsScene * scene, QWidget * parent = 0); + virtual ~KReportDesignerView(); - KoReportDesigner * designer() const; + KReportDesigner * designer() const; virtual QSize sizeHint() const; public Q_SLOTS: void resizeContents(const QSize&); protected: void mousePressEvent(QMouseEvent * e); void mouseReleaseEvent(QMouseEvent * e); private: - KoReportDesigner* m_reportDesigner; + KReportDesigner* m_reportDesigner; }; #endif diff --git a/src/wrtembed/detailgroupsectiondialog.cpp b/src/wrtembed/KReportDetailGroupSectionDialog.cpp similarity index 87% rename from src/wrtembed/detailgroupsectiondialog.cpp rename to src/wrtembed/KReportDetailGroupSectionDialog.cpp index a21bcccc..b3d10721 100644 --- a/src/wrtembed/detailgroupsectiondialog.cpp +++ b/src/wrtembed/KReportDetailGroupSectionDialog.cpp @@ -1,44 +1,44 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#include "detailgroupsectiondialog.h" +#include "KReportDetailGroupSectionDialog.h" /* * Constructs a DetailGroupSectionDialog as a child of 'parent'. * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. */ -DetailGroupSectionDialog::DetailGroupSectionDialog(QWidget* parent) +KReportDetailGroupSectionDialog::KReportDetailGroupSectionDialog(QWidget* parent) : QDialog(parent) { QWidget *widget = new QWidget(this); setupUi(widget); //! @todo setMainWidget(widget); //! @todo setButtons(Ok | Cancel); //! @todo setCaption(tr("Group Section Editor")); } /* * Destroys the object and frees any allocated resources */ -DetailGroupSectionDialog::~DetailGroupSectionDialog() +KReportDetailGroupSectionDialog::~KReportDetailGroupSectionDialog() { // no need to delete child widgets, Qt does it all for us } diff --git a/src/wrtembed/detailgroupsectiondialog.h b/src/wrtembed/KReportDetailGroupSectionDialog.h similarity index 80% rename from src/wrtembed/detailgroupsectiondialog.h rename to src/wrtembed/KReportDetailGroupSectionDialog.h index dacddaa9..b07cee83 100644 --- a/src/wrtembed/detailgroupsectiondialog.h +++ b/src/wrtembed/KReportDetailGroupSectionDialog.h @@ -1,35 +1,35 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #ifndef DETAILGROUPSECTIONDIALOG_H #define DETAILGROUPSECTIONDIALOG_H #include -#include +#include -class DetailGroupSectionDialog : public QDialog, public Ui::DetailGroupSectionDialog +class KReportDetailGroupSectionDialog : public QDialog, public Ui::DetailGroupSectionDialog { Q_OBJECT public: - explicit DetailGroupSectionDialog(QWidget* parent = 0); - ~DetailGroupSectionDialog(); + explicit KReportDetailGroupSectionDialog(QWidget* parent = 0); + ~KReportDetailGroupSectionDialog(); }; #endif // DETAILGROUPSECTIONDIALOG_H diff --git a/src/wrtembed/detailgroupsectiondialog.ui b/src/wrtembed/KReportDetailGroupSectionDialog.ui similarity index 100% rename from src/wrtembed/detailgroupsectiondialog.ui rename to src/wrtembed/KReportDetailGroupSectionDialog.ui diff --git a/src/wrtembed/reportpropertiesbutton.cpp b/src/wrtembed/KReportPropertiesButton.cpp similarity index 88% rename from src/wrtembed/reportpropertiesbutton.cpp rename to src/wrtembed/KReportPropertiesButton.cpp index a767defb..c9071dbe 100644 --- a/src/wrtembed/reportpropertiesbutton.cpp +++ b/src/wrtembed/KReportPropertiesButton.cpp @@ -1,46 +1,46 @@ /* This file is part of the KDE project Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "reportpropertiesbutton.h" +#include "KReportPropertiesButton.h" #include -ReportPropertiesButton::ReportPropertiesButton(QWidget* parent) : QCheckBox(parent) +KReportPropertiesButton::KReportPropertiesButton(QWidget* parent) : QCheckBox(parent) { setToolTip(tr("Select entire report")); setWhatsThis(tr("A button that allows a report's surface to be selected, allowing its properties to be seen.")); } -void ReportPropertiesButton::paintEvent(QPaintEvent* event) +void KReportPropertiesButton::paintEvent(QPaintEvent* event) { Q_UNUSED(event); QPainter painter(this); QPen pen(palette().windowText(), 2.0, Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin); QColor c(pen.color()); c.setAlpha(120); pen.setColor(c); painter.setPen(pen); painter.drawRect(4, 4, width() - 8, height() - 8); if (isChecked()) { painter.fillRect(7, 7, width() - 14, height() - 14, pen.brush()); } } diff --git a/src/wrtembed/reportpropertiesbutton.h b/src/wrtembed/KReportPropertiesButton.h similarity index 91% rename from src/wrtembed/reportpropertiesbutton.h rename to src/wrtembed/KReportPropertiesButton.h index a3fdd0c8..ce3717cd 100644 --- a/src/wrtembed/reportpropertiesbutton.h +++ b/src/wrtembed/KReportPropertiesButton.h @@ -1,34 +1,34 @@ /* This file is part of the KDE project Copyright (C) 2010 by Adam Pigg (adam@piggz.co.uk) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef REPORTPROPERTIESBUTTON_H #define REPORTPROPERTIESBUTTON_H #include -class ReportPropertiesButton : public QCheckBox +class KReportPropertiesButton : public QCheckBox { Q_OBJECT public: - explicit ReportPropertiesButton(QWidget*); + explicit KReportPropertiesButton(QWidget*); protected: virtual void paintEvent(QPaintEvent*); }; #endif // REPORTPROPERTIESBUTTON_H diff --git a/src/wrtembed/sectioneditor.cpp b/src/wrtembed/KReportSectionEditor.cpp similarity index 71% rename from src/wrtembed/sectioneditor.cpp rename to src/wrtembed/KReportSectionEditor.cpp index ac1894ee..3736211c 100644 --- a/src/wrtembed/sectioneditor.cpp +++ b/src/wrtembed/KReportSectionEditor.cpp @@ -1,538 +1,538 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * Copyright (C) 2012 by Friedrich W. H. Kossebau (kossebau@kde.org) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ -#include "sectioneditor.h" +#include "KReportSectionEditor.h" + +#include "KReportDesigner.h" +#include "KReportSection.h" +#include "KReportDesignerSectionDetail.h" +#include "KReportDetailGroupSectionDialog.h" +#include "KReportDesignerSectionDetailGroup.h" -#include "KoReportDesigner.h" -#include "reportsection.h" -#include "reportsectiondetail.h" -#include "detailgroupsectiondialog.h" -#include "reportsectiondetailgroup.h" #include -// Qt #include #include #include enum { KeyRole = Qt::UserRole }; -// KoReportDesigner currently prepends an empty key/fieldname pair to the list +// KReportDesigner currently prepends an empty key/fieldname pair to the list // of fields, possibly to offer the option to have report elements not yet // bound to fields static inline bool isEditorHelperField(const QString &key) { return key.isEmpty(); } /* * Constructs a SectionEditor as a child of 'parent'. * * The dialog will by default be modeless, unless you set 'modal' to * true to construct a modal dialog. */ -SectionEditor::SectionEditor(QWidget* parent) +KReportSectionEditor::KReportSectionEditor(QWidget* parent) : QDialog(parent) { //! @todo check section editor //setButtons(Close); //setCaption(tr("Section Editor")); QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); QVBoxLayout* mainLayout = new QVBoxLayout(this); QPushButton* closeButton = buttonBox->button(QDialogButtonBox::Close); closeButton->setDefault(true); closeButton->setShortcut(Qt::CTRL | Qt::Key_Return); connect(buttonBox, SIGNAL(rejected()), this, SLOT(accept())); QWidget *widget = new QWidget(this); m_ui.setupUi(widget); m_btnAdd = new QPushButton(QIcon::fromTheme(QLatin1String("list-add")), tr("Add..."), this); m_ui.lGroupSectionsButtons->addWidget(m_btnAdd); m_btnEdit = new QPushButton(QIcon::fromTheme(QLatin1String("document-edit")), tr("Edit..."), this); m_ui.lGroupSectionsButtons->addWidget(m_btnEdit); m_btnRemove = new QPushButton(QIcon::fromTheme(QLatin1String("list-remove")), tr("Delete"), this); m_ui.lGroupSectionsButtons->addWidget(m_btnRemove); m_btnMoveUp = new QPushButton(QIcon::fromTheme(QLatin1String("arrow-up")), tr("Move Up"), this); m_ui.lGroupSectionsButtons->addWidget(m_btnMoveUp); m_btnMoveDown = new QPushButton(QIcon::fromTheme(QLatin1String("arrow-down")), tr("Move Down"), this); m_ui.lGroupSectionsButtons->addWidget(m_btnMoveDown); m_ui.lGroupSectionsButtons->addStretch(); mainLayout->addWidget(widget); mainLayout->addWidget(buttonBox); //setMainWidget(widget); // signals and slots connections connect(m_ui.cbReportHeader, SIGNAL(toggled(bool)), this, SLOT(cbReportHeader_toggled(bool))); connect(m_ui.cbReportFooter, SIGNAL(toggled(bool)), this, SLOT(cbReportFooter_toggled(bool))); connect(m_ui.cbHeadFirst, SIGNAL(toggled(bool)), this, SLOT(cbHeadFirst_toggled(bool))); connect(m_ui.cbHeadLast, SIGNAL(toggled(bool)), this, SLOT(cbHeadLast_toggled(bool))); connect(m_ui.cbHeadEven, SIGNAL(toggled(bool)), this, SLOT(cbHeadEven_toggled(bool))); connect(m_ui.cbHeadOdd, SIGNAL(toggled(bool)), this, SLOT(cbHeadOdd_toggled(bool))); connect(m_ui.cbFootFirst, SIGNAL(toggled(bool)), this, SLOT(cbFootFirst_toggled(bool))); connect(m_ui.cbFootLast, SIGNAL(toggled(bool)), this, SLOT(cbFootLast_toggled(bool))); connect(m_ui.cbFootEven, SIGNAL(toggled(bool)), this, SLOT(cbFootEven_toggled(bool))); connect(m_ui.cbFootOdd, SIGNAL(toggled(bool)), this, SLOT(cbFootOdd_toggled(bool))); connect(m_ui.cbHeadAny, SIGNAL(toggled(bool)), this, SLOT(cbHeadAny_toggled(bool))); connect(m_ui.cbFootAny, SIGNAL(toggled(bool)), this, SLOT(cbFootAny_toggled(bool))); connect(m_ui.lbGroups, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), this, SLOT(updateButtonsForItem(QListWidgetItem*))); connect(m_ui.lbGroups, SIGNAL(currentRowChanged(int)), this, SLOT(updateButtonsForRow(int))); connect(m_btnAdd, SIGNAL(clicked(bool)), this, SLOT(btnAdd_clicked())); connect(m_btnEdit, SIGNAL(clicked(bool)), this, SLOT(btnEdit_clicked())); connect(m_btnRemove, SIGNAL(clicked(bool)), this, SLOT(btnRemove_clicked())); connect(m_btnMoveUp, SIGNAL(clicked(bool)), this, SLOT(btnMoveUp_clicked())); connect(m_btnMoveDown, SIGNAL(clicked(bool)), this, SLOT(brnMoveDown_clicked())); } /* * Destroys the object and frees any allocated resources */ -SectionEditor::~SectionEditor() +KReportSectionEditor::~KReportSectionEditor() { // no need to delete child widgets, Qt does it all for us } -void SectionEditor::cbReportHeader_toggled(bool yes) +void KReportSectionEditor::cbReportHeader_toggled(bool yes) { if (m_reportDesigner) { if (yes) { - m_reportDesigner->insertSection(KRSectionData::ReportHeader); + m_reportDesigner->insertSection(KReportSectionData::ReportHeader); } else { - m_reportDesigner->removeSection(KRSectionData::ReportHeader); + m_reportDesigner->removeSection(KReportSectionData::ReportHeader); } } } -void SectionEditor::cbReportFooter_toggled(bool yes) +void KReportSectionEditor::cbReportFooter_toggled(bool yes) { if (m_reportDesigner) { if (yes) { - m_reportDesigner->insertSection(KRSectionData::ReportFooter); + m_reportDesigner->insertSection(KReportSectionData::ReportFooter); } else { - m_reportDesigner->removeSection(KRSectionData::ReportFooter); + m_reportDesigner->removeSection(KReportSectionData::ReportFooter); } } } -void SectionEditor::cbHeadFirst_toggled(bool yes) +void KReportSectionEditor::cbHeadFirst_toggled(bool yes) { if (m_reportDesigner) { if (yes) { - m_reportDesigner->insertSection(KRSectionData::PageHeaderFirst); + m_reportDesigner->insertSection(KReportSectionData::PageHeaderFirst); } else { - m_reportDesigner->removeSection(KRSectionData::PageHeaderFirst); + m_reportDesigner->removeSection(KReportSectionData::PageHeaderFirst); } } } -void SectionEditor::cbHeadLast_toggled(bool yes) +void KReportSectionEditor::cbHeadLast_toggled(bool yes) { if (m_reportDesigner) { if (yes) { - m_reportDesigner->insertSection(KRSectionData::PageHeaderLast); + m_reportDesigner->insertSection(KReportSectionData::PageHeaderLast); } else { - m_reportDesigner->removeSection(KRSectionData::PageHeaderLast); + m_reportDesigner->removeSection(KReportSectionData::PageHeaderLast); } } } -void SectionEditor::cbHeadEven_toggled(bool yes) +void KReportSectionEditor::cbHeadEven_toggled(bool yes) { if (m_reportDesigner) { if (yes) { - m_reportDesigner->insertSection(KRSectionData::PageHeaderEven); + m_reportDesigner->insertSection(KReportSectionData::PageHeaderEven); } else { - m_reportDesigner->removeSection(KRSectionData::PageHeaderEven); + m_reportDesigner->removeSection(KReportSectionData::PageHeaderEven); } } } -void SectionEditor::cbHeadOdd_toggled(bool yes) +void KReportSectionEditor::cbHeadOdd_toggled(bool yes) { if (m_reportDesigner) { if (yes) { - m_reportDesigner->insertSection(KRSectionData::PageHeaderOdd); + m_reportDesigner->insertSection(KReportSectionData::PageHeaderOdd); } else { - m_reportDesigner->removeSection(KRSectionData::PageHeaderOdd); + m_reportDesigner->removeSection(KReportSectionData::PageHeaderOdd); } } } -void SectionEditor::cbFootFirst_toggled(bool yes) +void KReportSectionEditor::cbFootFirst_toggled(bool yes) { if (m_reportDesigner) { if (yes) { - m_reportDesigner->insertSection(KRSectionData::PageFooterFirst); + m_reportDesigner->insertSection(KReportSectionData::PageFooterFirst); } else { - m_reportDesigner->removeSection(KRSectionData::PageFooterFirst); + m_reportDesigner->removeSection(KReportSectionData::PageFooterFirst); } } } -void SectionEditor::cbFootLast_toggled(bool yes) +void KReportSectionEditor::cbFootLast_toggled(bool yes) { if (m_reportDesigner) { if (yes) { - m_reportDesigner->insertSection(KRSectionData::PageFooterLast); + m_reportDesigner->insertSection(KReportSectionData::PageFooterLast); } else { - m_reportDesigner->removeSection(KRSectionData::PageFooterLast); + m_reportDesigner->removeSection(KReportSectionData::PageFooterLast); } } } -void SectionEditor::cbFootEven_toggled(bool yes) +void KReportSectionEditor::cbFootEven_toggled(bool yes) { if (m_reportDesigner) { if (yes) { - m_reportDesigner->insertSection(KRSectionData::PageFooterEven); + m_reportDesigner->insertSection(KReportSectionData::PageFooterEven); } else { - m_reportDesigner->removeSection(KRSectionData::PageFooterEven); + m_reportDesigner->removeSection(KReportSectionData::PageFooterEven); } } } -void SectionEditor::cbFootOdd_toggled(bool yes) +void KReportSectionEditor::cbFootOdd_toggled(bool yes) { if (m_reportDesigner) { if (yes) { - m_reportDesigner->insertSection(KRSectionData::PageFooterOdd); + m_reportDesigner->insertSection(KReportSectionData::PageFooterOdd); } else { - m_reportDesigner->removeSection(KRSectionData::PageFooterOdd); + m_reportDesigner->removeSection(KReportSectionData::PageFooterOdd); } } } -void SectionEditor::init(KoReportDesigner * rw) +void KReportSectionEditor::init(KReportDesigner * rw) { m_reportDesigner = 0; // set all the properties - m_ui.cbReportHeader->setChecked(rw->section(KRSectionData::ReportHeader)); - m_ui.cbReportFooter->setChecked(rw->section(KRSectionData::ReportFooter)); + m_ui.cbReportHeader->setChecked(rw->section(KReportSectionData::ReportHeader)); + m_ui.cbReportFooter->setChecked(rw->section(KReportSectionData::ReportFooter)); - m_ui.cbHeadFirst->setChecked(rw->section(KRSectionData::PageHeaderFirst)); - m_ui.cbHeadOdd->setChecked(rw->section(KRSectionData::PageHeaderOdd)); - m_ui.cbHeadEven->setChecked(rw->section(KRSectionData::PageHeaderEven)); - m_ui.cbHeadLast->setChecked(rw->section(KRSectionData::PageHeaderLast)); - m_ui.cbHeadAny->setChecked(rw->section(KRSectionData::PageHeaderAny)); + m_ui.cbHeadFirst->setChecked(rw->section(KReportSectionData::PageHeaderFirst)); + m_ui.cbHeadOdd->setChecked(rw->section(KReportSectionData::PageHeaderOdd)); + m_ui.cbHeadEven->setChecked(rw->section(KReportSectionData::PageHeaderEven)); + m_ui.cbHeadLast->setChecked(rw->section(KReportSectionData::PageHeaderLast)); + m_ui.cbHeadAny->setChecked(rw->section(KReportSectionData::PageHeaderAny)); - m_ui.cbFootFirst->setChecked(rw->section(KRSectionData::PageFooterFirst)); - m_ui.cbFootOdd->setChecked(rw->section(KRSectionData::PageFooterOdd)); - m_ui.cbFootEven->setChecked(rw->section(KRSectionData::PageFooterEven)); - m_ui.cbFootLast->setChecked(rw->section(KRSectionData::PageFooterLast)); - m_ui.cbFootAny->setChecked(rw->section(KRSectionData::PageFooterAny)); + m_ui.cbFootFirst->setChecked(rw->section(KReportSectionData::PageFooterFirst)); + m_ui.cbFootOdd->setChecked(rw->section(KReportSectionData::PageFooterOdd)); + m_ui.cbFootEven->setChecked(rw->section(KReportSectionData::PageFooterEven)); + m_ui.cbFootLast->setChecked(rw->section(KReportSectionData::PageFooterLast)); + m_ui.cbFootAny->setChecked(rw->section(KReportSectionData::PageFooterAny)); // now set the rw value m_reportDesigner = rw; m_reportSectionDetail = rw->detailSection(); if (m_reportSectionDetail) { const QStringList columnNames = m_reportDesigner->fieldNames(); const QStringList keys = m_reportDesigner->fieldKeys(); for (int i = 0; i < m_reportSectionDetail->groupSectionCount(); ++i) { const QString key = m_reportSectionDetail->groupSection(i)->column(); const int idx = keys.indexOf(key); const QString columnName = columnNames.value(idx); QListWidgetItem *item = new QListWidgetItem(columnName); item->setData(KeyRole, key); m_ui.lbGroups->addItem(item); } } if (m_ui.lbGroups->count() == 0) { } else { m_ui.lbGroups->setCurrentItem(m_ui.lbGroups->item(0)); } updateButtonsForItem(m_ui.lbGroups->currentItem()); updateAddButton(); updateButtonsForRow(m_ui.lbGroups->currentRow()); } -bool SectionEditor::editDetailGroup(ReportSectionDetailGroup * rsdg) +bool KReportSectionEditor::editDetailGroup(KReportDesignerSectionDetailGroup * rsdg) { - DetailGroupSectionDialog * dgsd = new DetailGroupSectionDialog(this); + KReportDetailGroupSectionDialog * dgsd = new KReportDetailGroupSectionDialog(this); // add the current column and all columns not yet used for groups const QStringList keys = m_reportDesigner->fieldKeys(); const QStringList columnNames = m_reportDesigner->fieldNames(); // in case of to-be-added group that column needs to be added to the used const QSet usedColumns = groupingColumns() << rsdg->column(); // if the current column is not among the keys, something is broken. // for now just simply select no column in the combobox, achieved by -1 int indexOfCurrentColumn = -1; for (int i = 0; i < keys.count(); ++i) { const QString &key = keys.at(i); // skip any editor helper fields if (isEditorHelperField(key)) { continue; } // already used? if (usedColumns.contains(key)) { // and not the one of the group? if (key != rsdg->column()) { continue; } // remember index indexOfCurrentColumn = dgsd->cbColumn->count(); } dgsd->cbColumn->insertItem( i, columnNames.value(i), key); } dgsd->cbColumn->setCurrentIndex(indexOfCurrentColumn); dgsd->cbSort->addItem(tr("Ascending"), Qt::AscendingOrder); dgsd->cbSort->addItem(tr("Descending"), Qt::DescendingOrder); dgsd->cbSort->setCurrentIndex(dgsd->cbSort->findData(rsdg->sort())); - dgsd->breakAfterFooter->setChecked(rsdg->pageBreak() == ReportSectionDetailGroup::BreakAfterGroupFooter); + dgsd->breakAfterFooter->setChecked(rsdg->pageBreak() == KReportDesignerSectionDetailGroup::BreakAfterGroupFooter); dgsd->cbHead->setChecked(rsdg->groupHeaderVisible()); dgsd->cbFoot->setChecked(rsdg->groupFooterVisible()); const bool isOkayed = (dgsd->exec() == QDialog::Accepted); if (isOkayed) { const QString newColumn = dgsd->cbColumn->itemData(dgsd->cbColumn->currentIndex()).toString(); const QString oldColumn = rsdg->column(); if (newColumn != oldColumn) { rsdg->setColumn(newColumn); } rsdg->setGroupHeaderVisible(dgsd->cbHead->isChecked()); rsdg->setGroupFooterVisible(dgsd->cbFoot->isChecked()); - const ReportSectionDetailGroup::PageBreak pageBreak = dgsd->breakAfterFooter->isChecked() ? - ReportSectionDetailGroup::BreakAfterGroupFooter : ReportSectionDetailGroup::BreakNone; + const KReportDesignerSectionDetailGroup::PageBreak pageBreak = dgsd->breakAfterFooter->isChecked() ? + KReportDesignerSectionDetailGroup::BreakAfterGroupFooter : KReportDesignerSectionDetailGroup::BreakNone; rsdg->setPageBreak(pageBreak); const Qt::SortOrder sortOrder = static_cast(dgsd->cbSort->itemData(dgsd->cbSort->currentIndex()).toInt()); rsdg->setSort(sortOrder); } delete dgsd; return isOkayed; } -QString SectionEditor::columnName(const QString &column) const +QString KReportSectionEditor::columnName(const QString &column) const { const QStringList keys = m_reportDesigner->fieldKeys(); const QStringList columnNames = m_reportDesigner->fieldNames(); return columnNames.at(keys.indexOf(column)); } -QSet SectionEditor::groupingColumns() const +QSet KReportSectionEditor::groupingColumns() const { QSet result; for (int i = 0; i < m_ui.lbGroups->count(); ++i) { result.insert(m_ui.lbGroups->item(i)->data(KeyRole).toString()); } return result; } -void SectionEditor::cbHeadAny_toggled(bool yes) +void KReportSectionEditor::cbHeadAny_toggled(bool yes) { if (m_reportDesigner) { if (yes) { - m_reportDesigner->insertSection(KRSectionData::PageHeaderAny); + m_reportDesigner->insertSection(KReportSectionData::PageHeaderAny); } else { - m_reportDesigner->removeSection(KRSectionData::PageHeaderAny); + m_reportDesigner->removeSection(KReportSectionData::PageHeaderAny); } } } -void SectionEditor::cbFootAny_toggled(bool yes) +void KReportSectionEditor::cbFootAny_toggled(bool yes) { if (m_reportDesigner) { if (yes) { - m_reportDesigner->insertSection(KRSectionData::PageFooterAny); + m_reportDesigner->insertSection(KReportSectionData::PageFooterAny); } else { - m_reportDesigner->removeSection(KRSectionData::PageFooterAny); + m_reportDesigner->removeSection(KReportSectionData::PageFooterAny); } } } -void SectionEditor::btnEdit_clicked() +void KReportSectionEditor::btnEdit_clicked() { if (m_reportSectionDetail) { const int idx = m_ui.lbGroups->currentRow(); if (idx < 0) { return; } - ReportSectionDetailGroup * rsdg = m_reportSectionDetail->groupSection(idx); + KReportDesignerSectionDetailGroup * rsdg = m_reportSectionDetail->groupSection(idx); if (editDetailGroup(rsdg)) { // update name in list m_ui.lbGroups->item(idx)->setText(columnName(rsdg->column())); } } } -void SectionEditor::btnAdd_clicked() +void KReportSectionEditor::btnAdd_clicked() { if (m_reportSectionDetail) { // lets add a new section // search for unused column QString column; const QStringList keys = m_reportDesigner->fieldKeys(); const QSet columns = groupingColumns(); foreach(const QString &key, keys) { // skip any editor helper fields if (isEditorHelperField(key)) { continue; } if (! columns.contains(key)) { column = key; break; } } // should not happen, but we do not really know if m_reportDesigner is in sync if (column.isEmpty()) { return; } // create new group, have it edited and add it, if not cancelled - ReportSectionDetailGroup * rsdg = - new ReportSectionDetailGroup(column, m_reportSectionDetail, m_reportSectionDetail); + KReportDesignerSectionDetailGroup * rsdg = + new KReportDesignerSectionDetailGroup(column, m_reportSectionDetail, m_reportSectionDetail); if (editDetailGroup(rsdg)) { // append to group sections m_reportSectionDetail->insertGroupSection(m_reportSectionDetail->groupSectionCount(), rsdg); // add to combobox const QString column = rsdg->column(); QListWidgetItem *item = new QListWidgetItem(columnName(column)); item->setData(KeyRole, column); m_ui.lbGroups->addItem(item); m_ui.lbGroups->setCurrentRow(m_ui.lbGroups->count() - 1); updateAddButton(); } else { delete rsdg; } } } -void SectionEditor::btnRemove_clicked() +void KReportSectionEditor::btnRemove_clicked() { if (m_reportSectionDetail) { const int index = m_ui.lbGroups->currentRow(); if (index != -1) { QListWidgetItem *item = m_ui.lbGroups->takeItem(index); delete item; m_reportSectionDetail->removeGroupSection(index, true); // a field got usable, so make sure add button is available again m_btnAdd->setEnabled(true); // workaround for at least Qt 4.8.1, which does not emit the proper // currentRowChanged signal on deletion of the first element updateButtonsForRow(m_ui.lbGroups->currentRow()); } } } -void SectionEditor::btnMoveUp_clicked() +void KReportSectionEditor::btnMoveUp_clicked() { if (m_reportSectionDetail) { int idx = m_ui.lbGroups->currentRow(); if (idx <= 0) return; QString s = m_ui.lbGroups->currentItem()->text(); m_ui.lbGroups->takeItem(idx); m_ui.lbGroups->insertItem(idx - 1, s); m_ui.lbGroups->setCurrentRow(idx - 1, QItemSelectionModel::ClearAndSelect); - ReportSectionDetailGroup * rsdg = m_reportSectionDetail->groupSection(idx); + KReportDesignerSectionDetailGroup * rsdg = m_reportSectionDetail->groupSection(idx); bool showgh = rsdg->groupHeaderVisible(); bool showgf = rsdg->groupFooterVisible(); m_reportSectionDetail->removeGroupSection(idx); m_reportSectionDetail->insertGroupSection(idx - 1, rsdg); rsdg->setGroupHeaderVisible(showgh); rsdg->setGroupFooterVisible(showgf); } } -void SectionEditor::brnMoveDown_clicked() +void KReportSectionEditor::brnMoveDown_clicked() { if (m_reportSectionDetail) { int idx = m_ui.lbGroups->currentRow(); if (idx == (int)(m_ui.lbGroups->count() - 1)) return; QString s = m_ui.lbGroups->currentItem()->text(); m_ui.lbGroups->takeItem(idx); m_ui.lbGroups->insertItem (idx + 1, s); m_ui.lbGroups->setCurrentRow(idx + 1, QItemSelectionModel::ClearAndSelect); - ReportSectionDetailGroup * rsdg = m_reportSectionDetail->groupSection(idx); + KReportDesignerSectionDetailGroup * rsdg = m_reportSectionDetail->groupSection(idx); bool showgh = rsdg->groupHeaderVisible(); bool showgf = rsdg->groupFooterVisible(); m_reportSectionDetail->removeGroupSection(idx); m_reportSectionDetail->insertGroupSection(idx + 1, rsdg); rsdg->setGroupHeaderVisible(showgh); rsdg->setGroupFooterVisible(showgf); } } -void SectionEditor::updateButtonsForItem(QListWidgetItem* currentItem) +void KReportSectionEditor::updateButtonsForItem(QListWidgetItem* currentItem) { const bool isItemSelected = (currentItem != 0); m_btnEdit->setEnabled(isItemSelected); m_btnRemove->setEnabled(isItemSelected); } -void SectionEditor::updateButtonsForRow(int row) +void KReportSectionEditor::updateButtonsForRow(int row) { const bool enableMoveUpButton = (row > 0); const bool enableMoveDownButton = (0 <= row) && (row+1 < m_ui.lbGroups->count()); m_btnMoveUp->setEnabled(enableMoveUpButton); m_btnMoveDown->setEnabled(enableMoveDownButton); } -void SectionEditor::updateAddButton() +void KReportSectionEditor::updateAddButton() { // search for unused column bool foundUnusedColumn = false; const QStringList keys = m_reportDesigner->fieldKeys(); const QSet columns = groupingColumns(); foreach(const QString &key, keys) { // skip any editor helper fields if (isEditorHelperField(key)) { continue; } if (! columns.contains(key)) { foundUnusedColumn = true; break; } } m_btnAdd->setEnabled(foundUnusedColumn); } diff --git a/src/wrtembed/sectioneditor.h b/src/wrtembed/KReportSectionEditor.h similarity index 81% rename from src/wrtembed/sectioneditor.h rename to src/wrtembed/KReportSectionEditor.h index b78fcf43..25b6c325 100644 --- a/src/wrtembed/sectioneditor.h +++ b/src/wrtembed/KReportSectionEditor.h @@ -1,85 +1,85 @@ /* This file is part of the KDE project * Copyright (C) 2001-2007 by OpenMFG, LLC (info@openmfg.com) * Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk) * Copyright (C) 2012 by Friedrich W. H. Kossebau (kossebau@kde.org) * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . */ #ifndef SECTIONEDITOR_H #define SECTIONEDITOR_H #include #include -#include +#include -class KoReportDesigner; -class ReportSectionDetail; -class ReportSectionDetailGroup; +class KReportDesigner; +class KReportDesignerSectionDetail; +class KReportDesignerSectionDetailGroup; -class SectionEditor : public QDialog +class KReportSectionEditor : public QDialog { Q_OBJECT public: - explicit SectionEditor(QWidget* parent = 0); - ~SectionEditor(); + explicit KReportSectionEditor(QWidget* parent = 0); + ~KReportSectionEditor(); public: - void init(KoReportDesigner *rd); + void init(KReportDesigner *rd); private Q_SLOTS: void cbReportHeader_toggled(bool yes); void cbReportFooter_toggled(bool yes); void cbHeadFirst_toggled(bool yes); void cbHeadLast_toggled(bool yes); void cbHeadEven_toggled(bool yes); void cbHeadOdd_toggled(bool yes); void cbFootFirst_toggled(bool yes); void cbFootLast_toggled(bool yes); void cbFootEven_toggled(bool yes); void cbFootOdd_toggled(bool yes); void cbHeadAny_toggled(bool yes); void cbFootAny_toggled(bool yes); void btnAdd_clicked(); void btnEdit_clicked(); void btnRemove_clicked(); void btnMoveUp_clicked(); void brnMoveDown_clicked(); void updateButtonsForItem(QListWidgetItem *currentItem); void updateButtonsForRow(int row); private: - bool editDetailGroup(ReportSectionDetailGroup *rsdg); + bool editDetailGroup(KReportDesignerSectionDetailGroup *rsdg); void updateAddButton(); QString columnName(const QString &column) const; QSet groupingColumns() const; private: Ui::SectionEditor m_ui; QPushButton *m_btnAdd; QPushButton *m_btnEdit; QPushButton *m_btnRemove; QPushButton *m_btnMoveUp; QPushButton *m_btnMoveDown; - KoReportDesigner *m_reportDesigner; - ReportSectionDetail *m_reportSectionDetail; + KReportDesigner *m_reportDesigner; + KReportDesignerSectionDetail *m_reportSectionDetail; }; #endif // SECTIONEDITOR_H diff --git a/src/wrtembed/sectioneditor.ui b/src/wrtembed/KReportSectionEditor.ui similarity index 100% rename from src/wrtembed/sectioneditor.ui rename to src/wrtembed/KReportSectionEditor.ui