summaryrefslogtreecommitdiffstats
path: root/writerperfect/inc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
commited5640d8b587fbcfed7dd7967f3de04b37a76f26 (patch)
tree7a5f7c6c9d02226d7471cb3cc8fbbf631b415303 /writerperfect/inc
parentInitial commit. (diff)
downloadlibreoffice-ed5640d8b587fbcfed7dd7967f3de04b37a76f26.tar.xz
libreoffice-ed5640d8b587fbcfed7dd7967f3de04b37a76f26.zip
Adding upstream version 4:7.4.7.upstream/4%7.4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--writerperfect/inc/DirectoryStream.hxx57
-rw-r--r--writerperfect/inc/DocumentHandler.hxx51
-rw-r--r--writerperfect/inc/DocumentHandlerFor.hxx22
-rw-r--r--writerperfect/inc/DocumentHandlerForOdg.hxx24
-rw-r--r--writerperfect/inc/DocumentHandlerForOdp.hxx24
-rw-r--r--writerperfect/inc/DocumentHandlerForOds.hxx24
-rw-r--r--writerperfect/inc/DocumentHandlerForOdt.hxx24
-rw-r--r--writerperfect/inc/ImportFilter.hxx183
-rw-r--r--writerperfect/inc/WPFTEncodingDialog.hxx45
-rw-r--r--writerperfect/inc/WPFTResMgr.hxx9
-rw-r--r--writerperfect/inc/WPXSvInputStream.hxx54
-rw-r--r--writerperfect/inc/strings.hrc23
-rw-r--r--writerperfect/inc/writerperfectdllapi.h20
13 files changed, 560 insertions, 0 deletions
diff --git a/writerperfect/inc/DirectoryStream.hxx b/writerperfect/inc/DirectoryStream.hxx
new file mode 100644
index 000000000..c45209333
--- /dev/null
+++ b/writerperfect/inc/DirectoryStream.hxx
@@ -0,0 +1,57 @@
+/* -*- 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 <librevenge-stream/librevenge-stream.h>
+#include <com/sun/star/uno/Reference.h>
+#include "writerperfectdllapi.h"
+#include <tools/long.hxx>
+#include <memory>
+
+namespace com::sun::star::ucb
+{
+class XContent;
+}
+
+namespace writerperfect
+{
+class WRITERPERFECT_DLLPUBLIC DirectoryStream final : public librevenge::RVNGInputStream
+{
+ struct Impl;
+
+public:
+ explicit DirectoryStream(const css::uno::Reference<css::ucb::XContent>& xContent);
+ virtual ~DirectoryStream() override;
+
+ static bool isDirectory(const css::uno::Reference<css::ucb::XContent>& xContent);
+ static std::unique_ptr<DirectoryStream>
+ createForParent(const css::uno::Reference<css::ucb::XContent>& xContent);
+
+ css::uno::Reference<css::ucb::XContent> getContent() const;
+
+ virtual bool isStructured() override;
+ SAL_DLLPRIVATE virtual unsigned subStreamCount() override;
+ SAL_DLLPRIVATE virtual const char* subStreamName(unsigned id) override;
+ SAL_DLLPRIVATE virtual bool existsSubStream(const char* name) override;
+ SAL_DLLPRIVATE virtual librevenge::RVNGInputStream*
+ getSubStreamByName(const char* name) override;
+ SAL_DLLPRIVATE virtual librevenge::RVNGInputStream* getSubStreamById(unsigned id) override;
+
+ virtual const unsigned char* read(unsigned long numBytes, unsigned long& numBytesRead) override;
+ virtual int seek(long offset, librevenge::RVNG_SEEK_TYPE seekType) override;
+ virtual long tell() override;
+ virtual bool isEnd() override;
+
+private:
+ std::unique_ptr<Impl> m_pImpl;
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/inc/DocumentHandler.hxx b/writerperfect/inc/DocumentHandler.hxx
new file mode 100644
index 000000000..a79b114f3
--- /dev/null
+++ b/writerperfect/inc/DocumentHandler.hxx
@@ -0,0 +1,51 @@
+/* -*- 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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <libodfgen/libodfgen.hxx>
+
+#include <com/sun/star/uno/Reference.h>
+
+#include "writerperfectdllapi.h"
+
+namespace com::sun::star::xml::sax
+{
+class XDocumentHandler;
+}
+
+namespace writerperfect
+{
+class WRITERPERFECT_DLLPUBLIC DocumentHandler final : public OdfDocumentHandler
+{
+public:
+ DocumentHandler(css::uno::Reference<css::xml::sax::XDocumentHandler> const& xHandler);
+ SAL_DLLPRIVATE void startDocument() override;
+ SAL_DLLPRIVATE void endDocument() override;
+ SAL_DLLPRIVATE void startElement(const char* psName,
+ const librevenge::RVNGPropertyList& xPropList) override;
+ SAL_DLLPRIVATE void endElement(const char* psName) override;
+ SAL_DLLPRIVATE void characters(const librevenge::RVNGString& sCharacters) override;
+
+private:
+ css::uno::Reference<css::xml::sax::XDocumentHandler> mxHandler;
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/inc/DocumentHandlerFor.hxx b/writerperfect/inc/DocumentHandlerFor.hxx
new file mode 100644
index 000000000..a7c7459fd
--- /dev/null
+++ b/writerperfect/inc/DocumentHandlerFor.hxx
@@ -0,0 +1,22 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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
+
+namespace writerperfect
+{
+/** Definition of XML import service used with a Generator.
+
+ This template must be specialized for every libodfgen generator.
+ */
+template <class Generator> struct DocumentHandlerFor
+{
+ // static OUString name();
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/inc/DocumentHandlerForOdg.hxx b/writerperfect/inc/DocumentHandlerForOdg.hxx
new file mode 100644
index 000000000..7784dddca
--- /dev/null
+++ b/writerperfect/inc/DocumentHandlerForOdg.hxx
@@ -0,0 +1,24 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 <libodfgen/libodfgen.hxx>
+
+#include "DocumentHandlerFor.hxx"
+
+#include <rtl/ustring.hxx>
+
+namespace writerperfect
+{
+template <> struct DocumentHandlerFor<OdgGenerator>
+{
+ static OUString name() { return "com.sun.star.comp.Draw.XMLOasisImporter"; }
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/inc/DocumentHandlerForOdp.hxx b/writerperfect/inc/DocumentHandlerForOdp.hxx
new file mode 100644
index 000000000..970f129e6
--- /dev/null
+++ b/writerperfect/inc/DocumentHandlerForOdp.hxx
@@ -0,0 +1,24 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 <libodfgen/libodfgen.hxx>
+
+#include "DocumentHandlerFor.hxx"
+
+#include <rtl/ustring.hxx>
+
+namespace writerperfect
+{
+template <> struct DocumentHandlerFor<OdpGenerator>
+{
+ static OUString name() { return "com.sun.star.comp.Impress.XMLOasisImporter"; }
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/inc/DocumentHandlerForOds.hxx b/writerperfect/inc/DocumentHandlerForOds.hxx
new file mode 100644
index 000000000..226252f09
--- /dev/null
+++ b/writerperfect/inc/DocumentHandlerForOds.hxx
@@ -0,0 +1,24 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 <libodfgen/libodfgen.hxx>
+
+#include "DocumentHandlerFor.hxx"
+
+#include <rtl/ustring.hxx>
+
+namespace writerperfect
+{
+template <> struct DocumentHandlerFor<OdsGenerator>
+{
+ static OUString name() { return "com.sun.star.comp.Calc.XMLOasisImporter"; }
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/inc/DocumentHandlerForOdt.hxx b/writerperfect/inc/DocumentHandlerForOdt.hxx
new file mode 100644
index 000000000..49af6f9d5
--- /dev/null
+++ b/writerperfect/inc/DocumentHandlerForOdt.hxx
@@ -0,0 +1,24 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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 <libodfgen/libodfgen.hxx>
+
+#include "DocumentHandlerFor.hxx"
+
+#include <rtl/ustring.hxx>
+
+namespace writerperfect
+{
+template <> struct DocumentHandlerFor<OdtGenerator>
+{
+ static OUString name() { return "com.sun.star.comp.Writer.XMLOasisImporter"; }
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/inc/ImportFilter.hxx b/writerperfect/inc/ImportFilter.hxx
new file mode 100644
index 000000000..f2cfb614d
--- /dev/null
+++ b/writerperfect/inc/ImportFilter.hxx
@@ -0,0 +1,183 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * 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/awt/XWindow.hpp>
+#include <com/sun/star/beans/PropertyValue.hpp>
+#include <com/sun/star/document/XExtendedFilterDetection.hpp>
+#include <com/sun/star/document/XFilter.hpp>
+#include <com/sun/star/document/XImporter.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/uno/Reference.h>
+#include <com/sun/star/uno/XComponentContext.hpp>
+#include <com/sun/star/xml/sax/XFastDocumentHandler.hpp>
+
+#include <osl/diagnose.h>
+#include <cppuhelper/implbase.hxx>
+
+#include <unotools/mediadescriptor.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/weld.hxx>
+#include <xmloff/xmlimp.hxx>
+
+#include "DocumentHandler.hxx"
+#include "WPXSvInputStream.hxx"
+
+#include "DocumentHandlerFor.hxx"
+
+namespace writerperfect
+{
+namespace detail
+{
+template <class Generator>
+class ImportFilterImpl
+ : public cppu::WeakImplHelper<css::document::XFilter, css::document::XImporter,
+ css::document::XExtendedFilterDetection,
+ css::lang::XInitialization>
+{
+public:
+ ImportFilterImpl(const css::uno::Reference<css::uno::XComponentContext>& rxContext)
+ : mxContext(rxContext)
+ {
+ }
+
+ const css::uno::Reference<css::uno::XComponentContext>& getXContext() const
+ {
+ return mxContext;
+ }
+
+ // XFilter
+ virtual sal_Bool SAL_CALL
+ filter(const css::uno::Sequence<css::beans::PropertyValue>& rDescriptor) override
+ {
+ utl::MediaDescriptor aDescriptor(rDescriptor);
+ css::uno::Reference<css::io::XInputStream> xInputStream;
+ aDescriptor[utl::MediaDescriptor::PROP_INPUTSTREAM] >>= xInputStream;
+ if (!xInputStream.is())
+ {
+ OSL_ASSERT(false);
+ return false;
+ }
+
+ css::uno::Reference<css::awt::XWindow> xDialogParent;
+ aDescriptor["ParentWindow"] >>= xDialogParent;
+
+ // An XML import service: what we push sax messages to...
+ css::uno::Reference<XInterface> xInternalFilter
+ = mxContext->getServiceManager()->createInstanceWithContext(
+ DocumentHandlerFor<Generator>::name(), mxContext);
+ assert(xInternalFilter);
+ css::uno::Reference<css::xml::sax::XFastDocumentHandler> xInternalHandler(
+ xInternalFilter, css::uno::UNO_QUERY);
+ assert(xInternalHandler);
+
+ // The XImporter sets up an empty target document for XDocumentHandler to write to...
+ css::uno::Reference<css::document::XImporter> xImporter(xInternalHandler,
+ css::uno::UNO_QUERY);
+ assert(xImporter);
+ xImporter->setTargetDocument(mxDoc);
+
+ // OO Graphics Handler: abstract class to handle document SAX messages, concrete implementation here
+ // writes to in-memory target doc
+ DocumentHandler aHandler(
+ new SvXMLLegacyToFastDocHandler(static_cast<SvXMLImport*>(xInternalHandler.get())));
+
+ WPXSvInputStream input(xInputStream);
+
+ Generator exporter;
+ exporter.addDocumentHandler(&aHandler, ODF_FLAT_XML);
+
+ doRegisterHandlers(exporter);
+
+ return doImportDocument(Application::GetFrameWeld(xDialogParent), input, exporter,
+ aDescriptor);
+ }
+
+ virtual void SAL_CALL cancel() override {}
+
+ // XImporter
+ const css::uno::Reference<css::lang::XComponent>& getTargetDocument() const { return mxDoc; }
+ virtual void SAL_CALL
+ setTargetDocument(const css::uno::Reference<css::lang::XComponent>& xDoc) override
+ {
+ mxDoc = xDoc;
+ }
+
+ //XExtendedFilterDetection
+ virtual OUString SAL_CALL
+ detect(css::uno::Sequence<css::beans::PropertyValue>& Descriptor) override
+ {
+ OUString sTypeName;
+ sal_Int32 nLength = Descriptor.getLength();
+ sal_Int32 location = nLength;
+ const css::beans::PropertyValue* pValue = Descriptor.getConstArray();
+ css::uno::Reference<css::io::XInputStream> xInputStream;
+ for (sal_Int32 i = 0; i < nLength; i++)
+ {
+ if (pValue[i].Name == "TypeName")
+ location = i;
+ else if (pValue[i].Name == "InputStream")
+ pValue[i].Value >>= xInputStream;
+ }
+
+ if (!xInputStream.is())
+ return OUString();
+
+ WPXSvInputStream input(xInputStream);
+
+ if (doDetectFormat(input, sTypeName))
+ {
+ assert(!sTypeName.isEmpty());
+
+ if (location == nLength)
+ {
+ Descriptor.realloc(nLength + 1);
+ Descriptor.getArray()[location].Name = "TypeName";
+ }
+
+ Descriptor.getArray()[location].Value <<= sTypeName;
+ }
+
+ return sTypeName;
+ }
+
+ // XInitialization
+ virtual void SAL_CALL
+ initialize(const css::uno::Sequence<css::uno::Any>& /*aArguments*/) override
+ {
+ }
+
+private:
+ virtual bool doDetectFormat(librevenge::RVNGInputStream& rInput, OUString& rTypeName) = 0;
+ virtual bool doImportDocument(weld::Window* pParent, librevenge::RVNGInputStream& rInput,
+ Generator& rGenerator, utl::MediaDescriptor& rDescriptor)
+ = 0;
+ virtual void doRegisterHandlers(Generator&){};
+
+ css::uno::Reference<css::uno::XComponentContext> mxContext;
+ css::uno::Reference<css::lang::XComponent> mxDoc;
+};
+}
+
+/** A base class for import filters.
+ */
+template <class Generator>
+struct ImportFilter : public cppu::ImplInheritanceHelper<detail::ImportFilterImpl<Generator>,
+ css::lang::XServiceInfo>
+{
+ ImportFilter(const css::uno::Reference<css::uno::XComponentContext>& rxContext)
+ : cppu::ImplInheritanceHelper<detail::ImportFilterImpl<Generator>, css::lang::XServiceInfo>(
+ rxContext)
+ {
+ }
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/inc/WPFTEncodingDialog.hxx b/writerperfect/inc/WPFTEncodingDialog.hxx
new file mode 100644
index 000000000..31df95826
--- /dev/null
+++ b/writerperfect/inc/WPFTEncodingDialog.hxx
@@ -0,0 +1,45 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* MSWorksImportFilter: Sets up the filter, and calls DocumentCollector
+ * to do the actual filtering
+ *
+ * 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 <vcl/weld.hxx>
+
+#include "writerperfectdllapi.h"
+
+namespace writerperfect
+{
+class WRITERPERFECT_DLLPUBLIC WPFTEncodingDialog final : public weld::GenericDialogController
+{
+public:
+ WPFTEncodingDialog(weld::Window* pParent, const OUString& title, const OUString& defEncoding);
+
+ virtual ~WPFTEncodingDialog() override;
+
+ OUString GetEncoding() const;
+ bool hasUserCalledCancel() const { return m_userHasCancelled; }
+
+private:
+ bool m_userHasCancelled;
+
+ std::unique_ptr<weld::ComboBox> m_xLbCharset;
+ std::unique_ptr<weld::Button> m_xBtnOk;
+ std::unique_ptr<weld::Button> m_xBtnCancel;
+
+private:
+ DECL_DLLPRIVATE_LINK(CancelHdl, weld::Button&, void);
+
+ WPFTEncodingDialog(WPFTEncodingDialog const&) = delete;
+ WPFTEncodingDialog& operator=(WPFTEncodingDialog const&) = delete;
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/inc/WPFTResMgr.hxx b/writerperfect/inc/WPFTResMgr.hxx
new file mode 100644
index 000000000..5780dd30f
--- /dev/null
+++ b/writerperfect/inc/WPFTResMgr.hxx
@@ -0,0 +1,9 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+
+#pragma once
+
+#include <unotools/resmgr.hxx>
+
+inline OUString WpResId(TranslateId aId) { return Translate::get(aId, Translate::Create("wpt")); }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/inc/WPXSvInputStream.hxx b/writerperfect/inc/WPXSvInputStream.hxx
new file mode 100644
index 000000000..8cf41d777
--- /dev/null
+++ b/writerperfect/inc/WPXSvInputStream.hxx
@@ -0,0 +1,54 @@
+/* -*- 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 <librevenge-stream/librevenge-stream.h>
+#include <com/sun/star/uno/Reference.h>
+#include <tools/long.hxx>
+#include "writerperfectdllapi.h"
+#include <memory>
+
+namespace com::sun::star::io
+{
+class XInputStream;
+class XSeekable;
+}
+
+namespace writerperfect
+{
+class WPXSvInputStreamImpl;
+
+class SAL_DLLPUBLIC_RTTI WPXSvInputStream final : public librevenge::RVNGInputStream
+{
+public:
+ WRITERPERFECT_DLLPUBLIC
+ WPXSvInputStream(css::uno::Reference<css::io::XInputStream> const& xStream);
+ WRITERPERFECT_DLLPUBLIC virtual ~WPXSvInputStream() override;
+
+ virtual bool isStructured() override;
+ virtual unsigned subStreamCount() override;
+ virtual const char* subStreamName(unsigned id) override;
+ virtual bool existsSubStream(const char* name) override;
+ virtual librevenge::RVNGInputStream* getSubStreamByName(const char* name) override;
+ virtual librevenge::RVNGInputStream* getSubStreamById(unsigned id) override;
+
+ WRITERPERFECT_DLLPUBLIC virtual const unsigned char* read(unsigned long numBytes,
+ unsigned long& numBytesRead) override;
+ WRITERPERFECT_DLLPUBLIC virtual int seek(long offset,
+ librevenge::RVNG_SEEK_TYPE seekType) override;
+ virtual long tell() override;
+ virtual bool isEnd() override;
+
+private:
+ std::unique_ptr<WPXSvInputStreamImpl> mpImpl;
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/inc/strings.hrc b/writerperfect/inc/strings.hrc
new file mode 100644
index 000000000..a9373d237
--- /dev/null
+++ b/writerperfect/inc/strings.hrc
@@ -0,0 +1,23 @@
+/* -*- 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
+
+#define NC_(Context, String) TranslateId(Context, reinterpret_cast<char const *>(u8##String))
+
+#define STR_ENCODING_DIALOG_TITLE NC_("STR_ENCODING_DIALOG_TITLE", "Import file")
+#define STR_ENCODING_DIALOG_TITLE_MSMULTIPLAN NC_("STR_ENCODING_DIALOG_TITLE_MSMULTIPLAN", "Import MS Multiplan for DOS file")
+#define STR_ENCODING_DIALOG_TITLE_MSWORKS NC_("STR_ENCODING_DIALOG_TITLE_MSWORKS", "Import MS Works file")
+#define STR_ENCODING_DIALOG_TITLE_MSWRITE NC_("STR_ENCODING_DIALOG_TITLE_MSWRITE", "Import MS Write file")
+#define STR_ENCODING_DIALOG_TITLE_DOSWORD NC_("STR_ENCODING_DIALOG_TITLE_DOSWORD", "Import MS Word for DOS file")
+#define STR_ENCODING_DIALOG_TITLE_LOTUS NC_("STR_ENCODING_DIALOG_TITLE_LOTUS", "Import Lotus file")
+#define STR_ENCODING_DIALOG_TITLE_SYMPHONY NC_("STR_ENCODING_DIALOG_TITLE_SYMPHONY", "Import Symphony file")
+#define STR_ENCODING_DIALOG_TITLE_QUATTROPRO NC_("STR_ENCODING_DIALOG_TITLE_QUATTROPRO", "Import Quattro Pro file")
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerperfect/inc/writerperfectdllapi.h b/writerperfect/inc/writerperfectdllapi.h
new file mode 100644
index 000000000..29f708ffc
--- /dev/null
+++ b/writerperfect/inc/writerperfectdllapi.h
@@ -0,0 +1,20 @@
+/* -*- 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
+
+#if defined WRITERPERFECT_DLLIMPLEMENTATION
+
+#define WRITERPERFECT_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define WRITERPERFECT_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define WRITERPERFECT_DLLPRIVATE SAL_DLLPRIVATE
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */