diff --git a/autotests/PluginsTest.cpp b/autotests/PluginsTest.cpp --- a/autotests/PluginsTest.cpp +++ b/autotests/PluginsTest.cpp @@ -17,8 +17,8 @@ #include "PluginsTest.h" -#include -#include +#include +#include #include #include @@ -37,14 +37,14 @@ 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() @@ -124,7 +124,7 @@ void PluginsTest::checkBuiltInPlugins() { - KoReportPluginManager* manager = KoReportPluginManager::self(); + KReportPluginManager* manager = KReportPluginManager::self(); QStringList pluginIds = manager->pluginIds(); QCOMPARE(pluginIds.toSet().count(), pluginIds.count()); QSet builtInPlugins( @@ -135,7 +135,7 @@ << "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); diff --git a/autotests/format/FormatTest.cpp b/autotests/format/FormatTest.cpp --- a/autotests/format/FormatTest.cpp +++ b/autotests/format/FormatTest.cpp @@ -21,18 +21,18 @@ #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 @@ -92,14 +92,14 @@ //! @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(); @@ -125,21 +125,21 @@ #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); @@ -197,23 +197,23 @@ //! @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"))); diff --git a/autotests/headers/CMakeLists.txt b/autotests/headers/CMakeLists.txt --- a/autotests/headers/CMakeLists.txt +++ b/autotests/headers/CMakeLists.txt @@ -20,44 +20,44 @@ 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 diff --git a/autotests/headers/KReportAsyncItemBase_HeaderTest.cpp b/autotests/headers/KReportAsyncItemBase_HeaderTest.cpp new file mode 100644 --- /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 --- /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 --- /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 --- /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 --- /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 --- /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 --- /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 --- /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 --- /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 --- /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 --- /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 --- /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 --- /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 --- /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 --- /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 --- /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 --- /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 --- /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 --- /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 --- /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 --- /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 --- /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 --- /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 --- /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 --- /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 --- /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 --- /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 --- /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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- 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 --- a/autotests/headers/reportsectiondetailgroup_HeaderTest.cpp +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -8,7 +8,7 @@ -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 diff --git a/examples/KReportExampleData.h b/examples/KReportExampleData.h --- a/examples/KReportExampleData.h +++ b/examples/KReportExampleData.h @@ -20,12 +20,12 @@ #ifndef KREPORTEXAMPLEDATA_H #define KREPORTEXAMPLEDATA_H -#include +#include #include #include #include -class KReportExampleData : public KoReportData +class KReportExampleData : public KReportData { public: KReportExampleData(); diff --git a/examples/designerwindow.h b/examples/designerwindow.h --- a/examples/designerwindow.h +++ b/examples/designerwindow.h @@ -27,7 +27,7 @@ #include class QScrollArea; -class KoReportDesigner; +class KReportDesigner; /*! @short KReportExample application's design window */ class DesignerWindow : public QMainWindow @@ -48,7 +48,7 @@ private: QScrollArea * m_scrollArea; - KoReportDesigner *m_reportDesigner; + KReportDesigner *m_reportDesigner; KPropertySet *m_propertySet; QToolBar *m_mainToolbar; diff --git a/examples/designerwindow.cpp b/examples/designerwindow.cpp --- a/examples/designerwindow.cpp +++ b/examples/designerwindow.cpp @@ -20,7 +20,7 @@ #include "designerwindow.h" #include "KReportExampleData.h" -#include +#include #include #include @@ -33,7 +33,7 @@ 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")); @@ -45,7 +45,7 @@ } QActionGroup *group = new QActionGroup(this); - QList itemActions = KoReportDesigner::itemActions(group); + QList itemActions = KReportDesigner::itemActions(group); foreach(QAction* action, itemActions) { m_itemToolbar->addAction(action); } diff --git a/examples/window.h b/examples/window.h --- a/examples/window.h +++ b/examples/window.h @@ -26,9 +26,9 @@ #include #include -#include -#include -#include +#include +#include +#include /*! @short KReportExample application's main window */ class Window : public QMainWindow diff --git a/examples/window.cpp b/examples/window.cpp --- a/examples/window.cpp +++ b/examples/window.cpp @@ -18,16 +18,16 @@ */ #include "window.h" -#include +#include #include #include #include #include #include -#include -#include +#include +#include Window::Window() : QMainWindow() @@ -39,15 +39,15 @@ #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); } @@ -90,7 +90,7 @@ void Window::showDesign(const QDomElement &design) { qDebug() << "Show design"; - KoReportPreRenderer preRenderer(design); + KReportPreRenderer preRenderer(design); if (!preRenderer.isValid()) { return; } diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -13,22 +13,22 @@ 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 @@ -39,69 +39,69 @@ ${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 @@ -115,21 +115,21 @@ #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) @@ -241,8 +241,7 @@ 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}" @@ -254,60 +253,60 @@ 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 diff --git a/src/common/KoReportASyncItemBase.h b/src/common/KReportAsyncItemBase.h rename from src/common/KoReportASyncItemBase.h rename to src/common/KReportAsyncItemBase.h --- a/src/common/KoReportASyncItemBase.h +++ b/src/common/KReportAsyncItemBase.h @@ -17,19 +17,19 @@ */ -#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/KoReportASyncItemBase.cpp b/src/common/KReportAsyncItemBase.cpp rename from src/common/KoReportASyncItemBase.cpp rename to src/common/KReportAsyncItemBase.cpp --- a/src/common/KoReportASyncItemBase.cpp +++ b/src/common/KReportAsyncItemBase.cpp @@ -17,4 +17,4 @@ */ -#include "KoReportASyncItemBase.h" +#include "KReportAsyncItemBase.h" diff --git a/src/common/KoReportData.h b/src/common/KReportData.h rename from src/common/KoReportData.h rename to src/common/KReportData.h --- a/src/common/KoReportData.h +++ b/src/common/KReportData.h @@ -14,8 +14,8 @@ * 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 @@ -26,11 +26,11 @@ /** */ -class KREPORT_EXPORT KoReportData +class KREPORT_EXPORT KReportData { public: - virtual ~KoReportData(); + virtual ~KReportData(); //! Describes sorting for single field /*! By default the order is ascending. */ @@ -114,7 +114,7 @@ //! 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/KoReportData.cpp b/src/common/KReportData.cpp rename from src/common/KoReportData.cpp rename to src/common/KReportData.cpp --- a/src/common/KoReportData.cpp +++ b/src/common/KReportData.cpp @@ -15,64 +15,64 @@ * 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/KReportDesign.cpp b/src/common/KReportDesign.cpp --- a/src/common/KReportDesign.cpp +++ b/src/common/KReportDesign.cpp @@ -22,8 +22,8 @@ #include "KReportElement.h" #include "KReportUnit.h" #include "KReportUtils.h" -#include "KoReportPluginManager.h" -#include "KoReportPluginInterface.h" +#include "KReportPluginManager.h" +#include "KReportPluginInterface.h" #include #include @@ -112,7 +112,7 @@ { 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; diff --git a/src/common/KReportDesign_p.h b/src/common/KReportDesign_p.h --- a/src/common/KReportDesign_p.h +++ b/src/common/KReportDesign_p.h @@ -29,7 +29,7 @@ class QDomDocument; class QDomElement; -class KoReportPluginInterface; +class KReportPluginInterface; static const bool DEFAULT_SHOW_GRID = true; static const bool DEFAULT_SNAP_TO_GRID = true; @@ -78,7 +78,7 @@ //! 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; diff --git a/src/common/KReportDesign_p.cpp b/src/common/KReportDesign_p.cpp --- a/src/common/KReportDesign_p.cpp +++ b/src/common/KReportDesign_p.cpp @@ -20,8 +20,8 @@ #include "KReportDesign_p.h" #include "KReportElement.h" #include "KReportUtils.h" -#include "KoReportPluginManager.h" -#include "KoReportPluginInterface.h" +#include "KReportPluginManager.h" +#include "KReportPluginInterface.h" #include #include @@ -174,11 +174,11 @@ 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; @@ -198,7 +198,7 @@ } 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(); } @@ -302,9 +302,9 @@ } 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") { diff --git a/src/common/krdetailsectiondata.h b/src/common/KReportDetailSectionData.h rename from src/common/krdetailsectiondata.h rename to src/common/KReportDetailSectionData.h --- a/src/common/krdetailsectiondata.h +++ b/src/common/KReportDetailSectionData.h @@ -16,41 +16,41 @@ * 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; @@ -60,10 +60,10 @@ bool m_valid; }; -class ORDetailGroupSectionData +class KReportDetailGroupSectionData { public: - ORDetailGroupSectionData(); + KReportDetailGroupSectionData(); enum PageBreak { BreakNone = 0, @@ -76,8 +76,8 @@ 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/krdetailsectiondata.cpp b/src/common/KReportDetailSectionData.cpp rename from src/common/krdetailsectiondata.cpp rename to src/common/KReportDetailSectionData.cpp --- a/src/common/krdetailsectiondata.cpp +++ b/src/common/KReportDetailSectionData.cpp @@ -16,22 +16,22 @@ * 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; @@ -48,20 +48,20 @@ 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; } } @@ -74,29 +74,29 @@ 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 @@ -109,11 +109,11 @@ m_valid = true; } -KRDetailSectionData::~KRDetailSectionData() +KReportDetailSectionData::~KReportDetailSectionData() { } -ORDetailGroupSectionData::ORDetailGroupSectionData() +KReportDetailGroupSectionData::KReportDetailGroupSectionData() { m_pagebreak = BreakNone; m_sort = Qt::AscendingOrder; diff --git a/src/common/krreportdata.h b/src/common/KReportDocument.h rename from src/common/krreportdata.h rename to src/common/KReportDocument.h --- a/src/common/krreportdata.h +++ b/src/common/KReportDocument.h @@ -16,15 +16,15 @@ * 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 @@ -35,43 +35,43 @@ /** */ -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; @@ -89,7 +89,7 @@ return m_externalData; } - KRDetailSectionData* detail() const { + KReportDetailSectionData* detail() const { return m_detailSection; } @@ -100,7 +100,7 @@ return m_name; } - ReportPageOptions pageOptions() const; + KReportPageOptions pageOptions() const; protected: QString m_title; @@ -112,33 +112,33 @@ #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 }; diff --git a/src/common/krreportdata.cpp b/src/common/KReportDocument.cpp rename from src/common/krreportdata.cpp rename to src/common/KReportDocument.cpp --- a/src/common/krreportdata.cpp +++ b/src/common/KReportDocument.cpp @@ -15,32 +15,32 @@ * 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) { @@ -98,56 +98,56 @@ 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; @@ -167,23 +167,23 @@ } -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(); } @@ -196,37 +196,37 @@ } /*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; } @@ -241,65 +241,65 @@ 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/KoReportItemBase.h b/src/common/KReportItemBase.h rename from src/common/KoReportItemBase.h rename to src/common/KReportItemBase.h --- a/src/common/KoReportItemBase.h +++ b/src/common/KReportItemBase.h @@ -15,27 +15,28 @@ * 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; @@ -54,24 +55,25 @@ }; -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 @@ -83,13 +85,13 @@ @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 @@ -110,25 +112,25 @@ 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*); }; diff --git a/src/common/KoReportItemBase.cpp b/src/common/KReportItemBase.cpp rename from src/common/KoReportItemBase.cpp rename to src/common/KReportItemBase.cpp --- a/src/common/KoReportItemBase.cpp +++ b/src/common/KReportItemBase.cpp @@ -15,53 +15,53 @@ * 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) @@ -71,8 +71,8 @@ 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) @@ -82,37 +82,37 @@ 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/KoReportItemLine.h b/src/common/KReportItemLine.h rename from src/common/KoReportItemLine.h rename to src/common/KReportItemLine.h --- a/src/common/KoReportItemLine.h +++ b/src/common/KReportItemLine.h @@ -15,11 +15,11 @@ * 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; @@ -31,31 +31,31 @@ /** */ -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: diff --git a/src/common/KoReportItemLine.cpp b/src/common/KReportItemLine.cpp rename from src/common/KoReportItemLine.cpp rename to src/common/KReportItemLine.cpp --- a/src/common/KoReportItemLine.cpp +++ b/src/common/KReportItemLine.cpp @@ -15,20 +15,20 @@ * 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(); @@ -51,24 +51,24 @@ 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")); @@ -86,31 +86,32 @@ 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) @@ -135,18 +136,18 @@ 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/labelsizeinfo.h b/src/common/KReportLabelSizeInfo.h rename from src/common/labelsizeinfo.h rename to src/common/KReportLabelSizeInfo.h --- a/src/common/labelsizeinfo.h +++ b/src/common/KReportLabelSizeInfo.h @@ -21,12 +21,12 @@ #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; @@ -45,7 +45,7 @@ bool isNull() const; - static LabelSizeInfo find(const QString &); + static KReportLabelSizeInfo find(const QString &); static QStringList labelNames(); protected: diff --git a/src/common/labelsizeinfo.cpp b/src/common/KReportLabelSizeInfo.cpp rename from src/common/labelsizeinfo.cpp rename to src/common/KReportLabelSizeInfo.cpp --- a/src/common/labelsizeinfo.cpp +++ b/src/common/KReportLabelSizeInfo.cpp @@ -16,34 +16,34 @@ * 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) { @@ -65,7 +65,7 @@ m_null = false; } -LabelSizeInfo::LabelSizeInfo() +KReportLabelSizeInfo::KReportLabelSizeInfo() { m_columns = 0; m_rows = 0; @@ -82,60 +82,60 @@ 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/reportpageoptions.h b/src/common/KReportPageOptions.h rename from src/common/reportpageoptions.h rename to src/common/KReportPageOptions.h --- a/src/common/reportpageoptions.h +++ b/src/common/KReportPageOptions.h @@ -16,22 +16,22 @@ * 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 diff --git a/src/common/reportpageoptions.cpp b/src/common/KReportPageOptions.cpp rename from src/common/reportpageoptions.cpp rename to src/common/KReportPageOptions.cpp --- a/src/common/reportpageoptions.cpp +++ b/src/common/KReportPageOptions.cpp @@ -16,13 +16,13 @@ * 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; @@ -34,7 +34,7 @@ m_customHeight = 11.0; } -ReportPageOptions::ReportPageOptions(const ReportPageOptions & rpo) +KReportPageOptions::KReportPageOptions(const KReportPageOptions & rpo) : QObject() { m_marginTop = rpo.m_marginTop; @@ -51,7 +51,7 @@ 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; @@ -69,127 +69,127 @@ 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; @@ -199,7 +199,7 @@ } //Convenience functions that return the page width/height in pixels based on the DPI -qreal ReportPageOptions::widthPx() +qreal KReportPageOptions::widthPx() { int pageWidth; @@ -217,7 +217,7 @@ return pageWidth; } -qreal ReportPageOptions::heightPx() +qreal KReportPageOptions::heightPx() { int pageHeight; diff --git a/src/common/KoReportPluginInterface.h b/src/common/KReportPluginInterface.h rename from src/common/KoReportPluginInterface.h rename to src/common/KReportPluginInterface.h --- a/src/common/KoReportPluginInterface.h +++ b/src/common/KReportPluginInterface.h @@ -32,27 +32,27 @@ 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; @@ -62,7 +62,7 @@ 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 @@ -72,7 +72,7 @@ friend class KReportPluginEntry; void setMetaData(KReportPluginMetaData* metaData); - Q_DISABLE_COPY(KoReportPluginInterface) + Q_DISABLE_COPY(KReportPluginInterface) class Private; Private * const d; }; diff --git a/src/common/KoReportPluginInterface.cpp b/src/common/KReportPluginInterface.cpp rename from src/common/KoReportPluginInterface.cpp rename to src/common/KReportPluginInterface.cpp --- a/src/common/KoReportPluginInterface.cpp +++ b/src/common/KReportPluginInterface.cpp @@ -18,14 +18,14 @@ 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) {} @@ -36,28 +36,28 @@ // --- -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); diff --git a/src/common/KoReportPluginManager.h b/src/common/KReportPluginManager.h rename from src/common/KoReportPluginManager.h rename to src/common/KReportPluginManager.h --- a/src/common/KoReportPluginManager.h +++ b/src/common/KReportPluginManager.h @@ -18,47 +18,47 @@ 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/KoReportPluginManager.cpp b/src/common/KReportPluginManager.cpp rename from src/common/KoReportPluginManager.cpp rename to src/common/KReportPluginManager.cpp --- a/src/common/KoReportPluginManager.cpp +++ b/src/common/KReportPluginManager.cpp @@ -18,22 +18,22 @@ 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); @@ -46,7 +46,7 @@ { } -KReportPluginEntry::KReportPluginEntry(KoReportPluginInterface *staticInterface) +KReportPluginEntry::KReportPluginEntry(KReportPluginInterface *staticInterface) : m_loader(0), m_interface(staticInterface), m_metaData(0) { } @@ -57,7 +57,7 @@ delete m_interface; } -KoReportPluginInterface* KReportPluginEntry::plugin() +KReportPluginInterface* KReportPluginEntry::plugin() { if (m_interface) { return m_interface; @@ -75,7 +75,7 @@ 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; @@ -121,13 +121,13 @@ // --- -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(); @@ -176,7 +176,7 @@ if (!factory()) return 0; - KoReportPluginInterface* plugin = factory()->create(parent); + KReportPluginInterface* plugin = factory()->create(parent); if (plugin) { plugin->setObjectName(pluginName()); } @@ -186,29 +186,29 @@ #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")); @@ -228,46 +228,46 @@ // --- -//! 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; @@ -283,7 +283,7 @@ return entry->plugin(); } -QList KoReportPluginManager::actions() +QList KReportPluginManager::actions() { const QMap *plugins = d->plugins(); QList actList; diff --git a/src/common/KoReportPluginManagerPrivate.h b/src/common/KReportPluginManagerPrivate.h rename from src/common/KoReportPluginManagerPrivate.h rename to src/common/KReportPluginManagerPrivate.h --- a/src/common/KoReportPluginManagerPrivate.h +++ b/src/common/KReportPluginManagerPrivate.h @@ -18,15 +18,15 @@ 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 @@ -37,11 +37,11 @@ KReportPluginEntry(); //! Used for static plugins. - KReportPluginEntry(KoReportPluginInterface *staticInterface); + KReportPluginEntry(KReportPluginInterface *staticInterface); ~KReportPluginEntry(); - KoReportPluginInterface* plugin(); + KReportPluginInterface* plugin(); void setBuiltIn(bool set); @@ -58,17 +58,17 @@ 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(); @@ -79,7 +79,7 @@ void addBuiltInPlugin(const QJsonObject &json); private: - KoReportPluginManager *q; + KReportPluginManager *q; QObject *m_parent; bool m_findPlugins; void findPlugins(); diff --git a/src/common/KReportPluginMetaData.h b/src/common/KReportPluginMetaData.h --- a/src/common/KReportPluginMetaData.h +++ b/src/common/KReportPluginMetaData.h @@ -18,8 +18,8 @@ Boston, MA 02110-1301, USA. */ -#ifndef KOREPORTPLUGININFO_H -#define KOREPORTPLUGININFO_H +#ifndef KREPORTPLUGININFO_H +#define KREPORTPLUGININFO_H #include @@ -60,4 +60,4 @@ Private * const d; }; -#endif // KOREPORTPLUGININFO_H +#endif // KREPORTPLUGININFO_H diff --git a/src/common/krpos.h b/src/common/KReportPosition.h rename from src/common/krpos.h rename to src/common/KReportPosition.h --- a/src/common/krpos.h +++ b/src/common/KReportPosition.h @@ -28,17 +28,17 @@ /** */ -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; diff --git a/src/common/krpos.cpp b/src/common/KReportPosition.cpp rename from src/common/krpos.cpp rename to src/common/KReportPosition.cpp --- a/src/common/krpos.cpp +++ b/src/common/KReportPosition.cpp @@ -16,30 +16,30 @@ * 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); @@ -53,7 +53,7 @@ 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()); @@ -65,27 +65,27 @@ 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); @@ -95,7 +95,7 @@ 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()); diff --git a/src/common/renderobjects.h b/src/common/KReportRenderObjects.h rename from src/common/renderobjects.h rename to src/common/KReportRenderObjects.h --- a/src/common/renderobjects.h +++ b/src/common/KReportRenderObjects.h @@ -15,8 +15,8 @@ * 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 @@ -28,9 +28,11 @@ #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; @@ -72,8 +74,8 @@ OROSection* section(int); void addSection(OROSection*); - void setPageOptions(const ReportPageOptions &); - ReportPageOptions pageOptions() const { + void setPageOptions(const KReportPageOptions &); + KReportPageOptions pageOptions() const { return m_pageOptions; }; @@ -83,7 +85,7 @@ QString m_title; QList m_pages; QList m_sections; - ReportPageOptions m_pageOptions; + KReportPageOptions m_pageOptions; Q_SIGNALS: void updated(int pageNo); @@ -149,10 +151,10 @@ 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; } @@ -168,7 +170,7 @@ QList m_primitives; long m_row; int m_height; - KRSectionData::Section m_type; + KReportSectionData::Section m_type; QColor m_backgroundColor; private: @@ -238,10 +240,10 @@ } 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 &); @@ -266,7 +268,7 @@ 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; @@ -294,16 +296,16 @@ }; 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; }; // @@ -458,11 +460,11 @@ 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) { @@ -476,7 +478,7 @@ QSizeF m_size; QString m_checkType; bool m_value; - KRLineStyleData m_lineStyle; + KReportLineStyle m_lineStyle; QColor m_fgColor; diff --git a/src/common/renderobjects.cpp b/src/common/KReportRenderObjects.cpp rename from src/common/renderobjects.cpp rename to src/common/KReportRenderObjects.cpp --- a/src/common/renderobjects.cpp +++ b/src/common/KReportRenderObjects.cpp @@ -15,7 +15,7 @@ * 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" @@ -76,7 +76,7 @@ m_sections.append(s); } -void ORODocument::setPageOptions(const ReportPageOptions & options) +void ORODocument::setPageOptions(const KReportPageOptions & options) { m_pageOptions = options; } @@ -244,9 +244,9 @@ { 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; @@ -268,7 +268,7 @@ m_textStyle = ts; } -void OROTextBox::setLineStyle(const KRLineStyleData & ls) +void OROTextBox::setLineStyle(const KReportLineStyle & ls) { m_lineStyle = ls; } @@ -321,7 +321,7 @@ m_endPoint = p; } -void OROLine::setLineStyle(const KRLineStyleData& ls) +void OROLine::setLineStyle(const KReportLineStyle& ls) { m_lineStyle = ls; } diff --git a/src/common/KReportSection.cpp b/src/common/KReportSection.cpp --- a/src/common/KReportSection.cpp +++ b/src/common/KReportSection.cpp @@ -20,14 +20,14 @@ #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()); @@ -46,24 +46,24 @@ 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); } @@ -76,12 +76,12 @@ 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(); } diff --git a/src/common/krsectiondata.h b/src/common/KReportSectionData.h rename from src/common/krsectiondata.h rename to src/common/KReportSectionData.h --- a/src/common/krsectiondata.h +++ b/src/common/KReportSectionData.h @@ -17,31 +17,31 @@ * 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: @@ -64,9 +64,9 @@ 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; } @@ -79,7 +79,7 @@ return m_height->value().toDouble(); } - QList objects() const { + QList objects() const { return m_objects; } @@ -93,27 +93,27 @@ 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/krsectiondata.cpp b/src/common/KReportSectionData.cpp rename from src/common/krsectiondata.cpp rename to src/common/KReportSectionData.cpp --- a/src/common/krsectiondata.cpp +++ b/src/common/KReportSectionData.cpp @@ -17,26 +17,26 @@ * 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()); @@ -47,32 +47,32 @@ } 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); } @@ -86,23 +86,23 @@ 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")); @@ -116,59 +116,59 @@ 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: @@ -178,43 +178,43 @@ 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/krsize.h b/src/common/KReportSize.h rename from src/common/krsize.h rename to src/common/KReportSize.h --- a/src/common/krsize.h +++ b/src/common/KReportSize.h @@ -14,8 +14,8 @@ * 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 @@ -26,16 +26,16 @@ /** */ -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; diff --git a/src/common/krsize.cpp b/src/common/KReportSize.cpp rename from src/common/krsize.cpp rename to src/common/KReportSize.cpp --- a/src/common/krsize.cpp +++ b/src/common/KReportSize.cpp @@ -15,25 +15,25 @@ * 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; @@ -48,7 +48,7 @@ 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()); @@ -60,36 +60,36 @@ 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()); diff --git a/src/common/KoReportStaticPluginInterface.h b/src/common/KReportStaticPluginInterface.h rename from src/common/KoReportStaticPluginInterface.h rename to src/common/KReportStaticPluginInterface.h --- a/src/common/KoReportStaticPluginInterface.h +++ b/src/common/KReportStaticPluginInterface.h @@ -22,7 +22,7 @@ #define QT_STATICPLUGIN -#include "KoReportPluginInterface.h" +#include "KReportPluginInterface.h" //! Declaration to put in all static plugin headers #define KREPORT_DECLARE_STATIC_PLUGIN(name) \ diff --git a/src/common/KReportUtils.h b/src/common/KReportUtils.h --- a/src/common/KReportUtils.h +++ b/src/common/KReportUtils.h @@ -32,10 +32,10 @@ class QFont; class QPointF; class KProperty; -class KRPos; -class KRSize; +class KReportPosition; +class KReportSize; class KRTextStyleData; -class KRLineStyleData; +class KReportLineStyle; namespace KReportUtils { @@ -90,13 +90,13 @@ 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); @@ -114,10 +114,10 @@ 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. diff --git a/src/common/KReportUtils.cpp b/src/common/KReportUtils.cpp --- a/src/common/KReportUtils.cpp +++ b/src/common/KReportUtils.cpp @@ -19,9 +19,10 @@ #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 @@ -355,7 +356,7 @@ } -void KReportUtils::buildXMLRect(QDomElement *entity, KRPos *pos, KRSize *size) +void KReportUtils::buildXMLRect(QDomElement *entity, KReportPosition *pos, KReportSize *size) { Q_ASSERT(entity); Q_ASSERT(pos); @@ -378,17 +379,17 @@ 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; @@ -476,33 +477,33 @@ 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); diff --git a/src/items/check/KoReportCheckPlugin.h b/src/items/check/KReportCheckBoxPlugin.h rename from src/items/check/KoReportCheckPlugin.h rename to src/items/check/KReportCheckBoxPlugin.h --- a/src/items/check/KoReportCheckPlugin.h +++ b/src/items/check/KReportCheckBoxPlugin.h @@ -17,25 +17,25 @@ 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/KReportCheckBoxPlugin.cpp b/src/items/check/KReportCheckBoxPlugin.cpp new file mode 100644 --- /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/KoReportDesignerItemCheck.h b/src/items/check/KReportDesignerItemCheckBox.h rename from src/items/check/KoReportDesignerItemCheck.h rename to src/items/check/KReportDesignerItemCheckBox.h --- a/src/items/check/KoReportDesignerItemCheck.h +++ b/src/items/check/KReportDesignerItemCheckBox.h @@ -15,42 +15,41 @@ * 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/KoReportDesignerItemCheck.cpp b/src/items/check/KReportDesignerItemCheckBox.cpp rename from src/items/check/KoReportDesignerItemCheck.cpp rename to src/items/check/KReportDesignerItemCheckBox.cpp --- a/src/items/check/KoReportDesignerItemCheck.cpp +++ b/src/items/check/KReportDesignerItemCheckBox.cpp @@ -15,10 +15,10 @@ * 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 @@ -29,51 +29,51 @@ // 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); @@ -139,7 +139,7 @@ drawHandles(painter); } -void KoReportDesignerItemCheck::buildXML(QDomDocument *doc, QDomElement *parent) +void KReportDesignerItemCheckBox::buildXML(QDomDocument *doc, QDomElement *parent) { //kreportpluginDebug(); QDomElement entity = doc->createElement(QLatin1String("report:") + typeName()); @@ -160,7 +160,7 @@ parent->appendChild(entity); } -void KoReportDesignerItemCheck::slotPropertyChanged(KPropertySet &s, KProperty &p) +void KReportDesignerItemCheckBox::slotPropertyChanged(KPropertySet &s, KProperty &p) { Q_UNUSED(s) @@ -173,12 +173,12 @@ } } - 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/KoReportItemCheck.h b/src/items/check/KReportItemCheck.h rename from src/items/check/KoReportItemCheck.h rename to src/items/check/KReportItemCheck.h --- a/src/items/check/KoReportItemCheck.h +++ b/src/items/check/KReportItemCheck.h @@ -15,30 +15,30 @@ * 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; @@ -54,12 +54,12 @@ 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/KoReportItemCheck.cpp b/src/items/check/KReportItemCheck.cpp rename from src/items/check/KoReportItemCheck.cpp rename to src/items/check/KReportItemCheck.cpp --- a/src/items/check/KoReportItemCheck.cpp +++ b/src/items/check/KReportItemCheck.cpp @@ -15,24 +15,24 @@ * 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(); @@ -53,25 +53,25 @@ 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")); @@ -101,28 +101,28 @@ 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(); @@ -179,12 +179,12 @@ 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/KoReportScriptCheck.h b/src/items/check/KReportScriptCheck.h rename from src/items/check/KoReportScriptCheck.h rename to src/items/check/KReportScriptCheck.h --- a/src/items/check/KoReportScriptCheck.h +++ b/src/items/check/KReportScriptCheck.h @@ -1,5 +1,4 @@ -/* - * 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 @@ -16,23 +15,23 @@ * 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(); @@ -62,8 +61,8 @@ void setSize(const QSizeF&); private: - KoReportItemCheck *m_check; + KReportItemCheckBox *m_check; }; } -#endif // KOREPORTSCRIPTCHECK_H +#endif // KREPORTSCRIPTCHECK_H diff --git a/src/items/check/KoReportScriptCheck.cpp b/src/items/check/KReportScriptCheck.cpp rename from src/items/check/KoReportScriptCheck.cpp rename to src/items/check/KReportScriptCheck.cpp --- a/src/items/check/KoReportScriptCheck.cpp +++ b/src/items/check/KReportScriptCheck.cpp @@ -1,5 +1,4 @@ -/* - * 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 @@ -16,95 +15,95 @@ * 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/KoReportCheckPlugin.cpp b/src/items/check/KoReportCheckPlugin.cpp deleted file mode 100644 --- 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.h b/src/items/field/KReportDesignerItemField.h rename from src/items/field/KoReportDesignerItemField.h rename to src/items/field/KReportDesignerItemField.h --- a/src/items/field/KoReportDesignerItemField.h +++ b/src/items/field/KReportDesignerItemField.h @@ -17,35 +17,35 @@ */ -#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: diff --git a/src/items/field/KoReportDesignerItemField.cpp b/src/items/field/KReportDesignerItemField.cpp rename from src/items/field/KoReportDesignerItemField.cpp rename to src/items/field/KReportDesignerItemField.cpp --- a/src/items/field/KoReportDesignerItemField.cpp +++ b/src/items/field/KReportDesignerItemField.cpp @@ -16,10 +16,11 @@ * 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 @@ -30,12 +31,12 @@ // 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&))); @@ -46,44 +47,44 @@ } // 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); @@ -121,7 +122,7 @@ painter->setPen(p); } -void KoReportDesignerItemField::buildXML(QDomDocument *doc, QDomElement *parent) +void KReportDesignerItemField::buildXML(QDomDocument *doc, QDomElement *parent) { QDomElement entity = doc->createElement(QLatin1String("report:") + typeName()); @@ -161,7 +162,7 @@ parent->appendChild(entity); } -void KoReportDesignerItemField::slotPropertyChanged(KPropertySet &s, KProperty &p) +void KReportDesignerItemField::slotPropertyChanged(KPropertySet &s, KProperty &p) { Q_UNUSED(s); @@ -176,15 +177,15 @@ 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/text/KoReportTextPlugin.h b/src/items/field/KReportFieldPlugin.h rename from src/items/text/KoReportTextPlugin.h rename to src/items/field/KReportFieldPlugin.h --- a/src/items/text/KoReportTextPlugin.h +++ b/src/items/field/KReportFieldPlugin.h @@ -17,25 +17,25 @@ 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/KReportFieldPlugin.cpp b/src/items/field/KReportFieldPlugin.cpp new file mode 100644 --- /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/field/KoReportItemField.h b/src/items/field/KReportItemField.h rename from src/items/field/KoReportItemField.h rename to src/items/field/KReportItemField.h --- a/src/items/field/KoReportItemField.h +++ b/src/items/field/KReportItemField.h @@ -15,11 +15,11 @@ * 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 @@ -30,16 +30,16 @@ 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; @@ -68,7 +68,7 @@ QStringList fieldNames(const QString &); - KRLineStyleData lineStyle() const; + KReportLineStyle lineStyle() const; KRTextStyleData textStyle() const; void setTrackTotal(bool); diff --git a/src/items/field/KoReportItemField.cpp b/src/items/field/KReportItemField.cpp rename from src/items/field/KoReportItemField.cpp rename to src/items/field/KReportItemField.cpp --- a/src/items/field/KoReportItemField.cpp +++ b/src/items/field/KReportItemField.cpp @@ -15,11 +15,11 @@ * 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 @@ -29,12 +29,12 @@ #include #include -KoReportItemField::KoReportItemField() +KReportItemField::KReportItemField() { createProperties(); } -KoReportItemField::KoReportItemField(const QDomNode & element) +KReportItemField::KReportItemField(const QDomNode & element) { createProperties(); QDomNodeList nl = element.childNodes(); @@ -67,24 +67,24 @@ } } 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")); @@ -151,7 +151,7 @@ //_set->addProperty ( _trackTotalFormat ); } -int KoReportItemField::textFlags() const +int KReportItemField::textFlags() const { int flags; QString t; @@ -177,7 +177,7 @@ return flags; } -KRTextStyleData KoReportItemField::textStyle() const +KRTextStyleData KReportItemField::textStyle() const { KRTextStyleData d; d.backgroundColor = m_backgroundColor->value().value(); @@ -188,35 +188,35 @@ 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); diff --git a/src/items/field/krscriptfield.h b/src/items/field/KReportScriptField.h rename from src/items/field/krscriptfield.h rename to src/items/field/KReportScriptField.h --- a/src/items/field/krscriptfield.h +++ b/src/items/field/KReportScriptField.h @@ -20,7 +20,7 @@ #include -#include "KoReportItemField.h" +#include "KReportItemField.h" /** */ @@ -30,7 +30,7 @@ { Q_OBJECT public: - explicit Field(KoReportItemField*); + explicit Field(KReportItemField*); ~Field(); @@ -71,7 +71,7 @@ void setSize(const QSizeF&); private: - KoReportItemField *m_field; + KReportItemField *m_field; }; } diff --git a/src/items/field/krscriptfield.cpp b/src/items/field/KReportScriptField.cpp rename from src/items/field/krscriptfield.cpp rename to src/items/field/KReportScriptField.cpp --- a/src/items/field/krscriptfield.cpp +++ b/src/items/field/KReportScriptField.cpp @@ -15,11 +15,11 @@ * 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; } diff --git a/src/items/field/KoReportFieldPlugin.cpp b/src/items/field/KoReportFieldPlugin.cpp deleted file mode 100644 --- 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/plugins/barcode/KoReportDesignerItemBarcode.h b/src/items/image/KReportDesignerItemImage.h rename from src/plugins/barcode/KoReportDesignerItemBarcode.h rename to src/items/image/KReportDesignerItemImage.h --- a/src/plugins/barcode/KoReportDesignerItemBarcode.h +++ b/src/items/image/KReportDesignerItemImage.h @@ -16,42 +16,35 @@ * 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/KoReportDesignerItemImage.cpp b/src/items/image/KReportDesignerItemImage.cpp rename from src/items/image/KoReportDesignerItemImage.cpp rename to src/items/image/KReportDesignerItemImage.cpp --- a/src/items/image/KoReportDesignerItemImage.cpp +++ b/src/items/image/KReportDesignerItemImage.cpp @@ -16,12 +16,11 @@ * 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 @@ -32,54 +31,54 @@ // // 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); @@ -109,7 +108,7 @@ painter->setPen(p); } -void KoReportDesignerItemImage::buildXML(QDomDocument *doc, QDomElement *parent) +void KReportDesignerItemImage::buildXML(QDomDocument *doc, QDomElement *parent) { QDomElement entity = doc->createElement(QLatin1String("report:") + typeName()); @@ -131,7 +130,7 @@ 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 @@ -142,12 +141,12 @@ } } - 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/items/image/KoReportImagePlugin.h b/src/items/image/KReportImagePlugin.h rename from src/items/image/KoReportImagePlugin.h rename to src/items/image/KReportImagePlugin.h --- a/src/items/image/KoReportImagePlugin.h +++ b/src/items/image/KReportImagePlugin.h @@ -17,25 +17,25 @@ 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/KReportImagePlugin.cpp b/src/items/image/KReportImagePlugin.cpp new file mode 100644 --- /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/KoReportItemImage.h b/src/items/image/KReportItemImage.h rename from src/items/image/KoReportItemImage.h rename to src/items/image/KReportItemImage.h --- a/src/items/image/KoReportItemImage.h +++ b/src/items/image/KReportItemImage.h @@ -15,30 +15,30 @@ * 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; diff --git a/src/items/image/KoReportItemImage.cpp b/src/items/image/KReportItemImage.cpp rename from src/items/image/KoReportItemImage.cpp rename to src/items/image/KReportItemImage.cpp --- a/src/items/image/KoReportItemImage.cpp +++ b/src/items/image/KReportItemImage.cpp @@ -15,22 +15,22 @@ * 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(); @@ -58,17 +58,17 @@ } -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; @@ -80,7 +80,7 @@ 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); @@ -99,19 +99,19 @@ } -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")); @@ -131,23 +131,23 @@ } -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) diff --git a/src/items/image/krscriptimage.h b/src/items/image/KReportScriptImage.h rename from src/items/image/krscriptimage.h rename to src/items/image/KReportScriptImage.h --- a/src/items/image/krscriptimage.h +++ b/src/items/image/KReportScriptImage.h @@ -22,7 +22,7 @@ #include #include -class KoReportItemImage; +class KReportItemImage; namespace Scripting { @@ -33,7 +33,7 @@ { Q_OBJECT public: - explicit Image(KoReportItemImage *); + explicit Image(KReportItemImage *); ~Image(); public Q_SLOTS: @@ -91,7 +91,7 @@ */ void loadFromFile(const QVariant &); private: - KoReportItemImage *m_image; + KReportItemImage *m_image; }; diff --git a/src/items/image/krscriptimage.cpp b/src/items/image/KReportScriptImage.cpp rename from src/items/image/krscriptimage.cpp rename to src/items/image/KReportScriptImage.cpp --- a/src/items/image/krscriptimage.cpp +++ b/src/items/image/KReportScriptImage.cpp @@ -15,15 +15,15 @@ * 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; } diff --git a/src/items/image/KoReportImagePlugin.cpp b/src/items/image/KoReportImagePlugin.cpp deleted file mode 100644 --- 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.h b/src/items/label/KReportBoundedTextItem.h rename from src/items/label/BoundedTextItem.h rename to src/items/label/KReportBoundedTextItem.h --- a/src/items/label/BoundedTextItem.h +++ b/src/items/label/KReportBoundedTextItem.h @@ -17,8 +17,8 @@ Boston, MA 02110-1301, USA. */ -#ifndef KOREPORT_BOUNDEDTEXTITEM_H -#define KOREPORT_BOUNDEDTEXTITEM_H +#ifndef KREPORT_BOUNDEDTEXTITEM_H +#define KREPORT_BOUNDEDTEXTITEM_H #include #include @@ -59,4 +59,4 @@ }; -#endif // KOREPORT_BOUNDEDTEXTITEM_H +#endif // KREPORT_BOUNDEDTEXTITEM_H diff --git a/src/items/label/BoundedTextItem.cpp b/src/items/label/KReportBoundedTextItem.cpp rename from src/items/label/BoundedTextItem.cpp rename to src/items/label/KReportBoundedTextItem.cpp --- a/src/items/label/BoundedTextItem.cpp +++ b/src/items/label/KReportBoundedTextItem.cpp @@ -17,7 +17,7 @@ Boston, MA 02110-1301, USA. */ -#include "BoundedTextItem.h" +#include "KReportBoundedTextItem.h" #include #include #include diff --git a/src/items/label/KoReportDesignerItemLabel.h b/src/items/label/KReportDesignerItemLabel.h rename from src/items/label/KoReportDesignerItemLabel.h rename to src/items/label/KReportDesignerItemLabel.h --- a/src/items/label/KoReportDesignerItemLabel.h +++ b/src/items/label/KReportDesignerItemLabel.h @@ -16,30 +16,29 @@ * 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(); @@ -50,7 +49,7 @@ virtual void keyReleaseEvent ( QKeyEvent * event ); private: - void init(QGraphicsScene*, KoReportDesigner*); + void init(QGraphicsScene*, KReportDesigner*); QRectF getTextRect() const; BoundedTextItem *m_inlineEdit; diff --git a/src/items/label/KoReportDesignerItemLabel.cpp b/src/items/label/KReportDesignerItemLabel.cpp rename from src/items/label/KoReportDesignerItemLabel.cpp rename to src/items/label/KReportDesignerItemLabel.cpp --- a/src/items/label/KoReportDesignerItemLabel.cpp +++ b/src/items/label/KReportDesignerItemLabel.cpp @@ -16,10 +16,11 @@ * 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 @@ -29,12 +30,12 @@ #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&))); @@ -55,8 +56,8 @@ } // 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); @@ -66,33 +67,33 @@ 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); @@ -132,7 +133,7 @@ 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()); @@ -156,7 +157,7 @@ parent->appendChild(entity); } -void KoReportDesignerItemLabel::slotPropertyChanged(KPropertySet &s, KProperty &p) +void KReportDesignerItemLabel::slotPropertyChanged(KPropertySet &s, KProperty &p) { Q_UNUSED(s); @@ -171,12 +172,12 @@ 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); @@ -198,21 +199,21 @@ } } -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(); diff --git a/src/items/label/KoReportItemLabel.h b/src/items/label/KReportItemLabel.h rename from src/items/label/KoReportItemLabel.h rename to src/items/label/KReportItemLabel.h --- a/src/items/label/KoReportItemLabel.h +++ b/src/items/label/KReportItemLabel.h @@ -15,12 +15,12 @@ * 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 @@ -33,16 +33,16 @@ /** */ -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: @@ -64,7 +64,7 @@ Qt::Alignment textFlags() const; void setText(const QString&); KRTextStyleData textStyle() const; - KRLineStyleData lineStyle() const; + KReportLineStyle lineStyle() const; private: virtual void createProperties(); diff --git a/src/items/label/KoReportItemLabel.cpp b/src/items/label/KReportItemLabel.cpp rename from src/items/label/KoReportItemLabel.cpp rename to src/items/label/KReportItemLabel.cpp --- a/src/items/label/KoReportItemLabel.cpp +++ b/src/items/label/KReportItemLabel.cpp @@ -15,22 +15,22 @@ * 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(); @@ -59,34 +59,34 @@ } } 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")); @@ -130,7 +130,7 @@ m_set->addProperty(m_lineStyle); } -Qt::Alignment KoReportItemLabel::textFlags() const +Qt::Alignment KReportItemLabel::textFlags() const { Qt::Alignment align; QString t; @@ -153,7 +153,7 @@ return align; } -KRTextStyleData KoReportItemLabel::textStyle() const +KRTextStyleData KReportItemLabel::textStyle() const { KRTextStyleData d; d.backgroundColor = m_backgroundColor->value().value(); @@ -163,23 +163,23 @@ 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) diff --git a/src/items/label/KoReportLabelPlugin.h b/src/items/label/KReportLabelPlugin.h rename from src/items/label/KoReportLabelPlugin.h rename to src/items/label/KReportLabelPlugin.h --- a/src/items/label/KoReportLabelPlugin.h +++ b/src/items/label/KReportLabelPlugin.h @@ -17,29 +17,29 @@ 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/KoReportLabelPlugin.cpp b/src/items/label/KReportLabelPlugin.cpp rename from src/items/label/KoReportLabelPlugin.cpp rename to src/items/label/KReportLabelPlugin.cpp --- a/src/items/label/KoReportLabelPlugin.cpp +++ b/src/items/label/KReportLabelPlugin.cpp @@ -17,55 +17,56 @@ 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); @@ -93,14 +94,14 @@ } #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/krscriptlabel.h b/src/items/label/KReportScriptLabel.h rename from src/items/label/krscriptlabel.h rename to src/items/label/KReportScriptLabel.h --- a/src/items/label/krscriptlabel.h +++ b/src/items/label/KReportScriptLabel.h @@ -20,7 +20,7 @@ #include -#include "KoReportItemLabel.h" +#include "KReportItemLabel.h" /** */ @@ -30,7 +30,7 @@ { Q_OBJECT public: - explicit Label(KoReportItemLabel *); + explicit Label(KReportItemLabel *); ~Label(); @@ -72,7 +72,7 @@ void setSize(const QSizeF&); private: - KoReportItemLabel *m_label; + KReportItemLabel *m_label; }; } diff --git a/src/items/label/krscriptlabel.cpp b/src/items/label/KReportScriptLabel.cpp rename from src/items/label/krscriptlabel.cpp rename to src/items/label/KReportScriptLabel.cpp --- a/src/items/label/krscriptlabel.cpp +++ b/src/items/label/KReportScriptLabel.cpp @@ -15,11 +15,11 @@ * 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; } diff --git a/src/items/text/KoReportDesignerItemText.h b/src/items/text/KReportDesignerItemText.h rename from src/items/text/KoReportDesignerItemText.h rename to src/items/text/KReportDesignerItemText.h --- a/src/items/text/KoReportDesignerItemText.h +++ b/src/items/text/KReportDesignerItemText.h @@ -17,36 +17,35 @@ */ -#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 &); diff --git a/src/items/text/KoReportDesignerItemText.cpp b/src/items/text/KReportDesignerItemText.cpp rename from src/items/text/KoReportDesignerItemText.cpp rename to src/items/text/KReportDesignerItemText.cpp --- a/src/items/text/KoReportDesignerItemText.cpp +++ b/src/items/text/KReportDesignerItemText.cpp @@ -16,12 +16,12 @@ * 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 @@ -33,61 +33,61 @@ // // 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) @@ -123,7 +123,7 @@ 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()); @@ -149,21 +149,21 @@ 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)) { diff --git a/src/items/text/KoReportItemText.h b/src/items/text/KReportItemText.h rename from src/items/text/KoReportItemText.h rename to src/items/text/KReportItemText.h --- a/src/items/text/KoReportItemText.h +++ b/src/items/text/KReportItemText.h @@ -15,12 +15,12 @@ * 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 @@ -33,16 +33,16 @@ } /** */ -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; @@ -73,7 +73,7 @@ KRTextStyleData textStyle() const; - KRLineStyleData lineStyle() const; + KReportLineStyle lineStyle() const; private: virtual void createProperties(); diff --git a/src/items/text/KoReportItemText.cpp b/src/items/text/KReportItemText.cpp rename from src/items/text/KoReportItemText.cpp rename to src/items/text/KReportItemText.cpp --- a/src/items/text/KoReportItemText.cpp +++ b/src/items/text/KReportItemText.cpp @@ -15,8 +15,8 @@ * 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 @@ -27,12 +27,12 @@ #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; @@ -63,25 +63,25 @@ } } 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; @@ -104,7 +104,7 @@ return align; } -void KoReportItemText::createProperties() +void KReportItemText::createProperties() { m_set = new KPropertySet(0, QLatin1String("Text")); @@ -155,24 +155,24 @@ } -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(); @@ -182,23 +182,23 @@ 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); diff --git a/src/items/text/krscripttext.h b/src/items/text/KReportScriptText.h rename from src/items/text/krscripttext.h rename to src/items/text/KReportScriptText.h --- a/src/items/text/krscripttext.h +++ b/src/items/text/KReportScriptText.h @@ -19,7 +19,7 @@ #include -#include "KoReportItemText.h" +#include "KReportItemText.h" namespace Scripting { @@ -30,7 +30,7 @@ { Q_OBJECT public: - explicit Text(KoReportItemText*); + explicit Text(KReportItemText*); ~Text(); public Q_SLOTS: @@ -75,7 +75,7 @@ void loadFromFile(const QString&); private: - KoReportItemText *m_text; + KReportItemText *m_text; }; } diff --git a/src/items/text/krscripttext.cpp b/src/items/text/KReportScriptText.cpp rename from src/items/text/krscripttext.cpp rename to src/items/text/KReportScriptText.cpp --- a/src/items/text/krscripttext.cpp +++ b/src/items/text/KReportScriptText.cpp @@ -14,16 +14,16 @@ * 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; } diff --git a/src/items/field/KoReportFieldPlugin.h b/src/items/text/KReportTextPlugin.h rename from src/items/field/KoReportFieldPlugin.h rename to src/items/text/KReportTextPlugin.h --- a/src/items/field/KoReportFieldPlugin.h +++ b/src/items/text/KReportTextPlugin.h @@ -17,25 +17,25 @@ 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/KReportTextPlugin.cpp b/src/items/text/KReportTextPlugin.cpp new file mode 100644 --- /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/text/KoReportTextPlugin.cpp b/src/items/text/KoReportTextPlugin.cpp deleted file mode 100644 --- 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 rename from src/koreport_itemplugin.desktop rename to src/kreport_elementplugin.desktop --- a/src/koreport_itemplugin.desktop +++ b/src/kreport_elementplugin.desktop @@ -1,7 +1,7 @@ [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 diff --git a/src/plugins/barcode/3of9.cpp b/src/plugins/barcode/3of9.cpp --- a/src/plugins/barcode/3of9.cpp +++ b/src/plugins/barcode/3of9.cpp @@ -21,7 +21,7 @@ * All this code assumes a 100dpi rendering surface for it's calculations. */ -#include "renderobjects.h" +#include "KReportRenderObjects.h" #include #include diff --git a/src/plugins/barcode/CMakeLists.txt b/src/plugins/barcode/CMakeLists.txt --- a/src/plugins/barcode/CMakeLists.txt +++ b/src/plugins/barcode/CMakeLists.txt @@ -1,10 +1,10 @@ -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 @@ -15,8 +15,8 @@ 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}) diff --git a/src/plugins/barcode/KoReportBarcodePlugin.h b/src/plugins/barcode/KReportBarcodePlugin.h rename from src/plugins/barcode/KoReportBarcodePlugin.h rename to src/plugins/barcode/KReportBarcodePlugin.h --- a/src/plugins/barcode/KoReportBarcodePlugin.h +++ b/src/plugins/barcode/KReportBarcodePlugin.h @@ -17,23 +17,23 @@ 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/KReportBarcodePlugin.cpp b/src/plugins/barcode/KReportBarcodePlugin.cpp new file mode 100644 --- /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/items/image/KoReportDesignerItemImage.h b/src/plugins/barcode/KReportDesignerItemBarcode.h rename from src/items/image/KoReportDesignerItemImage.h rename to src/plugins/barcode/KReportDesignerItemBarcode.h --- a/src/items/image/KoReportDesignerItemImage.h +++ b/src/plugins/barcode/KReportDesignerItemBarcode.h @@ -16,36 +16,42 @@ * 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/KoReportDesignerItemBarcode.cpp b/src/plugins/barcode/KReportDesignerItemBarcode.cpp rename from src/plugins/barcode/KoReportDesignerItemBarcode.cpp rename to src/plugins/barcode/KReportDesignerItemBarcode.cpp --- a/src/plugins/barcode/KoReportDesignerItemBarcode.cpp +++ b/src/plugins/barcode/KReportDesignerItemBarcode.cpp @@ -16,9 +16,9 @@ * 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" @@ -31,61 +31,61 @@ #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) { @@ -130,7 +130,7 @@ 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()); @@ -150,7 +150,7 @@ 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 @@ -163,12 +163,12 @@ 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/plugins/barcode/KoReportItemBarcode.h b/src/plugins/barcode/KReportItemBarcode.h rename from src/plugins/barcode/KoReportItemBarcode.h rename to src/plugins/barcode/KReportItemBarcode.h --- a/src/plugins/barcode/KoReportItemBarcode.h +++ b/src/plugins/barcode/KReportItemBarcode.h @@ -15,12 +15,12 @@ * 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; @@ -31,16 +31,16 @@ /** */ -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: diff --git a/src/plugins/barcode/KoReportItemBarcode.cpp b/src/plugins/barcode/KReportItemBarcode.cpp rename from src/plugins/barcode/KoReportItemBarcode.cpp rename to src/plugins/barcode/KReportItemBarcode.cpp --- a/src/plugins/barcode/KoReportItemBarcode.cpp +++ b/src/plugins/barcode/KReportItemBarcode.cpp @@ -15,7 +15,7 @@ * License along with this library. If not, see . */ -#include "KoReportItemBarcode.h" +#include "KReportItemBarcode.h" #include #include @@ -26,12 +26,12 @@ #include "barcodes.h" -KoReportItemBarcode::KoReportItemBarcode() +KReportItemBarcode::KReportItemBarcode() { createProperties(); } -KoReportItemBarcode::KoReportItemBarcode(const QDomNode & element) +KReportItemBarcode::KReportItemBarcode(const QDomNode & element) { createProperties(); QDomNodeList nl = element.childNodes(); @@ -49,7 +49,7 @@ } -void KoReportItemBarcode::setMaxLength(int i) +void KReportItemBarcode::setMaxLength(int i) { if (i > 0) { if (m_maxLength->value().toInt() != i) { @@ -112,7 +112,7 @@ } } -void KoReportItemBarcode::createProperties() +void KReportItemBarcode::createProperties() { m_set = new KPropertySet(0, QLatin1String("Barcode")); @@ -156,12 +156,12 @@ m_set->addProperty(m_maxLength); } -KoReportItemBarcode::~KoReportItemBarcode() +KReportItemBarcode::~KReportItemBarcode() { delete m_set; } -int KoReportItemBarcode::alignment() +int KReportItemBarcode::alignment() { QByteArray a = m_horizontalAlignment->value().toByteArray(); @@ -175,39 +175,39 @@ 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); diff --git a/src/plugins/barcode/krscriptbarcode.h b/src/plugins/barcode/KReportScriptBarcode.h rename from src/plugins/barcode/krscriptbarcode.h rename to src/plugins/barcode/KReportScriptBarcode.h --- a/src/plugins/barcode/krscriptbarcode.h +++ b/src/plugins/barcode/KReportScriptBarcode.h @@ -20,7 +20,7 @@ #include -#include "KoReportItemBarcode.h" +#include "KReportItemBarcode.h" namespace Scripting { @@ -31,7 +31,7 @@ { Q_OBJECT public: - explicit Barcode(KoReportItemBarcode *f); + explicit Barcode(KReportItemBarcode *f); ~Barcode(); @@ -107,7 +107,7 @@ private: - KoReportItemBarcode *m_barcode; + KReportItemBarcode *m_barcode; }; } diff --git a/src/plugins/barcode/krscriptbarcode.cpp b/src/plugins/barcode/KReportScriptBarcode.cpp rename from src/plugins/barcode/krscriptbarcode.cpp rename to src/plugins/barcode/KReportScriptBarcode.cpp --- a/src/plugins/barcode/krscriptbarcode.cpp +++ b/src/plugins/barcode/KReportScriptBarcode.cpp @@ -15,14 +15,14 @@ * 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; } diff --git a/src/plugins/barcode/KoReportBarcodePlugin.cpp b/src/plugins/barcode/KoReportBarcodePlugin.cpp deleted file mode 100644 --- 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 --- a/src/plugins/barcode/code128.cpp +++ b/src/plugins/barcode/code128.cpp @@ -27,7 +27,7 @@ #include #include -#include "renderobjects.h" +#include "KReportRenderObjects.h" #include "kreportplugin_debug.h" static const int SETA = 0; diff --git a/src/plugins/barcode/code128paint.cpp b/src/plugins/barcode/code128paint.cpp --- a/src/plugins/barcode/code128paint.cpp +++ b/src/plugins/barcode/code128paint.cpp @@ -28,7 +28,7 @@ #include #include -#include "renderobjects.h" +#include "KReportRenderObjects.h" #include "kreportplugin_debug.h" static const int SETA = 0; diff --git a/src/plugins/barcode/codeean.cpp b/src/plugins/barcode/codeean.cpp --- a/src/plugins/barcode/codeean.cpp +++ b/src/plugins/barcode/codeean.cpp @@ -27,7 +27,7 @@ #include #include -#include "renderobjects.h" +#include "KReportRenderObjects.h" static const int LEFTHAND_ODD = 0; static const int LEFTHAND_EVEN = 1; diff --git a/src/plugins/barcode/codeeanpaint.cpp b/src/plugins/barcode/codeeanpaint.cpp --- a/src/plugins/barcode/codeeanpaint.cpp +++ b/src/plugins/barcode/codeeanpaint.cpp @@ -28,7 +28,7 @@ #include #include -#include "renderobjects.h" +#include "KReportRenderObjects.h" static const int LEFTHAND_ODD = 0; static const int LEFTHAND_EVEN = 1; diff --git a/src/plugins/barcode/i2of5.cpp b/src/plugins/barcode/i2of5.cpp --- a/src/plugins/barcode/i2of5.cpp +++ b/src/plugins/barcode/i2of5.cpp @@ -27,7 +27,7 @@ #include #include -#include "renderobjects.h" +#include "KReportRenderObjects.h" const char* _i2of5charmap[] = { "NNWWN", diff --git a/src/plugins/chart/CMakeLists.txt b/src/plugins/chart/CMakeLists.txt --- a/src/plugins/chart/CMakeLists.txt +++ b/src/plugins/chart/CMakeLists.txt @@ -2,10 +2,10 @@ 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} ) diff --git a/src/plugins/chart/KoReportChartPlugin.h b/src/plugins/chart/KReportChartPlugin.h rename from src/plugins/chart/KoReportChartPlugin.h rename to src/plugins/chart/KReportChartPlugin.h --- a/src/plugins/chart/KoReportChartPlugin.h +++ b/src/plugins/chart/KReportChartPlugin.h @@ -17,23 +17,23 @@ 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 }; diff --git a/src/plugins/chart/KoReportChartPlugin.cpp b/src/plugins/chart/KReportChartPlugin.cpp rename from src/plugins/chart/KoReportChartPlugin.cpp rename to src/plugins/chart/KReportChartPlugin.cpp --- a/src/plugins/chart/KoReportChartPlugin.cpp +++ b/src/plugins/chart/KReportChartPlugin.cpp @@ -29,7 +29,7 @@ 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); @@ -41,28 +41,28 @@ 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) { diff --git a/src/plugins/chart/KoReportDesignerItemChart.h b/src/plugins/chart/KReportDesignerItemChart.h rename from src/plugins/chart/KoReportDesignerItemChart.h rename to src/plugins/chart/KReportDesignerItemChart.h --- a/src/plugins/chart/KoReportDesignerItemChart.h +++ b/src/plugins/chart/KReportDesignerItemChart.h @@ -23,17 +23,17 @@ /** */ -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); diff --git a/src/plugins/chart/KoReportDesignerItemChart.cpp b/src/plugins/chart/KReportDesignerItemChart.cpp rename from src/plugins/chart/KoReportDesignerItemChart.cpp rename to src/plugins/chart/KReportDesignerItemChart.cpp --- a/src/plugins/chart/KoReportDesignerItemChart.cpp +++ b/src/plugins/chart/KReportDesignerItemChart.cpp @@ -27,7 +27,7 @@ #include #include -void KoReportDesignerItemChart::init(QGraphicsScene* scene, KoReportDesigner *d) +void KReportDesignerItemChart::init(QGraphicsScene* scene, KoReportDesigner *d) { setPos(0, 0); @@ -43,29 +43,29 @@ 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); @@ -99,17 +99,17 @@ 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()); @@ -137,7 +137,7 @@ 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 @@ -185,7 +185,7 @@ 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(); @@ -195,7 +195,7 @@ KoReportDesignerItemRectBase::mousePressEvent(event); } -void KoReportDesignerItemChart::slotReportDataChanged() +void KReportDesignerItemChart::slotReportDataChanged() { setConnection(m_reportDesigner->reportData()); } diff --git a/src/plugins/chart/KoReportItemChart.h b/src/plugins/chart/KReportItemChart.h rename from src/plugins/chart/KoReportItemChart.h rename to src/plugins/chart/KReportItemChart.h --- a/src/plugins/chart/KoReportItemChart.h +++ b/src/plugins/chart/KReportItemChart.h @@ -20,29 +20,29 @@ #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; @@ -52,7 +52,7 @@ @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 @@ -105,7 +105,7 @@ private: virtual void createProperties(); - KoReportData *m_reportData; + KReportData *m_reportData; friend class Scripting::Chart; diff --git a/src/plugins/chart/KoReportItemChart.cpp b/src/plugins/chart/KReportItemChart.cpp rename from src/plugins/chart/KoReportItemChart.cpp rename to src/plugins/chart/KReportItemChart.cpp --- a/src/plugins/chart/KoReportItemChart.cpp +++ b/src/plugins/chart/KReportItemChart.cpp @@ -17,7 +17,7 @@ #include "KoReportItemChart.h" -#include "renderobjects.h" +#include "KReportRenderObjects.h" #include #include @@ -41,13 +41,13 @@ typedef QVector datalist; -KoReportItemChart::KoReportItemChart() +KReportItemChart::KReportItemChart() { m_reportData = 0; createProperties(); } -KoReportItemChart::KoReportItemChart(QDomNode *element) +KReportItemChart::KReportItemChart(QDomNode *element) { m_reportData = 0; createProperties(); @@ -80,12 +80,12 @@ } -KoReportItemChart::~KoReportItemChart() +KReportItemChart::~KReportItemChart() { delete m_set; } -void KoReportItemChart::createProperties() +void KReportItemChart::createProperties() { m_chartWidget = 0; m_set = new KPropertySet(0, "Chart"); @@ -179,7 +179,7 @@ setColorScheme("default"); } -void KoReportItemChart::set3D(bool td) +void KReportItemChart::set3D(bool td) { if (m_chartWidget && m_chartWidget->barDiagram()) { KDChart::BarDiagram *bar = m_chartWidget->barDiagram(); @@ -194,14 +194,14 @@ } } -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") { @@ -214,13 +214,13 @@ } } -void KoReportItemChart::setConnection(KoReportData *c) +void KReportItemChart::setConnection(KReportData *c) { m_reportData = c; populateData(); } -void KoReportItemChart::populateData() +void KReportItemChart::populateData() { QVector data; QStringList labels; @@ -235,7 +235,7 @@ 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) { @@ -299,18 +299,18 @@ } } -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; @@ -349,7 +349,7 @@ } } -void KoReportItemChart::setBackgroundColor(const QColor&) +void KReportItemChart::setBackgroundColor(const QColor&) { //Set the background color if (!m_chartWidget) { @@ -364,7 +364,7 @@ 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) { @@ -386,13 +386,13 @@ } // 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); diff --git a/src/plugins/chart/krscriptchart.h b/src/plugins/chart/KReportScriptChart.h rename from src/plugins/chart/krscriptchart.h rename to src/plugins/chart/KReportScriptChart.h --- a/src/plugins/chart/krscriptchart.h +++ b/src/plugins/chart/KReportScriptChart.h @@ -23,7 +23,7 @@ #include #include -class KoReportItemChart; +class KReportItemChart; namespace Scripting { @@ -34,7 +34,7 @@ { Q_OBJECT public: - explicit Chart(KoReportItemChart *); + explicit Chart(KReportItemChart *); ~Chart(); public Q_SLOTS: @@ -149,7 +149,7 @@ void setYAxisTitle(const QString &); private: - KoReportItemChart* m_chart; + KReportItemChart* m_chart; }; diff --git a/src/plugins/chart/krscriptchart.cpp b/src/plugins/chart/KReportScriptChart.cpp rename from src/plugins/chart/krscriptchart.cpp rename to src/plugins/chart/KReportScriptChart.cpp --- a/src/plugins/chart/krscriptchart.cpp +++ b/src/plugins/chart/KReportScriptChart.cpp @@ -21,7 +21,7 @@ namespace Scripting { -Chart::Chart(KoReportItemChart *c) +Chart::Chart(KReportItemChart *c) { m_chart = c; } diff --git a/src/plugins/maps/CMakeLists.txt b/src/plugins/maps/CMakeLists.txt --- a/src/plugins/maps/CMakeLists.txt +++ b/src/plugins/maps/CMakeLists.txt @@ -3,10 +3,10 @@ #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} ) diff --git a/src/plugins/maps/KoReportDesignerItemMaps.h b/src/plugins/maps/KReportDesignerItemMaps.h rename from src/plugins/maps/KoReportDesignerItemMaps.h rename to src/plugins/maps/KReportDesignerItemMaps.h --- a/src/plugins/maps/KoReportDesignerItemMaps.h +++ b/src/plugins/maps/KReportDesignerItemMaps.h @@ -23,20 +23,20 @@ #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); diff --git a/src/plugins/maps/KoReportDesignerItemMaps.cpp b/src/plugins/maps/KReportDesignerItemMaps.cpp rename from src/plugins/maps/KoReportDesignerItemMaps.cpp rename to src/plugins/maps/KReportDesignerItemMaps.cpp --- a/src/plugins/maps/KoReportDesignerItemMaps.cpp +++ b/src/plugins/maps/KReportDesignerItemMaps.cpp @@ -30,7 +30,7 @@ #include #include "kreportplugin_debug.h" -void KoReportDesignerItemMaps::init(QGraphicsScene *scene, KoReportDesigner *d) +void KReportDesignerItemMaps::init(QGraphicsScene *scene, KoReportDesigner *d) { if (scene) scene->addItem(this); @@ -44,38 +44,38 @@ 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); @@ -95,7 +95,7 @@ painter->setPen(p); } -void KoReportDesignerItemMaps::buildXML(QDomDocument *doc, QDomElement *parent) +void KReportDesignerItemMaps::buildXML(QDomDocument *doc, QDomElement *parent) { QDomElement entity = doc->createElement(QLatin1String("report:") + typeName()); @@ -113,7 +113,7 @@ 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") { @@ -129,7 +129,7 @@ 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/KoReportItemMaps.h b/src/plugins/maps/KReportItemMaps.h rename from src/plugins/maps/KoReportItemMaps.h rename to src/plugins/maps/KReportItemMaps.h --- a/src/plugins/maps/KoReportItemMaps.h +++ b/src/plugins/maps/KReportItemMaps.h @@ -19,16 +19,16 @@ #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; @@ -41,18 +41,18 @@ 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; @@ -83,7 +83,7 @@ OROSection *m_sectionId; QPointF m_offset; OROPicture * m_oroPicture; - MapRenderer m_mapRenderer; + KReportMapRenderer m_mapRenderer; Marble::MapThemeManager m_themeManager; private: diff --git a/src/plugins/maps/KoReportItemMaps.cpp b/src/plugins/maps/KReportItemMaps.cpp rename from src/plugins/maps/KoReportItemMaps.cpp rename to src/plugins/maps/KReportItemMaps.cpp --- a/src/plugins/maps/KoReportItemMaps.cpp +++ b/src/plugins/maps/KReportItemMaps.cpp @@ -21,13 +21,13 @@ #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) @@ -53,12 +53,12 @@ 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")); @@ -101,23 +101,23 @@ } -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) @@ -145,7 +145,7 @@ 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) { @@ -159,42 +159,42 @@ } } -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; diff --git a/src/plugins/maps/MapRenderer.h b/src/plugins/maps/KReportMapRenderer.h rename from src/plugins/maps/MapRenderer.h rename to src/plugins/maps/KReportMapRenderer.h --- a/src/plugins/maps/MapRenderer.h +++ b/src/plugins/maps/KReportMapRenderer.h @@ -25,7 +25,7 @@ #include "kreportplugin_debug.h" -class KoReportItemMaps; +class KReportItemMaps; namespace Marble{ /** * Workaround Marble error in signal specification. @@ -60,14 +60,14 @@ }; } -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: @@ -77,7 +77,7 @@ private: Marble::MarbleWidget m_marble; - KoReportItemMaps* m_currentJob; + KReportItemMaps* m_currentJob; Marble::RenderStatusSignalProxy m_renderStatusProxy; }; diff --git a/src/plugins/maps/MapRenderer.cpp b/src/plugins/maps/KReportMapRenderer.cpp rename from src/plugins/maps/MapRenderer.cpp rename to src/plugins/maps/KReportMapRenderer.cpp --- a/src/plugins/maps/MapRenderer.cpp +++ b/src/plugins/maps/KReportMapRenderer.cpp @@ -18,7 +18,7 @@ #include "MapRenderer.h" #include "KoReportItemMaps.h" -#include +#include #include #include @@ -28,7 +28,7 @@ #include "kreportplugin_debug.h" -MapRenderer::MapRenderer(QObject* parent) +KReportMapRenderer::KReportMapRenderer(QObject* parent) : QObject(parent) , m_currentJob(0) , m_renderStatusProxy(this) @@ -50,12 +50,12 @@ 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(); @@ -69,7 +69,7 @@ m_currentJob->renderFinished(); } -void MapRenderer::onRenderStatusChange(int renderStatus) +void KReportMapRenderer::onRenderStatusChange(int renderStatus) { if(m_currentJob){ kreportpluginDebug() << m_marble.renderStatus() << "|" << renderStatus; @@ -88,13 +88,13 @@ } } -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 diff --git a/src/plugins/maps/KoReportMapsPlugin.h b/src/plugins/maps/KReportMapsPlugin.h rename from src/plugins/maps/KoReportMapsPlugin.h rename to src/plugins/maps/KReportMapsPlugin.h --- a/src/plugins/maps/KoReportMapsPlugin.h +++ b/src/plugins/maps/KReportMapsPlugin.h @@ -18,22 +18,22 @@ 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 }; diff --git a/src/plugins/maps/KoReportMapsPlugin.cpp b/src/plugins/maps/KReportMapsPlugin.cpp rename from src/plugins/maps/KoReportMapsPlugin.cpp rename to src/plugins/maps/KReportMapsPlugin.cpp --- a/src/plugins/maps/KoReportMapsPlugin.cpp +++ b/src/plugins/maps/KReportMapsPlugin.cpp @@ -21,40 +21,40 @@ #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) { diff --git a/src/plugins/maps/krscriptmaps.h b/src/plugins/maps/KReportScriptMaps.h rename from src/plugins/maps/krscriptmaps.h rename to src/plugins/maps/KReportScriptMaps.h --- a/src/plugins/maps/krscriptmaps.h +++ b/src/plugins/maps/KReportScriptMaps.h @@ -22,16 +22,16 @@ #include #include -class KoReportItemMaps; +class KReportItemMaps; namespace Scripting { class Maps : public QObject { Q_OBJECT public: - explicit Maps(KoReportItemMaps *i); + explicit Maps(KReportItemMaps *i); ~Maps(); @@ -67,7 +67,7 @@ void setZoom(int zoom); private: - KoReportItemMaps *m_map; + KReportItemMaps *m_map; }; } diff --git a/src/plugins/maps/krscriptmaps.cpp b/src/plugins/maps/KReportScriptMaps.cpp rename from src/plugins/maps/krscriptmaps.cpp rename to src/plugins/maps/KReportScriptMaps.cpp --- a/src/plugins/maps/krscriptmaps.cpp +++ b/src/plugins/maps/KReportScriptMaps.cpp @@ -23,7 +23,7 @@ namespace Scripting { -Maps::Maps(KoReportItemMaps *i) +Maps::Maps(KReportItemMaps *i) { m_map = i; m_map->m_latDataSetFromScript = false; diff --git a/src/plugins/web/KoReportDesignerItemWeb.h b/src/plugins/web/KReportDesignerItemWeb.h rename from src/plugins/web/KoReportDesignerItemWeb.h rename to src/plugins/web/KReportDesignerItemWeb.h --- a/src/plugins/web/KoReportDesignerItemWeb.h +++ b/src/plugins/web/KReportDesignerItemWeb.h @@ -18,29 +18,29 @@ * 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); diff --git a/src/plugins/web/KoReportDesignerItemWeb.cpp b/src/plugins/web/KReportDesignerItemWeb.cpp rename from src/plugins/web/KoReportDesignerItemWeb.cpp rename to src/plugins/web/KReportDesignerItemWeb.cpp --- a/src/plugins/web/KoReportDesignerItemWeb.cpp +++ b/src/plugins/web/KReportDesignerItemWeb.cpp @@ -31,7 +31,7 @@ #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) @@ -42,40 +42,40 @@ 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); @@ -88,7 +88,7 @@ drawHandles(painter); } -void KoReportDesignerItemWeb::buildXML(QDomDocument *doc, QDomElement *parent) +void KReportDesignerItemWeb::buildXML(QDomDocument *doc, QDomElement *parent) { Q_UNUSED(doc); Q_UNUSED(parent); @@ -102,7 +102,7 @@ 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)) { @@ -119,7 +119,7 @@ } } -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/KoReportItemWeb.h b/src/plugins/web/KReportItemWeb.h rename from src/plugins/web/KoReportItemWeb.h rename to src/plugins/web/KReportItemWeb.h --- a/src/plugins/web/KoReportItemWeb.h +++ b/src/plugins/web/KReportItemWeb.h @@ -18,13 +18,13 @@ * 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 @@ -39,16 +39,16 @@ /** */ -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: diff --git a/src/plugins/web/KoReportItemWeb.cpp b/src/plugins/web/KReportItemWeb.cpp rename from src/plugins/web/KoReportItemWeb.cpp rename to src/plugins/web/KReportItemWeb.cpp --- a/src/plugins/web/KoReportItemWeb.cpp +++ b/src/plugins/web/KReportItemWeb.cpp @@ -19,7 +19,7 @@ */ #include "KoReportItemWeb.h" -#include +#include #include #include @@ -29,13 +29,13 @@ #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(); @@ -54,13 +54,13 @@ } } -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"); @@ -70,16 +70,16 @@ 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) { @@ -110,8 +110,8 @@ } } -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); @@ -133,7 +133,7 @@ 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/KoReportWebPlugin.h b/src/plugins/web/KReportWebPlugin.h rename from src/plugins/web/KoReportWebPlugin.h rename to src/plugins/web/KReportWebPlugin.h --- a/src/plugins/web/KoReportWebPlugin.h +++ b/src/plugins/web/KReportWebPlugin.h @@ -17,25 +17,25 @@ * 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 }; diff --git a/src/plugins/web/KoReportWebPlugin.cpp b/src/plugins/web/KReportWebPlugin.cpp rename from src/plugins/web/KoReportWebPlugin.cpp rename to src/plugins/web/KReportWebPlugin.cpp --- a/src/plugins/web/KoReportWebPlugin.cpp +++ b/src/plugins/web/KReportWebPlugin.cpp @@ -24,8 +24,8 @@ 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) @@ -37,29 +37,29 @@ 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); diff --git a/src/renderer/KoReportASyncItemManager.h b/src/renderer/KReportAsyncItemManager_p.h rename from src/renderer/KoReportASyncItemManager.h rename to src/renderer/KReportAsyncItemManager_p.h --- a/src/renderer/KoReportASyncItemManager.h +++ b/src/renderer/KReportAsyncItemManager_p.h @@ -17,35 +17,28 @@ */ -#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(); @@ -57,7 +50,8 @@ private: QQueue m_renderList; - QList m_itemList; + QList m_itemList; }; -#endif // KOREPORTASYNCITEMMANAGER_H +} +#endif // KREPORTASYNCITEMMANAGER_H diff --git a/src/renderer/KoReportASyncItemManager.cpp b/src/renderer/KReportAsyncItemManager_p.cpp rename from src/renderer/KoReportASyncItemManager.cpp rename to src/renderer/KReportAsyncItemManager_p.cpp --- a/src/renderer/KoReportASyncItemManager.cpp +++ b/src/renderer/KReportAsyncItemManager_p.cpp @@ -17,22 +17,33 @@ */ -#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; @@ -55,7 +66,7 @@ //kreportDebug() << m_renderList.count(); } -void KoReportASyncItemManager::itemFinished() +void AsyncItemManager::itemFinished() { //kreportDebug(); if (m_renderList.count() > 0) { @@ -66,7 +77,7 @@ } } -void KoReportASyncItemManager::startRendering() +void AsyncItemManager::startRendering() { //kreportDebug(); if (m_renderList.count() > 0) { @@ -76,3 +87,5 @@ emit(finished()); } } + +} diff --git a/src/renderer/KoReportHTMLCSSRenderer.h b/src/renderer/KReportHTMLCSSRenderer_p.h rename from src/renderer/KoReportHTMLCSSRenderer.h rename to src/renderer/KReportHTMLCSSRenderer_p.h --- a/src/renderer/KoReportHTMLCSSRenderer.h +++ b/src/renderer/KReportHTMLCSSRenderer_p.h @@ -15,21 +15,23 @@ * 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*); @@ -41,5 +43,6 @@ QString m_tempDirName; }; +} #endif diff --git a/src/renderer/KoReportHTMLCSSRenderer.cpp b/src/renderer/KReportHTMLCSSRenderer_p.cpp rename from src/renderer/KoReportHTMLCSSRenderer.cpp rename to src/renderer/KReportHTMLCSSRenderer_p.cpp --- a/src/renderer/KoReportHTMLCSSRenderer.cpp +++ b/src/renderer/KReportHTMLCSSRenderer_p.cpp @@ -16,27 +16,28 @@ * 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 @@ -80,7 +81,7 @@ } //! @todo use QTextStream for efficiency -QString KoReportHTMLCSSRenderer::renderCSS(ORODocument *document) +QString HTMLCSSRenderer::renderCSS(ORODocument *document) { QString html; QString body; @@ -95,17 +96,17 @@ 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;"); @@ -216,3 +217,5 @@ return html; } + +} \ No newline at end of file diff --git a/src/renderer/KoReportHTMLTableRenderer.h b/src/renderer/KReportHTMLTableRenderer_p.h rename from src/renderer/KoReportHTMLTableRenderer.h rename to src/renderer/KReportHTMLTableRenderer_p.h --- a/src/renderer/KoReportHTMLTableRenderer.h +++ b/src/renderer/KReportHTMLTableRenderer_p.h @@ -15,21 +15,23 @@ * 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*); @@ -41,5 +43,5 @@ QString m_tempDirName; }; - +} #endif diff --git a/src/renderer/KoReportHTMLTableRenderer.cpp b/src/renderer/KReportHTMLTableRenderer_p.cpp rename from src/renderer/KoReportHTMLTableRenderer.cpp rename to src/renderer/KReportHTMLTableRenderer_p.cpp --- a/src/renderer/KoReportHTMLTableRenderer.cpp +++ b/src/renderer/KReportHTMLTableRenderer_p.cpp @@ -16,26 +16,28 @@ * 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 @@ -78,7 +80,7 @@ return status; } -QString KoReportHTMLTableRenderer::renderTable(ORODocument *document) +QString HTMLTableRenderer::renderTable(ORODocument *document) { QString html; QString body; @@ -95,17 +97,17 @@ 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"); @@ -166,3 +168,5 @@ return html; } +} + diff --git a/src/renderer/KoReportKSpreadRenderer.h b/src/renderer/KReportKSpreadRenderer.h rename from src/renderer/KoReportKSpreadRenderer.h rename to src/renderer/KReportKSpreadRenderer.h --- a/src/renderer/KoReportKSpreadRenderer.h +++ b/src/renderer/KReportKSpreadRenderer.h @@ -15,20 +15,20 @@ * 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: diff --git a/src/renderer/KoReportKSpreadRenderer.cpp b/src/renderer/KReportKSpreadRenderer.cpp rename from src/renderer/KoReportKSpreadRenderer.cpp rename to src/renderer/KReportKSpreadRenderer.cpp --- a/src/renderer/KoReportKSpreadRenderer.cpp +++ b/src/renderer/KReportKSpreadRenderer.cpp @@ -20,7 +20,7 @@ #include "ods/KoSimpleOdsDocument.h" #include "ods/KoSimpleOdsCell.h" #include "ods/KoSimpleOdsSheet.h" -#include "common/renderobjects.h" +#include "KReportRenderObjects.h" #include "kreport_debug.h" @@ -50,17 +50,17 @@ 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 diff --git a/src/renderer/KoReportODTRenderer.h b/src/renderer/KReportODTRenderer.h rename from src/renderer/KoReportODTRenderer.h rename to src/renderer/KReportODTRenderer.h --- a/src/renderer/KoReportODTRenderer.h +++ b/src/renderer/KReportODTRenderer.h @@ -15,21 +15,21 @@ * 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; diff --git a/src/renderer/KoReportODTRenderer.cpp b/src/renderer/KReportODTRenderer.cpp rename from src/renderer/KoReportODTRenderer.cpp rename to src/renderer/KReportODTRenderer.cpp --- a/src/renderer/KoReportODTRenderer.cpp +++ b/src/renderer/KReportODTRenderer.cpp @@ -16,7 +16,7 @@ */ #include "KoReportODTRenderer.h" -#include "common/renderobjects.h" +#include "KReportRenderObjects.h" #include #include @@ -50,9 +50,9 @@ 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 diff --git a/src/renderer/KoOdtFrameReportRenderer.h b/src/renderer/KReportOdtFrameReportRenderer.h rename from src/renderer/KoOdtFrameReportRenderer.h rename to src/renderer/KReportOdtFrameReportRenderer.h --- a/src/renderer/KoOdtFrameReportRenderer.h +++ b/src/renderer/KReportOdtFrameReportRenderer.h @@ -16,19 +16,17 @@ * 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); }; diff --git a/src/renderer/KoOdtFrameReportRenderer.cpp b/src/renderer/KReportOdtFrameReportRenderer.cpp rename from src/renderer/KoOdtFrameReportRenderer.cpp rename to src/renderer/KReportOdtFrameReportRenderer.cpp --- a/src/renderer/KoOdtFrameReportRenderer.cpp +++ b/src/renderer/KReportOdtFrameReportRenderer.cpp @@ -23,7 +23,7 @@ #include "odtframe/KoOdtFrameReportPicture.h" #include "odtframe/KoOdtFrameReportLine.h" #include "odtframe/KoOdtFrameReportCheckBox.h" -#include "common/renderobjects.h" +#include "KReportRenderObjects.h" KoOdtFrameReportRenderer::KoOdtFrameReportRenderer() { diff --git a/src/renderer/KReportOneRecordData.h b/src/renderer/KReportOneRecordData_p.h rename from src/renderer/KReportOneRecordData.h rename to src/renderer/KReportOneRecordData_p.h --- a/src/renderer/KReportOneRecordData.h +++ b/src/renderer/KReportOneRecordData_p.h @@ -22,8 +22,9 @@ #ifndef KREPORTONERECORDDATA_H #define KREPORTONERECORDDATA_H -#include +#include +namespace KReportPrivate { /** * @brief A Report Data provide which returns one record * @@ -33,11 +34,11 @@ * 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; @@ -51,5 +52,6 @@ virtual bool close(); virtual bool open(); }; +} #endif // KREPORTONERECORDDATA_H diff --git a/src/renderer/KReportOneRecordData.cpp b/src/renderer/KReportOneRecordData_p.cpp rename from src/renderer/KReportOneRecordData.cpp rename to src/renderer/KReportOneRecordData_p.cpp --- a/src/renderer/KReportOneRecordData.cpp +++ b/src/renderer/KReportOneRecordData_p.cpp @@ -19,76 +19,80 @@ * */ -#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/KoReportPage.h b/src/renderer/KReportPage.h rename from src/renderer/KoReportPage.h rename to src/renderer/KReportPage.h --- a/src/renderer/KoReportPage.h +++ b/src/renderer/KReportPage.h @@ -15,8 +15,8 @@ * License along with this library. If not, see . */ -#ifndef KOREPORTPAGE_H -#define KOREPORTPAGE_H +#ifndef KREPORTPAGE_H +#define KREPORTPAGE_H #include "kreport_export.h" @@ -30,13 +30,13 @@ 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); @@ -49,7 +49,7 @@ void renderCurrentPage(); private: - Q_DISABLE_COPY(KoReportPage) + Q_DISABLE_COPY(KReportPage) class Private; Private * const d; }; diff --git a/src/renderer/KoReportPage.cpp b/src/renderer/KReportPage.cpp rename from src/renderer/KoReportPage.cpp rename to src/renderer/KReportPage.cpp --- a/src/renderer/KoReportPage.cpp +++ b/src/renderer/KReportPage.cpp @@ -15,22 +15,21 @@ * 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) @@ -46,14 +45,14 @@ 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)) { @@ -88,32 +87,32 @@ 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 @@ -123,7 +122,7 @@ } } -void KoReportPage::renderCurrentPage() +void KReportPage::renderCurrentPage() { renderPage(d->page + 1); } diff --git a/src/renderer/KoReportPreRenderer.h b/src/renderer/KReportPreRenderer.h rename from src/renderer/KoReportPreRenderer.h rename to src/renderer/KReportPreRenderer.h --- a/src/renderer/KoReportPreRenderer.h +++ b/src/renderer/KReportPreRenderer.h @@ -16,42 +16,42 @@ * 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 @@ -64,16 +64,16 @@ 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.cpp b/src/renderer/KReportPreRenderer.cpp rename from src/renderer/KoReportPreRenderer.cpp rename to src/renderer/KReportPreRenderer.cpp --- a/src/renderer/KoReportPreRenderer.cpp +++ b/src/renderer/KReportPreRenderer.cpp @@ -16,57 +16,59 @@ * 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) @@ -88,77 +90,77 @@ 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(); @@ -230,7 +232,7 @@ 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 @@ -279,12 +281,12 @@ } } } - 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(); @@ -294,13 +296,13 @@ 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); @@ -314,15 +316,15 @@ 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); @@ -340,15 +342,15 @@ 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); @@ -377,70 +379,70 @@ } #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; @@ -452,45 +454,45 @@ 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 @@ -531,18 +533,18 @@ 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(); @@ -572,19 +574,19 @@ } 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); @@ -620,49 +622,49 @@ 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_p.h b/src/renderer/KReportPreRenderer_p.h rename from src/renderer/KoReportPreRenderer_p.h rename to src/renderer/KReportPreRenderer_p.h --- a/src/renderer/KoReportPreRenderer_p.h +++ b/src/renderer/KReportPreRenderer_p.h @@ -16,34 +16,37 @@ * 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 @@ -55,8 +58,8 @@ 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; @@ -68,25 +71,25 @@ 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.h b/src/renderer/KReportPrintRenderer_p.h rename from src/renderer/KoReportPrintRenderer.h rename to src/renderer/KReportPrintRenderer_p.h --- a/src/renderer/KoReportPrintRenderer.h +++ b/src/renderer/KReportPrintRenderer_p.h @@ -15,25 +15,29 @@ * 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/KoReportPrintRenderer.cpp b/src/renderer/KReportPrintRenderer_p.cpp rename from src/renderer/KoReportPrintRenderer.cpp rename to src/renderer/KReportPrintRenderer_p.cpp --- a/src/renderer/KoReportPrintRenderer.cpp +++ b/src/renderer/KReportPrintRenderer_p.cpp @@ -16,29 +16,32 @@ * 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)); @@ -52,7 +55,7 @@ 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) @@ -121,7 +124,7 @@ 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 @@ -133,7 +136,7 @@ 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); @@ -198,10 +201,10 @@ 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; @@ -253,3 +256,5 @@ return true; } + +} diff --git a/src/renderer/KoReportRendererBase.h b/src/renderer/KReportRendererBase.h rename from src/renderer/KoReportRendererBase.h rename to src/renderer/KReportRendererBase.h --- a/src/renderer/KoReportRendererBase.h +++ b/src/renderer/KReportRendererBase.h @@ -17,8 +17,8 @@ Boston, MA 02110-1301, USA. */ -#ifndef KOREPORTRENDERERBASE_H -#define KOREPORTRENDERERBASE_H +#ifndef KREPORTRENDERERBASE_H +#define KREPORTRENDERERBASE_H #include @@ -29,36 +29,36 @@ 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/KoReportRendererBase.cpp b/src/renderer/KReportRendererBase.cpp rename from src/renderer/KoReportRendererBase.cpp rename to src/renderer/KReportRendererBase.cpp --- a/src/renderer/KoReportRendererBase.cpp +++ b/src/renderer/KReportRendererBase.cpp @@ -17,60 +17,60 @@ 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/KoReportScreenRenderer.h b/src/renderer/KReportScreenRenderer_p.h rename from src/renderer/KoReportScreenRenderer.h rename to src/renderer/KReportScreenRenderer_p.h --- a/src/renderer/KoReportScreenRenderer.h +++ b/src/renderer/KReportScreenRenderer_p.h @@ -15,30 +15,35 @@ * 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/KoReportScreenRenderer.cpp b/src/renderer/KReportScreenRenderer_p.cpp rename from src/renderer/KoReportScreenRenderer.cpp rename to src/renderer/KReportScreenRenderer_p.cpp --- a/src/renderer/KoReportScreenRenderer.cpp +++ b/src/renderer/KReportScreenRenderer_p.cpp @@ -16,27 +16,29 @@ * 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; @@ -77,7 +79,7 @@ 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 @@ -88,7 +90,7 @@ 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); @@ -159,10 +161,10 @@ 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; @@ -219,3 +221,5 @@ return true; } + +} diff --git a/src/renderer/KReportView.cpp b/src/renderer/KReportView.cpp --- a/src/renderer/KReportView.cpp +++ b/src/renderer/KReportView.cpp @@ -18,7 +18,11 @@ */ #include "KReportView.h" -#include +#include "KReportPage.h" +#include "KReportRenderObjects.h" +#include "KReportPreRenderer.h" +#include "KReportRendererBase.h" +#include "kreport_debug.h" #include #include @@ -31,11 +35,6 @@ #include #include -#include -#include -#include -#include "kreport_debug.h" - //! @internal class KReportView::Private { @@ -53,12 +52,12 @@ ORODocument *reportDocument; QGraphicsView *reportView; QGraphicsScene *reportScene; - KoReportPage *reportPage; + KReportPage *reportPage; int currentPage; int pageCount; - KoReportRendererFactory factory; + KReportRendererFactory factory; }; @@ -141,7 +140,7 @@ 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); diff --git a/src/renderer/odtframe/KoOdtFrameReportCheckBox.cpp b/src/renderer/odtframe/KoOdtFrameReportCheckBox.cpp --- a/src/renderer/odtframe/KoOdtFrameReportCheckBox.cpp +++ b/src/renderer/odtframe/KoOdtFrameReportCheckBox.cpp @@ -26,7 +26,7 @@ #include #include -#include "renderobjects.h" +#include "KReportRenderObjects.h" #include #include diff --git a/src/renderer/odtframe/KoOdtFrameReportDocument.cpp b/src/renderer/odtframe/KoOdtFrameReportDocument.cpp --- a/src/renderer/odtframe/KoOdtFrameReportDocument.cpp +++ b/src/renderer/odtframe/KoOdtFrameReportDocument.cpp @@ -19,7 +19,7 @@ #include "KoOdtFrameReportDocument.h" #include "KoOdtFrameReportPrimitive.h" -#include "renderobjects.h" +#include "KReportRenderObjects.h" #include #include diff --git a/src/renderer/odtframe/KoOdtFrameReportImage.cpp b/src/renderer/odtframe/KoOdtFrameReportImage.cpp --- a/src/renderer/odtframe/KoOdtFrameReportImage.cpp +++ b/src/renderer/odtframe/KoOdtFrameReportImage.cpp @@ -25,7 +25,7 @@ #include #include -#include "renderobjects.h" +#include "KReportRenderObjects.h" KoOdtFrameReportImage::KoOdtFrameReportImage(OROImage *primitive) : KoOdtFrameReportPrimitive(primitive) diff --git a/src/renderer/odtframe/KoOdtFrameReportLine.cpp b/src/renderer/odtframe/KoOdtFrameReportLine.cpp --- a/src/renderer/odtframe/KoOdtFrameReportLine.cpp +++ b/src/renderer/odtframe/KoOdtFrameReportLine.cpp @@ -18,7 +18,7 @@ */ #include "KoOdtFrameReportLine.h" -#include "renderobjects.h" +#include "KReportRenderObjects.h" #include #include diff --git a/src/renderer/odtframe/KoOdtFrameReportPicture.cpp b/src/renderer/odtframe/KoOdtFrameReportPicture.cpp --- a/src/renderer/odtframe/KoOdtFrameReportPicture.cpp +++ b/src/renderer/odtframe/KoOdtFrameReportPicture.cpp @@ -18,7 +18,7 @@ */ #include "KoOdtFrameReportPicture.h" -#include "renderobjects.h" +#include "KReportRenderObjects.h" #include #include diff --git a/src/renderer/odtframe/KoOdtFrameReportPrimitive.cpp b/src/renderer/odtframe/KoOdtFrameReportPrimitive.cpp --- a/src/renderer/odtframe/KoOdtFrameReportPrimitive.cpp +++ b/src/renderer/odtframe/KoOdtFrameReportPrimitive.cpp @@ -18,7 +18,7 @@ */ #include "KoOdtFrameReportPrimitive.h" -#include "renderobjects.h" +#include "KReportRenderObjects.h" #include #include diff --git a/src/renderer/odtframe/KoOdtFrameReportTextBox.cpp b/src/renderer/odtframe/KoOdtFrameReportTextBox.cpp --- a/src/renderer/odtframe/KoOdtFrameReportTextBox.cpp +++ b/src/renderer/odtframe/KoOdtFrameReportTextBox.cpp @@ -18,7 +18,7 @@ */ #include "KoOdtFrameReportTextBox.h" -#include "renderobjects.h" +#include "KReportRenderObjects.h" #include #include diff --git a/src/renderer/scripting/kreportgrouptracker.h b/src/renderer/scripting/KReportGroupTracker.h rename from src/renderer/scripting/kreportgrouptracker.h rename to src/renderer/scripting/KReportGroupTracker.h diff --git a/src/renderer/scripting/krscriptconstants.h b/src/renderer/scripting/KReportScriptConstants.h rename from src/renderer/scripting/krscriptconstants.h rename to src/renderer/scripting/KReportScriptConstants.h --- a/src/renderer/scripting/krscriptconstants.h +++ b/src/renderer/scripting/KReportScriptConstants.h @@ -23,13 +23,13 @@ /** */ -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}; diff --git a/src/renderer/scripting/krscriptconstants.cpp b/src/renderer/scripting/KReportScriptConstants.cpp rename from src/renderer/scripting/krscriptconstants.cpp rename to src/renderer/scripting/KReportScriptConstants.cpp --- a/src/renderer/scripting/krscriptconstants.cpp +++ b/src/renderer/scripting/KReportScriptConstants.cpp @@ -16,17 +16,17 @@ * 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/krscriptdebug.h b/src/renderer/scripting/KReportScriptDebug.h rename from src/renderer/scripting/krscriptdebug.h rename to src/renderer/scripting/KReportScriptDebug.h --- a/src/renderer/scripting/krscriptdebug.h +++ b/src/renderer/scripting/KReportScriptDebug.h @@ -22,13 +22,13 @@ /** */ -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&); diff --git a/src/renderer/scripting/krscriptdebug.cpp b/src/renderer/scripting/KReportScriptDebug.cpp rename from src/renderer/scripting/krscriptdebug.cpp rename to src/renderer/scripting/KReportScriptDebug.cpp --- a/src/renderer/scripting/krscriptdebug.cpp +++ b/src/renderer/scripting/KReportScriptDebug.cpp @@ -15,28 +15,27 @@ * 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/krscriptdraw.h b/src/renderer/scripting/KReportScriptDraw.h rename from src/renderer/scripting/krscriptdraw.h rename to src/renderer/scripting/KReportScriptDraw.h --- a/src/renderer/scripting/krscriptdraw.h +++ b/src/renderer/scripting/KReportScriptDraw.h @@ -25,13 +25,13 @@ /** */ -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: diff --git a/src/renderer/scripting/krscriptdraw.cpp b/src/renderer/scripting/KReportScriptDraw.cpp rename from src/renderer/scripting/krscriptdraw.cpp rename to src/renderer/scripting/KReportScriptDraw.cpp --- a/src/renderer/scripting/krscriptdraw.cpp +++ b/src/renderer/scripting/KReportScriptDraw.cpp @@ -15,40 +15,41 @@ * 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)); @@ -65,12 +66,12 @@ } } -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)); @@ -87,33 +88,30 @@ } } -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); @@ -125,13 +123,13 @@ 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(); diff --git a/src/renderer/scripting/krscripthandler.h b/src/renderer/scripting/KReportScriptHandler.h rename from src/renderer/scripting/krscripthandler.h rename to src/renderer/scripting/KReportScriptHandler.h --- a/src/renderer/scripting/krscripthandler.h +++ b/src/renderer/scripting/KReportScriptHandler.h @@ -21,39 +21,38 @@ #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) { @@ -68,27 +67,27 @@ 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/krscripthandler.cpp b/src/renderer/scripting/KReportScriptHandler.cpp rename from src/renderer/scripting/krscripthandler.cpp rename to src/renderer/scripting/KReportScriptHandler.cpp --- a/src/renderer/scripting/krscripthandler.cpp +++ b/src/renderer/scripting/KReportScriptHandler.cpp @@ -16,28 +16,28 @@ * 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; @@ -48,24 +48,24 @@ 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('_')) @@ -79,9 +79,9 @@ 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()) { @@ -99,34 +99,34 @@ 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); @@ -138,7 +138,7 @@ } } -QVariant KRScriptHandler::evaluate(const QString &code) +QVariant KReportScriptHandler::evaluate(const QString &code) { if (!m_scriptValue.isError()) { QJSValue result = m_engine->evaluate(code); @@ -151,16 +151,16 @@ 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(); @@ -174,7 +174,7 @@ } #endif -QJSValue KRScriptHandler::registerScriptObject(QObject* obj, const QString& name) +QJSValue KReportScriptHandler::registerScriptObject(QObject* obj, const QString& name) { QJSValue val; val = m_engine->newQObject(obj); diff --git a/src/renderer/scripting/krscriptline.h b/src/renderer/scripting/KReportScriptLine.h rename from src/renderer/scripting/krscriptline.h rename to src/renderer/scripting/KReportScriptLine.h --- a/src/renderer/scripting/krscriptline.h +++ b/src/renderer/scripting/KReportScriptLine.h @@ -22,7 +22,7 @@ #include #include -class KoReportItemLine; +class KReportItemLine; namespace Scripting { @@ -33,7 +33,7 @@ { Q_OBJECT public: - explicit Line(KoReportItemLine *); + explicit Line(KReportItemLine *); ~Line(); @@ -100,7 +100,7 @@ void setLineStyle(int); private: - KoReportItemLine *m_line; + KReportItemLine *m_line; }; diff --git a/src/renderer/scripting/krscriptline.cpp b/src/renderer/scripting/KReportScriptLine.cpp rename from src/renderer/scripting/krscriptline.cpp rename to src/renderer/scripting/KReportScriptLine.cpp --- a/src/renderer/scripting/krscriptline.cpp +++ b/src/renderer/scripting/KReportScriptLine.cpp @@ -15,15 +15,15 @@ * 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; } diff --git a/src/renderer/scripting/krscriptreport.h b/src/renderer/scripting/KReportScriptReport.h rename from src/renderer/scripting/krscriptreport.h rename to src/renderer/scripting/KReportScriptReport.h --- a/src/renderer/scripting/krscriptreport.h +++ b/src/renderer/scripting/KReportScriptReport.h @@ -20,7 +20,7 @@ #include #include -class KoReportReportData; +class KReportDocument; namespace Scripting { @@ -31,7 +31,7 @@ { Q_OBJECT public: - explicit Report(KoReportReportData*); + explicit Report(KReportDocument*); ~Report(); @@ -49,7 +49,7 @@ void eventOnNewPage(); private: - KoReportReportData *m_reportData; + KReportDocument *m_reportData; QJSValue m_scriptObject; }; diff --git a/src/renderer/scripting/krscriptreport.cpp b/src/renderer/scripting/KReportScriptReport.cpp rename from src/renderer/scripting/krscriptreport.cpp rename to src/renderer/scripting/KReportScriptReport.cpp --- a/src/renderer/scripting/krscriptreport.cpp +++ b/src/renderer/scripting/KReportScriptReport.cpp @@ -15,20 +15,20 @@ * 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; @@ -57,16 +57,16 @@ 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) { @@ -84,7 +84,7 @@ 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 { diff --git a/src/renderer/scripting/krscriptsection.h b/src/renderer/scripting/KReportScriptSection.h rename from src/renderer/scripting/krscriptsection.h rename to src/renderer/scripting/KReportScriptSection.h --- a/src/renderer/scripting/krscriptsection.h +++ b/src/renderer/scripting/KReportScriptSection.h @@ -20,7 +20,7 @@ #include #include -class KRSectionData; +class KReportSectionData; /** */ @@ -30,7 +30,7 @@ { Q_OBJECT public: - explicit Section(KRSectionData*); + explicit Section(KReportSectionData*); ~Section(); @@ -59,7 +59,7 @@ void eventOnRender(); private: - KRSectionData *m_section; + KReportSectionData *m_section; QJSValue m_scriptObject; }; } diff --git a/src/renderer/scripting/krscriptsection.cpp b/src/renderer/scripting/KReportScriptSection.cpp rename from src/renderer/scripting/krscriptsection.cpp rename to src/renderer/scripting/KReportScriptSection.cpp --- a/src/renderer/scripting/krscriptsection.cpp +++ b/src/renderer/scripting/KReportScriptSection.cpp @@ -14,19 +14,19 @@ * 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; @@ -66,11 +66,11 @@ 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) { diff --git a/src/wrtembed/KoReportDesigner.h b/src/wrtembed/KReportDesigner.h rename from src/wrtembed/KoReportDesigner.h rename to src/wrtembed/KReportDesigner.h --- a/src/wrtembed/KoReportDesigner.h +++ b/src/wrtembed/KReportDesigner.h @@ -16,97 +16,97 @@ * 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 @@ -139,12 +139,12 @@ 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; @@ -190,14 +190,14 @@ @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 @@ -225,7 +225,7 @@ /** @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. @@ -292,7 +292,7 @@ /** @brief Sets the detail section to the given section */ - void setDetail(ReportSectionDetail *rsd); + void setDetail(KReportDesignerSectionDetail *rsd); /** @brief Deletes the detail section @@ -329,7 +329,7 @@ void itemInserted(const QString& entity); private: - Q_DISABLE_COPY(KoReportDesigner) + Q_DISABLE_COPY(KReportDesigner) class Private; Private * const d; }; diff --git a/src/wrtembed/KoReportDesigner.cpp b/src/wrtembed/KReportDesigner.cpp rename from src/wrtembed/KoReportDesigner.cpp rename to src/wrtembed/KReportDesigner.cpp --- a/src/wrtembed/KoReportDesigner.cpp +++ b/src/wrtembed/KReportDesigner.cpp @@ -17,22 +17,23 @@ * 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 @@ -96,12 +97,12 @@ 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() @@ -138,26 +139,26 @@ 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; @@ -200,16 +201,16 @@ 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(); @@ -231,7 +232,7 @@ 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)); @@ -242,7 +243,7 @@ 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); @@ -256,13 +257,13 @@ 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(); @@ -339,12 +340,12 @@ //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); } @@ -364,7 +365,7 @@ } ///The saving code -QDomElement KoReportDesigner::document() const +QDomElement KReportDesigner::document() const { QDomDocument doc; QString saveInterpreter; @@ -433,11 +434,11 @@ 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); } @@ -451,15 +452,15 @@ 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) { @@ -470,92 +471,92 @@ } } -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: @@ -567,75 +568,75 @@ } } -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; } @@ -646,54 +647,54 @@ } } -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(); @@ -703,7 +704,7 @@ return qs; } -QStringList KoReportDesigner::fieldKeys() const +QStringList KReportDesigner::fieldKeys() const { QStringList qs; qs << QString(); @@ -713,7 +714,7 @@ return qs; } -void KoReportDesigner::createProperties() +void KReportDesigner::createProperties() { QStringList keys, strings; d->set = new KPropertySet(0, QLatin1String("Report")); @@ -787,7 +788,7 @@ /** @brief Handle property changes */ -void KoReportDesigner::slotPropertyChanged(KPropertySet &s, KProperty &p) +void KReportDesigner::slotPropertyChanged(KPropertySet &s, KProperty &p) { setModified(true); emit pagePropertyChanged(s); @@ -803,7 +804,7 @@ } } -void KoReportDesigner::slotPageButton_Pressed() +void KReportDesigner::slotPageButton_Pressed() { #ifdef KREPORT_SCRIPTING if (d->kordata) { @@ -815,7 +816,7 @@ #endif } -QSize KoReportDesigner::sizeHint() const +QSize KReportDesigner::sizeHint() const { int w = 0; int h = 0; @@ -856,7 +857,7 @@ return QSize(w, h); } -int KoReportDesigner::pageWidthPx() const +int KReportDesigner::pageWidthPx() const { int cw = 0; int ch = 0; @@ -876,14 +877,14 @@ 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; @@ -897,13 +898,13 @@ 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; @@ -918,16 +919,16 @@ 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); @@ -965,14 +966,14 @@ } } -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(); @@ -995,12 +996,12 @@ 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) { @@ -1014,7 +1015,7 @@ 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()) { @@ -1031,15 +1032,15 @@ } } -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) @@ -1055,15 +1056,15 @@ // 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; @@ -1090,7 +1091,7 @@ } } -void KoReportDesigner::slotEditCut() +void KReportDesigner::slotEditCut() { if (selectionCount() > 0) { //First delete any items that are curerntly in the list @@ -1103,8 +1104,8 @@ 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); @@ -1120,29 +1121,29 @@ } } -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 @@ -1158,12 +1159,12 @@ //! @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)); @@ -1182,22 +1183,22 @@ } } } -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(); @@ -1207,18 +1208,18 @@ 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(); @@ -1253,18 +1254,18 @@ 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; @@ -1281,7 +1282,7 @@ 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; @@ -1293,7 +1294,7 @@ 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; @@ -1307,7 +1308,7 @@ 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; @@ -1327,9 +1328,9 @@ 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: @@ -1363,7 +1364,7 @@ return actList; } -QList< QAction* > KoReportDesigner::designerActions() +QList< QAction* > KReportDesigner::designerActions() { QList al; QAction *sep = new QAction(QString(), this); @@ -1374,7 +1375,7 @@ 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")); @@ -1422,7 +1423,7 @@ 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); @@ -1450,7 +1451,7 @@ d->detail->setSectionCursor(c); } -void KoReportDesigner::unsetSectionCursor() +void KReportDesigner::unsetSectionCursor() { if (d->pageFooterAny) d->pageFooterAny->unsetSectionCursor(); @@ -1478,50 +1479,50 @@ 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; diff --git a/src/wrtembed/KoReportDesignerItemBase.h b/src/wrtembed/KReportDesignerItemBase.h rename from src/wrtembed/KoReportDesignerItemBase.h rename to src/wrtembed/KReportDesignerItemBase.h --- a/src/wrtembed/KoReportDesignerItemBase.h +++ b/src/wrtembed/KReportDesignerItemBase.h @@ -21,53 +21,53 @@ * 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; /** diff --git a/src/wrtembed/KoReportDesignerItemBase.cpp b/src/wrtembed/KReportDesignerItemBase.cpp rename from src/wrtembed/KoReportDesignerItemBase.cpp rename to src/wrtembed/KReportDesignerItemBase.cpp --- a/src/wrtembed/KoReportDesignerItemBase.cpp +++ b/src/wrtembed/KReportDesignerItemBase.cpp @@ -16,61 +16,60 @@ * 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/KoReportDesignerItemLine.h b/src/wrtembed/KReportDesignerItemLine.h rename from src/wrtembed/KoReportDesignerItemLine.h rename to src/wrtembed/KReportDesignerItemLine.h --- a/src/wrtembed/KoReportDesignerItemLine.h +++ b/src/wrtembed/KReportDesignerItemLine.h @@ -16,37 +16,36 @@ * 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; diff --git a/src/wrtembed/KoReportDesignerItemLine.cpp b/src/wrtembed/KReportDesignerItemLine.cpp rename from src/wrtembed/KoReportDesignerItemLine.cpp rename to src/wrtembed/KReportDesignerItemLine.cpp --- a/src/wrtembed/KoReportDesignerItemLine.cpp +++ b/src/wrtembed/KReportDesignerItemLine.cpp @@ -16,12 +16,12 @@ * 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 @@ -31,7 +31,7 @@ // // class ReportEntityLine // -void KoReportDesignerItemLine::init(QGraphicsScene* s, KoReportDesigner *r) +void KReportDesignerItemLine::init(QGraphicsScene* s, KReportDesigner *r) { m_reportDesigner = r; setPos(0, 0); @@ -51,41 +51,41 @@ 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); @@ -108,7 +108,7 @@ } } -void KoReportDesignerItemLine::buildXML(QDomDocument *doc, QDomElement *parent) +void KReportDesignerItemLine::buildXML(QDomDocument *doc, QDomElement *parent) { QDomElement entity = doc->createElement(QLatin1String("report:") + typeName()); @@ -125,15 +125,15 @@ 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()); } @@ -151,29 +151,29 @@ 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(); @@ -191,7 +191,7 @@ 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) && @@ -206,7 +206,7 @@ } } -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 @@ -220,7 +220,7 @@ } -void KoReportDesignerItemLine::hoverMoveEvent(QGraphicsSceneHoverEvent * event) +void KReportDesignerItemLine::hoverMoveEvent(QGraphicsSceneHoverEvent * event) { if (isSelected()) { m_grabAction = grabHandle(event->pos()); @@ -237,13 +237,13 @@ } } -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; diff --git a/src/wrtembed/KoReportDesignerItemRectBase.h b/src/wrtembed/KReportDesignerItemRectBase.h rename from src/wrtembed/KoReportDesignerItemRectBase.h rename to src/wrtembed/KReportDesignerItemRectBase.h --- a/src/wrtembed/KoReportDesignerItemRectBase.h +++ b/src/wrtembed/KReportDesignerItemRectBase.h @@ -17,39 +17,39 @@ * 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; @@ -77,14 +77,14 @@ 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; }; diff --git a/src/wrtembed/KoReportDesignerItemRectBase.cpp b/src/wrtembed/KReportDesignerItemRectBase.cpp rename from src/wrtembed/KoReportDesignerItemRectBase.cpp rename to src/wrtembed/KReportDesignerItemRectBase.cpp --- a/src/wrtembed/KoReportDesignerItemRectBase.cpp +++ b/src/wrtembed/KReportDesignerItemRectBase.cpp @@ -16,20 +16,20 @@ * 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); @@ -48,37 +48,37 @@ #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()); @@ -89,7 +89,7 @@ this->update(); } -void KoReportDesignerItemRectBase::mousePressEvent(QGraphicsSceneMouseEvent * event) +void KReportDesignerItemRectBase::mousePressEvent(QGraphicsSceneMouseEvent * event) { //Update and show properties m_ppos->setScenePos(QPointF(sceneRect().x(), sceneRect().y())); @@ -100,22 +100,22 @@ 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(); @@ -159,7 +159,7 @@ } } -void KoReportDesignerItemRectBase::hoverMoveEvent(QGraphicsSceneHoverEvent * event) +void KReportDesignerItemRectBase::hoverMoveEvent(QGraphicsSceneHoverEvent * event) { //m_grabAction = 0; @@ -197,7 +197,7 @@ //kreportDebug() << m_grabAction; } -void KoReportDesignerItemRectBase::drawHandles(QPainter *painter) +void KReportDesignerItemRectBase::drawHandles(QPainter *painter) { if (isSelected()) { // draw a selected border for visual purposes @@ -232,7 +232,7 @@ 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); @@ -267,12 +267,12 @@ 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())) @@ -285,11 +285,11 @@ 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())) @@ -300,31 +300,31 @@ 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(); @@ -340,7 +340,7 @@ 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(); @@ -362,15 +362,15 @@ 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()) { diff --git a/src/wrtembed/reportscene.h b/src/wrtembed/KReportDesignerScene.h rename from src/wrtembed/reportscene.h rename to src/wrtembed/KReportDesignerScene.h --- a/src/wrtembed/reportscene.h +++ b/src/wrtembed/KReportDesignerScene.h @@ -22,26 +22,26 @@ // 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&); @@ -65,9 +65,9 @@ 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; diff --git a/src/wrtembed/reportscene.cpp b/src/wrtembed/KReportDesignerScene.cpp rename from src/wrtembed/reportscene.cpp rename to src/wrtembed/KReportDesignerScene.cpp --- a/src/wrtembed/reportscene.cpp +++ b/src/wrtembed/KReportDesignerScene.cpp @@ -16,21 +16,21 @@ * 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; @@ -57,12 +57,12 @@ } } } -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); @@ -125,7 +125,7 @@ } } -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 @@ -139,21 +139,21 @@ 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; @@ -186,15 +186,15 @@ 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; @@ -210,7 +210,7 @@ return z; } -qreal ReportScene::highestZValue() +qreal KReportDesignerScene::highestZValue() { qreal z; qreal zz; @@ -225,25 +225,25 @@ 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(); @@ -256,10 +256,10 @@ 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/reportsection.h b/src/wrtembed/KReportDesignerSection.h rename from src/wrtembed/reportsection.h rename to src/wrtembed/KReportDesignerSection.h --- a/src/wrtembed/reportsection.h +++ b/src/wrtembed/KReportDesignerSection.h @@ -34,20 +34,20 @@ 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); @@ -76,10 +76,10 @@ 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/reportsection.cpp b/src/wrtembed/KReportDesignerSection.cpp rename from src/wrtembed/reportsection.cpp rename to src/wrtembed/KReportDesignerSection.cpp --- a/src/wrtembed/reportsection.cpp +++ b/src/wrtembed/KReportDesignerSection.cpp @@ -17,21 +17,21 @@ * 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 @@ -59,12 +59,12 @@ }; //! @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(); @@ -75,32 +75,32 @@ }; //! @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); @@ -117,14 +117,14 @@ 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); @@ -147,17 +147,17 @@ 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 @@ -178,20 +178,20 @@ 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; @@ -215,15 +215,15 @@ //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); } @@ -235,12 +235,12 @@ } } -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) @@ -251,7 +251,7 @@ //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); } @@ -270,13 +270,13 @@ 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(); @@ -298,19 +298,19 @@ 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; @@ -345,14 +345,14 @@ //============================================================================= -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() { } @@ -375,17 +375,17 @@ *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)) { @@ -405,12 +405,12 @@ 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/reportsectiondetail.h b/src/wrtembed/KReportDesignerSectionDetail.h rename from src/wrtembed/reportsectiondetail.h rename to src/wrtembed/KReportDesignerSectionDetail.h --- a/src/wrtembed/reportsectiondetail.h +++ b/src/wrtembed/KReportDesignerSectionDetail.h @@ -16,8 +16,8 @@ * License along with this library. If not, see . */ -#ifndef REPORTSECTIONDETAIL_H -#define REPORTSECTIONDETAIL_H +#ifndef KREPORTSECTIONDETAIL_H +#define KREPORTSECTIONDETAIL_H #include @@ -27,18 +27,18 @@ 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, @@ -48,25 +48,25 @@ 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; }; diff --git a/src/wrtembed/reportsectiondetail.cpp b/src/wrtembed/KReportDesignerSectionDetail.cpp rename from src/wrtembed/reportsectiondetail.cpp rename to src/wrtembed/KReportDesignerSectionDetail.cpp --- a/src/wrtembed/reportsectiondetail.cpp +++ b/src/wrtembed/KReportDesignerSectionDetail.cpp @@ -16,83 +16,82 @@ * 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); } @@ -103,7 +102,7 @@ section->appendChild(gdetail); } -void ReportSectionDetail::initFromXML(QDomNode *section) +void KReportDesignerSectionDetail::initFromXML(QDomNode *section) { QDomNodeList nl = section->childNodes(); QDomNode node; @@ -118,7 +117,7 @@ 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")) { @@ -132,22 +131,22 @@ } -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); @@ -176,19 +175,19 @@ 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()); @@ -200,34 +199,34 @@ 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()) diff --git a/src/wrtembed/reportsectiondetailgroup.h b/src/wrtembed/KReportDesignerSectionDetailGroup.h rename from src/wrtembed/reportsectiondetailgroup.h rename to src/wrtembed/KReportDesignerSectionDetailGroup.h --- a/src/wrtembed/reportsectiondetailgroup.h +++ b/src/wrtembed/KReportDesignerSectionDetailGroup.h @@ -16,8 +16,8 @@ * License along with this library. If not, see . */ -#ifndef REPORTSECTIONDETAILGROUP_H -#define REPORTSECTIONDETAILGROUP_H +#ifndef KREPORTSECTIONDETAILGROUP_H +#define KREPORTSECTIONDETAILGROUP_H #include @@ -28,17 +28,17 @@ 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, @@ -61,14 +61,14 @@ 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; }; diff --git a/src/wrtembed/reportsectiondetailgroup.cpp b/src/wrtembed/KReportDesignerSectionDetailGroup.cpp rename from src/wrtembed/reportsectiondetailgroup.cpp rename to src/wrtembed/KReportDesignerSectionDetailGroup.cpp --- a/src/wrtembed/reportsectiondetailgroup.cpp +++ b/src/wrtembed/KReportDesignerSectionDetailGroup.cpp @@ -16,21 +16,21 @@ * 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) {} @@ -44,48 +44,48 @@ 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")); } @@ -113,18 +113,18 @@ 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 ); } } @@ -147,62 +147,62 @@ } } -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; @@ -213,11 +213,11 @@ 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/reportsceneview.h b/src/wrtembed/KReportDesignerView.h rename from src/wrtembed/reportsceneview.h rename to src/wrtembed/KReportDesignerView.h --- a/src/wrtembed/reportsceneview.h +++ b/src/wrtembed/KReportDesignerView.h @@ -16,21 +16,21 @@ * 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&); @@ -40,7 +40,7 @@ void mouseReleaseEvent(QMouseEvent * e); private: - KoReportDesigner* m_reportDesigner; + KReportDesigner* m_reportDesigner; }; #endif diff --git a/src/wrtembed/reportsceneview.cpp b/src/wrtembed/KReportDesignerView.cpp rename from src/wrtembed/reportsceneview.cpp rename to src/wrtembed/KReportDesignerView.cpp --- a/src/wrtembed/reportsceneview.cpp +++ b/src/wrtembed/KReportDesignerView.cpp @@ -19,12 +19,12 @@ // // 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; @@ -41,36 +41,36 @@ } -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/detailgroupsectiondialog.h b/src/wrtembed/KReportDetailGroupSectionDialog.h rename from src/wrtembed/detailgroupsectiondialog.h rename to src/wrtembed/KReportDetailGroupSectionDialog.h --- a/src/wrtembed/detailgroupsectiondialog.h +++ b/src/wrtembed/KReportDetailGroupSectionDialog.h @@ -21,15 +21,15 @@ #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.cpp b/src/wrtembed/KReportDetailGroupSectionDialog.cpp rename from src/wrtembed/detailgroupsectiondialog.cpp rename to src/wrtembed/KReportDetailGroupSectionDialog.cpp --- a/src/wrtembed/detailgroupsectiondialog.cpp +++ b/src/wrtembed/KReportDetailGroupSectionDialog.cpp @@ -16,15 +16,15 @@ * 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); @@ -38,7 +38,7 @@ /* * 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.ui b/src/wrtembed/KReportDetailGroupSectionDialog.ui rename from src/wrtembed/detailgroupsectiondialog.ui rename to src/wrtembed/KReportDetailGroupSectionDialog.ui diff --git a/src/wrtembed/reportpropertiesbutton.h b/src/wrtembed/KReportPropertiesButton.h rename from src/wrtembed/reportpropertiesbutton.h rename to src/wrtembed/KReportPropertiesButton.h --- a/src/wrtembed/reportpropertiesbutton.h +++ b/src/wrtembed/KReportPropertiesButton.h @@ -22,11 +22,11 @@ #include -class ReportPropertiesButton : public QCheckBox +class KReportPropertiesButton : public QCheckBox { Q_OBJECT public: - explicit ReportPropertiesButton(QWidget*); + explicit KReportPropertiesButton(QWidget*); protected: virtual void paintEvent(QPaintEvent*); }; diff --git a/src/wrtembed/reportpropertiesbutton.cpp b/src/wrtembed/KReportPropertiesButton.cpp rename from src/wrtembed/reportpropertiesbutton.cpp rename to src/wrtembed/KReportPropertiesButton.cpp --- a/src/wrtembed/reportpropertiesbutton.cpp +++ b/src/wrtembed/KReportPropertiesButton.cpp @@ -17,17 +17,17 @@ 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); diff --git a/src/wrtembed/sectioneditor.h b/src/wrtembed/KReportSectionEditor.h rename from src/wrtembed/sectioneditor.h rename to src/wrtembed/KReportSectionEditor.h --- a/src/wrtembed/sectioneditor.h +++ b/src/wrtembed/KReportSectionEditor.h @@ -23,22 +23,22 @@ #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); @@ -64,7 +64,7 @@ void updateButtonsForRow(int row); private: - bool editDetailGroup(ReportSectionDetailGroup *rsdg); + bool editDetailGroup(KReportDesignerSectionDetailGroup *rsdg); void updateAddButton(); QString columnName(const QString &column) const; @@ -78,8 +78,8 @@ 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.cpp b/src/wrtembed/KReportSectionEditor.cpp rename from src/wrtembed/sectioneditor.cpp rename to src/wrtembed/KReportSectionEditor.cpp --- a/src/wrtembed/sectioneditor.cpp +++ b/src/wrtembed/KReportSectionEditor.cpp @@ -17,24 +17,24 @@ * 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) @@ -48,7 +48,7 @@ * 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 @@ -110,151 +110,151 @@ /* * 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; @@ -281,9 +281,9 @@ 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(); @@ -316,7 +316,7 @@ 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()); @@ -333,8 +333,8 @@ 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 = @@ -347,60 +347,60 @@ 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 @@ -424,8 +424,8 @@ } // 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); @@ -443,7 +443,7 @@ } -void SectionEditor::btnRemove_clicked() +void KReportSectionEditor::btnRemove_clicked() { if (m_reportSectionDetail) { const int index = m_ui.lbGroups->currentRow(); @@ -461,16 +461,16 @@ } -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); @@ -481,16 +481,16 @@ } -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); @@ -500,25 +500,25 @@ } } -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; diff --git a/src/wrtembed/sectioneditor.ui b/src/wrtembed/KReportSectionEditor.ui rename from src/wrtembed/sectioneditor.ui rename to src/wrtembed/KReportSectionEditor.ui