Files
libreoffice/forms/source/misc/services.cxx

468 lines
21 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2000-09-18 15:33:13 +00:00
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2000-09-18 15:33:13 +00:00
*
* Copyright 2000, 2010 Oracle and/or its affiliates.
2000-09-18 15:33:13 +00:00
*
* OpenOffice.org - a multi-platform office productivity suite
2000-09-18 15:33:13 +00:00
*
* This file is part of OpenOffice.org.
2000-09-18 15:33:13 +00:00
*
* 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.
2000-09-18 15:33:13 +00:00
*
* 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).
2000-09-18 15:33:13 +00:00
*
* You should have received a copy of the GNU Lesser General Public License
* version 3 along with OpenOffice.org. If not, see
* <http://www.openoffice.org/license.html>
* for a copy of the LGPLv3 License.
2000-09-18 15:33:13 +00:00
*
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_forms.hxx"
2000-09-18 15:33:13 +00:00
#include "services.hxx"
#include "frm_module.hxx"
2000-09-18 15:33:13 +00:00
#include <cppuhelper/factory.hxx>
#include <uno/lbnames.h>
#include <osl/diagnose.h>
#include <uno/mapping.hxx>
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::registry;
2000-09-18 15:33:13 +00:00
//---------------------------------------------------------------------------------------
//.......................................................................................
#define DECLARE_SERVICE_INFO(classImplName) \
namespace frm { \
extern ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface> SAL_CALL classImplName##_CreateInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory) throw (::com::sun::star::uno::RuntimeException); \
2000-09-18 15:33:13 +00:00
}
//---------------------------------------------------------------------------------------
DECLARE_SERVICE_INFO(OFixedTextModel)
DECLARE_SERVICE_INFO(ORadioButtonModel)
DECLARE_SERVICE_INFO(ORadioButtonControl)
DECLARE_SERVICE_INFO(OCheckBoxModel)
DECLARE_SERVICE_INFO(OCheckBoxControl)
DECLARE_SERVICE_INFO(OHiddenModel)
DECLARE_SERVICE_INFO(OGroupBoxModel)
DECLARE_SERVICE_INFO(OGroupBoxControl)
DECLARE_SERVICE_INFO(OListBoxControl)
DECLARE_SERVICE_INFO(OListBoxModel)
DECLARE_SERVICE_INFO(OComboBoxControl)
DECLARE_SERVICE_INFO(OComboBoxModel)
DECLARE_SERVICE_INFO(OEditControl)
DECLARE_SERVICE_INFO(OEditModel)
DECLARE_SERVICE_INFO(ONumericControl)
DECLARE_SERVICE_INFO(ONumericModel)
DECLARE_SERVICE_INFO(OPatternControl)
DECLARE_SERVICE_INFO(OPatternModel)
DECLARE_SERVICE_INFO(OCurrencyControl)
DECLARE_SERVICE_INFO(OCurrencyModel)
DECLARE_SERVICE_INFO(ODateControl)
DECLARE_SERVICE_INFO(ODateModel)
DECLARE_SERVICE_INFO(OTimeControl)
DECLARE_SERVICE_INFO(OTimeModel)
DECLARE_SERVICE_INFO(OFormattedControl)
DECLARE_SERVICE_INFO(OFormattedModel)
DECLARE_SERVICE_INFO(OFileControlModel)
DECLARE_SERVICE_INFO(OButtonControl)
DECLARE_SERVICE_INFO(OButtonModel)
DECLARE_SERVICE_INFO(OImageButtonControl)
DECLARE_SERVICE_INFO(OImageButtonModel)
DECLARE_SERVICE_INFO(OImageControlControl)
DECLARE_SERVICE_INFO(OImageControlModel)
DECLARE_SERVICE_INFO(OGridControlModel)
// XForms objects
DECLARE_SERVICE_INFO(Binding)
DECLARE_SERVICE_INFO(Model)
DECLARE_SERVICE_INFO(XForms)
2000-09-18 15:33:13 +00:00
// some special handling for the FormattedFieldWrapper which can act as FormattedModel or as EditModel
DECLARE_SERVICE_INFO(OFormattedFieldWrapper)
2000-09-18 15:33:13 +00:00
// this is for a service, which is instantiated through the EditModel service name
// and which acts mostly as Edit (mostly means : if somebody uses XPersistObject::read immediately after
// the object was instantiated and the stream contains a FormattedModel, it switches permanently to
// formatted.)
namespace frm { \
extern Reference< XInterface > SAL_CALL OFormattedFieldWrapper_CreateInstance_ForceFormatted(const Reference<XMultiServiceFactory>& _rxFactory) throw (RuntimeException); \
2000-09-18 15:33:13 +00:00
}
DECLARE_SERVICE_INFO(OFormsCollection)
DECLARE_SERVICE_INFO(ImageProducer)
2000-09-18 15:33:13 +00:00
//---------------------------------------------------------------------------------------
static Sequence< ::rtl::OUString > s_aClassImplementationNames;
static Sequence<Sequence< ::rtl::OUString > > s_aClassServiceNames;
static Sequence<sal_Int64> s_aFactories;
2000-09-18 15:33:13 +00:00
// need to use sal_Int64 instead of ComponentInstantiation, as ComponentInstantiation has no cppuType, so
// it can't be used with sequences
//---------------------------------------------------------------------------------------
void registerClassInfo(
::rtl::OUString _rClassImplName, // the ImplName of the class
const Sequence< ::rtl::OUString >& _rServiceNames, // the services supported by this class
2000-09-18 15:33:13 +00:00
::cppu::ComponentInstantiation _pCreateFunction // the method for instantiating such a class
)
{
sal_Int32 nCurrentLength = s_aClassImplementationNames.getLength();
2001-03-23 06:39:46 +00:00
OSL_ENSURE((nCurrentLength == s_aClassServiceNames.getLength())
2000-09-18 15:33:13 +00:00
&& (nCurrentLength == s_aFactories.getLength()),
"forms::registerClassInfo : invalid class infos !");
s_aClassImplementationNames.realloc(nCurrentLength + 1);
s_aClassServiceNames.realloc(nCurrentLength + 1);
s_aFactories.realloc(nCurrentLength + 1);
s_aClassImplementationNames.getArray()[nCurrentLength] = _rClassImplName;
s_aClassServiceNames.getArray()[nCurrentLength] = _rServiceNames;
s_aFactories.getArray()[nCurrentLength] = reinterpret_cast<sal_Int64>(_pCreateFunction);
}
//---------------------------------------------------------------------------------------
//.......................................................................................
#define REGISTER_CLASS_CORE(classImplName) \
registerClassInfo( \
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.") ) + ::rtl::OUString::createFromAscii(#classImplName), \
2000-09-18 15:33:13 +00:00
aServices, \
frm::classImplName##_CreateInstance)
//.......................................................................................
#define REGISTER_CLASS1(classImplName, service1) \
aServices.realloc(1); \
aServices.getArray()[0] = frm::service1; \
REGISTER_CLASS_CORE(classImplName)
//.......................................................................................
#define REGISTER_CLASS2(classImplName, service1, service2) \
aServices.realloc(2); \
aServices.getArray()[0] = frm::service1; \
aServices.getArray()[1] = frm::service2; \
REGISTER_CLASS_CORE(classImplName)
//.......................................................................................
#define REGISTER_CLASS3(classImplName, service1, service2, service3) \
aServices.realloc(3); \
aServices.getArray()[0] = frm::service1; \
aServices.getArray()[1] = frm::service2; \
aServices.getArray()[2] = frm::service3; \
REGISTER_CLASS_CORE(classImplName)
//.......................................................................................
#define REGISTER_CLASS4(classImplName, service1, service2, service3, service4) \
aServices.realloc(4); \
aServices.getArray()[0] = frm::service1; \
aServices.getArray()[1] = frm::service2; \
aServices.getArray()[2] = frm::service3; \
aServices.getArray()[3] = frm::service4; \
REGISTER_CLASS_CORE(classImplName)
//---------------------------------------------------------------------------------------
void ensureClassInfos()
{
if (s_aClassImplementationNames.getLength())
// nothing to do
return;
Sequence< ::rtl::OUString > aServices;
2000-09-18 15:33:13 +00:00
// ========================================================================
// = ControlModels
// ------------------------------------------------------------------------
// - FixedText
REGISTER_CLASS2(OFixedTextModel, FRM_COMPONENT_FIXEDTEXT, FRM_SUN_COMPONENT_FIXEDTEXT);
// - Hidden
REGISTER_CLASS3(OHiddenModel, FRM_COMPONENT_HIDDENCONTROL, FRM_SUN_COMPONENT_HIDDENCONTROL, FRM_COMPONENT_HIDDEN);
// - FileControl
REGISTER_CLASS2(OFileControlModel, FRM_COMPONENT_FILECONTROL, FRM_SUN_COMPONENT_FILECONTROL);
// - ImageButton
REGISTER_CLASS2(OImageButtonModel, FRM_COMPONENT_IMAGEBUTTON, FRM_SUN_COMPONENT_IMAGEBUTTON);
// - GridControl
REGISTER_CLASS3(OGridControlModel, FRM_COMPONENT_GRID /* compatibility */, FRM_COMPONENT_GRIDCONTROL, FRM_SUN_COMPONENT_GRIDCONTROL);
// - GroupBox
REGISTER_CLASS2(OGroupBoxModel, FRM_COMPONENT_GROUPBOX, FRM_SUN_COMPONENT_GROUPBOX);
2000-09-18 15:33:13 +00:00
// - RadioButton
REGISTER_CLASS4( ORadioButtonModel, FRM_COMPONENT_RADIOBUTTON, FRM_SUN_COMPONENT_RADIOBUTTON, FRM_SUN_COMPONENT_DATABASE_RADIOBUTTON, BINDABLE_DATABASE_RADIO_BUTTON );
2000-09-18 15:33:13 +00:00
// - CheckBox
REGISTER_CLASS4( OCheckBoxModel, FRM_COMPONENT_CHECKBOX, FRM_SUN_COMPONENT_CHECKBOX, FRM_SUN_COMPONENT_DATABASE_CHECKBOX, BINDABLE_DATABASE_CHECK_BOX );
2000-09-18 15:33:13 +00:00
// - ListBox
REGISTER_CLASS4( OListBoxModel, FRM_COMPONENT_LISTBOX, FRM_SUN_COMPONENT_LISTBOX, FRM_SUN_COMPONENT_DATABASE_LISTBOX, BINDABLE_DATABASE_LIST_BOX );
2000-09-18 15:33:13 +00:00
// - ComboBox
REGISTER_CLASS4( OComboBoxModel, FRM_COMPONENT_COMBOBOX, FRM_SUN_COMPONENT_COMBOBOX, FRM_SUN_COMPONENT_DATABASE_COMBOBOX, BINDABLE_DATABASE_COMBO_BOX );
2000-09-18 15:33:13 +00:00
// - EditControl
REGISTER_CLASS4( OEditModel, FRM_COMPONENT_TEXTFIELD, FRM_SUN_COMPONENT_TEXTFIELD, FRM_SUN_COMPONENT_DATABASE_TEXTFIELD, BINDABLE_DATABASE_TEXT_FIELD );
2000-09-18 15:33:13 +00:00
// - DateControl
2002-03-04 13:51:58 +00:00
REGISTER_CLASS3( ODateModel, FRM_COMPONENT_DATEFIELD, FRM_SUN_COMPONENT_DATEFIELD, FRM_SUN_COMPONENT_DATABASE_DATEFIELD );
2000-09-18 15:33:13 +00:00
// - TimeControl
2002-03-04 13:51:58 +00:00
REGISTER_CLASS3( OTimeModel, FRM_COMPONENT_TIMEFIELD, FRM_SUN_COMPONENT_TIMEFIELD, FRM_SUN_COMPONENT_DATABASE_TIMEFIELD );
2000-09-18 15:33:13 +00:00
// - NumericField
REGISTER_CLASS4( ONumericModel, FRM_COMPONENT_NUMERICFIELD, FRM_SUN_COMPONENT_NUMERICFIELD, FRM_SUN_COMPONENT_DATABASE_NUMERICFIELD, BINDABLE_DATABASE_NUMERIC_FIELD );
2000-09-18 15:33:13 +00:00
// - CurrencyField
2002-03-04 13:51:58 +00:00
REGISTER_CLASS3( OCurrencyModel, FRM_COMPONENT_CURRENCYFIELD, FRM_SUN_COMPONENT_CURRENCYFIELD, FRM_SUN_COMPONENT_DATABASE_CURRENCYFIELD );
2000-09-18 15:33:13 +00:00
// - PatternField
2002-03-04 13:51:58 +00:00
REGISTER_CLASS3( OPatternModel, FRM_COMPONENT_PATTERNFIELD, FRM_SUN_COMPONENT_PATTERNFIELD, FRM_SUN_COMPONENT_DATABASE_PATTERNFIELD );
2000-09-18 15:33:13 +00:00
// - Button
2002-03-04 13:51:58 +00:00
REGISTER_CLASS2( OButtonModel, FRM_COMPONENT_COMMANDBUTTON, FRM_SUN_COMPONENT_COMMANDBUTTON );
2000-09-18 15:33:13 +00:00
// - ImageControl
2002-03-04 13:51:58 +00:00
REGISTER_CLASS2( OImageControlModel, FRM_COMPONENT_IMAGECONTROL, FRM_SUN_COMPONENT_IMAGECONTROL );
2000-09-18 15:33:13 +00:00
// - FormattedField
REGISTER_CLASS1(OFormattedFieldWrapper, FRM_COMPONENT_EDIT);
// since SRC568 both OFormattedModel and OEditModel use FRM_COMPONENT_EDIT for persistence,
2000-09-18 15:33:13 +00:00
// and while reading a wrapper determines which kind of model it is
// register the wrapper for the FormattedField, as it handles the XPersistObject::write
// so that version <= 5.1 are able to read it
aServices.realloc(4);
2000-09-18 15:33:13 +00:00
aServices.getArray()[0] = frm::FRM_COMPONENT_FORMATTEDFIELD;
aServices.getArray()[1] = frm::FRM_SUN_COMPONENT_FORMATTEDFIELD;
aServices.getArray()[2] = frm::FRM_SUN_COMPONENT_DATABASE_FORMATTEDFIELD;
aServices.getArray()[3] = frm::BINDABLE_DATABASE_FORMATTED_FIELD;
registerClassInfo(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.forms.OFormattedFieldWrapper_ForcedFormatted") ),
2000-09-18 15:33:13 +00:00
aServices,
frm::OFormattedFieldWrapper_CreateInstance_ForceFormatted);
// ========================================================================
// = Controls
// - RadioButton
REGISTER_CLASS2(ORadioButtonControl, STARDIV_ONE_FORM_CONTROL_RADIOBUTTON, FRM_SUN_CONTROL_RADIOBUTTON);
2000-09-18 15:33:13 +00:00
// - CheckBox
REGISTER_CLASS2(OCheckBoxControl, STARDIV_ONE_FORM_CONTROL_CHECKBOX, FRM_SUN_CONTROL_CHECKBOX);
2000-09-18 15:33:13 +00:00
// - GroupBox
REGISTER_CLASS2(OGroupBoxControl, STARDIV_ONE_FORM_CONTROL_GROUPBOX, FRM_SUN_CONTROL_GROUPBOX);
2000-09-18 15:33:13 +00:00
// - ListBox
REGISTER_CLASS2(OListBoxControl, STARDIV_ONE_FORM_CONTROL_LISTBOX, FRM_SUN_CONTROL_LISTBOX);
2000-09-18 15:33:13 +00:00
// - ComboBox
REGISTER_CLASS2(OComboBoxControl, STARDIV_ONE_FORM_CONTROL_COMBOBOX, FRM_SUN_CONTROL_COMBOBOX);
2000-09-18 15:33:13 +00:00
// - EditControl
REGISTER_CLASS3(OEditControl, STARDIV_ONE_FORM_CONTROL_TEXTFIELD, FRM_SUN_CONTROL_TEXTFIELD, STARDIV_ONE_FORM_CONTROL_EDIT);
2000-09-18 15:33:13 +00:00
// - DateControl
REGISTER_CLASS2(ODateControl, STARDIV_ONE_FORM_CONTROL_DATEFIELD, FRM_SUN_CONTROL_DATEFIELD);
2000-09-18 15:33:13 +00:00
// - TimeControl
REGISTER_CLASS2(OTimeControl, STARDIV_ONE_FORM_CONTROL_TIMEFIELD, FRM_SUN_CONTROL_TIMEFIELD);
2000-09-18 15:33:13 +00:00
// - NumericField
REGISTER_CLASS2(ONumericControl, STARDIV_ONE_FORM_CONTROL_NUMERICFIELD, FRM_SUN_CONTROL_NUMERICFIELD);
2000-09-18 15:33:13 +00:00
// - CurrencyField
REGISTER_CLASS2(OCurrencyControl, STARDIV_ONE_FORM_CONTROL_CURRENCYFIELD, FRM_SUN_CONTROL_CURRENCYFIELD);
2000-09-18 15:33:13 +00:00
// - PatternField
REGISTER_CLASS2(OPatternControl, STARDIV_ONE_FORM_CONTROL_PATTERNFIELD, FRM_SUN_CONTROL_PATTERNFIELD);
2000-09-18 15:33:13 +00:00
// - FormattedField
REGISTER_CLASS2(OFormattedControl, STARDIV_ONE_FORM_CONTROL_FORMATTEDFIELD, FRM_SUN_CONTROL_FORMATTEDFIELD);
2000-09-18 15:33:13 +00:00
// - Button
REGISTER_CLASS2(OButtonControl, STARDIV_ONE_FORM_CONTROL_COMMANDBUTTON, FRM_SUN_CONTROL_COMMANDBUTTON);
2000-09-18 15:33:13 +00:00
// - ImageButton
REGISTER_CLASS2(OImageButtonControl, STARDIV_ONE_FORM_CONTROL_IMAGEBUTTON, FRM_SUN_CONTROL_IMAGEBUTTON);
2000-09-18 15:33:13 +00:00
// - ImageControl
REGISTER_CLASS2(OImageControlControl, STARDIV_ONE_FORM_CONTROL_IMAGECONTROL, FRM_SUN_CONTROL_IMAGECONTROL);
2000-09-18 15:33:13 +00:00
// ========================================================================
// = various
REGISTER_CLASS1(OFormsCollection, FRM_SUN_FORMS_COLLECTION);
REGISTER_CLASS1(ImageProducer, SRV_AWT_IMAGEPRODUCER);
// ========================================================================
// = XForms core
#define REGISTER_XFORMS_CLASS(name) \
aServices.realloc(1); \
aServices.getArray()[0] = rtl::OUString::createFromAscii( "com.sun.star.xforms." #name ); \
REGISTER_CLASS_CORE(name)
REGISTER_XFORMS_CLASS(Model);
REGISTER_XFORMS_CLASS(XForms);
2000-09-18 15:33:13 +00:00
}
//---------------------------------------------------------------------------------------
void registerServiceProvider(const ::rtl::OUString& _rServiceImplName, const Sequence< ::rtl::OUString >& _rServices, XRegistryKey* _pKey)
2000-09-18 15:33:13 +00:00
{
::rtl::OUString sMainKeyName (RTL_CONSTASCII_USTRINGPARAM("/") );
2000-09-18 15:33:13 +00:00
sMainKeyName += _rServiceImplName;
sMainKeyName += ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") );
Reference< XRegistryKey > xNewKey = _pKey->createKey(sMainKeyName);
2001-03-23 06:39:46 +00:00
OSL_ENSURE(xNewKey.is(), "forms::registerProvider : could not create a registry key !");
2000-09-18 15:33:13 +00:00
if (!xNewKey.is())
return;
const ::rtl::OUString* pSupportedServices = _rServices.getConstArray();
for (sal_Int32 i=0; i<_rServices.getLength(); ++i, ++pSupportedServices)
xNewKey->createKey(*pSupportedServices);
}
//=======================================================================================
extern "C"
{
//---------------------------------------------------------------------------------------
void SAL_CALL createRegistryInfo_ODatabaseForm();
void SAL_CALL createRegistryInfo_OFilterControl();
void SAL_CALL createRegistryInfo_OScrollBarModel();
void SAL_CALL createRegistryInfo_OSpinButtonModel();
void SAL_CALL createRegistryInfo_ONavigationBarModel();
void SAL_CALL createRegistryInfo_ONavigationBarControl();
void SAL_CALL createRegistryInfo_ORichTextModel();
void SAL_CALL createRegistryInfo_ORichTextControl();
void SAL_CALL createRegistryInfo_CLibxml2XFormsExtension();
void SAL_CALL createRegistryInfo_FormOperations();
//---------------------------------------------------------------------------------------
void SAL_CALL createRegistryInfo_FORMS()
{
static sal_Bool bInit = sal_False;
if (!bInit)
{
createRegistryInfo_ODatabaseForm();
createRegistryInfo_OFilterControl();
createRegistryInfo_OScrollBarModel();
createRegistryInfo_OSpinButtonModel();
createRegistryInfo_ONavigationBarModel();
createRegistryInfo_ONavigationBarControl();
createRegistryInfo_ORichTextModel();
createRegistryInfo_ORichTextControl();
createRegistryInfo_CLibxml2XFormsExtension();
createRegistryInfo_FormOperations();
bInit = sal_True;
}
}
2000-09-18 15:33:13 +00:00
//---------------------------------------------------------------------------------------
CWS-TOOLING: integrate CWS sb102 2008-12-11 16:18:12 +0100 sb r265332 : #i95065# cleanup, to make Windows linking work 2008-12-11 16:16:03 +0100 sb r265331 : #i95065# missing SAL_DLLPUBLIC_EXPORT 2008-12-09 17:40:28 +0100 sb r265122 : #i94469# move CJK specific configuration data to brand layer 2008-12-09 16:09:08 +0100 sb r265112 : #i96959# use PTHREAD_MUTEX_RECURSIVE on all platforms 2008-12-09 15:54:31 +0100 sb r265110 : #i95065# do not derive apphelper::LifeTimeGuard from osl::ResettableMutexGuard to avoid problems with VISIBILITY_HIDDEN=TRUE on MSC 2008-12-09 15:40:51 +0100 sb r265104 : #i95065# add VISIBILITY_HIDDEN=TRUE to connectivity/source/drivers/mozab 2008-12-09 15:36:21 +0100 sb r265102 : #i95501# updated SDK_HOME 2008-12-09 15:31:46 +0100 sb r265099 : typo (temppath vs. tmppath) 2008-12-08 11:48:08 +0100 sb r264979 : #i95065# removed spurious ExplicitCategoriesProvider.obj (ExplicitCategoriesProvider.cxx is not in this directory) 2008-12-07 19:41:07 +0100 sb r264960 : #i96994# erroneously doubled backslash caused visibility feature to be disabled for all GCC versions on Mac OS X 2008-12-06 23:54:49 +0100 sb r264948 : changes from trunk that CWS-TOOLING's rebase to DEV300:m37 (r264891) had missed, as files had been moved around on this CWS 2008-12-05 20:29:23 +0100 sb r264919 : #i85508# versions of flex apparently differ in whether input() resp. yyinput() returns zero or EOF upon end of file 2008-12-05 15:37:23 +0100 sb r264908 : #i95315# removed obsolete jut 2008-12-05 15:34:59 +0100 sb r264907 : #i95531# removed empty obsolete directories 2008-12-05 10:09:23 +0100 sb r264891 : CWS-TOOLING: rebase CWS sb102 to trunk@264807 (milestone: DEV300:m37) 2008-12-04 14:50:20 +0100 sb r264845 : #i95065# introduced VISIBILITY_HIDDEN makefile flag to reduce duplications; made additional libraries use VISIBILITY_HIDDEN=TRUE to avoid warnings with recent GCC 4 versions (had to split certain code directories to make changes that would otherwise erroneously affect multiple libraries built in the same makefile); changed connectivity::ORefVector to no longer derive from std::vector, as that caused problems with the MSC implementation of VISIBILITY_HIDDEN=TRUE; replaced uses of JNIEXPORT with SAL_DLLPUBLIC_EXPORT, as the former does not expand to visibility attributes on some platforms where the latter does 2008-12-03 11:29:38 +0100 sb r264759 : #i94583# remove unnecessary (and wrong) assertion check for rtl_getAppCommandArg return value (which is guaranteed to return osl_Process_E_None or not return at all) 2008-12-02 17:18:31 +0100 sb r264724 : #i96809# silenced GCC 4.3.2 warning 2008-12-02 13:29:34 +0100 sb r264695 : #i96797# make get_tmp_dir fail less often 2008-11-28 17:19:24 +0100 sb r264566 : #i95691# inadvertently missing from -c 264564 2008-11-28 17:07:50 +0100 sb r264564 : #i95691# only structs of exactly 1, 2, 4, or 8 bytes are returned through registers 2008-11-25 13:28:08 +0100 sb r264291 : #i96427# support for SAL_EXCEPTION_DLLPUBLIC_EXPORT (patch by np) 2008-11-21 14:45:22 +0100 sb r264140 : #i95428# added SAL_EXCEPTION_DLLPUBLIC_EXPORT and SAL_EXCEPTION_DLLPRIVATE 2008-11-19 13:19:37 +0100 sb r263984 : #i95525# removed erroneous application/octet-stream svn:mime-type properties
2008-12-30 13:32:01 +00:00
SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(const sal_Char** _ppEnvTypeName, uno_Environment** /*_ppEnv*/)
2000-09-18 15:33:13 +00:00
{
*_ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
}
//---------------------------------------------------------------------------------------
CWS-TOOLING: integrate CWS sb102 2008-12-11 16:18:12 +0100 sb r265332 : #i95065# cleanup, to make Windows linking work 2008-12-11 16:16:03 +0100 sb r265331 : #i95065# missing SAL_DLLPUBLIC_EXPORT 2008-12-09 17:40:28 +0100 sb r265122 : #i94469# move CJK specific configuration data to brand layer 2008-12-09 16:09:08 +0100 sb r265112 : #i96959# use PTHREAD_MUTEX_RECURSIVE on all platforms 2008-12-09 15:54:31 +0100 sb r265110 : #i95065# do not derive apphelper::LifeTimeGuard from osl::ResettableMutexGuard to avoid problems with VISIBILITY_HIDDEN=TRUE on MSC 2008-12-09 15:40:51 +0100 sb r265104 : #i95065# add VISIBILITY_HIDDEN=TRUE to connectivity/source/drivers/mozab 2008-12-09 15:36:21 +0100 sb r265102 : #i95501# updated SDK_HOME 2008-12-09 15:31:46 +0100 sb r265099 : typo (temppath vs. tmppath) 2008-12-08 11:48:08 +0100 sb r264979 : #i95065# removed spurious ExplicitCategoriesProvider.obj (ExplicitCategoriesProvider.cxx is not in this directory) 2008-12-07 19:41:07 +0100 sb r264960 : #i96994# erroneously doubled backslash caused visibility feature to be disabled for all GCC versions on Mac OS X 2008-12-06 23:54:49 +0100 sb r264948 : changes from trunk that CWS-TOOLING's rebase to DEV300:m37 (r264891) had missed, as files had been moved around on this CWS 2008-12-05 20:29:23 +0100 sb r264919 : #i85508# versions of flex apparently differ in whether input() resp. yyinput() returns zero or EOF upon end of file 2008-12-05 15:37:23 +0100 sb r264908 : #i95315# removed obsolete jut 2008-12-05 15:34:59 +0100 sb r264907 : #i95531# removed empty obsolete directories 2008-12-05 10:09:23 +0100 sb r264891 : CWS-TOOLING: rebase CWS sb102 to trunk@264807 (milestone: DEV300:m37) 2008-12-04 14:50:20 +0100 sb r264845 : #i95065# introduced VISIBILITY_HIDDEN makefile flag to reduce duplications; made additional libraries use VISIBILITY_HIDDEN=TRUE to avoid warnings with recent GCC 4 versions (had to split certain code directories to make changes that would otherwise erroneously affect multiple libraries built in the same makefile); changed connectivity::ORefVector to no longer derive from std::vector, as that caused problems with the MSC implementation of VISIBILITY_HIDDEN=TRUE; replaced uses of JNIEXPORT with SAL_DLLPUBLIC_EXPORT, as the former does not expand to visibility attributes on some platforms where the latter does 2008-12-03 11:29:38 +0100 sb r264759 : #i94583# remove unnecessary (and wrong) assertion check for rtl_getAppCommandArg return value (which is guaranteed to return osl_Process_E_None or not return at all) 2008-12-02 17:18:31 +0100 sb r264724 : #i96809# silenced GCC 4.3.2 warning 2008-12-02 13:29:34 +0100 sb r264695 : #i96797# make get_tmp_dir fail less often 2008-11-28 17:19:24 +0100 sb r264566 : #i95691# inadvertently missing from -c 264564 2008-11-28 17:07:50 +0100 sb r264564 : #i95691# only structs of exactly 1, 2, 4, or 8 bytes are returned through registers 2008-11-25 13:28:08 +0100 sb r264291 : #i96427# support for SAL_EXCEPTION_DLLPUBLIC_EXPORT (patch by np) 2008-11-21 14:45:22 +0100 sb r264140 : #i95428# added SAL_EXCEPTION_DLLPUBLIC_EXPORT and SAL_EXCEPTION_DLLPRIVATE 2008-11-19 13:19:37 +0100 sb r263984 : #i95525# removed erroneous application/octet-stream svn:mime-type properties
2008-12-30 13:32:01 +00:00
SAL_DLLPUBLIC_EXPORT sal_Bool SAL_CALL component_writeInfo(void* _pServiceManager, XRegistryKey* _pRegistryKey)
2000-09-18 15:33:13 +00:00
{
if (_pRegistryKey)
{
try
{
// ========================================================================
// the real way - use the OModule
createRegistryInfo_FORMS();
if ( !::frm::OFormsModule::writeComponentInfos(
static_cast<XMultiServiceFactory*>( _pServiceManager ),
static_cast<XRegistryKey*>( _pRegistryKey ) )
)
return sal_False;
// ========================================================================
// a lot of stuff which is implemented "manually" here in this file
2000-09-18 15:33:13 +00:00
// collect the class infos
ensureClassInfos();
// both our static sequences should have the same length ...
sal_Int32 nClasses = s_aClassImplementationNames.getLength();
2001-03-23 06:39:46 +00:00
OSL_ENSURE(s_aClassServiceNames.getLength() == nClasses,
2000-09-18 15:33:13 +00:00
"forms::component_writeInfo : invalid class infos !");
// loop through the sequences and register the service providers
const ::rtl::OUString* pClasses = s_aClassImplementationNames.getConstArray();
const Sequence< ::rtl::OUString >* pServices = s_aClassServiceNames.getConstArray();
2000-09-18 15:33:13 +00:00
for (sal_Int32 i=0; i<nClasses; ++i, ++pClasses, ++pServices)
registerServiceProvider(*pClasses, *pServices, _pRegistryKey);
s_aClassImplementationNames.realloc(0);
s_aClassServiceNames.realloc(0);
s_aFactories.realloc(0);
2000-09-18 15:33:13 +00:00
return sal_True;
}
catch ( InvalidRegistryException& )
2000-09-18 15:33:13 +00:00
{
2001-03-23 06:39:46 +00:00
OSL_ENSURE(sal_False, "forms::component_writeInfo : InvalidRegistryException !");
2000-09-18 15:33:13 +00:00
}
}
s_aClassImplementationNames.realloc(0);
s_aClassServiceNames.realloc(0);
s_aFactories.realloc(0);
return sal_False;
}
//---------------------------------------------------------------------------------------
CWS-TOOLING: integrate CWS sb102 2008-12-11 16:18:12 +0100 sb r265332 : #i95065# cleanup, to make Windows linking work 2008-12-11 16:16:03 +0100 sb r265331 : #i95065# missing SAL_DLLPUBLIC_EXPORT 2008-12-09 17:40:28 +0100 sb r265122 : #i94469# move CJK specific configuration data to brand layer 2008-12-09 16:09:08 +0100 sb r265112 : #i96959# use PTHREAD_MUTEX_RECURSIVE on all platforms 2008-12-09 15:54:31 +0100 sb r265110 : #i95065# do not derive apphelper::LifeTimeGuard from osl::ResettableMutexGuard to avoid problems with VISIBILITY_HIDDEN=TRUE on MSC 2008-12-09 15:40:51 +0100 sb r265104 : #i95065# add VISIBILITY_HIDDEN=TRUE to connectivity/source/drivers/mozab 2008-12-09 15:36:21 +0100 sb r265102 : #i95501# updated SDK_HOME 2008-12-09 15:31:46 +0100 sb r265099 : typo (temppath vs. tmppath) 2008-12-08 11:48:08 +0100 sb r264979 : #i95065# removed spurious ExplicitCategoriesProvider.obj (ExplicitCategoriesProvider.cxx is not in this directory) 2008-12-07 19:41:07 +0100 sb r264960 : #i96994# erroneously doubled backslash caused visibility feature to be disabled for all GCC versions on Mac OS X 2008-12-06 23:54:49 +0100 sb r264948 : changes from trunk that CWS-TOOLING's rebase to DEV300:m37 (r264891) had missed, as files had been moved around on this CWS 2008-12-05 20:29:23 +0100 sb r264919 : #i85508# versions of flex apparently differ in whether input() resp. yyinput() returns zero or EOF upon end of file 2008-12-05 15:37:23 +0100 sb r264908 : #i95315# removed obsolete jut 2008-12-05 15:34:59 +0100 sb r264907 : #i95531# removed empty obsolete directories 2008-12-05 10:09:23 +0100 sb r264891 : CWS-TOOLING: rebase CWS sb102 to trunk@264807 (milestone: DEV300:m37) 2008-12-04 14:50:20 +0100 sb r264845 : #i95065# introduced VISIBILITY_HIDDEN makefile flag to reduce duplications; made additional libraries use VISIBILITY_HIDDEN=TRUE to avoid warnings with recent GCC 4 versions (had to split certain code directories to make changes that would otherwise erroneously affect multiple libraries built in the same makefile); changed connectivity::ORefVector to no longer derive from std::vector, as that caused problems with the MSC implementation of VISIBILITY_HIDDEN=TRUE; replaced uses of JNIEXPORT with SAL_DLLPUBLIC_EXPORT, as the former does not expand to visibility attributes on some platforms where the latter does 2008-12-03 11:29:38 +0100 sb r264759 : #i94583# remove unnecessary (and wrong) assertion check for rtl_getAppCommandArg return value (which is guaranteed to return osl_Process_E_None or not return at all) 2008-12-02 17:18:31 +0100 sb r264724 : #i96809# silenced GCC 4.3.2 warning 2008-12-02 13:29:34 +0100 sb r264695 : #i96797# make get_tmp_dir fail less often 2008-11-28 17:19:24 +0100 sb r264566 : #i95691# inadvertently missing from -c 264564 2008-11-28 17:07:50 +0100 sb r264564 : #i95691# only structs of exactly 1, 2, 4, or 8 bytes are returned through registers 2008-11-25 13:28:08 +0100 sb r264291 : #i96427# support for SAL_EXCEPTION_DLLPUBLIC_EXPORT (patch by np) 2008-11-21 14:45:22 +0100 sb r264140 : #i95428# added SAL_EXCEPTION_DLLPUBLIC_EXPORT and SAL_EXCEPTION_DLLPRIVATE 2008-11-19 13:19:37 +0100 sb r263984 : #i95525# removed erroneous application/octet-stream svn:mime-type properties
2008-12-30 13:32:01 +00:00
SAL_DLLPUBLIC_EXPORT void* SAL_CALL component_getFactory(const sal_Char* _pImplName, XMultiServiceFactory* _pServiceManager, void* /*_pRegistryKey*/)
2000-09-18 15:33:13 +00:00
{
if (!_pServiceManager || !_pImplName)
2000-09-18 15:33:13 +00:00
return NULL;
// ========================================================================
// a lot of stuff which is implemented "manually" here in this file
2000-09-18 15:33:13 +00:00
void* pRet = NULL;
// collect the class infos
ensureClassInfos();
// both our static sequences should have the same length ...
sal_Int32 nClasses = s_aClassImplementationNames.getLength();
2001-03-23 06:39:46 +00:00
OSL_ENSURE((s_aClassServiceNames.getLength() == nClasses) &&
2000-09-18 15:33:13 +00:00
(s_aFactories.getLength() == nClasses),
"forms::component_writeInfo : invalid class infos !");
// loop through the sequences and register the service providers
const ::rtl::OUString* pClasses = s_aClassImplementationNames.getConstArray();
const Sequence< ::rtl::OUString >* pServices = s_aClassServiceNames.getConstArray();
2000-09-18 15:33:13 +00:00
const sal_Int64* pFunctionsAsInts = s_aFactories.getConstArray();
for (sal_Int32 i=0; i<nClasses; ++i, ++pClasses, ++pServices, ++pFunctionsAsInts)
{
if (rtl_ustr_ascii_compare(*pClasses, _pImplName) == 0)
{
::cppu::ComponentInstantiation aCurrentCreateFunction =
reinterpret_cast< ::cppu::ComponentInstantiation>(*pFunctionsAsInts);
Reference<XSingleServiceFactory> xFactory(
2000-09-18 15:33:13 +00:00
::cppu::createSingleFactory(
_pServiceManager,
*pClasses,
aCurrentCreateFunction,
*pServices
)
);
if (xFactory.is())
{
xFactory->acquire();
pRet = xFactory.get();
break;
}
}
}
// ========================================================================
// the real way - use the OModule
if ( !pRet )
{
createRegistryInfo_FORMS();
{
// let the module look for the component
Reference< XInterface > xRet;
xRet = ::frm::OFormsModule::getComponentFactory(
::rtl::OUString::createFromAscii( _pImplName ),
static_cast< XMultiServiceFactory* >( _pServiceManager ) );
if ( xRet.is() )
xRet->acquire();
pRet = xRet.get();
}
}
2000-09-18 15:33:13 +00:00
return pRet;
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */