1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_xmloff.hxx"
30 
31 #include <stdio.h>
32 #include <xmloff/formlayerexport.hxx>
33 #include "strings.hxx"
34 #include "elementexport.hxx"
35 #include "xmloff/xmlnmspe.hxx"
36 #include <xmloff/xmlexp.hxx>
37 #include "layerexport.hxx"
38 #include "propertyexport.hxx"
39 #include <osl/diagnose.h>
40 #include <comphelper/extract.hxx>
41 #include <com/sun/star/lang/XServiceInfo.hpp>
42 #include <comphelper/stl_types.hxx>
43 #include "officeforms.hxx"
44 
45 
46 //.........................................................................
47 namespace xmloff
48 {
49 //.........................................................................
50 
51 	using namespace ::com::sun::star::uno;
52 	using namespace ::com::sun::star::lang;
53 	using namespace ::com::sun::star::awt;
54 	using namespace ::com::sun::star::beans;
55 	using namespace ::com::sun::star::container;
56 	using namespace ::com::sun::star::drawing;
57 	using namespace ::com::sun::star::frame;
58 
59 	//=====================================================================
60 	//= OFormLayerXMLExport
61 	//=====================================================================
62 
63 	//---------------------------------------------------------------------
64 	OFormLayerXMLExport::OFormLayerXMLExport(SvXMLExport& _rContext)
65 		:m_rContext(_rContext)
66 		,m_pImpl(new OFormLayerXMLExport_Impl(_rContext))
67 	{
68 	}
69 
70 	//---------------------------------------------------------------------
71 	OFormLayerXMLExport::~OFormLayerXMLExport()
72 	{
73 		delete m_pImpl;
74 		m_pImpl = NULL;
75 	}
76 
77 	//---------------------------------------------------------------------
78 	sal_Bool OFormLayerXMLExport::seekPage(const Reference< XDrawPage >& _rxDrawPage)
79 	{
80 		return m_pImpl->seekPage(_rxDrawPage);
81 	}
82 
83 	//---------------------------------------------------------------------
84 	::rtl::OUString OFormLayerXMLExport::getControlId(const Reference< XPropertySet >& _rxControl)
85 	{
86 		return m_pImpl->getControlId(_rxControl);
87 	}
88 
89 	//---------------------------------------------------------------------
90 	::rtl::OUString OFormLayerXMLExport::getControlNumberStyle( const Reference< XPropertySet >& _rxControl )
91 	{
92 		return m_pImpl->getControlNumberStyle(_rxControl);
93 	}
94 
95 	//---------------------------------------------------------------------
96 	void OFormLayerXMLExport::initialize()
97 	{
98 		m_pImpl->clear();
99 	}
100 
101 	//---------------------------------------------------------------------
102 	void OFormLayerXMLExport::examineForms(const Reference< XDrawPage >& _rxDrawPage)
103 	{
104 		try
105 		{
106 			m_pImpl->examineForms(_rxDrawPage);
107 		}
108 		catch(Exception&)
109 		{
110 			OSL_ENSURE(sal_False, "OFormLayerXMLExport::examine: could not examine the draw page!");
111 		}
112 	}
113 
114 	//---------------------------------------------------------------------
115 	void OFormLayerXMLExport::exportForms(const Reference< XDrawPage >& _rxDrawPage)
116 	{
117 		m_pImpl->exportForms(_rxDrawPage);
118 	}
119 
120 	//---------------------------------------------------------------------
121 	void OFormLayerXMLExport::exportXForms() const
122     {
123 		m_pImpl->exportXForms();
124     }
125 
126 	//---------------------------------------------------------------------
127 	bool OFormLayerXMLExport::pageContainsForms( const Reference< XDrawPage >& _rxDrawPage ) const
128     {
129 		return m_pImpl->pageContainsForms( _rxDrawPage );
130     }
131 
132 	//---------------------------------------------------------------------
133 	bool OFormLayerXMLExport::documentContainsXForms() const
134     {
135 		return m_pImpl->documentContainsXForms();
136     }
137 
138 	//---------------------------------------------------------------------
139 	void OFormLayerXMLExport::exportControlNumberStyles()
140 	{
141 		m_pImpl->exportControlNumberStyles();
142 	}
143 
144 	//---------------------------------------------------------------------
145 	void OFormLayerXMLExport::exportAutoControlNumberStyles()
146 	{
147 		m_pImpl->exportAutoControlNumberStyles();
148 	}
149 
150 	//---------------------------------------------------------------------
151 	void OFormLayerXMLExport::exportAutoStyles()
152 	{
153 		m_pImpl->exportAutoStyles();
154 	}
155 
156 	//---------------------------------------------------------------------
157 	void OFormLayerXMLExport::excludeFromExport( const Reference< XControlModel > _rxControl )
158 	{
159 		m_pImpl->excludeFromExport( _rxControl );
160 	}
161 
162 	//=========================================================================
163 	//= OOfficeFormsExport
164 	//=========================================================================
165 	//-------------------------------------------------------------------------
166 	OOfficeFormsExport::OOfficeFormsExport( SvXMLExport& _rExp )
167 		:m_pImpl(NULL)
168 	{
169 		m_pImpl = new OFormsRootExport(_rExp);
170 	}
171 
172 	//-------------------------------------------------------------------------
173 	OOfficeFormsExport::~OOfficeFormsExport()
174 	{
175 		delete m_pImpl;
176 	}
177 
178 //.........................................................................
179 }	// namespace xmloff
180 //.........................................................................
181 
182