/* -*- 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 * * for a copy of the LGPLv3 License. * ************************************************************************/ #ifndef _XMLOFF_FORMLAYEREXPORT_HXX_ #define _XMLOFF_FORMLAYEREXPORT_HXX_ #include "sal/config.h" #include "xmloff/dllapi.h" #include #include #include #include #include #include #include namespace com { namespace sun { namespace star { namespace awt { class XControlModel; } } } } class SvXMLExport; //......................................................................... namespace xmloff { //......................................................................... class OFormLayerXMLExport_Impl; class OFormsRootExport; //===================================================================== //= OFormLayerXMLExport //===================================================================== /** provides functionallity for exporting a complete form layer. */ class XMLOFF_DLLPUBLIC OFormLayerXMLExport :public ::salhelper::SimpleReferenceObject { protected: /// our export context SvXMLExport& m_rContext; // impl class OFormLayerXMLExport_Impl* m_pImpl; protected: ~OFormLayerXMLExport(); public: OFormLayerXMLExport(SvXMLExport& _rContext); /** initial the object

To be called if you want to reuse the same object for exportin different documents.

You don't need to call this if you just constructed the object, in this case it is already initialized..

*/ void initialize(); /** initializes some internal structures for fast access to the given page

This method has to be called before you use getControlId for controls on the given page. This way a performance optimization can be done for faster access to the control ids

@return if the page has been examined before. If is returned, this is a serious error. @see getControlId @see examineForms */ sal_Bool seekPage( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& _rxDrawPage); /** get the id for the given control

The page the control belongs to must have been examined and sought to.

@param _rxControl the control which's id should be retrieved. Must not be . @see examineForms @see seekPage */ ::rtl::OUString getControlId( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControl); /** retrieves the style name for the control's number style.

For performance reasons, this method is allowed to be called for any controls, even those which do not have a number style. In this case, an empty string is returned.

@param _rxControl the control which's id should be retrieved. Must not be . @see examineForms @see seekPage */ ::rtl::OUString getControlNumberStyle( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxControl ); /** examines the forms collection given.

This method will collect all form layer related data of the given draw page

@param _rxDrawPage the draw page to examine. The object will be queried for a XFormsSupplier interface to obtain the forms container. */ void examineForms(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& _rxDrawPage); /** exports the structure of a form layer

This method does not export styles (e.g. font properties of the controls), or any references external instances may have to the control models contained in the form layer (e.g. uno control shapes in the drawing layer may have such references)

No top level element describing the whole collection is inserted. I.e. if within your document, you expect the the forms collection to be stored like

<Forms> .... // all the forms stuff here </Forms> you have to start the Forms element yourself.

@param _rxDrawPage the draw page to examine. The object will be queried for a XFormsSupplier interface to obtain the forms container. */ void exportForms(const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& _rxDrawPage); /** exports the XForms model data */ void exportXForms() const; /** determines whether the given page contains logical forms */ bool pageContainsForms( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage >& _rxDrawPage ) const; /** determines whether the given page contains XForm instances */ bool documentContainsXForms() const; /// retrieves the property mapper for control styles ::rtl::Reference< SvXMLExportPropertyMapper > getStylePropertyMapper(); /** exports the controls number styles */ void exportControlNumberStyles(); /** exports the automatic controls number styles */ void exportAutoControlNumberStyles(); /** exports the auto-styles collected during the examineForms calls */ void exportAutoStyles(); /** exclude the given control (model) from export.

If your document contains form controls which are not to be exported for whatever reason, you need to announce the models of these controls (can be retrieved from XControlShape::getControl) to the form layer exporter.
Of course you have to do this before calling exportForms

*/ void excludeFromExport( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > _rxControl ); }; //========================================================================= //= OOfficeFormsExport //========================================================================= /// export helper for the office::forms element class XMLOFF_DLLPUBLIC OOfficeFormsExport { private: OFormsRootExport* m_pImpl; public: OOfficeFormsExport( SvXMLExport& _rExp ); ~OOfficeFormsExport(); }; //......................................................................... } // namespace xmloff //......................................................................... #endif // _XMLOFF_FORMLAYEREXPORT_HXX_ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */