diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2013-04-18 18:26:28 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2013-04-23 22:20:31 +0200 |
commit | b9337e22ce1dbf2eba0e8c8db294ae99f4111f91 (patch) | |
tree | 53ee1bd3dfd213815a21579151983cb997922b05 /include/xmlscript | |
parent | f4e1642a1761d5eab6ccdd89928869c2b2f1528a (diff) |
execute move of global headers
see https://gerrit.libreoffice.org/#/c/3367/
and Change-Id: I00c96fa77d04b33a6f8c8cd3490dfcd9bdc9e84a for details
Change-Id: I199a75bc4042af20817265d5ef85b1134a96ff5a
Diffstat (limited to 'include/xmlscript')
-rw-r--r-- | include/xmlscript/xml_helper.hxx | 139 | ||||
-rw-r--r-- | include/xmlscript/xmldlg_imexp.hxx | 81 | ||||
-rw-r--r-- | include/xmlscript/xmllib_imexp.hxx | 88 | ||||
-rw-r--r-- | include/xmlscript/xmlmod_imexp.hxx | 59 | ||||
-rw-r--r-- | include/xmlscript/xmlns.h | 39 | ||||
-rw-r--r-- | include/xmlscript/xmlscriptdllapi.h | 33 |
6 files changed, 439 insertions, 0 deletions
diff --git a/include/xmlscript/xml_helper.hxx b/include/xmlscript/xml_helper.hxx new file mode 100644 index 000000000000..5d3c747452ae --- /dev/null +++ b/include/xmlscript/xml_helper.hxx @@ -0,0 +1,139 @@ +/* -*- 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 _XMLSCRIPT_XML_HELPER_HXX_ +#define _XMLSCRIPT_XML_HELPER_HXX_ + +#include <vector> +#include <rtl/byteseq.hxx> +#include <cppuhelper/implbase1.hxx> +#include <com/sun/star/xml/sax/XDocumentHandler.hpp> +#include <com/sun/star/io/XInputStream.hpp> +#include <com/sun/star/io/XOutputStream.hpp> + +#include "xmlscript/xmlscriptdllapi.h" + +namespace xmlscript +{ + +/*################################################################################################## + + EXPORTING + +##################################################################################################*/ + +//================================================================================================== +class XMLSCRIPT_DLLPUBLIC XMLElement + : public ::cppu::WeakImplHelper1< ::com::sun::star::xml::sax::XAttributeList > +{ +public: + inline XMLElement( OUString const & name ) + SAL_THROW(()) + : _name( name ) + {} + + /** Adds a sub element of element. + + @param xElem element reference + */ + void SAL_CALL addSubElement( + ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > const & xElem ) + SAL_THROW(()); + + /** Gets sub element of given index. The index follows order in which sub elements were added. + + @param nIndex index of sub element + */ + ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > SAL_CALL getSubElement( sal_Int32 nIndex ) + SAL_THROW(()); + + /** Adds an attribute to elements. + + @param rAttrName qname of attribute + @param rValue value string of element + */ + void SAL_CALL addAttribute( OUString const & rAttrName, OUString const & rValue ) + SAL_THROW(()); + + /** Gets the tag name (qname) of element. + + @return + qname of element + */ + inline OUString SAL_CALL getName() SAL_THROW(()) + { return _name; } + + /** Dumps out element (and all sub elements). + + @param xOut document handler to be written to + */ + void SAL_CALL dump( + ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > const & xOut ); + /** Dumps out sub elements (and all further sub elements). + + @param xOut document handler to be written to + */ + void SAL_CALL dumpSubElements( + ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > const & xOut ); + + // XAttributeList + virtual sal_Int16 SAL_CALL getLength() + throw (::com::sun::star::uno::RuntimeException); + virtual OUString SAL_CALL getNameByIndex( sal_Int16 nPos ) + throw (::com::sun::star::uno::RuntimeException); + virtual OUString SAL_CALL getTypeByIndex( sal_Int16 nPos ) + throw (::com::sun::star::uno::RuntimeException); + virtual OUString SAL_CALL getTypeByName( OUString const & rName ) + throw (::com::sun::star::uno::RuntimeException); + virtual OUString SAL_CALL getValueByIndex( sal_Int16 nPos ) + throw (::com::sun::star::uno::RuntimeException); + virtual OUString SAL_CALL getValueByName( OUString const & rName ) + throw (::com::sun::star::uno::RuntimeException); + +protected: + OUString _name; + + ::std::vector< OUString > _attrNames; + ::std::vector< OUString > _attrValues; + + ::std::vector< ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XAttributeList > > _subElems; +}; + + +/*################################################################################################## + + STREAMING + +##################################################################################################*/ + +XMLSCRIPT_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > +SAL_CALL createInputStream( + ::rtl::ByteSequence const & rInData ) + SAL_THROW(()); + +XMLSCRIPT_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > +SAL_CALL createOutputStream( + ::rtl::ByteSequence * pOutData ) + SAL_THROW(()); + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/xmlscript/xmldlg_imexp.hxx b/include/xmlscript/xmldlg_imexp.hxx new file mode 100644 index 000000000000..28f726d57109 --- /dev/null +++ b/include/xmlscript/xmldlg_imexp.hxx @@ -0,0 +1,81 @@ +/* -*- 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 _XMLSCRIPT_XMLDLG_IMEXP_HXX_ +#define _XMLSCRIPT_XMLDLG_IMEXP_HXX_ + +#include <com/sun/star/frame/XModel.hpp> + +#include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/io/XInputStreamProvider.hpp> +#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> + +#include "xmlscript/xmlns.h" +#include "xmlscript/xmlscriptdllapi.h" + +namespace xmlscript +{ + +XMLSCRIPT_DLLPUBLIC void SAL_CALL exportDialogModel( + ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XExtendedDocumentHandler > const & xOut, + ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameContainer > const & xDialogModel, + ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XModel > const & xDocument ) + SAL_THROW( (::com::sun::star::uno::Exception) ); + +XMLSCRIPT_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > +SAL_CALL importDialogModel( + ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameContainer > const & xDialogModel, + ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > const & xContext, + ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XModel > const & xDocument ) + SAL_THROW( (::com::sun::star::uno::Exception) ); + +// additional functions for convenience + +XMLSCRIPT_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStreamProvider > +SAL_CALL exportDialogModel( + ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameContainer > const & xDialogModel, + ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > const & xContext, + ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XModel > const & xDocument ) + SAL_THROW( (::com::sun::star::uno::Exception) ); + +XMLSCRIPT_DLLPUBLIC void SAL_CALL importDialogModel( + ::com::sun::star::uno::Reference< + ::com::sun::star::io::XInputStream > const & xInput, + ::com::sun::star::uno::Reference< + ::com::sun::star::container::XNameContainer > const & xDialogModel, + ::com::sun::star::uno::Reference< + ::com::sun::star::uno::XComponentContext > const & xContext, + ::com::sun::star::uno::Reference< + ::com::sun::star::frame::XModel > const & xDocument ) + SAL_THROW( (::com::sun::star::uno::Exception) ); + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/xmlscript/xmllib_imexp.hxx b/include/xmlscript/xmllib_imexp.hxx new file mode 100644 index 000000000000..08f58c5e6049 --- /dev/null +++ b/include/xmlscript/xmllib_imexp.hxx @@ -0,0 +1,88 @@ +/* -*- 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 _XMLSCRIPT_XMLLIB_IMEXP_HXX_ +#define _XMLSCRIPT_XMLLIB_IMEXP_HXX_ + +#include <com/sun/star/xml/sax/XWriter.hpp> +#include <com/sun/star/uno/Sequence.hxx> + +#include "xmlscript/xmlns.h" +#include "xmlscript/xmlscriptdllapi.h" + +namespace xmlscript +{ + +//============================================================================== +// Library container export +// HACK C++ struct to transport info. Later the container +// itself should do the export/import and use exportet XML +// functionality from xmlscript +struct XMLSCRIPT_DLLPUBLIC LibDescriptor +{ + OUString aName; + OUString aStorageURL; + sal_Bool bLink; + sal_Bool bReadOnly; + sal_Bool bPasswordProtected; + ::com::sun::star::uno::Sequence< OUString > aElementNames; + sal_Bool bPreload; +}; + +struct XMLSCRIPT_DLLPUBLIC LibDescriptorArray +{ + LibDescriptor* mpLibs; + sal_Int32 mnLibCount; + + LibDescriptorArray( void ) { mpLibs = NULL; mnLibCount = 0; } + LibDescriptorArray( sal_Int32 nLibCount ); + + ~LibDescriptorArray(); + +}; + +XMLSCRIPT_DLLPUBLIC void +SAL_CALL exportLibraryContainer( + ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XWriter > const & xOut, + const LibDescriptorArray* pLibArray ) + SAL_THROW( (::com::sun::star::uno::Exception) ); + +XMLSCRIPT_DLLPUBLIC ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XDocumentHandler > +SAL_CALL importLibraryContainer( LibDescriptorArray* pLibArray ) + SAL_THROW( (::com::sun::star::uno::Exception) ); + + +XMLSCRIPT_DLLPUBLIC void +SAL_CALL exportLibrary( + ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XWriter > const & xOut, + const LibDescriptor& rLib ) + SAL_THROW( (::com::sun::star::uno::Exception) ); + +XMLSCRIPT_DLLPUBLIC ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XDocumentHandler > +SAL_CALL importLibrary( LibDescriptor& rLib ) + SAL_THROW( (::com::sun::star::uno::Exception) ); + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/xmlscript/xmlmod_imexp.hxx b/include/xmlscript/xmlmod_imexp.hxx new file mode 100644 index 000000000000..2898d8a5fc20 --- /dev/null +++ b/include/xmlscript/xmlmod_imexp.hxx @@ -0,0 +1,59 @@ +/* -*- 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 _XMLSCRIPT_XMLMOD_IMEXP_HXX_ +#define _XMLSCRIPT_XMLMOD_IMEXP_HXX_ + +#include <com/sun/star/xml/sax/XWriter.hpp> +#include <com/sun/star/uno/Sequence.hxx> +#include <xmlscript/xmlns.h> +#include "xmlscript/xmlscriptdllapi.h" + +namespace xmlscript +{ + +//============================================================================== +// Script module import/export +// HACK C++ struct to transport info. Later the container +// itself should do the export/import and use exportet XML +// functionality from xmlscript +struct XMLSCRIPT_DLLPUBLIC ModuleDescriptor +{ + OUString aName; + OUString aLanguage; + OUString aCode; + OUString aModuleType; // VBA +}; + +XMLSCRIPT_DLLPUBLIC void +SAL_CALL exportScriptModule( + ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XWriter > const & xOut, + const ModuleDescriptor& rMod ) + SAL_THROW( (::com::sun::star::uno::Exception) ); + +XMLSCRIPT_DLLPUBLIC ::com::sun::star::uno::Reference< + ::com::sun::star::xml::sax::XDocumentHandler > +SAL_CALL importScriptModule( ModuleDescriptor& rMod ) + SAL_THROW( (::com::sun::star::uno::Exception) ); + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/xmlscript/xmlns.h b/include/xmlscript/xmlns.h new file mode 100644 index 000000000000..cb0e37af0b07 --- /dev/null +++ b/include/xmlscript/xmlns.h @@ -0,0 +1,39 @@ +/* -*- 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 _XMLSCRIPT_XMLNS_H_ +#define _XMLSCRIPT_XMLNS_H_ + +#define XMLNS_DIALOGS_URI "http://openoffice.org/2000/dialog" +#define XMLNS_DIALOGS_PREFIX "dlg" + +#define XMLNS_SCRIPT_URI "http://openoffice.org/2000/script" +#define XMLNS_SCRIPT_PREFIX "script" + +#define XMLNS_OOO_URI "http://openoffice.org/2004/office" +#define XMLNS_OOO_PREFIX "ooo" + +#define XMLNS_LIBRARY_URI "http://openoffice.org/2000/library" +#define XMLNS_LIBRARY_PREFIX "library" + +#define XMLNS_XLINK_URI "http://www.w3.org/1999/xlink" +#define XMLNS_XLINK_PREFIX "xlink" + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/include/xmlscript/xmlscriptdllapi.h b/include/xmlscript/xmlscriptdllapi.h new file mode 100644 index 000000000000..b9634d57ee36 --- /dev/null +++ b/include/xmlscript/xmlscriptdllapi.h @@ -0,0 +1,33 @@ +/* -*- 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_XMLSCRIPT_DLL_API_H +#define INCLUDED_XMLSCRIPT_DLL_API_H + +#include <sal/types.h> + +#if defined(XMLSCRIPT_DLLIMPLEMENTATION) +#define XMLSCRIPT_DLLPUBLIC SAL_DLLPUBLIC_EXPORT +#else +#define XMLSCRIPT_DLLPUBLIC SAL_DLLPUBLIC_IMPORT +#endif +#define XMLSCRIPT_DLLPRIVATE SAL_DLLPRIVATE + +#endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |