1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 // MARKER(update_precomp.py): autogen include statement, do not remove 25 #include "precompiled_xmloff.hxx" 26 27 #include <stdio.h> 28 #include <xmloff/formlayerexport.hxx> 29 #include "strings.hxx" 30 #include "elementexport.hxx" 31 #include "xmloff/xmlnmspe.hxx" 32 #include <xmloff/xmlexp.hxx> 33 #include "layerexport.hxx" 34 #include "propertyexport.hxx" 35 #include <osl/diagnose.h> 36 #include <comphelper/extract.hxx> 37 #include <com/sun/star/lang/XServiceInfo.hpp> 38 #include <comphelper/stl_types.hxx> 39 #include "officeforms.hxx" 40 41 42 //......................................................................... 43 namespace xmloff 44 { 45 //......................................................................... 46 47 using namespace ::com::sun::star::uno; 48 using namespace ::com::sun::star::lang; 49 using namespace ::com::sun::star::awt; 50 using namespace ::com::sun::star::beans; 51 using namespace ::com::sun::star::container; 52 using namespace ::com::sun::star::drawing; 53 using namespace ::com::sun::star::frame; 54 55 //===================================================================== 56 //= OFormLayerXMLExport 57 //===================================================================== 58 59 //--------------------------------------------------------------------- OFormLayerXMLExport(SvXMLExport & _rContext)60 OFormLayerXMLExport::OFormLayerXMLExport(SvXMLExport& _rContext) 61 :m_rContext(_rContext) 62 ,m_pImpl(new OFormLayerXMLExport_Impl(_rContext)) 63 { 64 } 65 66 //--------------------------------------------------------------------- ~OFormLayerXMLExport()67 OFormLayerXMLExport::~OFormLayerXMLExport() 68 { 69 delete m_pImpl; 70 m_pImpl = NULL; 71 } 72 73 //--------------------------------------------------------------------- seekPage(const Reference<XDrawPage> & _rxDrawPage)74 sal_Bool OFormLayerXMLExport::seekPage(const Reference< XDrawPage >& _rxDrawPage) 75 { 76 return m_pImpl->seekPage(_rxDrawPage); 77 } 78 79 //--------------------------------------------------------------------- getControlId(const Reference<XPropertySet> & _rxControl)80 ::rtl::OUString OFormLayerXMLExport::getControlId(const Reference< XPropertySet >& _rxControl) 81 { 82 return m_pImpl->getControlId(_rxControl); 83 } 84 85 //--------------------------------------------------------------------- getControlNumberStyle(const Reference<XPropertySet> & _rxControl)86 ::rtl::OUString OFormLayerXMLExport::getControlNumberStyle( const Reference< XPropertySet >& _rxControl ) 87 { 88 return m_pImpl->getControlNumberStyle(_rxControl); 89 } 90 91 //--------------------------------------------------------------------- initialize()92 void OFormLayerXMLExport::initialize() 93 { 94 m_pImpl->clear(); 95 } 96 97 //--------------------------------------------------------------------- examineForms(const Reference<XDrawPage> & _rxDrawPage)98 void OFormLayerXMLExport::examineForms(const Reference< XDrawPage >& _rxDrawPage) 99 { 100 try 101 { 102 m_pImpl->examineForms(_rxDrawPage); 103 } 104 catch(Exception&) 105 { 106 OSL_ENSURE(sal_False, "OFormLayerXMLExport::examine: could not examine the draw page!"); 107 } 108 } 109 110 //--------------------------------------------------------------------- exportForms(const Reference<XDrawPage> & _rxDrawPage)111 void OFormLayerXMLExport::exportForms(const Reference< XDrawPage >& _rxDrawPage) 112 { 113 m_pImpl->exportForms(_rxDrawPage); 114 } 115 116 //--------------------------------------------------------------------- exportXForms() const117 void OFormLayerXMLExport::exportXForms() const 118 { 119 m_pImpl->exportXForms(); 120 } 121 122 //--------------------------------------------------------------------- pageContainsForms(const Reference<XDrawPage> & _rxDrawPage) const123 bool OFormLayerXMLExport::pageContainsForms( const Reference< XDrawPage >& _rxDrawPage ) const 124 { 125 return m_pImpl->pageContainsForms( _rxDrawPage ); 126 } 127 128 //--------------------------------------------------------------------- documentContainsXForms() const129 bool OFormLayerXMLExport::documentContainsXForms() const 130 { 131 return m_pImpl->documentContainsXForms(); 132 } 133 134 //--------------------------------------------------------------------- exportControlNumberStyles()135 void OFormLayerXMLExport::exportControlNumberStyles() 136 { 137 m_pImpl->exportControlNumberStyles(); 138 } 139 140 //--------------------------------------------------------------------- exportAutoControlNumberStyles()141 void OFormLayerXMLExport::exportAutoControlNumberStyles() 142 { 143 m_pImpl->exportAutoControlNumberStyles(); 144 } 145 146 //--------------------------------------------------------------------- exportAutoStyles()147 void OFormLayerXMLExport::exportAutoStyles() 148 { 149 m_pImpl->exportAutoStyles(); 150 } 151 152 //--------------------------------------------------------------------- excludeFromExport(const Reference<XControlModel> _rxControl)153 void OFormLayerXMLExport::excludeFromExport( const Reference< XControlModel > _rxControl ) 154 { 155 m_pImpl->excludeFromExport( _rxControl ); 156 } 157 158 //========================================================================= 159 //= OOfficeFormsExport 160 //========================================================================= 161 //------------------------------------------------------------------------- OOfficeFormsExport(SvXMLExport & _rExp)162 OOfficeFormsExport::OOfficeFormsExport( SvXMLExport& _rExp ) 163 :m_pImpl(NULL) 164 { 165 m_pImpl = new OFormsRootExport(_rExp); 166 } 167 168 //------------------------------------------------------------------------- ~OOfficeFormsExport()169 OOfficeFormsExport::~OOfficeFormsExport() 170 { 171 delete m_pImpl; 172 } 173 174 //......................................................................... 175 } // namespace xmloff 176 //......................................................................... 177 178