diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2021-06-30 16:33:48 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-06-30 14:58:20 +0200 |
commit | 95b06d3aa514ce83f82fd538d1731fc6363e4b8a (patch) | |
tree | 6a62ef4d5e7c7d9b55aa037416ef98adf66490ea /sw/source/filter/inc | |
parent | a876055b6f56e838114cce041d4c49aed43693f9 (diff) |
indexing: add indexing export as an export filter for Writer
Change-Id: I26157a8ffeee80b03866569d3d3cec2a34fe377d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118144
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sw/source/filter/inc')
-rw-r--r-- | sw/source/filter/inc/IndexingExportFilter.hxx | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/sw/source/filter/inc/IndexingExportFilter.hxx b/sw/source/filter/inc/IndexingExportFilter.hxx new file mode 100644 index 000000000000..82c56dfa9a61 --- /dev/null +++ b/sw/source/filter/inc/IndexingExportFilter.hxx @@ -0,0 +1,68 @@ +/* -*- 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/. + */ + +#pragma once + +#include <com/sun/star/document/XFilter.hpp> +#include <com/sun/star/document/XExporter.hpp> +#include <com/sun/star/lang/XInitialization.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <cppuhelper/implbase.hxx> +#include <cppuhelper/supportsservice.hxx> + +namespace sw +{ +class IndexingExportFilter final + : public cppu::WeakImplHelper<css::document::XFilter, css::document::XExporter, + css::lang::XInitialization, css::lang::XServiceInfo> +{ +private: + css::uno::Reference<css::lang::XComponent> m_xSourceDocument; + +public: + IndexingExportFilter() {} + + // XFilter + virtual sal_Bool SAL_CALL + filter(const css::uno::Sequence<css::beans::PropertyValue>& aDescriptor) override; + + virtual void SAL_CALL cancel() override {} + + // XExporter + virtual void SAL_CALL + setSourceDocument(const css::uno::Reference<css::lang::XComponent>& xDocument) override + { + m_xSourceDocument = xDocument; + } + + // XInitialization + virtual void SAL_CALL + initialize(const css::uno::Sequence<css::uno::Any>& /*aArguments*/) override + { + } + + // XServiceInfo + virtual OUString SAL_CALL getImplementationName() override + { + return "com.sun.star.comp.Writer.IndexingExportFilter"; + } + + virtual sal_Bool SAL_CALL supportsService(OUString const& rServiceName) override + { + return cppu::supportsService(this, rServiceName); + } + + virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override + { + return { "com.sun.star.document.ExportFilter" }; + } +}; +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |