Commit 8b125b02 authored by Jarosław Staniek's avatar Jarosław Staniek

Remove the koreport lib +plugins, it will be replaced by external KReport

(also add the proper name KReport to linking commands)
parent 23d69297
......@@ -800,15 +800,6 @@ set(KOPAGEAPP_INCLUDES ${TEXTLAYOUT_INCLUDES}
${CMAKE_SOURCE_DIR}/libs/widgets
${CMAKE_SOURCE_DIR}/libs/kopageapp ${CMAKE_SOURCE_DIR}/libs/kopageapp/commands ${CMAKE_BINARY_DIR}/libs/kopageapp )
# koreport
set(KOREPORT_INCLUDES
${CMAKE_SOURCE_DIR}/libs/
${CMAKE_SOURCE_DIR}/libs/koreport
${CMAKE_SOURCE_DIR}/libs/koreport/common
${CMAKE_SOURCE_DIR}/libs/koreport/renderer
${CMAKE_SOURCE_DIR}/libs/koreport/wrtembed)
set(KOREPORT_LIBS koreport)
# calligradb
set(CALLIGRADB_LIBS calligradb) # TODO remove when Predicate lib arrives
set(CALLIGRADB_INCLUDES ${CMAKE_SOURCE_DIR}/libs # TODO remove when Predicate lib arrives
......
......@@ -65,7 +65,6 @@ calligra_define_product(BUILDTOOL_RNG2CPP "rng2cpp")
# Calligra-independent utility libs
calligra_define_product(LIB_KOVECTORIMAGE "libkovectorimage")
calligra_define_product(LIB_CALLIGRADB "libcalligradb" UNPORTED)
calligra_define_product(LIB_KOREPORT "libkoreport" UNPORTED REQUIRES LIB_CALLIGRADB)
# calligra libs
calligra_define_product(LIB_CALLIGRA "Calligra core libs" REQUIRES BUILDTOOL_RNG2CPP)
......@@ -95,9 +94,9 @@ calligra_define_product(APP_SHEETS "Sheets app (for Desktop)" UNPORTED REQUIRES
calligra_define_product(APP_AUTHOR "Author app (for Desktop)" UNPORTED REQUIRES PART_WORDS)
calligra_define_product(APP_KARBON "Karbon app (for Desktop)" UNPORTED REQUIRES LIB_CALLIGRA)
calligra_define_product(APP_KRITA "Krita app (for Desktop)" UNPORTED REQUIRES LIB_CALLIGRA)
calligra_define_product(APP_KEXI "Kexi app (for Desktop)" UNPORTED REQUIRES LIB_CALLIGRA LIB_KOREPORT LIB_CALLIGRADB)
calligra_define_product(APP_KEXI "Kexi app (for Desktop)" UNPORTED REQUIRES LIB_CALLIGRA LIB_CALLIGRADB)
calligra_define_product(APP_FLOW "Flow app (for Desktop)" UNPORTED REQUIRES LIB_CALLIGRA LIB_KOPAGEAPP)
calligra_define_product(APP_PLAN "Plan app (for Desktop)" UNPORTED REQUIRES LIB_CALLIGRA LIB_KOREPORT)
calligra_define_product(APP_PLAN "Plan app (for Desktop)" UNPORTED REQUIRES LIB_CALLIGRA)
calligra_define_product(APP_BRAINDUMP "Braindump app (for Desktop)" UNPORTED REQUIRES LIB_CALLIGRA)
calligra_define_product(APP_GEMINI "The Calligra Gemini application" UNPORTED REQUIRES PART_QTQUICK)
# TODO: this needs to be split up by app products
......@@ -129,7 +128,6 @@ calligra_define_product(PLUGIN_PLUGINSHAPE "Plugin shape plugin" UNPORTED REQUI
calligra_define_product(PLUGIN_FORMULASHAPE "Formula shape plugin" UNPORTED REQUIRES LIB_CALLIGRA)
calligra_define_product(PLUGIN_VIDEOSHAPE "Plugin for handling videos in Calligra" UNPORTED REQUIRES LIB_CALLIGRA)
calligra_define_product(PLUGIN_VECTORSHAPE "Vectorgraphic shape plugin" UNPORTED REQUIRES LIB_CALLIGRA LIB_KOVECTORIMAGE)
calligra_define_product(PLUGIN_REPORTING "Renderer plugins for libkoreport" UNPORTED REQUIRES LIB_KOREPORT)
calligra_define_product(PLUGIN_SEMANTICITEMS "Semantic items plugins" UNPORTED REQUIRES FEATURE_RDF LIB_CALLIGRA)
calligra_define_product(PLUGIN_CALLIGRAGEMINI_GIT "Git support plugin for Calligra Gemini" UNPORTED)
......@@ -448,7 +446,6 @@ calligra_define_productset(KEXI "Full Kexi (for Desktop)"
OPTIONAL
FEATURE_SCRIPTING
PLUGIN_KEXI_SPREADSHEETMIGRATION
PLUGIN_REPORTING
)
calligra_define_productset(KRITA "Full Krita"
REQUIRES
......
......@@ -29,11 +29,6 @@ if (SHOULD_BUILD_LIB_CALLIGRADB)
add_subdirectory( db ) # used by Kexi and Word's Biblio; TODO: remove when Predicate lib arrives
endif ()
# only build koreport if possible
if (SHOULD_BUILD_LIB_KOREPORT)
add_subdirectory( koreport )
endif ()
if (SHOULD_BUILD_FEATURE_RDF)
add_subdirectory( rdf )
endif ()
#! /bin/sh
source ../calligra_xgettext.sh
EXCLUDE="-o -path ./db/drivers/sqlite" # TODO: -o -path ./koreport"
EXCLUDE="-o -path ./db/drivers/sqlite"
LIST=`find . \( $EXCLUDE \) -prune -o \( -name \*.ui -o -name \*.rc \) -type f -print | grep -v -e '/\.'`
$EXTRACTRC $LIST >> rc.cpp
LIST=`find . \( $EXCLUDE \) -prune -o \( -name \*.cpp -o -name \*.cc -o -name \*.h \) -type f -print | grep -v '/tests/' | grep -v -e '/\.'`
......
#make it a project so cmake spits out a codeblocks project
#project(reports)
if(KDE4_BUILD_TESTS)
# only with this definition will the KOREPORT_TEST_EXPORT macro do something
add_definitions(-DCOMPILING_TESTS)
endif()
add_subdirectory(pics)
add_subdirectory(tests)
include_directories(
${CMAKE_SOURCE_DIR}/libs/widgets
${FLAKE_INCLUDES}
${KOREPORT_INCLUDES}
)
#build a shared library
set(koreport_LIB_SRCS
common/krutils.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/KoReportPluginInfo.cpp
common/KoReportData.cpp
renderer/KoReportPrintRenderer.cpp
renderer/KoReportPreRenderer.cpp
renderer/KoReportASyncItemManager.cpp
renderer/KoReportScreenRenderer.cpp
renderer/KoReportHTMLTableRenderer.cpp
renderer/KoReportHTMLCSSRenderer.cpp
renderer/KoReportKSpreadRenderer.cpp
renderer/KoReportODTRenderer.cpp
renderer/KoOdtFrameReportRenderer.cpp
renderer/KoReportRendererBase.cpp
renderer/KoReportPage.cpp
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/odtframe/KoOdtFrameReportDocument.cpp
renderer/odtframe/KoOdtFrameReportCheckBox.cpp
renderer/odtframe/KoOdtFrameReportImage.cpp
renderer/odtframe/KoOdtFrameReportTextBox.cpp
renderer/odtframe/KoOdtFrameReportLine.cpp
renderer/odtframe/KoOdtFrameReportPicture.cpp
renderer/odtframe/KoOdtFrameReportPrimitive.cpp
renderer/ods/KoSimpleOdsDocument.cpp
renderer/ods/KoSimpleOdsSheet.cpp
renderer/ods/KoSimpleOdsCell.cpp
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
items/label/KoReportItemLabel.cpp
items/label/KoReportDesignerItemLabel.cpp
items/label/krscriptlabel.cpp
items/label/KoReportLabelPlugin.cpp
items/label/BoundedTextItem.cpp
items/check/KoReportItemCheck.cpp
items/check/KoReportDesignerItemCheck.cpp
items/check/KoReportScriptCheck.cpp
items/check/KoReportCheckPlugin.cpp
items/field/KoReportItemField.cpp
items/field/KoReportDesignerItemField.cpp
items/field/krscriptfield.cpp
items/field/KoReportFieldPlugin.cpp
items/image/KoReportItemImage.cpp
items/image/KoReportDesignerItemImage.cpp
items/image/krscriptimage.cpp
items/image/KoReportImagePlugin.cpp
items/text/KoReportItemText.cpp
items/text/KoReportDesignerItemText.cpp
items/text/krscripttext.cpp
items/text/KoReportTextPlugin.cpp
)
ki18n_wrap_ui(koreport_LIB_SRCS wrtembed/detailgroupsectiondialog.ui wrtembed/sectioneditor.ui )
add_library(koreport SHARED ${koreport_LIB_SRCS})
target_link_libraries(koreport
${KOPROPERTY_LIBS}
${CALLIGRADB_LIBS} # ONLY FOR KexiPluginLoader, TODO: remove
KF5::KrossCore
)
target_link_libraries(koreport LINK_INTERFACE_LIBRARIES
${KOPROPERTY_LIBS} KF5::KrossCore kowidgets)
set_target_properties(koreport PROPERTIES VERSION ${GENERIC_CALLIGRA_LIB_VERSION} SOVERSION ${GENERIC_CALLIGRA_LIB_SOVERSION} )
install(TARGETS koreport ${INSTALL_TARGETS_DEFAULT_ARGS})
install(FILES koreport_itemplugin.desktop DESTINATION ${SERVICETYPES_INSTALL_DIR})
/**
* \mainpage
*
* KoReport is a library for the generation of reports in multiple formats.
*/
// DOXYGEN_SET_PROJECT_NAME = KoReport
// DOXYGEN_SET_IGNORE_PREFIX = Ko K
/*
KoReport report engine for Calligra Office
Copyright (C) 2011 Adam Pigg <adam@piggz.co.uk>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "KoReportASyncItemBase.h"
/*
KoReport report engine for Calligra Office>
Copyright (C) 2011 Adam Pigg <adam@piggz.co.uk>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef KOREPORTASYNCITEMBASE_H
#define KOREPORTASYNCITEMBASE_H
#include <KoReportItemBase.h>
class KOREPORT_EXPORT KoReportASyncItemBase : public KoReportItemBase
{
Q_OBJECT
public:
virtual int renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, const QVariant &data, KRScriptHandler *script) = 0;
Q_SIGNALS:
void finishedRendering();
};
#endif // KOREPORTASYNCITEMBASE_H
/* Calligra/Kexi report engine
* Copyright (C) 2007-2010 by Adam Pigg (adam@piggz.co.uk)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "KoReportData.h"
#include <QVariant>
KoReportData::~KoReportData()
{
}
KoReportData::SortedField::SortedField()
: order(Qt::AscendingOrder)
{
}
QStringList KoReportData::fieldKeys() const
{
return fieldNames();
}
QString KoReportData::sourceName() const
{
return QString();
}
void KoReportData::setSorting(const QList<SortedField> &sorting)
{
Q_UNUSED(sorting);
}
void KoReportData::addExpression(const QString &field, const QVariant &value, int relation)
{
Q_UNUSED(field);
Q_UNUSED(value);
Q_UNUSED(relation);
}
QStringList KoReportData::scriptList(const QString &language) const
{
Q_UNUSED(language);
return QStringList();
}
QString KoReportData::scriptCode(const QString &script, const QString &language) const
{
Q_UNUSED(script);
Q_UNUSED(language);
return QString();
}
QStringList KoReportData::dataSources() const
{
return QStringList();
}
QStringList KoReportData::dataSourceNames() const
{
return dataSources();
}
KoReportData* KoReportData::data(const QString &source)
{
Q_UNUSED(source);
return 0;
}
/* Calligra/Kexi report engine
* Copyright (C) 2007-2010 by Adam Pigg (adam@piggz.co.uk)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __KOREPORTDATA_H__
#define __KOREPORTDATA_H__
#include "koreport_export.h"
#include <QStringList>
/**
*/
class KOREPORT_EXPORT KoReportData
{
public:
virtual ~KoReportData();
//! Describes sorting for single field
/*! By default the order is ascending. */
class KOREPORT_EXPORT SortedField
{
public:
SortedField();
QString field;
Qt::SortOrder order;
};
//!Open the dataset
virtual bool open() = 0;
//!Close the dataset
virtual bool close() = 0;
//!Move to the next record
virtual bool moveNext() = 0;
//!Move to the previous record
virtual bool movePrevious() = 0;
//!Move to the first record
virtual bool moveFirst() = 0;
//!Move to the last record
virtual bool moveLast() = 0;
//!Return the current position in the dataset
virtual qint64 at() const = 0;
//!Return the total number of records
virtual qint64 recordCount() const = 0;
//!Return the index number of the field given by nane field
virtual int fieldNumber(const QString &field) const = 0;
//!Return the list of field names
virtual QStringList fieldNames() const = 0;
//!Return the list of field keys. Returns fieldNames() by default
virtual QStringList fieldKeys() const;
//!Return the value of the field at the given position for the current record
virtual QVariant value(unsigned int) const = 0;
//!Return the value of the field fir the given name for the current record
virtual QVariant value(const QString &field) const = 0;
//!Return the name of this source
virtual QString sourceName() const;
//!Sets the sorting for the data
//!Should be called before open() so that the data source can be edited accordingly
//!Default impl does nothing
virtual void setSorting(const QList<SortedField> &sorting);
/**
@brief Adds an expression to the data source
*/
virtual void addExpression(const QString &field, const QVariant &value, int relation = '=');
//!Utility Functions
//!TODO These are probably eligable to be moved into a new class
//!Allow the reportdata implementation to return a list of possible scripts for a given language
virtual QStringList scriptList(const QString& language) const;
//!Allow the reportdata implementation to return some script code based on a specific script name
//!and a language, as set in the report
virtual QString scriptCode(const QString& script, const QString& language) const;
//!Return a list of data sources possible for advanced controls
virtual QStringList dataSources() const;
//!Return a list of data source names possible for advanced controls.
//!Returns dataSources() by default
virtual QStringList dataSourceNames() const;
//!Allow a driver to create a new instance with a new data source
//!source is a driver specific identifier
//!Owner of the returned pointer is the caller
virtual KoReportData* data(const QString &source);
};
#endif
/*
* Kexi Report Plugin
* Copyright (C) 2007-2008 by Adam Pigg (adam@piggz.co.uk)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "KoReportItemBase.h"
#include <klocale.h>
#include "krpos.h"
#include "krsize.h"
#include "krutils.h"
#include <koproperty/Set.h>
KoReportItemBase::KoReportItemBase()
{
Z = 0;
m_name = new KoProperty::Property("Name", QString(), i18n("Name"), i18n("Object Name"));
m_name->setAutoSync(0);
}
KoReportItemBase::~KoReportItemBase() { }
void KoReportItemBase::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)
{
return KRUtils::parseReportTextStyleData(elemSource, ts);
}
bool KoReportItemBase::parseReportLineStyleData(const QDomElement & elemSource, KRLineStyleData & ls)
{
return KRUtils::parseReportLineStyleData(elemSource, ls);
}
bool KoReportItemBase::parseReportRect(const QDomElement & elemSource, KRPos *pos, KRSize *siz)
{
return KRUtils::parseReportRect(elemSource, pos, siz);
}
void KoReportItemBase::setUnit(const KoUnit& u)
{
m_pos.setUnit(u);
m_size.setUnit(u);
}
int KoReportItemBase::renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset,
const QVariant &data, KRScriptHandler* script)
{
Q_UNUSED(page)
Q_UNUSED(section)
Q_UNUSED(offset)
Q_UNUSED(data)
Q_UNUSED(script)
return 0;
}
int KoReportItemBase::renderReportData(OROPage *page, OROSection *section, const QPointF &offset,
KoReportData *data, KRScriptHandler* script)
{
Q_UNUSED(page)
Q_UNUSED(section)
Q_UNUSED(offset)
Q_UNUSED(data)
Q_UNUSED(script)
return 0;
}
QString KoReportItemBase::itemDataSource() const
{
return QString();
}
KRPos KoReportItemBase::position()
{
return m_pos;
}
KoProperty::Set* KoReportItemBase::propertySet() const
{
return m_set;
}
bool KoReportItemBase::supportsSubQuery()
{
return false;
}
QString KoReportItemBase::entityName()
{
return m_name->value().toString();
}
void KoReportItemBase::setEntityName(const QString& n)
{
m_name->setValue(n);
}
KRPos KoReportItemBase::position() const
{
return m_pos;
}
KRSize KoReportItemBase::size() const
{
return m_size;
}
/*
* KoReport Library
* Copyright (C) 2007-2010 by Adam Pigg (adam@piggz.co.uk)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef KOREPORTITEMBASE_H
#define KOREPORTITEMBASE_H
#include <koproperty/Property.h>
#include <QObject>
#include <QDomElement>
#include <QFont>
#include <QColor>
#include "koreport_export.h"
#include "krpos.h"
#include "krsize.h"
class OROPage;
class OROSection;
class KRSize;
class KRScriptHandler;
class KoReportData;