summaryrefslogtreecommitdiffstats
path: root/writerperfect/inc
diff options
context:
space:
mode:
Diffstat (limited to 'writerperfect/inc')
-rw-r--r--writerperfect/inc/DirectoryStream.hxx67
-rw-r--r--writerperfect/inc/DocumentHandler.hxx65
-rw-r--r--writerperfect/inc/DocumentHandlerFor.hxx25
-rw-r--r--writerperfect/inc/DocumentHandlerForOdg.hxx27
-rw-r--r--writerperfect/inc/DocumentHandlerForOdp.hxx27
-rw-r--r--writerperfect/inc/DocumentHandlerForOds.hxx27
-rw-r--r--writerperfect/inc/DocumentHandlerForOdt.hxx27
-rw-r--r--writerperfect/inc/ImportFilter.hxx180
-rw-r--r--writerperfect/inc/WPFTEncodingDialog.hxx48
-rw-r--r--writerperfect/inc/WPFTResMgr.hxx12
-rw-r--r--writerperfect/inc/WPXSvInputStream.hxx62
-rw-r--r--writerperfect/inc/strings.hrc26
-rw-r--r--writerperfect/inc/writerperfectdllapi.h23
13 files changed, 616 insertions, 0 deletions
diff --git a/writerperfect/inc/DirectoryStream.hxx b/writerperfect/inc/DirectoryStream.hxx
new file mode 100644
index 000000000..3da07bc15
--- /dev/null
+++ b/writerperfect/inc/DirectoryStream.hxx
@@ -0,0 +1,67 @@
+/* -*- 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_DIRECTORYSTREAM_HXX
+#define INCLUDED_WRITERPERFECT_DIRECTORYSTREAM_HXX
+
+#include <librevenge-stream/librevenge-stream.h>
+#include <com/sun/star/uno/Reference.h>
+#include "writerperfectdllapi.h"
+#include <memory>
+
+namespace com
+{
+namespace sun
+{
+namespace star
+{
+namespace 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;
+ 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;
+
+ 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;
+};
+}
+
+#endif // INCLUDED_WRITERPERFECT_DIRECTORYSTREAM_HXX
+
+/* 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..6f8734008
--- /dev/null
+++ b/writerperfect/inc/DocumentHandler.hxx
@@ -0,0 +1,65 @@
+/* -*- 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 .
+ */
+
+#ifndef INCLUDED_WRITERPERFECT_DOCUMENTHANDLER_HXX
+#define INCLUDED_WRITERPERFECT_DOCUMENTHANDLER_HXX
+
+#include <libodfgen/libodfgen.hxx>
+
+#include <com/sun/star/uno/Reference.h>
+
+#include "writerperfectdllapi.h"
+
+namespace com
+{
+namespace sun
+{
+namespace star
+{
+namespace xml
+{
+namespace sax
+{
+class XDocumentHandler;
+}
+}
+}
+}
+}
+
+namespace writerperfect
+{
+class WRITERPERFECT_DLLPUBLIC DocumentHandler final : public OdfDocumentHandler
+{
+public:
+ DocumentHandler(css::uno::Reference<css::xml::sax::XDocumentHandler> const& xHandler);
+ void startDocument() override;
+ void endDocument() override;
+ void startElement(const char* psName, const librevenge::RVNGPropertyList& xPropList) override;
+ void endElement(const char* psName) override;
+ void characters(const librevenge::RVNGString& sCharacters) override;
+
+private:
+ css::uno::Reference<css::xml::sax::XDocumentHandler> mxHandler;
+};
+}
+
+#endif // INCLUDED_WRITERPERFECT_DOCUMENTHANDLER_HXX
+
+/* 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..d90039e2c
--- /dev/null
+++ b/writerperfect/inc/DocumentHandlerFor.hxx
@@ -0,0 +1,25 @@
+/* -*- 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/.
+ */
+
+#ifndef INCLUDED_WRITERPERFECT_INC_WRITERPERFECT_DOCUMENTHANDLERFOR_HXX
+#define INCLUDED_WRITERPERFECT_INC_WRITERPERFECT_DOCUMENTHANDLERFOR_HXX
+
+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();
+};
+}
+
+#endif // INCLUDED_WRITERPERFECT_INC_WRITERPERFECT_DOCUMENTHANDLERFOR_HXX
+
+/* 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..e7017513d
--- /dev/null
+++ b/writerperfect/inc/DocumentHandlerForOdg.hxx
@@ -0,0 +1,27 @@
+/* -*- 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/.
+ */
+
+#ifndef INCLUDED_WRITERPERFECT_INC_DOCUMENTHANDLERFORODG_HXX
+#define INCLUDED_WRITERPERFECT_INC_DOCUMENTHANDLERFORODG_HXX
+
+#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"; }
+};
+}
+
+#endif
+
+/* 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..6ee5a83e7
--- /dev/null
+++ b/writerperfect/inc/DocumentHandlerForOdp.hxx
@@ -0,0 +1,27 @@
+/* -*- 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/.
+ */
+
+#ifndef INCLUDED_WRITERPERFECT_INC_DOCUMENTHANDLERFORODP_HXX
+#define INCLUDED_WRITERPERFECT_INC_DOCUMENTHANDLERFORODP_HXX
+
+#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"; }
+};
+}
+
+#endif
+
+/* 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..48b78fa9a
--- /dev/null
+++ b/writerperfect/inc/DocumentHandlerForOds.hxx
@@ -0,0 +1,27 @@
+/* -*- 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/.
+ */
+
+#ifndef INCLUDED_WRITERPERFECT_INC_DOCUMENTHANDLERFORODS_HXX
+#define INCLUDED_WRITERPERFECT_INC_DOCUMENTHANDLERFORODS_HXX
+
+#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"; }
+};
+}
+
+#endif
+
+/* 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..55acf1fc7
--- /dev/null
+++ b/writerperfect/inc/DocumentHandlerForOdt.hxx
@@ -0,0 +1,27 @@
+/* -*- 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/.
+ */
+
+#ifndef INCLUDED_WRITERPERFECT_INC_DOCUMENTHANDLERFORODT_HXX
+#define INCLUDED_WRITERPERFECT_INC_DOCUMENTHANDLERFORODT_HXX
+
+#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"; }
+};
+}
+
+#endif
+
+/* 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..4328b9021
--- /dev/null
+++ b/writerperfect/inc/ImportFilter.hxx
@@ -0,0 +1,180 @@
+/* -*- 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/.
+ */
+
+#ifndef INCLUDED_WRITERPERFECT_INC_WRITERPERFECT_IMPORTFILTER_HXX
+#define INCLUDED_WRITERPERFECT_INC_WRITERPERFECT_IMPORTFILTER_HXX
+
+#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/XDocumentHandler.hpp>
+
+#include <osl/diagnose.h>
+#include <cppuhelper/implbase.hxx>
+
+#include <unotools/mediadescriptor.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/weld.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<css::xml::sax::XDocumentHandler> xInternalHandler(
+ mxContext->getServiceManager()->createInstanceWithContext(
+ DocumentHandlerFor<Generator>::name(), mxContext),
+ css::uno::UNO_QUERY_THROW);
+
+ // 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);
+ xImporter->setTargetDocument(mxDoc);
+
+ // OO Graphics Handler: abstract class to handle document SAX messages, concrete implementation here
+ // writes to in-memory target doc
+ DocumentHandler aHandler(xInternalHandler);
+
+ 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[location].Name = "TypeName";
+ }
+
+ Descriptor[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)
+ {
+ }
+};
+}
+
+#endif // INCLUDED_WRITERPERFECT_INC_WRITERPERFECT_IMPORTFILTER_HXX
+
+/* 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..433141ebe
--- /dev/null
+++ b/writerperfect/inc/WPFTEncodingDialog.hxx
@@ -0,0 +1,48 @@
+/* -*- 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/.
+ */
+
+#ifndef INCLUDED_WRITERPERFECT_WPFTENCODINGDIALOG_HXX
+#define INCLUDED_WRITERPERFECT_WPFTENCODINGDIALOG_HXX
+
+#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_LINK(CancelHdl, weld::Button&, void);
+
+ WPFTEncodingDialog(WPFTEncodingDialog const&) = delete;
+ WPFTEncodingDialog& operator=(WPFTEncodingDialog const&) = delete;
+};
+}
+
+#endif
+
+/* 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..0cff3e446
--- /dev/null
+++ b/writerperfect/inc/WPFTResMgr.hxx
@@ -0,0 +1,12 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+
+#ifndef INCLUDED_WRITERPERFECT_INC_WPFTRESMGR_HXX
+#define INCLUDED_WRITERPERFECT_INC_WPFTRESMGR_HXX
+
+#include <unotools/resmgr.hxx>
+
+inline OUString WpResId(const char* pId) { return Translate::get(pId, Translate::Create("wpt")); }
+
+#endif
+
+/* 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..359086848
--- /dev/null
+++ b/writerperfect/inc/WPXSvInputStream.hxx
@@ -0,0 +1,62 @@
+/* -*- 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_WPXSVINPUTSTREAM_HXX
+#define INCLUDED_WRITERPERFECT_WPXSVINPUTSTREAM_HXX
+
+#include <librevenge-stream/librevenge-stream.h>
+#include <com/sun/star/uno/Reference.h>
+#include "writerperfectdllapi.h"
+#include <memory>
+
+namespace com
+{
+namespace sun
+{
+namespace star
+{
+namespace io
+{
+class XInputStream;
+class XSeekable;
+}
+}
+}
+}
+
+namespace writerperfect
+{
+class WPXSvInputStreamImpl;
+
+class WRITERPERFECT_DLLPUBLIC WPXSvInputStream final : public librevenge::RVNGInputStream
+{
+public:
+ WPXSvInputStream(css::uno::Reference<css::io::XInputStream> const& xStream);
+ 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;
+
+ 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<WPXSvInputStreamImpl> mpImpl;
+};
+}
+
+#endif // INCLUDED_WRITERPERFECT_WPXSVINPUTSTREAM_HXX
+
+/* 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..a85c1fb71
--- /dev/null
+++ b/writerperfect/inc/strings.hrc
@@ -0,0 +1,26 @@
+/* -*- 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_INC_STRINGS_HRC
+#define INCLUDED_WRITERPERFECT_INC_STRINGS_HRC
+
+#define NC_(Context, String) reinterpret_cast<char const *>(Context "\004" 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")
+
+#endif
+
+/* 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..d5495717e
--- /dev/null
+++ b/writerperfect/inc/writerperfectdllapi.h
@@ -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/.
+ */
+
+#ifndef INCLUDED_WRITERPERFECT_WRITERPERFECTDLLAPI_H
+#define INCLUDED_WRITERPERFECT_WRITERPERFECTDLLAPI_H
+
+#if defined WRITERPERFECT_DLLIMPLEMENTATION
+
+#define WRITERPERFECT_DLLPUBLIC SAL_DLLPUBLIC_EXPORT
+#else
+#define WRITERPERFECT_DLLPUBLIC SAL_DLLPUBLIC_IMPORT
+#endif
+#define WRITERPERFECT_DLLPRIVATE SAL_DLLPRIVATE
+
+#endif /* INCLUDED_WRITERPERFECT_WRITERPERFECTDLLAPI_H */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */