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_comphelper.hxx"
26 #ifndef _COMPHELPER_TYPEGENERATION_HXX
27 #include <comphelper/TypeGeneration.hxx>
28 #endif
29 #include <com/sun/star/script/XLibraryContainer.hpp>
30 #include <com/sun/star/style/LineSpacingMode.hpp>
31 #include <com/sun/star/style/ParagraphAdjust.hpp>
32 #include <com/sun/star/style/DropCapFormat.hpp>
33 #include <com/sun/star/style/LineSpacing.hpp>
34 #include <com/sun/star/style/TabStop.hpp>
35 #include <com/sun/star/style/TabAlign.hpp>
36 #include <com/sun/star/style/PageStyleLayout.hpp>
37 #include <com/sun/star/style/BreakType.hpp>
38 #include <com/sun/star/text/XModule.hpp>
39 #include <com/sun/star/text/XTextRangeMover.hpp>
40 #include <com/sun/star/text/XFootnotesSettingsSupplier.hpp>
41 #include <com/sun/star/text/XFootnote.hpp>
42 #include <com/sun/star/text/XFootnotesSupplier.hpp>
43 #include <com/sun/star/text/XEndnotesSupplier.hpp>
44 #include <com/sun/star/text/XEndnotesSettingsSupplier.hpp>
45 #include <com/sun/star/text/FootnoteNumbering.hpp>
46 #include <com/sun/star/text/XTextSectionsSupplier.hpp>
47 #include <com/sun/star/text/XTextSection.hpp>
48 #include <com/sun/star/text/SectionFileLink.hpp>
49 #include <com/sun/star/text/RelOrientation.hpp>
50 #include <com/sun/star/text/VertOrientation.hpp>
51 #include <com/sun/star/text/HorizontalAdjust.hpp>
52 #include <com/sun/star/text/DocumentStatistic.hpp>
53 #include <com/sun/star/text/HoriOrientation.hpp>
54 #include <com/sun/star/text/HoriOrientationFormat.hpp>
55 #include <com/sun/star/text/NotePrintMode.hpp>
56 #include <com/sun/star/text/SizeType.hpp>
57 #include <com/sun/star/text/VertOrientationFormat.hpp>
58 #include <com/sun/star/text/WrapTextMode.hpp>
59 //undef to prevent error (from sfx2/docfile.cxx)
60 #undef SEQUENCE
61 #include <com/sun/star/text/SetVariableType.hpp>
62 #include <com/sun/star/text/XTextFieldsSupplier.hpp>
63 #include <com/sun/star/text/UserDataPart.hpp>
64 #include <com/sun/star/text/ChapterFormat.hpp>
65 #include <com/sun/star/text/XTextField.hpp>
66 #include <com/sun/star/text/PlaceholderType.hpp>
67 #include <com/sun/star/text/TemplateDisplayFormat.hpp>
68 #include <com/sun/star/text/UserFieldFormat.hpp>
69 #include <com/sun/star/text/PageNumberType.hpp>
70 #include <com/sun/star/text/ReferenceFieldPart.hpp>
71 #include <com/sun/star/text/FilenameDisplayFormat.hpp>
72 #include <com/sun/star/text/XDependentTextField.hpp>
73 #include <com/sun/star/text/GraphicCrop.hpp>
74 #include <com/sun/star/text/XTextGraphicObjectsSupplier.hpp>
75 #include <com/sun/star/text/XTextTableCursor.hpp>
76 #include <com/sun/star/text/XTextTablesSupplier.hpp>
77 #include <com/sun/star/text/TableColumnSeparator.hpp>
78 #include <com/sun/star/text/XTextTable.hpp>
79 #include <com/sun/star/text/XDocumentIndexMark.hpp>
80 #include <com/sun/star/text/XDocumentIndexesSupplier.hpp>
81 #include <com/sun/star/text/XDocumentIndex.hpp>
82 #include <com/sun/star/text/XTextColumns.hpp>
83 #include <com/sun/star/text/TextColumnSequence.hpp>
84 #include <com/sun/star/text/XTextFramesSupplier.hpp>
85 #include <com/sun/star/text/XTextFrame.hpp>
86 #include <com/sun/star/beans/PropertyValues.hpp>
87 #include <com/sun/star/beans/XPropertySet.hpp>
88 #include <com/sun/star/beans/PropertyValue.hpp>
89 #include <com/sun/star/beans/PropertyState.hpp>
90 #include <com/sun/star/beans/XPropertySetInfo.hpp>
91 #include <com/sun/star/beans/XMultiPropertySet.hpp>
92 #include <com/sun/star/beans/XFastPropertySet.hpp>
93 #include <com/sun/star/beans/XVetoableChangeListener.hpp>
94 #include <com/sun/star/beans/XPropertyState.hpp>
95 #include <com/sun/star/beans/XPropertyStateChangeListener.hpp>
96 #ifndef _COM_SUN_STAR_BEANS_PropertyAttribute_HPP_
97 #include <com/sun/star/beans/PropertyAttribute.hpp>
98 #endif
99 #include <com/sun/star/beans/XPropertiesChangeListener.hpp>
100 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
101 #include <com/sun/star/beans/XPropertyAccess.hpp>
102 #include <com/sun/star/beans/XPropertyContainer.hpp>
103 #include <com/sun/star/beans/NamedValue.hpp>
104 #include <com/sun/star/beans/PropertyStateChangeEvent.hpp>
105 #include <com/sun/star/beans/PropertyChangeEvent.hpp>
106 #include <com/sun/star/text/TextContentAnchorType.hpp>
107 #include <com/sun/star/awt/FontSlant.hpp>
108 #include <com/sun/star/awt/Size.hpp>
109 #include <com/sun/star/awt/XBitmap.hpp>
110 #include <com/sun/star/style/GraphicLocation.hpp>
111 #include <com/sun/star/style/VerticalAlignment.hpp>
112 #include <com/sun/star/container/XIndexReplace.hpp>
113 #include <com/sun/star/container/XIndexContainer.hpp>
114 #include <com/sun/star/table/ShadowFormat.hpp>
115 #include <com/sun/star/table/BorderLine.hpp>
116 #include <com/sun/star/table/TableBorder.hpp>
117 #include <com/sun/star/table/TableBorderDistances.hpp>
118 #include <com/sun/star/container/XNameContainer.hpp>
119 #include <com/sun/star/lang/Locale.hpp>
120 #include <com/sun/star/drawing/PointSequenceSequence.hpp>
121 #include <com/sun/star/i18n/XForbiddenCharacters.hpp>
122 #include <com/sun/star/drawing/ColorMode.hpp>
123 #include <com/sun/star/util/DateTime.hpp>
124 #include <com/sun/star/util/Date.hpp>
125 #include <com/sun/star/sdbc/XResultSet.hpp>
126 #include <com/sun/star/sdbc/XConnection.hpp>
127 #include <com/sun/star/frame/XModel.hpp>
128 // --> OD 2004-08-09 #i28749#
129 #include <com/sun/star/drawing/HomogenMatrix3.hpp>
130 // <--
131 #include <com/sun/star/graphic/XGraphic.hpp>
132 #include <com/sun/star/embed/XEmbeddedObject.hpp>
133 
134 using ::rtl::OUString;
135 using namespace ::com::sun::star;
136 using namespace ::com::sun::star::container;
137 using namespace ::com::sun::star::lang;
138 using namespace ::com::sun::star::awt;
139 using namespace ::com::sun::star::text;
140 using namespace ::com::sun::star::uno;
141 using namespace ::com::sun::star::beans;
142 using namespace ::com::sun::star::drawing;
143 using namespace ::com::sun::star::i18n;
144 using namespace ::comphelper;
145 
146 namespace comphelper
147 {
GenerateCppuType(CppuTypes eType,const com::sun::star::uno::Type * & pType)148 	void GenerateCppuType (
149         CppuTypes eType, const com::sun::star::uno::Type*& pType )
150 	{
151 		switch( eType )
152 		{
153 			case CPPUTYPE_BOOLEAN:		pType = &::getBooleanCppuType();	break;
154 			case CPPUTYPE_INT8:			pType = &::getCppuType( (sal_Int8*)0 );	break;
155 			case CPPUTYPE_INT16:		pType = &::getCppuType( (sal_Int16*)0 );	break;
156 			case CPPUTYPE_INT32:		pType = &::getCppuType( (sal_Int32*)0 );	break;
157 
158 			case CPPUTYPE_DOUBLE:		pType = &::getCppuType( (double*)0 ); break;
159 			case CPPUTYPE_FLOAT:		pType = &::getCppuType( (float*)0 );	break;
160 			case CPPUTYPE_OUSTRING:		pType = &::getCppuType( (OUString*)0 );	break;
161 			case CPPUTYPE_FONTSLANT:	pType = &::getCppuType( (FontSlant*)0 );	break;
162 			case CPPUTYPE_LOCALE:		pType = &::getCppuType( (Locale*)0 );	break;
163 			case CPPUTYPE_PROPERTYVALUE:pType = &::getCppuType( (Sequence<PropertyValue>*)0 );	break;
164 			case CPPUTYPE_PROPERTYVALUES:	pType = &::getCppuType( (Sequence<PropertyValues>*)0 );	break;
165 			case CPPUTYPE_BORDERLINE:	pType = &::getCppuType( (table::BorderLine*)0 );	break;
166 			case CPPUTYPE_BREAK:		pType = &::getCppuType( (style::BreakType*)0 );	break;
167 			case CPPUTYPE_GRAPHICLOC:	pType = &::getCppuType( (style::GraphicLocation*)0 );	break;
168 			case CPPUTYPE_DROPCAPFMT:	pType = &::getCppuType( (style::DropCapFormat*)0 );	break;
169 			case CPPUTYPE_LINESPACE:	pType = &::getCppuType( (style::LineSpacing*)0 );	break;
170 
171 			case CPPUTYPE_AWTSIZE:		pType = &::getCppuType( (awt::Size*)0 );	break;
172 			case CPPUTYPE_SHADOWFMT:	pType = &::getCppuType( (table::ShadowFormat*)0 );	break;
173 			case CPPUTYPE_TBLCOLSEP:	pType = &::getCppuType( (Sequence<text::TableColumnSeparator>*)0 );	break;
174 			case CPPUTYPE_PNTSEQSEQ:	pType = &::getCppuType( (PointSequenceSequence*)0 );	break;
175 			case CPPUTYPE_DOCIDXMRK:	pType = &::getCppuType( (Sequence< Reference< XDocumentIndexMark > >*)0 );	break;
176 			case CPPUTYPE_SEQINT8:		pType = &::getCppuType( (Sequence<sal_Int8>*)0 );	break;
177 			case CPPUTYPE_SEQTABSTOP:	pType = &::getCppuType( (Sequence<style::TabStop>*)0 ); break;
178 			case CPPUTYPE_SEQANCHORTYPE:pType = &::getCppuType( (Sequence<text::TextContentAnchorType>*)0 ); break;
179 			case CPPUTYPE_SEQDEPTXTFLD:	pType = &::getCppuType( (Sequence<Reference<XDependentTextField> >*)0); break;
180 			case CPPUTYPE_TXTCNTANCHOR:	pType = &::getCppuType( (text::TextContentAnchorType*)0 );	break;
181 			case CPPUTYPE_WRAPTXTMODE:	pType = &::getCppuType( (text::WrapTextMode*)0 );	break;
182 
183 			case CPPUTYPE_COLORMODE:	pType = &::getCppuType( (drawing::ColorMode*)0 ); break;
184 			case CPPUTYPE_PAGESTYLELAY:	pType = &::getCppuType( (style::PageStyleLayout*)0 ); break;
185 			case CPPUTYPE_VERTALIGN:	pType = &::getCppuType( (style::VerticalAlignment*)0 ); break;
186 			case CPPUTYPE_TABLEBORDER:	pType = &::getCppuType( (table::TableBorder*)0 ); break;
187 			case CPPUTYPE_GRFCROP:		pType = &::getCppuType( (text::GraphicCrop*)0 ); break;
188 			case CPPUTYPE_SECTFILELNK:	pType = &::getCppuType( (text::SectionFileLink*)0 ); break;
189 			case CPPUTYPE_PAGENUMTYPE: 	pType = &::getCppuType( (text::PageNumberType*)0); break;
190 			case CPPUTYPE_DATETIME:		pType = &::getCppuType( (util::DateTime*)0 ); break;
191 			case CPPUTYPE_DATE:			pType = &::getCppuType( (util::Date*)0 ); break;
192 
193 			case CPPUTYPE_REFINTERFACE:	pType = &::getCppuType( (Reference<XInterface>*)0 );	break;
194 			case CPPUTYPE_REFIDXREPL:	pType = &::getCppuType( (Reference<container::XIndexReplace>*)0 );	break;
195 			case CPPUTYPE_REFNAMECNT:	pType = &::getCppuType( (Reference<container::XNameContainer>*)0 );	break;
196 			case CPPUTYPE_REFTEXTFRAME:	pType = &::getCppuType( (Reference<text::XTextFrame>*)0 );	break;
197 			case CPPUTYPE_REFTEXTSECTION:	pType = &::getCppuType( (Reference<text::XTextSection>*)0 );	break;
198 			case CPPUTYPE_REFFOOTNOTE:	pType = &::getCppuType( (Reference<text::XFootnote>*)0 );	break;
199 			case CPPUTYPE_REFTEXT:		pType = &::getCppuType( (Reference<text::XText>*)0 );	break;
200 			case CPPUTYPE_REFTEXTCOL:	pType = &::getCppuType( (Reference<text::XTextColumns>*)0 );	break;
201 			case CPPUTYPE_REFFORBCHARS:	pType = &::getCppuType( (Reference<XForbiddenCharacters>*)0 ); break;
202 			case CPPUTYPE_REFIDXCNTNR:	pType = &::getCppuType( (Reference<XIndexContainer>*)0 ); break;
203 			case CPPUTYPE_REFTEXTCNTNT:	pType = &::getCppuType( (Reference<XTextContent>*)0 ); break;
204 			case CPPUTYPE_REFBITMAP:	pType = &::getCppuType( (Reference<awt::XBitmap>*)0 ); break;
205 			case CPPUTYPE_REFNMREPLACE:	pType = &::getCppuType( (Reference<container::XNameReplace>*)0 ); break;
206 			case CPPUTYPE_REFCELL:		pType = &::getCppuType( (Reference<table::XCell>*)0 ); break;
207 			case CPPUTYPE_REFDOCINDEX:	pType = &::getCppuType( (Reference<text::XDocumentIndex>*)0 ); break;
208 			case CPPUTYPE_REFDOCIDXMRK:	pType = &::getCppuType( (Reference<text::XDocumentIndexMark>*)0 ); break;
209 			case CPPUTYPE_REFTXTFIELD:	pType = &::getCppuType( (Reference<text::XTextField>*)0 ); break;
210 			case CPPUTYPE_REFTXTRANGE:	pType = &::getCppuType( (Reference<text::XTextRange>*)0 ); break;
211 			case CPPUTYPE_REFTXTTABLE:	pType = &::getCppuType( (Reference<text::XTextTable>*)0 ); break;
212             case CPPUTYPE_AWTPOINT:     pType = &::getCppuType( (awt::Point*)0 );    break;
213             case CPPUTYPE_REFLIBCONTAINER:  pType = &::getCppuType( (Reference< script::XLibraryContainer >*)0);    break;
214             case CPPUTYPE_OUSTRINGS:    pType = &::getCppuType( (Sequence< ::rtl::OUString >*)0);    break;
215             case CPPUTYPE_SEQANY:           pType = &::getCppuType( (Sequence< uno::Any >*)0);    break;
216             case CPPUTYPE_REFRESULTSET:     pType = &::getCppuType( (Reference< sdbc::XResultSet >*)0);    break;
217             case CPPUTYPE_REFCONNECTION:    pType = &::getCppuType( (Reference< sdbc::XConnection >*)0);    break;
218             case CPPUTYPE_REFMODEL:         pType = &::getCppuType( (Reference< frame::XModel >*)0);    break;
219             case CPPUTYPE_REFCOMPONENT:     pType = &::getCppuType( (Reference< lang::XComponent >*)0 ); break;
220             // --> OD 2004-08-09 #i28749#
221             case CPPUTYPE_TRANSFORMATIONINHORIL2R:
222             {
223                 pType = &::getCppuType( (drawing::HomogenMatrix3*)0 );
224             }
225             break;
226             // <--
227             case CPPUTYPE_SEQNAMEDVALUE:    pType = &::getCppuType( (Sequence<beans::NamedValue>*)0 ); break;
228             case CPPUTYPE_REFXGRAPHIC:      pType = &::getCppuType( (Reference< graphic::XGraphic >*)0); break;
229             case CPPUTYPE_TABLEBORDERDISTANCES:     pType = &::getCppuType( (table::TableBorderDistances*)0 ); break;
230             case CPPUTPYE_REFEMBEDDEDOBJECT:        pType = &embed::XEmbeddedObject::static_type(); break;
231 			default:
232 				OSL_ASSERT( "Unknown CPPU type" );
233 		}
234 	}
235 }
236