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_toolkit.hxx"
30 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
31 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
32 #include <com/sun/star/registry/XRegistryKey.hpp>
33 #include <toolkit/controls/geometrycontrolmodel.hxx>
34 #include <cppuhelper/factory.hxx>
35 #include <cppuhelper/weak.hxx>
36 #include <osl/mutex.hxx>
37 #include <toolkit/helper/servicenames.hxx>
38 #include <toolkit/helper/macros.hxx>
39 #include <toolkit/awt/vclxtoolkit.hxx>
40 #include <toolkit/awt/vclxmenu.hxx>
41 #include <toolkit/awt/vclxpointer.hxx>
42 #include <toolkit/awt/vclxprinter.hxx>
43 #include <toolkit/controls/unocontrols.hxx>
44 #include <toolkit/controls/unocontrolcontainer.hxx>
45 #include <toolkit/controls/unocontrolcontainermodel.hxx>
46 #include <toolkit/controls/stdtabcontroller.hxx>
47 #include <toolkit/controls/stdtabcontrollermodel.hxx>
48 #include <toolkit/controls/formattedcontrol.hxx>
49 #include <toolkit/controls/roadmapcontrol.hxx>
50 #include <toolkit/controls/tkscrollbar.hxx>
51 #include "toolkit/controls/tkspinbutton.hxx"
52 #include <toolkit/controls/tksimpleanimation.hxx>
53 #include <toolkit/controls/tkthrobber.hxx>
54 #include <toolkit/controls/animatedimages.hxx>
55 #include <toolkit/controls/spinningprogress.hxx>
56 #include <toolkit/controls/dialogcontrol.hxx>
57 #include <toolkit/controls/tabpagemodel.hxx>
58 #include <toolkit/controls/tabpagecontainer.hxx>
59 #include "toolkit/dllapi.h"
60 #include <com/sun/star/beans/XPropertySet.hpp>
61 #include <com/sun/star/uno/XComponentContext.hpp>
62 
63 namespace toolkit
64 {
65     using namespace ::com::sun::star::uno;
66     using namespace ::com::sun::star::lang;
67     using namespace ::com::sun::star::registry;
68 
69     //.........................................................................
70     Reference< XRegistryKey > registerServices( const Reference< XRegistryKey >& _rxParentKey,
71         const sal_Char* _pAsciiImplName, const sal_Char* _pAsciiServiceName )
72     {
73         ::rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM( "/stardiv.Toolkit." ) );
74         sImplName += ::rtl::OUString::createFromAscii( _pAsciiImplName );
75         sImplName += ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "/UNO/SERVICES" ) );
76 
77 		Reference< XRegistryKey > xNewKey = _rxParentKey->createKey( sImplName );
78         xNewKey->createKey( ::rtl::OUString::createFromAscii( _pAsciiServiceName ) );
79 
80         return xNewKey;
81     }
82 
83     //.........................................................................
84     Reference< XRegistryKey > registerServices( const Reference< XRegistryKey >& _rxParentKey,
85         const sal_Char* _pAsciiImplName, const sal_Char* _pAsciiServiceName1, const sal_Char* _pAsciiServiceName2 )
86     {
87         Reference< XRegistryKey > xComponentServicesKey = registerServices( _rxParentKey, _pAsciiImplName, _pAsciiServiceName1 );
88         xComponentServicesKey->createKey( ::rtl::OUString::createFromAscii( _pAsciiServiceName2 ) );
89         return xComponentServicesKey;
90     }
91 
92     //.........................................................................
93     void* tryCreateFactory( const sal_Char* _pRequiredImplName, const sal_Char* _pComponentImplName,
94         const sal_Char* _pAsciiServiceName1, const sal_Char* _pAsciiServiceName2,
95         ::cppu::ComponentInstantiation _pInstantiation, const Reference< XMultiServiceFactory >& _rxServiceFactory )
96     {
97         void* pReturn = NULL;
98 
99     	if ( rtl_str_compare( _pRequiredImplName, _pComponentImplName ) == 0 )
100     	{
101             Sequence< ::rtl::OUString > aServiceNames( _pAsciiServiceName2 ? 2 : 1 );
102             aServiceNames.getArray()[ 0 ] = ::rtl::OUString::createFromAscii( _pAsciiServiceName1 );
103             if ( _pAsciiServiceName2 )
104                 aServiceNames.getArray()[ 1 ] = ::rtl::OUString::createFromAscii( _pAsciiServiceName2 );
105     		Reference< XSingleServiceFactory > xFactory( ::cppu::createSingleFactory(
106                 _rxServiceFactory, ::rtl::OUString::createFromAscii( _pComponentImplName ),
107                 _pInstantiation, aServiceNames
108             ) );
109 
110 		    if ( xFactory.is() )
111 		    {
112 			    xFactory->acquire();
113 			    pReturn = xFactory.get();
114 		    }
115 	    }
116 
117         return pReturn;
118     }
119 
120 
121 }
122 
123 #define IMPL_CREATEINSTANCE( ImplName ) \
124 	::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ImplName##_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ) \
125 	{ return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new ImplName ); }
126 
127 #define IMPL_CREATEINSTANCE2( ImplName ) \
128 	::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ImplName##_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) \
129 	{ return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new ImplName( i_factory ) ); }
130 
131 #define IMPL_CREATE_INSTANCE_WITH_GEOMETRY( ImplName ) \
132     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ImplName##_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& i_factory ) \
133 { \
134 	return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new OGeometryControlModel< ImplName >( i_factory ) ); \
135 }
136 
137 #define GET_FACTORY_WITH_IMPL_PREFIX( ClassName, ImplNamePrefix, ServiceName1, ServiceName2 ) \
138     pRet = tryCreateFactory( sImplementationName, ImplNamePrefix "." #ClassName, \
139                 ServiceName1, ServiceName2, \
140                 ClassName##_CreateInstance, xServiceFactory \
141             ); \
142     if ( pRet ) \
143         return pRet; \
144 
145 #define GET_FACTORY( ImplName, ServiceName1, ServiceName2 ) \
146     GET_FACTORY_WITH_IMPL_PREFIX( ImplName, "stardiv.Toolkit", ServiceName1, ServiceName2 )
147 
148 using namespace toolkit;
149 
150 IMPL_CREATEINSTANCE2( VCLXToolkit )
151 IMPL_CREATEINSTANCE( StdTabController )
152 IMPL_CREATEINSTANCE( StdTabControllerModel )
153 IMPL_CREATEINSTANCE2( UnoButtonControl )
154 IMPL_CREATEINSTANCE2( UnoCheckBoxControl )
155 IMPL_CREATEINSTANCE2( UnoComboBoxControl )
156 IMPL_CREATEINSTANCE2( UnoControlButtonModel )
157 IMPL_CREATEINSTANCE2( UnoControlCheckBoxModel )
158 IMPL_CREATEINSTANCE2( UnoControlComboBoxModel )
159 IMPL_CREATEINSTANCE2( UnoControlContainer )
160 IMPL_CREATEINSTANCE2( UnoControlContainerModel )
161 IMPL_CREATEINSTANCE2( UnoControlCurrencyFieldModel )
162 IMPL_CREATEINSTANCE2( UnoControlDateFieldModel )
163 IMPL_CREATEINSTANCE2( UnoControlEditModel )
164 IMPL_CREATEINSTANCE2( UnoControlFileControlModel )
165 IMPL_CREATEINSTANCE2( UnoControlFixedHyperlinkModel )
166 IMPL_CREATEINSTANCE2( UnoControlFixedTextModel )
167 IMPL_CREATEINSTANCE2( UnoControlFormattedFieldModel )
168 IMPL_CREATEINSTANCE2( UnoControlGroupBoxModel )
169 IMPL_CREATEINSTANCE2( UnoControlImageControlModel )
170 IMPL_CREATEINSTANCE2( UnoControlListBoxModel )
171 IMPL_CREATEINSTANCE2( UnoControlNumericFieldModel )
172 IMPL_CREATEINSTANCE2( UnoControlPatternFieldModel )
173 IMPL_CREATEINSTANCE2( UnoControlRadioButtonModel )
174 IMPL_CREATEINSTANCE2( UnoControlTimeFieldModel )
175 IMPL_CREATEINSTANCE2( UnoControlProgressBarModel )
176 IMPL_CREATEINSTANCE2( UnoControlScrollBarModel )
177 IMPL_CREATEINSTANCE2( UnoSpinButtonModel )
178 IMPL_CREATEINSTANCE2( UnoControlFixedLineModel )
179 IMPL_CREATEINSTANCE2( UnoCurrencyFieldControl )
180 IMPL_CREATEINSTANCE2( UnoDateFieldControl )
181 IMPL_CREATEINSTANCE2( UnoDialogControl )
182 IMPL_CREATEINSTANCE2( UnoEditControl )
183 IMPL_CREATEINSTANCE2( UnoFileControl )
184 IMPL_CREATEINSTANCE2( UnoFixedHyperlinkControl )
185 IMPL_CREATEINSTANCE2( UnoFixedTextControl )
186 IMPL_CREATEINSTANCE2( UnoFormattedFieldControl )
187 IMPL_CREATEINSTANCE2( UnoGroupBoxControl )
188 IMPL_CREATEINSTANCE2( UnoImageControlControl )
189 IMPL_CREATEINSTANCE2( UnoListBoxControl )
190 IMPL_CREATEINSTANCE2( UnoNumericFieldControl )
191 IMPL_CREATEINSTANCE2( UnoPatternFieldControl )
192 IMPL_CREATEINSTANCE2( UnoRadioButtonControl )
193 IMPL_CREATEINSTANCE2( UnoTimeFieldControl )
194 IMPL_CREATEINSTANCE2( UnoProgressBarControl )
195 IMPL_CREATEINSTANCE2( UnoScrollBarControl )
196 IMPL_CREATEINSTANCE2( UnoSpinButtonControl )
197 IMPL_CREATEINSTANCE2( UnoFixedLineControl )
198 IMPL_CREATEINSTANCE( VCLXMenuBar )
199 IMPL_CREATEINSTANCE( VCLXPointer )
200 IMPL_CREATEINSTANCE( VCLXPopupMenu )
201 IMPL_CREATEINSTANCE( VCLXPrinterServer )
202 IMPL_CREATEINSTANCE2( UnoRoadmapControl )
203 IMPL_CREATEINSTANCE2( UnoControlRoadmapModel )
204 IMPL_CREATEINSTANCE2( UnoSimpleAnimationControl )
205 IMPL_CREATEINSTANCE2( UnoSimpleAnimationControlModel )
206 IMPL_CREATEINSTANCE2( UnoThrobberControl )
207 IMPL_CREATEINSTANCE2( UnoThrobberControlModel )
208 IMPL_CREATEINSTANCE2( UnoControlTabPage )
209 IMPL_CREATEINSTANCE2( UnoControlTabPageModel )
210 IMPL_CREATEINSTANCE2( UnoControlTabPageContainer )
211 IMPL_CREATEINSTANCE2( UnoControlTabPageContainerModel )
212 IMPL_CREATEINSTANCE2( AnimatedImagesControl )
213 IMPL_CREATEINSTANCE2( AnimatedImagesControlModel )
214 IMPL_CREATEINSTANCE2( SpinningProgressControlModel )
215 
216 IMPL_CREATE_INSTANCE_WITH_GEOMETRY( UnoControlDialogModel )
217 
218 extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL TreeControl_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
219 extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL TreeControlModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
220 extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL MutableTreeDataModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
221 extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GridControl_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
222 extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GridControlModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
223 extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL DefaultGridDataModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
224 extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL DefaultGridColumnModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
225 extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL GridColumn_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
226 extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SortableGridDataModel_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
227 
228 extern void * SAL_CALL comp_AsyncCallback_component_getFactory( const char * implName, void * serviceManager, void * registryKey );
229 
230 extern void * SAL_CALL comp_Layout_component_getFactory( const char * implName, void * serviceManager, void * registryKey );
231 
232 extern "C"
233 {
234 
235 TOOLKIT_DLLPUBLIC void SAL_CALL component_getImplementationEnvironment( const sal_Char** ppEnvTypeName, uno_Environment** )
236 {
237 	*ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
238 }
239 
240 
241 TOOLKIT_DLLPUBLIC void* SAL_CALL component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* _pRegistryKey )
242 {
243 	void* pRet = NULL;
244 
245 	if ( _pServiceManager )
246 	{
247         ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory =
248             static_cast< ::com::sun::star::lang::XMultiServiceFactory* >( _pServiceManager );
249 
250 		GET_FACTORY( VCLXToolkit, szServiceName_Toolkit, szServiceName2_Toolkit )
251 		GET_FACTORY( VCLXPopupMenu, szServiceName_PopupMenu, szServiceName2_PopupMenu )
252 		GET_FACTORY( VCLXMenuBar, szServiceName_MenuBar, szServiceName2_MenuBar )
253 		GET_FACTORY( VCLXPointer, szServiceName_Pointer, szServiceName2_Pointer )
254 		GET_FACTORY( UnoControlContainer, szServiceName_UnoControlContainer, szServiceName2_UnoControlContainer )
255 		GET_FACTORY( UnoControlContainerModel, szServiceName_UnoControlContainerModel, szServiceName2_UnoControlContainerModel )
256 		GET_FACTORY( StdTabController, szServiceName_TabController, szServiceName2_TabController )
257 		GET_FACTORY( StdTabControllerModel, szServiceName_TabControllerModel, szServiceName2_TabControllerModel )
258 		GET_FACTORY( UnoDialogControl, szServiceName_UnoControlDialog, szServiceName2_UnoControlDialog )
259 		GET_FACTORY( UnoControlDialogModel, szServiceName_UnoControlDialogModel, szServiceName2_UnoControlDialogModel )
260 		GET_FACTORY( UnoEditControl, szServiceName_UnoControlEdit, szServiceName2_UnoControlEdit )
261 		GET_FACTORY( UnoControlEditModel, szServiceName_UnoControlEditModel, szServiceName2_UnoControlEditModel )
262 		GET_FACTORY( UnoDateFieldControl, szServiceName_UnoControlDateField, szServiceName2_UnoControlDateField )
263 		GET_FACTORY( UnoControlDateFieldModel, szServiceName_UnoControlDateFieldModel, szServiceName2_UnoControlDateFieldModel )
264 		GET_FACTORY( UnoTimeFieldControl, szServiceName_UnoControlTimeField, szServiceName2_UnoControlTimeField )
265 		GET_FACTORY( UnoControlTimeFieldModel, szServiceName_UnoControlTimeFieldModel, szServiceName2_UnoControlTimeFieldModel )
266 		GET_FACTORY( UnoNumericFieldControl, szServiceName_UnoControlNumericField, szServiceName2_UnoControlNumericField )
267 		GET_FACTORY( UnoControlNumericFieldModel, szServiceName_UnoControlNumericFieldModel, szServiceName2_UnoControlNumericFieldModel )
268 		GET_FACTORY( UnoCurrencyFieldControl, szServiceName_UnoControlCurrencyField, szServiceName2_UnoControlCurrencyField )
269 		GET_FACTORY( UnoControlCurrencyFieldModel, szServiceName_UnoControlCurrencyFieldModel, szServiceName2_UnoControlCurrencyFieldModel )
270 		GET_FACTORY( UnoPatternFieldControl, szServiceName_UnoControlPatternField, szServiceName2_UnoControlPatternField )
271 		GET_FACTORY( UnoControlPatternFieldModel, szServiceName_UnoControlPatternFieldModel, szServiceName2_UnoControlPatternFieldModel )
272 		GET_FACTORY( UnoFormattedFieldControl, szServiceName_UnoControlFormattedField, szServiceName2_UnoControlFormattedField )
273 		GET_FACTORY( UnoControlFormattedFieldModel, szServiceName_UnoControlFormattedFieldModel, szServiceName2_UnoControlFormattedFieldModel )
274 		GET_FACTORY( UnoFileControl, szServiceName_UnoControlFileControl, szServiceName2_UnoControlFileControl )
275 		GET_FACTORY( UnoControlFileControlModel, szServiceName_UnoControlFileControlModel, szServiceName2_UnoControlFileControlModel )
276 		GET_FACTORY( UnoButtonControl, szServiceName_UnoControlButton, szServiceName2_UnoControlButton )
277 		GET_FACTORY( UnoControlButtonModel, szServiceName_UnoControlButtonModel, szServiceName2_UnoControlButtonModel )
278 		GET_FACTORY( UnoImageControlControl, szServiceName_UnoControlImageButton, szServiceName2_UnoControlImageButton )
279 		GET_FACTORY( UnoControlImageControlModel, szServiceName_UnoControlImageButtonModel, szServiceName2_UnoControlImageButtonModel )
280 		GET_FACTORY( UnoImageControlControl, szServiceName_UnoControlImageControl, szServiceName2_UnoControlImageControl )
281 		GET_FACTORY( UnoControlImageControlModel, szServiceName_UnoControlImageControlModel, szServiceName2_UnoControlImageControlModel )
282 		GET_FACTORY( UnoRadioButtonControl, szServiceName_UnoControlRadioButton, szServiceName2_UnoControlRadioButton )
283 		GET_FACTORY( UnoControlRadioButtonModel, szServiceName_UnoControlRadioButtonModel, szServiceName2_UnoControlRadioButtonModel )
284 		GET_FACTORY( UnoCheckBoxControl, szServiceName_UnoControlCheckBox, szServiceName2_UnoControlCheckBox )
285 		GET_FACTORY( UnoControlCheckBoxModel, szServiceName_UnoControlCheckBoxModel, szServiceName2_UnoControlCheckBoxModel )
286 		GET_FACTORY( UnoListBoxControl, szServiceName_UnoControlListBox, szServiceName2_UnoControlListBox )
287 		GET_FACTORY( UnoControlListBoxModel, szServiceName_UnoControlListBoxModel, szServiceName2_UnoControlListBoxModel )
288 		GET_FACTORY( UnoComboBoxControl, szServiceName_UnoControlComboBox, szServiceName2_UnoControlComboBox )
289 		GET_FACTORY( UnoControlComboBoxModel, szServiceName_UnoControlComboBoxModel, szServiceName2_UnoControlComboBoxModel )
290         GET_FACTORY( UnoFixedTextControl, szServiceName_UnoControlFixedText, szServiceName2_UnoControlFixedText )
291         GET_FACTORY( UnoControlFixedTextModel, szServiceName_UnoControlFixedTextModel, szServiceName2_UnoControlFixedTextModel )
292 		GET_FACTORY( UnoGroupBoxControl, szServiceName_UnoControlGroupBox, szServiceName2_UnoControlGroupBox )
293 		GET_FACTORY( UnoControlGroupBoxModel, szServiceName_UnoControlGroupBoxModel, szServiceName2_UnoControlGroupBoxModel )
294 		GET_FACTORY( UnoProgressBarControl, szServiceName_UnoControlProgressBar, szServiceName2_UnoControlProgressBar )
295 		GET_FACTORY( UnoControlProgressBarModel, szServiceName_UnoControlProgressBarModel, szServiceName2_UnoControlProgressBarModel )
296 		GET_FACTORY( UnoScrollBarControl, szServiceName_UnoControlScrollBar, szServiceName2_UnoControlScrollBar )
297 		GET_FACTORY( UnoControlScrollBarModel, szServiceName_UnoControlScrollBarModel, szServiceName2_UnoControlScrollBarModel )
298 		GET_FACTORY( UnoFixedLineControl, szServiceName_UnoControlFixedLine, szServiceName2_UnoControlFixedLine )
299 		GET_FACTORY( UnoControlFixedLineModel, szServiceName_UnoControlFixedLineModel, szServiceName2_UnoControlFixedLineModel )
300 		GET_FACTORY( VCLXPrinterServer, szServiceName_PrinterServer, szServiceName2_PrinterServer )
301 		GET_FACTORY( UnoRoadmapControl, szServiceName_UnoControlRoadmap, szServiceName2_UnoControlRoadmap )
302 		GET_FACTORY( UnoControlRoadmapModel, szServiceName_UnoControlRoadmapModel, szServiceName2_UnoControlRoadmapModel )
303         GET_FACTORY( UnoSpinButtonModel, szServiceName_UnoSpinButtonModel, NULL )
304         GET_FACTORY( UnoSpinButtonControl, szServiceName_UnoSpinButtonControl, NULL )
305 		GET_FACTORY( TreeControl, szServiceName_TreeControl, NULL )
306 		GET_FACTORY( TreeControlModel, szServiceName_TreeControlModel, NULL )
307 		GET_FACTORY( MutableTreeDataModel, szServiceName_MutableTreeDataModel, NULL )
308         GET_FACTORY( UnoSimpleAnimationControlModel, szServiceName_UnoSimpleAnimationControlModel, szServiceName2_UnoSimpleAnimationControlModel )
309         GET_FACTORY( UnoSimpleAnimationControl, szServiceName_UnoSimpleAnimationControl, szServiceName2_UnoSimpleAnimationControl )
310         GET_FACTORY( UnoThrobberControlModel, szServiceName_UnoThrobberControlModel, szServiceName2_UnoThrobberControlModel )
311         GET_FACTORY( UnoThrobberControl, szServiceName_UnoThrobberControl, szServiceName2_UnoThrobberControl )
312         GET_FACTORY( UnoFixedHyperlinkControl, szServiceName_UnoControlFixedHyperlink, NULL )
313         GET_FACTORY( UnoControlFixedHyperlinkModel, szServiceName_UnoControlFixedHyperlinkModel, NULL )
314 		GET_FACTORY( GridControl, szServiceName_GridControl, NULL );
315  		GET_FACTORY( GridControlModel, szServiceName_GridControlModel, NULL );
316 		GET_FACTORY( DefaultGridDataModel, szServiceName_DefaultGridDataModel, NULL );
317 		GET_FACTORY( DefaultGridColumnModel, szServiceName_DefaultGridColumnModel, NULL );
318 		GET_FACTORY_WITH_IMPL_PREFIX( GridColumn, "org.openoffice.comp.toolkit", szServiceName_GridColumn, NULL );
319 		GET_FACTORY_WITH_IMPL_PREFIX( SortableGridDataModel, "org.openoffice.comp.toolkit", szServiceName_SortableGridDataModel, NULL );
320 		GET_FACTORY( UnoControlTabPageModel, szServiceName_UnoControlTabPageModel, NULL )
321 		GET_FACTORY( UnoControlTabPage, szServiceName_UnoControlTabPage, NULL )
322 		GET_FACTORY( UnoControlTabPageContainerModel, szServiceName_UnoControlTabPageContainerModel, NULL )
323 		GET_FACTORY( UnoControlTabPageContainer, szServiceName_UnoControlTabPageContainer, NULL )
324         GET_FACTORY_WITH_IMPL_PREFIX( AnimatedImagesControl, "org.openoffice.comp.toolkit", szServiceName_AnimatedImagesControl, NULL )
325         GET_FACTORY_WITH_IMPL_PREFIX( AnimatedImagesControlModel, "org.openoffice.comp.toolkit", szServiceName_AnimatedImagesControlModel, NULL )
326         GET_FACTORY_WITH_IMPL_PREFIX( SpinningProgressControlModel, "org.openoffice.comp.toolkit", szServiceName_SpinningProgressControlModel, NULL )
327 
328     	if ( rtl_str_compare( sImplementationName, "com.sun.star.awt.comp.AsyncCallback" ) == 0 )
329             return comp_AsyncCallback_component_getFactory( sImplementationName, _pServiceManager, _pRegistryKey );
330 		if( pRet == 0 )
331 			pRet = comp_Layout_component_getFactory( sImplementationName, _pServiceManager, _pRegistryKey );
332 	}
333 	return pRet;
334 }
335 }
336 
337 
338 
339