summaryrefslogtreecommitdiff
path: root/writerperfect/source
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2017-08-01 13:51:28 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-08-01 14:57:14 +0200
commitba7ebd400d39bc84ababab3bb416a199d57780e8 (patch)
tree94e8d214ac20779d38dfe938f43a376ef3a35ff3 /writerperfect/source
parentb1d829e52e826b6ea4ae884a64fdb68b66c74dd7 (diff)
writerperfect: add initial EPUB export filter
It doesn't do anything yet, but EPUBExportFilter::filter() is called. Actual functionality will be provided by libepubgen later. Change-Id: I7229dc33c69238c6e98a7bb30fd38473b3c35bfe Reviewed-on: https://gerrit.libreoffice.org/40630 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerperfect/source')
-rw-r--r--writerperfect/source/writer/EPUBExportFilter.cxx66
-rw-r--r--writerperfect/source/writer/EPUBExportFilter.hxx52
-rw-r--r--writerperfect/source/writer/wpftwriter.component4
3 files changed, 122 insertions, 0 deletions
diff --git a/writerperfect/source/writer/EPUBExportFilter.cxx b/writerperfect/source/writer/EPUBExportFilter.cxx
new file mode 100644
index 000000000000..d7fb0cac0e0d
--- /dev/null
+++ b/writerperfect/source/writer/EPUBExportFilter.cxx
@@ -0,0 +1,66 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "EPUBExportFilter.hxx"
+
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+#include <cppuhelper/supportsservice.hxx>
+
+using namespace com::sun::star;
+
+namespace writerperfect
+{
+
+EPUBExportFilter::EPUBExportFilter()
+{
+}
+
+sal_Bool EPUBExportFilter::filter(const uno::Sequence<beans::PropertyValue> &/*rDescriptor*/)
+{
+ SAL_WARN("writerperfect", "EPUBExportFilter::filter: implement me");
+ return true;
+}
+
+void EPUBExportFilter::cancel()
+{
+}
+
+void EPUBExportFilter::setSourceDocument(const uno::Reference<lang::XComponent> &xDocument)
+{
+ mxSourceDocument = xDocument;
+}
+
+OUString EPUBExportFilter::getImplementationName()
+{
+ return OUString("com.sun.star.comp.Writer.EPUBExportFilter");
+}
+
+sal_Bool EPUBExportFilter::supportsService(const OUString &rServiceName)
+{
+ return cppu::supportsService(this, rServiceName);
+}
+
+uno::Sequence<OUString> EPUBExportFilter::getSupportedServiceNames()
+{
+ uno::Sequence<OUString> aRet =
+ {
+ OUString("com.sun.star.document.ExportFilter")
+ };
+ return aRet;
+}
+
+extern "C" SAL_DLLPUBLIC_EXPORT uno::XInterface *SAL_CALL com_sun_star_comp_Writer_EPUBExportFilter_get_implementation(uno::XComponentContext *, uno::Sequence<uno::Any> const &)
+{
+ return cppu::acquire(new EPUBExportFilter);
+}
+
+} // namespace writerperfect
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/writer/EPUBExportFilter.hxx b/writerperfect/source/writer/EPUBExportFilter.hxx
new file mode 100644
index 000000000000..101a4f85bf42
--- /dev/null
+++ b/writerperfect/source/writer/EPUBExportFilter.hxx
@@ -0,0 +1,52 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_WRITERPERFECT_SOURCE_WRITER_EPUBEXPORTFILTER_HXX
+#define INCLUDED_WRITERPERFECT_SOURCE_WRITER_EPUBEXPORTFILTER_HXX
+
+#include <cppuhelper/implbase.hxx>
+
+#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/document/XExporter.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+
+namespace writerperfect
+{
+
+/// EPUB export XFilter implementation.
+class EPUBExportFilter : public cppu::WeakImplHelper
+ <
+ css::document::XFilter,
+ css::document::XExporter,
+ css::lang::XServiceInfo
+ >
+{
+ css::uno::Reference<css::lang::XComponent> mxSourceDocument;
+
+public:
+ EPUBExportFilter();
+
+ // XFilter
+ sal_Bool SAL_CALL filter(const css::uno::Sequence<css::beans::PropertyValue> &rDescriptor) override;
+ void SAL_CALL cancel() override;
+
+ // XExporter
+ void SAL_CALL setSourceDocument(const css::uno::Reference<css::lang::XComponent> &xDocument) override;
+
+ // XServiceInfo
+ OUString SAL_CALL getImplementationName() override;
+ sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override;
+ css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+};
+
+} // namespace writerperfect
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/source/writer/wpftwriter.component b/writerperfect/source/writer/wpftwriter.component
index ace6b687363c..5e68de56cfd2 100644
--- a/writerperfect/source/writer/wpftwriter.component
+++ b/writerperfect/source/writer/wpftwriter.component
@@ -53,4 +53,8 @@
<service name="com.sun.star.document.ImportFilter"/>
<service name="com.sun.star.document.ExtendedTypeDetection"/>
</implementation>
+ <implementation name="com.sun.star.comp.Writer.EPUBExportFilter"
+ constructor="com_sun_star_comp_Writer_EPUBExportFilter_get_implementation">
+ <service name="com.sun.star.document.ExportFilter"/>
+ </implementation>
</component>