diff options
Diffstat (limited to 'writerfilter/inc')
-rw-r--r-- | writerfilter/inc/WriterFilterDllApi.hxx | 6 | ||||
-rw-r--r-- | writerfilter/inc/dmapper/DomainMapper.hxx | 1 | ||||
-rw-r--r-- | writerfilter/inc/rtftok/RTFDocument.hxx | 72 | ||||
-rw-r--r-- | writerfilter/inc/rtftok/RTFInputSource.hxx | 45 | ||||
-rw-r--r-- | writerfilter/inc/rtftok/RTFParseException.hxx | 45 | ||||
-rw-r--r-- | writerfilter/inc/rtftok/RTFScanner.hxx | 68 | ||||
-rw-r--r-- | writerfilter/inc/rtftok/RTFScannerHandler.hxx | 53 |
7 files changed, 79 insertions, 211 deletions
diff --git a/writerfilter/inc/WriterFilterDllApi.hxx b/writerfilter/inc/WriterFilterDllApi.hxx index dff806017c8a..358e5cd624bc 100644 --- a/writerfilter/inc/WriterFilterDllApi.hxx +++ b/writerfilter/inc/WriterFilterDllApi.hxx @@ -35,6 +35,12 @@ #else #define WRITERFILTER_DLLPUBLIC SAL_DLLPUBLIC_IMPORT #endif +#if defined(WRITERFILTER_RTFTOK_DLLIMPLEMENTATION) +#define WRITERFILTER_RTFTOK_DLLPUBLIC SAL_DLLPUBLIC_EXPORT +#else +#define WRITERFILTER_RTFTOK_DLLPUBLIC SAL_DLLPUBLIC_IMPORT +#endif + #define WRITERFILTER_DLLPRIVATE SAL_DLLPRIVATE #endif /* INCLUDED_WRITERFILTERDLLAPI_H */ diff --git a/writerfilter/inc/dmapper/DomainMapper.hxx b/writerfilter/inc/dmapper/DomainMapper.hxx index d9d40aa32ad9..71190a158e1e 100644 --- a/writerfilter/inc/dmapper/DomainMapper.hxx +++ b/writerfilter/inc/dmapper/DomainMapper.hxx @@ -106,6 +106,7 @@ public: void PopListProperties(); bool IsOOXMLImport() const; + bool IsRTFImport() const; ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory > GetTextFactory() const; void AddListIDToLFOTable( sal_Int32 nAbstractNumId ); ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > GetCurrentTextRange(); diff --git a/writerfilter/inc/rtftok/RTFDocument.hxx b/writerfilter/inc/rtftok/RTFDocument.hxx new file mode 100644 index 000000000000..72fe6bd2d952 --- /dev/null +++ b/writerfilter/inc/rtftok/RTFDocument.hxx @@ -0,0 +1,72 @@ +/* + * Version: MPL 1.1 / GPLv3+ / LGPLv3+ + * + * The contents of this file are subject to the Mozilla Public License Version + * 1.1 (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.mozilla.org/MPL/ + * + * Software distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License + * for the specific language governing rights and limitations under the + * License. + * + * The Initial Developer of the Original Code is + * Miklos Vajna <vmiklos@frugalware.org> + * Portions created by the Initial Developer are Copyright (C) 2011 the + * Initial Developer. All Rights Reserved. + * + * Contributor(s): + * + * Alternatively, the contents of this file may be used under the terms of + * either the GNU General Public License Version 3 or later (the "GPLv3+"), or + * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), + * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable + * instead of those above. + */ + +#ifndef _RTFDOCUMENT_HXX_ +#define _RTFDOCUMENT_HXX_ + +#include <resourcemodel/WW8ResourceModel.hxx> +#include <com/sun/star/uno/XComponentContext.hpp> +#include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/frame/XFrame.hpp> + +namespace writerfilter { + namespace rtftok { + /// The RTFDocument opens and resolves the RTF document. + class WRITERFILTER_RTFTOK_DLLPUBLIC RTFDocument + : public writerfilter::Reference<Stream> + { + public: + /// Pointer to this stream. + typedef ::boost::shared_ptr<RTFDocument> Pointer_t; + + virtual ~RTFDocument() { } + + /// Resolves this document to a stream handler. + virtual void resolve(Stream & rHandler) = 0; + + /// Returns string representation of the type of this reference. (Debugging purpose only.) + virtual ::std::string getType() const = 0; + }; + + /// Interface to create an RTFDocument instance. + class WRITERFILTER_RTFTOK_DLLPUBLIC RTFDocumentFactory + { + public: + static RTFDocument::Pointer_t + createDocument( + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext, + ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > const & xInputStream, + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > const & xDstDoc, + ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > const & xFrame); + }; + } // namespace rtftok +} // namespace writerfilter + +#endif // _RTFDOCUMENT_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/inc/rtftok/RTFInputSource.hxx b/writerfilter/inc/rtftok/RTFInputSource.hxx deleted file mode 100644 index 5a0ca071ab1a..000000000000 --- a/writerfilter/inc/rtftok/RTFInputSource.hxx +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef INCLUDED_RTFINPUTSOURCE_HXX -#define INCLUDED_RTFINPUTSOURCE_HXX - -namespace writerfilter { namespace rtftok { - -class RTFInputSource -{ -public: - virtual int read(void *buffer, int maxLen) = 0; -}; - -} } /* end namespace writerfilter::rtftok */ - - -#endif /* INCLUDED_RTFINPUTSOURCE_HXX */ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/inc/rtftok/RTFParseException.hxx b/writerfilter/inc/rtftok/RTFParseException.hxx deleted file mode 100644 index 338711e57cb7..000000000000 --- a/writerfilter/inc/rtftok/RTFParseException.hxx +++ /dev/null @@ -1,45 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef INCLUDED_RTFPARSEEXCEPTION_HXX -#define INCLUDED_RTFPARSEEXCEPTION_HXX - -namespace writerfilter { namespace rtftok { - -class RTFParseException -{ -public: - RTFParseException(char *message); -}; - -} } /* end namespace writerfilter::rtftok */ - - -#endif /* INCLUDED_RTFPARSEEXCEPTION_HXX */ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/inc/rtftok/RTFScanner.hxx b/writerfilter/inc/rtftok/RTFScanner.hxx deleted file mode 100644 index 9f1e2c655402..000000000000 --- a/writerfilter/inc/rtftok/RTFScanner.hxx +++ /dev/null @@ -1,68 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef INCLUDED_RTFSCANNER_HXX -#define INCLUDED_RTFSCANNER_HXX - -#include <WriterFilterDllApi.hxx> -#include <vector> -#include <rtftok/RTFInputSource.hxx> -#include <rtftok/RTFScannerHandler.hxx> - -namespace writerfilter { namespace rtftok { - -class WRITERFILTER_DLLPUBLIC RTFScanner { -public: - RTFScanner(RTFScannerHandler &eventHandler_) : eventHandler(eventHandler_) {}; - virtual ~RTFScanner() { } - - const char* YYText() { return yytext; } - int YYLeng() { return yyleng; } - - virtual int yylex() = 0; - - int lineno() const { return yylineno; } - -protected: - char* yytext; - int yyleng; - int yylineno; // only maintained if you use %option yylineno - int yy_flex_debug; // only has effect with -d or "%option debug" - RTFScannerHandler &eventHandler; - - -public: - static writerfilter::rtftok::RTFScanner* createRTFScanner(writerfilter::rtftok::RTFInputSource& inputSource, writerfilter::rtftok::RTFScannerHandler &eventHandler); -}; - -} } /* end namespace writerfilter::rtftok */ - - -#endif /* INCLUDED_RTFSCANNER_HXX */ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/writerfilter/inc/rtftok/RTFScannerHandler.hxx b/writerfilter/inc/rtftok/RTFScannerHandler.hxx deleted file mode 100644 index aa423439fa53..000000000000 --- a/writerfilter/inc/rtftok/RTFScannerHandler.hxx +++ /dev/null @@ -1,53 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org 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 version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef INCLUDED_RTFSCANNERHANDLER_HXX -#define INCLUDED_RTFSCANNERHANDLER_HXX - -namespace writerfilter { namespace rtftok { - -class RTFScannerHandler -{ -public: - virtual void dest(char*token, char*value)=0; - virtual void ctrl(char*token, char*value)=0; - virtual void lbrace(void)=0; - virtual void rbrace(void)=0; - virtual void addSpaces(int count)=0; - virtual void addBinData(unsigned char data)=0; - virtual void addChar(char ch) =0; - virtual void addCharU(sal_Unicode ch) =0; - virtual void addHexChar(char* hexch) =0; - -}; - -} } /* end namespace writerfilter::rtftok */ - -#endif /* INCLUDED_RTFSCANNERHANDLER_HXX */ - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |