summaryrefslogtreecommitdiff
path: root/forms/source/misc
diff options
context:
space:
mode:
Diffstat (limited to 'forms/source/misc')
-rw-r--r--forms/source/misc/InterfaceContainer.cxx896
-rw-r--r--forms/source/misc/ids.cxx67
-rw-r--r--forms/source/misc/makefile.mk90
-rw-r--r--forms/source/misc/property.cxx468
-rw-r--r--forms/source/misc/services.cxx580
5 files changed, 2101 insertions, 0 deletions
diff --git a/forms/source/misc/InterfaceContainer.cxx b/forms/source/misc/InterfaceContainer.cxx
new file mode 100644
index 000000000000..9fcbb65c9efe
--- /dev/null
+++ b/forms/source/misc/InterfaceContainer.cxx
@@ -0,0 +1,896 @@
+/*************************************************************************
+ *
+ * $RCSfile: InterfaceContainer.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:29:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _FRM_INTERFACE_CONTAINER_HXX_
+#include "InterfaceContainer.hxx"
+#endif
+
+#ifndef _CPPUHELPER_QUERYINTERFACE_HXX_
+#include <cppuhelper/queryinterface.hxx>
+#endif
+#ifndef _UNOTOOLS_EVENTATTACHERMGR_HXX_
+#include <unotools/eventattachermgr.hxx>
+#endif
+#ifndef _UTL_TYPES_HXX_
+#include <unotools/types.hxx>
+#endif
+#ifndef _UNOTOOLS_ENUMHELPER_HXX_
+#include <unotools/enumhelper.hxx>
+#endif
+#ifndef _UTL_PROPERTY_HXX_
+#include <unotools/property.hxx>
+#endif
+#ifndef _UTL_CONTAINER_HXX_
+#include <unotools/container.hxx>
+#endif
+#ifndef _UTL_SEQUENCE_HXX_
+#include <unotools/sequence.hxx>
+#endif
+
+#ifndef _FRM_PROPERTY_HRC_
+#include "property.hrc"
+#endif
+#ifndef _FRM_SERVICES_HXX_
+#include "services.hxx"
+#endif
+#ifndef _FRM_RESOURCE_HRC_
+#include "frm_resource.hrc"
+#endif
+#ifndef _FRM_RESOURCE_HXX_
+#include "frm_resource.hxx"
+#endif
+
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HPP_
+#include <com/sun/star/lang/XComponent.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XMARKABLESTREAM_HPP_
+#include <com/sun/star/io/XMarkableStream.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_WRONGFORMATEXCEPTION_HPP_
+#include <com/sun/star/io/WrongFormatException.hpp>
+#endif
+
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+//.........................................................................
+namespace frm
+{
+//.........................................................................
+
+//------------------------------------------------------------------
+OInterfaceContainer::OInterfaceContainer(
+ const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory,
+ ::osl::Mutex& _rMutex,
+ const staruno::Type& _rElementType)
+ :m_rMutex(_rMutex)
+ ,m_aContainerListeners(_rMutex)
+ ,m_aElementType(_rElementType)
+ ,m_xServiceFactory(_rxFactory)
+{
+ m_xEventAttacher = ::utl::createEventAttacherManager(m_xServiceFactory);
+}
+
+//------------------------------------------------------------------------------
+staruno::Any SAL_CALL OInterfaceContainer::queryInterface(const staruno::Type& _rType) throw (staruno::RuntimeException)
+{
+ staruno::Any aReturn =
+ ::cppu::queryInterface(_rType
+ ,static_cast<starcontainer::XElementAccess*>(static_cast<starcontainer::XNameAccess*>(this))
+ ,static_cast<starcontainer::XIndexAccess*>(this)
+ ,static_cast<starcontainer::XNameAccess*>(this)
+ ,static_cast<starcontainer::XIndexReplace*>(this)
+ ,static_cast<starcontainer::XNameReplace*>(this)
+ ,static_cast<starcontainer::XIndexContainer*>(this)
+ ,static_cast<starcontainer::XNameContainer*>(this)
+ ,static_cast<starcontainer::XEnumerationAccess*>(this)
+ ,static_cast<starcontainer::XContainer*>(this)
+ ,static_cast<starlang::XEventListener*>(this)
+ ,static_cast<starbeans::XPropertyChangeListener*>(this)
+ ,static_cast<starscript::XEventAttacherManager*>(this)
+ );
+
+ if (!aReturn.hasValue())
+ aReturn = ::cppu::queryInterface(_rType
+ ,static_cast<stario::XPersistObject*>(this)
+ );
+
+ return aReturn;
+}
+
+//------------------------------------------------------------------------------
+staruno::Sequence<staruno::Type> SAL_CALL OInterfaceContainer::getTypes() throw(staruno::RuntimeException)
+{
+ staruno::Sequence<staruno::Type> aTypes(7);
+ aTypes.getArray()[0] = ::getCppuType(static_cast<staruno::Reference<starcontainer::XNameContainer>*>(NULL));
+ aTypes.getArray()[1] = ::getCppuType(static_cast<staruno::Reference<starcontainer::XIndexContainer>*>(NULL));
+ aTypes.getArray()[2] = ::getCppuType(static_cast<staruno::Reference<starcontainer::XContainer>*>(NULL));
+ aTypes.getArray()[3] = ::getCppuType(static_cast<staruno::Reference<starcontainer::XEnumerationAccess>*>(NULL));
+ aTypes.getArray()[4] = ::getCppuType(static_cast<staruno::Reference<starscript::XEventAttacherManager>*>(NULL));
+ aTypes.getArray()[5] = ::getCppuType(static_cast<staruno::Reference<starbeans::XPropertyChangeListener>*>(NULL));
+ aTypes.getArray()[6] = ::getCppuType(static_cast<staruno::Reference<stario::XPersistObject>*>(NULL));
+
+ return aTypes;
+}
+
+//------------------------------------------------------------------------------
+void OInterfaceContainer::disposing()
+{
+ // dispose aller elemente
+ for (sal_Int32 i = m_aItems.size(); i > 0; --i)
+ {
+ staruno::Reference<starbeans::XPropertySet> xSet(m_aItems[i - 1], staruno::UNO_QUERY);
+ if (xSet.is())
+ xSet->removePropertyChangeListener(PROPERTY_NAME, this);
+
+ // Eventverknpfungen aufheben
+ InterfaceRef xIfc(xSet, staruno::UNO_QUERY);
+ m_xEventAttacher->detach(i - 1, xIfc);
+ m_xEventAttacher->removeEntry(i - 1);
+
+ staruno::Reference<starlang::XComponent> xComponent(xSet, staruno::UNO_QUERY);
+ if (xComponent.is())
+ xComponent->dispose();
+ }
+ m_aMap.clear();
+ m_aItems.clear();
+
+ starlang::EventObject aEvt(static_cast<starcontainer::XContainer*>(this));
+ m_aContainerListeners.disposeAndClear(aEvt);
+}
+
+// stario::XPersistObject
+//------------------------------------------------------------------------------
+void SAL_CALL OInterfaceContainer::writeEvents(const staruno::Reference<stario::XObjectOutputStream>& _rxOutStream)
+{
+ staruno::Reference<stario::XMarkableStream> xMark(_rxOutStream, staruno::UNO_QUERY);
+ sal_Int32 nMark = xMark->createMark();
+
+ sal_Int32 nObjLen = 0;
+ _rxOutStream->writeLong(nObjLen);
+
+ staruno::Reference<stario::XPersistObject> xScripts(m_xEventAttacher, staruno::UNO_QUERY);
+ if (xScripts.is())
+ xScripts->write(_rxOutStream);
+
+ // feststellen der Laenge
+ nObjLen = xMark->offsetToMark(nMark) - 4;
+ xMark->jumpToMark(nMark);
+ _rxOutStream->writeLong(nObjLen);
+ xMark->jumpToFurthest();
+ xMark->deleteMark(nMark);
+}
+
+//------------------------------------------------------------------------------
+void SAL_CALL OInterfaceContainer::readEvents(const staruno::Reference<stario::XObjectInputStream>& _rxInStream, sal_Int32 nCount)
+{
+ ::osl::MutexGuard aGuard( m_rMutex );
+ if (nCount)
+ {
+ // Scripting Info lesen
+ staruno::Reference<stario::XMarkableStream> xMark(_rxInStream, staruno::UNO_QUERY);
+ sal_Int32 nObjLen = _rxInStream->readLong();
+ if (nObjLen)
+ {
+ sal_Int32 nMark = xMark->createMark();
+ staruno::Reference<stario::XPersistObject> xObj(m_xEventAttacher, staruno::UNO_QUERY);
+ if (xObj.is())
+ xObj->read(_rxInStream);
+ xMark->jumpToMark(nMark);
+ _rxInStream->skipBytes(nObjLen);
+ xMark->deleteMark(nMark);
+ }
+
+ // Attachement lesen
+ for (sal_Int32 i = 0; i < nCount; i++)
+ {
+ InterfaceRef xIfc(m_aItems[i], staruno::UNO_QUERY);
+ staruno::Reference<starbeans::XPropertySet> xSet(xIfc, staruno::UNO_QUERY);
+ staruno::Any aHelper;
+ aHelper <<= xSet;
+ m_xEventAttacher->attach( i, xIfc, aHelper );
+ }
+ }
+ else
+ {
+ // neuen EventManager
+ m_xEventAttacher = ::utl::createEventAttacherManager(m_xServiceFactory);
+ }
+}
+
+//------------------------------------------------------------------------------
+void SAL_CALL OInterfaceContainer::write( const staruno::Reference< stario::XObjectOutputStream >& _rxOutStream ) throw(stario::IOException, staruno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_rMutex );
+ sal_Int32 nLen = m_aItems.size();
+
+ // schreiben der laenge
+ _rxOutStream->writeLong(nLen);
+
+ if (nLen)
+ {
+ // 1. Version
+ _rxOutStream->writeShort(0x0001);
+
+ // 2. Objekte
+ for (sal_Int32 i = 0; i < nLen; i++)
+ {
+ staruno::Reference<stario::XPersistObject> xObj(m_aItems[i], staruno::UNO_QUERY);
+ if (xObj.is())
+ _rxOutStream->writeObject(xObj);
+ else
+ {
+ // ::com::sun::star::chaos::Error
+ }
+ }
+
+ // 3. Scripts
+ writeEvents(_rxOutStream);
+ }
+}
+
+//------------------------------------------------------------------------------
+void SAL_CALL OInterfaceContainer::read( const staruno::Reference< stario::XObjectInputStream >& _rxInStream ) throw(stario::IOException, staruno::RuntimeException)
+{
+ ::osl::MutexGuard aGuard( m_rMutex );
+
+ // after ::read the object is expected to be in the state it was when ::write was called, so we have
+ // to empty ourself here
+ // FS - 71598 - 12.01.00
+ while (getCount())
+ removeByIndex(0);
+
+ // Schreibt nur in Abhaengigkeit der Lnge
+ sal_Int32 nLen = _rxInStream->readLong();
+
+ if (nLen)
+ {
+ // 1. Version
+ sal_uInt16 nVersion = _rxInStream->readShort();
+
+ // 2. Objekte
+ for (sal_Int32 i = 0; i < nLen; i++)
+ {
+ staruno::Reference<stario::XPersistObject> xObj;
+ try
+ {
+ xObj = _rxInStream->readObject();
+ }
+ catch(stario::WrongFormatException& e)
+ {
+ e; // make compiler happy
+ // the object could not be read
+ xObj = NULL;
+ // create a dummy starform (so the readEvents below will assign the events to the right controls)
+ xObj = staruno::Reference<stario::XPersistObject> (m_xServiceFactory->createInstance(FRM_COMPONENT_HIDDENCONTROL), staruno::UNO_QUERY);
+ DBG_ASSERT(xObj.is(), "OInterfaceContainer::read : could not create a substitute for the unknown object !");
+ if (!xObj.is())
+ // couldn't handle it ...
+ throw;
+
+ // set some properties describing what we did
+ staruno::Reference<starbeans::XPropertySet> xObjProps(xObj, staruno::UNO_QUERY);
+ if (xObjProps.is())
+ {
+ try
+ {
+ xObjProps->setPropertyValue(PROPERTY_NAME, staruno::makeAny(FRM_RES_STRING(RID_STR_CONTROL_SUBSTITUTED_NAME)));
+ xObjProps->setPropertyValue(PROPERTY_TAG, staruno::makeAny(FRM_RES_STRING(RID_STR_CONTROL_SUBSTITUTED_EPXPLAIN)));
+ }
+ catch(...)
+ {
+ }
+ }
+ // 72133 - 09.02.00 - FS
+ }
+ catch(...)
+ {
+ // unsere Map leeren
+ while (!m_aItems.empty())
+ removeElementsNoEvents(0);
+
+ // und die staruno::Exception nach aussen
+ throw;
+ }
+
+ if (xObj.is())
+ {
+ staruno::Any aElement = xObj->queryInterface(m_aElementType);
+ if (aElement.hasValue())
+ insert(m_aItems.size(), *static_cast<const InterfaceRef*>(aElement.getValue()), sal_False);
+ else
+ ; // form konnte nicht gelesen werden; nyi
+ }
+ }
+ }
+
+ readEvents(_rxInStream, nLen);
+}
+
+// starcontainer::XContainer
+//------------------------------------------------------------------------------
+void SAL_CALL OInterfaceContainer::addContainerListener(const staruno::Reference<starcontainer::XContainerListener>& _rxListener) throw( staruno::RuntimeException )
+{
+ m_aContainerListeners.addInterface(_rxListener);
+}
+
+//------------------------------------------------------------------------------
+void SAL_CALL OInterfaceContainer::removeContainerListener(const staruno::Reference<starcontainer::XContainerListener>& _rxListener) throw( staruno::RuntimeException )
+{
+ m_aContainerListeners.removeInterface(_rxListener);
+}
+
+// starlang::XEventListener
+//------------------------------------------------------------------------------
+void SAL_CALL OInterfaceContainer::disposing(const starlang::EventObject& _rSource) throw( staruno::RuntimeException )
+{
+ ::osl::MutexGuard aGuard( m_rMutex );
+
+ OInterfaceArray::iterator j = find(m_aItems.begin(), m_aItems.end(), _rSource.Source);
+ if (j != m_aItems.end())
+ {
+ OInterfaceMap::iterator i = m_aMap.begin();
+ while (i != m_aMap.end() && (*i).second != _rSource.Source)
+ ++i;
+
+ m_aMap.erase(i);
+ m_aItems.erase(j);
+ }
+}
+
+// starbeans::XPropertyChangeListener
+//------------------------------------------------------------------------------
+void OInterfaceContainer::propertyChange(const starbeans::PropertyChangeEvent& evt)
+{
+ if (evt.PropertyName == PROPERTY_NAME)
+ {
+ ::osl::MutexGuard aGuard( m_rMutex );
+ OInterfaceMap::iterator i = find(m_aMap.begin(), m_aMap.end(),
+ pair<const ::rtl::OUString, InterfaceRef >(::utl::getString(evt.OldValue),evt.Source));
+ if (i != m_aMap.end())
+ {
+ InterfaceRef xCorrectType((*i).second);
+ m_aMap.erase(i);
+ m_aMap.insert(pair<const ::rtl::OUString, InterfaceRef >(::utl::getString(evt.NewValue),xCorrectType));
+ }
+ }
+}
+
+// starcontainer::XElementAccess
+//------------------------------------------------------------------------------
+sal_Bool SAL_CALL OInterfaceContainer::hasElements() throw( staruno::RuntimeException )
+{
+ return !m_aMap.empty();
+}
+
+//------------------------------------------------------------------------------
+staruno::Type SAL_CALL OInterfaceContainer::getElementType() throw(staruno::RuntimeException)
+{
+ return m_aElementType;
+}
+
+// starcontainer::XEnumerationAccess
+//------------------------------------------------------------------------------
+staruno::Reference<starcontainer::XEnumeration> SAL_CALL OInterfaceContainer::createEnumeration() throw( staruno::RuntimeException )
+{
+ ::osl::MutexGuard aGuard( m_rMutex );
+ return new ::utl::OEnumerationByIndex(static_cast<starcontainer::XIndexAccess*>(this));
+}
+
+// starcontainer::XNameAccess
+//------------------------------------------------------------------------------
+staruno::Any SAL_CALL OInterfaceContainer::getByName( const ::rtl::OUString& _rName ) throw(starcontainer::NoSuchElementException, starlang::WrappedTargetException, staruno::RuntimeException)
+{
+ pair <OInterfaceMap::iterator,
+ OInterfaceMap::iterator> aPair = m_aMap.equal_range(_rName);
+
+ if (aPair.first == aPair.second)
+ throw starcontainer::NoSuchElementException();
+
+ return staruno::Any(&(*aPair.first).second, m_aElementType);
+}
+
+//------------------------------------------------------------------------------
+StringSequence SAL_CALL OInterfaceContainer::getElementNames() throw(staruno::RuntimeException)
+{
+ StringSequence aNameList(m_aItems.size());
+ ::rtl::OUString* pStringArray = aNameList.getArray();
+
+ for (OInterfaceMap::const_iterator i = m_aMap.begin(); i != m_aMap.end(); ++i, ++pStringArray)
+ {
+ *pStringArray = (*i).first;
+ }
+ return aNameList;
+}
+
+//------------------------------------------------------------------------------
+sal_Bool SAL_CALL OInterfaceContainer::hasByName( const ::rtl::OUString& _rName ) throw(staruno::RuntimeException)
+{
+ pair <OInterfaceMap::iterator,
+ OInterfaceMap::iterator> aPair = m_aMap.equal_range(_rName);
+ return aPair.first != aPair.second;
+}
+
+// starcontainer::XIndexAccess
+//------------------------------------------------------------------------------
+sal_Int32 OInterfaceContainer::getCount() throw( staruno::RuntimeException )
+{
+ return m_aItems.size();
+}
+
+//------------------------------------------------------------------------------
+staruno::Any OInterfaceContainer::getByIndex(sal_Int32 _nIndex) throw( starlang::IndexOutOfBoundsException, starlang::WrappedTargetException, staruno::RuntimeException )
+{
+ if (_nIndex < 0 || _nIndex >= m_aItems.size())
+ throw starlang::IndexOutOfBoundsException();
+
+ return staruno::Any(&m_aItems[_nIndex], m_aElementType);
+}
+
+//------------------------------------------------------------------------------
+void OInterfaceContainer::insert(sal_Int32 _nIndex, const InterfaceRef& xElement, sal_Bool bEvents) throw( starlang::IllegalArgumentException )
+{
+ // das richtige Interface besorgen
+ staruno::Any aCorrectType = xElement->queryInterface(m_aElementType);
+ if (!aCorrectType.hasValue())
+ throw starlang::IllegalArgumentException();
+ InterfaceRef xCorrectType = *static_cast<const InterfaceRef*>(aCorrectType.getValue());
+
+ ::rtl::OUString sName;
+ staruno::Reference<starbeans::XPropertySet> xSet(xElement, staruno::UNO_QUERY);
+ if (xSet.is())
+ {
+ if (!hasProperty(PROPERTY_NAME, xSet))
+ throw starlang::IllegalArgumentException();
+
+ staruno::Any aValue = xSet->getPropertyValue(PROPERTY_NAME);
+ aValue >>= sName;
+ xSet->addPropertyChangeListener(PROPERTY_NAME, this);
+ }
+ else
+ throw starlang::IllegalArgumentException();
+
+ if (_nIndex > m_aItems.size()) // ermitteln des tatsaechlichen Indexs
+ {
+ _nIndex = m_aItems.size();
+ m_aItems.push_back(xCorrectType);
+ }
+ else
+ m_aItems.insert(m_aItems.begin() + _nIndex, xCorrectType);
+
+ m_aMap.insert(pair<const ::rtl::OUString, InterfaceRef >(sName,xCorrectType));
+
+ staruno::Reference<starcontainer::XChild> xChild(xElement, staruno::UNO_QUERY);
+ if (xChild.is())
+ xChild->setParent(static_cast<starcontainer::XContainer*>(this));
+
+ if (bEvents)
+ {
+ m_xEventAttacher->insertEntry(_nIndex);
+ InterfaceRef xIfc(xElement, staruno::UNO_QUERY);// wichtig
+ staruno::Any aHelper;
+ aHelper <<= xSet;
+ m_xEventAttacher->attach(_nIndex, xIfc, aHelper);
+ }
+
+ // notify derived classes
+ implInserted(xCorrectType);
+
+ // notify listeners
+ starcontainer::ContainerEvent aEvt;
+ aEvt.Source = static_cast<starcontainer::XContainer*>(this);
+ aEvt.Accessor <<= _nIndex;
+ aEvt.Element = staruno::Any(&xCorrectType, m_aElementType);
+ NOTIFY_LISTENERS(m_aContainerListeners, starcontainer::XContainerListener, elementInserted, aEvt);
+}
+
+//------------------------------------------------------------------------------
+void OInterfaceContainer::removeElementsNoEvents(sal_Int32 nIndex)
+{
+ OInterfaceArray::iterator i = m_aItems.begin() + nIndex;
+ InterfaceRef xElement(*i);
+
+ OInterfaceMap::iterator j = m_aMap.begin();
+ while (j != m_aMap.end() && (*j).second != xElement) ++j;
+
+ m_aItems.erase(i);
+ m_aMap.erase(j);
+
+ staruno::Reference<starbeans::XPropertySet> xSet(xElement, staruno::UNO_QUERY);
+ if (xSet.is())
+ xSet->removePropertyChangeListener(PROPERTY_NAME, this);
+
+ staruno::Reference<starcontainer::XChild> xChild(xElement, staruno::UNO_QUERY);
+ if (xChild.is())
+ xChild->setParent(InterfaceRef ());
+}
+
+// starcontainer::XIndexContainer
+//------------------------------------------------------------------------------
+void SAL_CALL OInterfaceContainer::insertByIndex(sal_Int32 _nIndex, const staruno::Any& Element) throw(starlang::IllegalArgumentException, starlang::IndexOutOfBoundsException, starlang::WrappedTargetException, staruno::RuntimeException)
+{
+ if (Element.getValueType().getTypeClass() != staruno::TypeClass_INTERFACE)
+ throw starlang::IllegalArgumentException();
+
+ ::osl::MutexGuard aGuard( m_rMutex );
+ insert(_nIndex, InterfaceRef (*(InterfaceRef *)Element.getValue()), sal_True);
+}
+
+//------------------------------------------------------------------------------
+void SAL_CALL OInterfaceContainer::replaceByIndex(sal_Int32 _nIndex, const staruno::Any& Element) throw( starlang::IllegalArgumentException, starlang::IndexOutOfBoundsException, starlang::WrappedTargetException, staruno::RuntimeException )
+{
+ if (Element.getValueType().getTypeClass() != staruno::TypeClass_INTERFACE)
+ throw starlang::IllegalArgumentException();
+
+ ::osl::MutexGuard aGuard( m_rMutex );
+ if (_nIndex < 0 || _nIndex >= m_aItems.size())
+ throw starlang::IndexOutOfBoundsException();
+
+
+ InterfaceRef xOldElement(m_aItems[_nIndex]);
+ InterfaceRef xNewElement(*(InterfaceRef *)Element.getValue());
+
+ OInterfaceMap::iterator j = m_aMap.begin();
+ while (j != m_aMap.end() && (*j).second != xOldElement) ++j;
+
+ // Eventverknpfungen aufheben
+ InterfaceRef xIfc(xOldElement, staruno::UNO_QUERY);// wichtig
+ m_xEventAttacher->detach(_nIndex, xIfc);
+ m_xEventAttacher->removeEntry(_nIndex);
+
+ staruno::Reference<starbeans::XPropertySet> xSet(xOldElement, staruno::UNO_QUERY);
+ if (xSet.is())
+ xSet->removePropertyChangeListener(PROPERTY_NAME, this);
+
+ staruno::Reference<starcontainer::XChild> xChild(xOldElement, staruno::UNO_QUERY);
+ if (xChild.is())
+ xChild->setParent(InterfaceRef ());
+
+ // neue einfuegen
+ ::rtl::OUString sName;
+ xSet = staruno::Reference<starbeans::XPropertySet> (xNewElement, staruno::UNO_QUERY);
+ if (xSet.is())
+ {
+ if (!hasProperty(PROPERTY_NAME, xSet))
+ throw starlang::IllegalArgumentException();
+
+ staruno::Any aValue = xSet->getPropertyValue(PROPERTY_NAME);
+ aValue >>= sName;
+ xSet->addPropertyChangeListener(PROPERTY_NAME, this);
+ }
+ else
+ throw starlang::IllegalArgumentException();
+
+ // remove the old one
+ m_aMap.erase(j);
+
+ // insert the new one
+ m_aMap.insert(pair<const ::rtl::OUString, InterfaceRef >(sName,xNewElement));
+ m_aItems[_nIndex] = xNewElement;
+
+ xChild = staruno::Reference<starcontainer::XChild> (xNewElement, staruno::UNO_QUERY);
+ if (xChild.is())
+ xChild->setParent(static_cast<starcontainer::XContainer*>(this));
+
+ m_xEventAttacher->insertEntry(_nIndex);
+ xIfc = InterfaceRef (xNewElement, staruno::UNO_QUERY);// wichtig
+ staruno::Any aHelper;
+ aHelper <<= xSet;
+ m_xEventAttacher->attach(_nIndex, xIfc, aHelper);
+
+ // benachrichtigen
+ starcontainer::ContainerEvent aEvt;
+ aEvt.Source = static_cast<starcontainer::XContainer*>(this);
+ aEvt.Accessor <<= _nIndex;
+ aEvt.Element = staruno::Any(&xNewElement, m_aElementType);
+ aEvt.ReplacedElement = staruno::Any(&xOldElement, m_aElementType);
+ NOTIFY_LISTENERS(m_aContainerListeners, starcontainer::XContainerListener, elementReplaced, aEvt);
+}
+
+//------------------------------------------------------------------------------
+void SAL_CALL OInterfaceContainer::removeByIndex(sal_Int32 _nIndex) throw( starlang::IndexOutOfBoundsException, starlang::WrappedTargetException, staruno::RuntimeException )
+{
+ ::osl::MutexGuard aGuard( m_rMutex );
+ if (_nIndex < 0 || _nIndex >= m_aItems.size())
+ throw starlang::IndexOutOfBoundsException();
+
+ OInterfaceArray::iterator i = m_aItems.begin() + _nIndex;
+ InterfaceRef xElement(*i);
+
+ OInterfaceMap::iterator j = m_aMap.begin();
+ while (j != m_aMap.end() && (*j).second != xElement) ++j;
+
+ m_aItems.erase(i);
+ m_aMap.erase(j);
+
+ // Eventverknpfungen aufheben
+ InterfaceRef xIfc(xElement, staruno::UNO_QUERY);// wichtig
+ m_xEventAttacher->detach(_nIndex, xIfc);
+ m_xEventAttacher->removeEntry(_nIndex);
+
+ staruno::Reference<starbeans::XPropertySet> xSet(xElement, staruno::UNO_QUERY);
+ if (xSet.is())
+ xSet->removePropertyChangeListener(PROPERTY_NAME, this);
+
+ staruno::Reference<starcontainer::XChild> xChild(xElement, staruno::UNO_QUERY);
+ if (xChild.is())
+ xChild->setParent(InterfaceRef ());
+
+ // notify derived classes
+ implRemoved(xElement);
+
+ // notify listeners
+ starcontainer::ContainerEvent aEvt;
+ aEvt.Source = static_cast<starcontainer::XContainer*>(this);
+ aEvt.Element = staruno::Any(&xElement, m_aElementType);
+ aEvt.Accessor <<= _nIndex;
+ NOTIFY_LISTENERS(m_aContainerListeners, starcontainer::XContainerListener, elementRemoved, aEvt);
+}
+
+//------------------------------------------------------------------------
+void SAL_CALL OInterfaceContainer::insertByName(const ::rtl::OUString& Name, const staruno::Any& Element) throw( starlang::IllegalArgumentException, starcontainer::ElementExistException, starlang::WrappedTargetException, staruno::RuntimeException )
+{
+ ::osl::MutexGuard aGuard( m_rMutex );
+ if (Element.getValueType().getTypeClass() != staruno::TypeClass_INTERFACE)
+ throw starlang::IllegalArgumentException();
+
+ InterfaceRef xElement(*(InterfaceRef *)Element.getValue());
+ staruno::Reference<starbeans::XPropertySet> xSet(xElement, staruno::UNO_QUERY);
+ if (xSet.is())
+ {
+ if (!hasProperty(PROPERTY_NAME, xSet))
+ throw starlang::IllegalArgumentException();
+
+ xSet->setPropertyValue(PROPERTY_NAME, staruno::makeAny(Name));
+ }
+
+ insertByIndex(m_aItems.size(), Element);
+}
+
+//------------------------------------------------------------------------
+void SAL_CALL OInterfaceContainer::replaceByName(const ::rtl::OUString& Name, const staruno::Any& Element) throw( starlang::IllegalArgumentException, starcontainer::NoSuchElementException, starlang::WrappedTargetException, staruno::RuntimeException )
+{
+ ::osl::MutexGuard aGuard( m_rMutex );
+ pair <OInterfaceMap::iterator,
+ OInterfaceMap::iterator> aPair = m_aMap.equal_range(Name);
+ if (aPair.first == aPair.second)
+ throw starcontainer::NoSuchElementException();
+
+ if (Element.getValueType().getTypeClass() != staruno::TypeClass_INTERFACE)
+ throw starlang::IllegalArgumentException();
+
+ staruno::Reference<starbeans::XPropertySet> xSet(*(InterfaceRef *)Element.getValue(), staruno::UNO_QUERY);
+ if (xSet.is())
+ {
+ if (!hasProperty(PROPERTY_NAME, xSet))
+ throw starlang::IllegalArgumentException();
+
+ xSet->setPropertyValue(PROPERTY_NAME, staruno::makeAny(Name));
+ }
+
+ // determine the element pos
+ sal_Int32 nPos = find(m_aItems.begin(), m_aItems.end(), (*aPair.first).second) - m_aItems.begin();
+ replaceByIndex(nPos, Element);
+}
+
+//------------------------------------------------------------------------
+void SAL_CALL OInterfaceContainer::removeByName(const ::rtl::OUString& Name) throw( starcontainer::NoSuchElementException, starlang::WrappedTargetException, staruno::RuntimeException )
+{
+ ::osl::MutexGuard aGuard( m_rMutex );
+ pair <OInterfaceMap::iterator,
+ OInterfaceMap::iterator> aPair = m_aMap.equal_range(Name);
+ if (aPair.first == aPair.second)
+ throw starcontainer::NoSuchElementException();
+
+ sal_Int32 nPos = find(m_aItems.begin(), m_aItems.end(), (*aPair.first).second) - m_aItems.begin();
+ removeByIndex(nPos);
+}
+
+
+// starscript::XEventAttacherManager
+//------------------------------------------------------------------------
+void SAL_CALL OInterfaceContainer::registerScriptEvent( sal_Int32 nIndex, const starscript::ScriptEventDescriptor& aScriptEvent ) throw(starlang::IllegalArgumentException, staruno::RuntimeException)
+{
+ m_xEventAttacher->registerScriptEvent(nIndex, aScriptEvent);
+}
+
+//------------------------------------------------------------------------
+void SAL_CALL OInterfaceContainer::registerScriptEvents( sal_Int32 nIndex, const staruno::Sequence< starscript::ScriptEventDescriptor >& aScriptEvents ) throw(starlang::IllegalArgumentException, staruno::RuntimeException)
+{
+ m_xEventAttacher->registerScriptEvents(nIndex, aScriptEvents);
+}
+
+//------------------------------------------------------------------------
+void SAL_CALL OInterfaceContainer::revokeScriptEvent( sal_Int32 nIndex, const ::rtl::OUString& aListenerType, const ::rtl::OUString& aEventMethod, const ::rtl::OUString& aRemoveListenerParam ) throw(starlang::IllegalArgumentException, staruno::RuntimeException)
+{
+ m_xEventAttacher->revokeScriptEvent(nIndex,
+ aListenerType, aEventMethod, aRemoveListenerParam );
+}
+
+//------------------------------------------------------------------------
+void SAL_CALL OInterfaceContainer::revokeScriptEvents( sal_Int32 nIndex ) throw(starlang::IllegalArgumentException, staruno::RuntimeException)
+{
+ m_xEventAttacher->revokeScriptEvents(nIndex);
+}
+
+//------------------------------------------------------------------------
+void SAL_CALL OInterfaceContainer::insertEntry( sal_Int32 nIndex ) throw(starlang::IllegalArgumentException, staruno::RuntimeException)
+{
+ m_xEventAttacher->insertEntry(nIndex);
+}
+
+//------------------------------------------------------------------------
+void SAL_CALL OInterfaceContainer::removeEntry( sal_Int32 nIndex ) throw(starlang::IllegalArgumentException, staruno::RuntimeException)
+{
+ m_xEventAttacher->removeEntry(nIndex);
+}
+
+//------------------------------------------------------------------------
+staruno::Sequence< starscript::ScriptEventDescriptor > SAL_CALL OInterfaceContainer::getScriptEvents( sal_Int32 nIndex ) throw(starlang::IllegalArgumentException, staruno::RuntimeException)
+{
+ return m_xEventAttacher->getScriptEvents(nIndex);
+}
+
+//------------------------------------------------------------------------
+void SAL_CALL OInterfaceContainer::attach( sal_Int32 nIndex, const staruno::Reference< staruno::XInterface >& xObject, const staruno::Any& aHelper ) throw(starlang::IllegalArgumentException, starlang::ServiceNotRegisteredException, staruno::RuntimeException)
+{
+ m_xEventAttacher->attach(nIndex, xObject, aHelper);
+}
+
+//------------------------------------------------------------------------
+void SAL_CALL OInterfaceContainer::detach( sal_Int32 nIndex, const staruno::Reference< staruno::XInterface >& xObject ) throw(starlang::IllegalArgumentException, staruno::RuntimeException)
+{
+ m_xEventAttacher->detach(nIndex, xObject);
+}
+
+//------------------------------------------------------------------------
+void SAL_CALL OInterfaceContainer::addScriptListener( const staruno::Reference< starscript::XScriptListener >& xListener ) throw(starlang::IllegalArgumentException, staruno::RuntimeException)
+{
+ m_xEventAttacher->addScriptListener(xListener);
+}
+
+//------------------------------------------------------------------------
+void SAL_CALL OInterfaceContainer::removeScriptListener( const staruno::Reference< starscript::XScriptListener >& xListener ) throw(starlang::IllegalArgumentException, staruno::RuntimeException)
+{
+ m_xEventAttacher->removeScriptListener(xListener);
+}
+
+//==================================================================
+//= OFormComponents
+//==================================================================
+//------------------------------------------------------------------------------
+staruno::Any SAL_CALL OFormComponents::queryAggregation(const staruno::Type& _rType) throw(staruno::RuntimeException)
+{
+ staruno::Any aReturn = ::cppu::queryInterface(
+ _rType,
+ static_cast<starform::XFormComponent*>(this),
+ static_cast<starcontainer::XChild*>(static_cast<starform::XFormComponent*>(this))
+ );
+
+ if (!aReturn.hasValue())
+ aReturn = OInterfaceContainer::queryInterface(_rType);
+
+ if (!aReturn.hasValue())
+ aReturn = FormComponentsBase::queryAggregation(_rType);
+
+ return aReturn;
+}
+
+//------------------------------------------------------------------
+staruno::Sequence<staruno::Type> SAL_CALL OFormComponents::getTypes() throw(staruno::RuntimeException)
+{
+ staruno::Sequence<staruno::Type> aBaseTypes = OInterfaceContainer::getTypes();
+ staruno::Sequence<staruno::Type> aComponentTypes = FormComponentsBase::getTypes();
+
+ staruno::Sequence<staruno::Type> aOwnTypes(1);
+ aOwnTypes.getArray()[0] = ::getCppuType(static_cast<staruno::Reference<starform::XFormComponent>*>(NULL));
+
+ return ::utl::concatSequences(aBaseTypes, aComponentTypes, aOwnTypes);
+}
+
+//------------------------------------------------------------------------------
+OFormComponents::OFormComponents(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory)
+ :FormComponentsBase(m_aMutex)
+ ,OInterfaceContainer(_rxFactory, m_aMutex, ::getCppuType(static_cast<staruno::Reference<starform::XFormComponent>*>(NULL)))
+{
+}
+
+//------------------------------------------------------------------------------
+OFormComponents::~OFormComponents()
+{
+ if (!FormComponentsBase::rBHelper.bDisposed)
+ {
+ acquire();
+ dispose();
+ }
+}
+
+// OComponentHelper
+//------------------------------------------------------------------------------
+void OFormComponents::disposing()
+{
+ OInterfaceContainer::disposing();
+ FormComponentsBase::disposing();
+ m_xParent = NULL;
+}
+
+//XChild
+//------------------------------------------------------------------------------
+void OFormComponents::setParent(const InterfaceRef& Parent) throw( starlang::NoSupportException, staruno::RuntimeException )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+ m_xParent = Parent;
+}
+
+//------------------------------------------------------------------------------
+InterfaceRef OFormComponents::getParent() throw( staruno::RuntimeException )
+{
+ return m_xParent;
+}
+
+//.........................................................................
+} // namespace frm
+//.........................................................................
+
diff --git a/forms/source/misc/ids.cxx b/forms/source/misc/ids.cxx
new file mode 100644
index 000000000000..ebce5c94cd87
--- /dev/null
+++ b/forms/source/misc/ids.cxx
@@ -0,0 +1,67 @@
+/*************************************************************************
+ *
+ * $RCSfile: ids.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:29:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+
+#include "ids.hxx"
+
+IMPLEMENT_IMPLEMENTATIONID_HELPER(frm, OImplementationIds)
+
+
diff --git a/forms/source/misc/makefile.mk b/forms/source/misc/makefile.mk
new file mode 100644
index 000000000000..cc74bd0745b5
--- /dev/null
+++ b/forms/source/misc/makefile.mk
@@ -0,0 +1,90 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:29:06 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+PRJINC=..
+PRJNAME=forms
+TARGET=common
+
+ENABLE_EXCEPTIONS=TRUE
+#TARGETTYPE=GUI
+
+# --- Settings ----------------------------------
+
+.INCLUDE : settings.mk
+
+# --- Types -------------------------------------
+
+INCPRE+=$(SOLARINCDIR)$/offuh
+
+# --- Files -------------------------------------
+
+SLOFILES= $(SLO)$/property.obj \
+ $(SLO)$/services.obj \
+ $(SLO)$/InterfaceContainer.obj \
+ $(SLO)$/ids.obj \
+ $(SLO)$/InternationalHack.obj \
+
+# --- Targets ----------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/forms/source/misc/property.cxx b/forms/source/misc/property.cxx
new file mode 100644
index 000000000000..01f2fdccbedd
--- /dev/null
+++ b/forms/source/misc/property.cxx
@@ -0,0 +1,468 @@
+/*************************************************************************
+ *
+ * $RCSfile: property.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:29:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _FRM_PROPERTY_HXX_
+#include "property.hxx"
+#endif
+#ifndef _FRM_PROPERTY_HRC_
+#include "property.hrc"
+#endif
+
+#ifndef _CPPUHELPER_QUERYINTERFACE_HXX_
+#include <cppuhelper/queryinterface.hxx>
+#endif
+
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+
+//... namespace frm .......................................................
+namespace frm
+{
+//.........................................................................
+
+//==================================================================
+//= PropertyInfoService
+//==================================================================
+PropertyInfoService::PropertyMap PropertyInfoService::s_AllKnownProperties;
+//------------------------------------------------------------------
+sal_Int32 PropertyInfoService::getPropertyId(const ::rtl::OUString& _rName)
+{
+ initialize();
+
+ PropertyAssignment aCompareName(_rName, -1);
+ PropertyAssignmentNameCompareLess aCompareOp;
+
+ ConstPropertyMapIterator aLowerBound = lower_bound(
+ s_AllKnownProperties.begin(),
+ s_AllKnownProperties.end(),
+ aCompareName,
+ aCompareOp);
+
+ if ((aLowerBound != s_AllKnownProperties.end()) && aLowerBound->sName.equals(_rName))
+ { // we found something _and_ we have an identity
+ return aLowerBound->nHandle;
+ }
+
+ return -1;
+}
+
+//------------------------------------------------------------------
+sal_Int32 ConcretInfoService::getPreferedPropertyId(const ::rtl::OUString& _rName)
+{
+ return PropertyInfoService::getPropertyId(_rName);
+}
+
+//------------------------------------------------------------------
+#define ADD_PROP_ASSIGNMENT(varname) \
+ s_AllKnownProperties.push_back(PropertyAssignment(PROPERTY_##varname, PROPERTY_ID_##varname))
+//..................................................................
+void PropertyInfoService::initialize()
+{
+ if (s_AllKnownProperties.size())
+ return;
+
+ ADD_PROP_ASSIGNMENT(NAME);
+ ADD_PROP_ASSIGNMENT(TAG);
+ ADD_PROP_ASSIGNMENT(TABINDEX);
+ ADD_PROP_ASSIGNMENT(CLASSID);
+ ADD_PROP_ASSIGNMENT(ALIGN);
+ ADD_PROP_ASSIGNMENT(ROWCOUNT);
+ ADD_PROP_ASSIGNMENT(ROWCOUNTFINAL);
+ ADD_PROP_ASSIGNMENT(FETCHSIZE);
+ ADD_PROP_ASSIGNMENT(VALUE);
+ ADD_PROP_ASSIGNMENT(VALUEMIN);
+ ADD_PROP_ASSIGNMENT(VALUEMAX);
+ ADD_PROP_ASSIGNMENT(VALUESTEP);
+ ADD_PROP_ASSIGNMENT(TEXT);
+ ADD_PROP_ASSIGNMENT(LABEL);
+ ADD_PROP_ASSIGNMENT(NAVIGATION);
+ ADD_PROP_ASSIGNMENT(CYCLE);
+ ADD_PROP_ASSIGNMENT(CONTROLSOURCE);
+ ADD_PROP_ASSIGNMENT(ENABLED);
+ ADD_PROP_ASSIGNMENT(SPIN);
+ ADD_PROP_ASSIGNMENT(READONLY);
+ ADD_PROP_ASSIGNMENT(FILTER_CRITERIA);
+ ADD_PROP_ASSIGNMENT(AUTOINCREMENT);
+ ADD_PROP_ASSIGNMENT(CACHESIZE);
+ ADD_PROP_ASSIGNMENT(LASTDIRTY);
+ ADD_PROP_ASSIGNMENT(STATEMENT);
+ ADD_PROP_ASSIGNMENT(WIDTH);
+ ADD_PROP_ASSIGNMENT(SEARCHABLE);
+ ADD_PROP_ASSIGNMENT(MULTILINE);
+ ADD_PROP_ASSIGNMENT(TARGET_URL);
+ ADD_PROP_ASSIGNMENT(DEFAULTCONTROL);
+ ADD_PROP_ASSIGNMENT(MAXTEXTLEN);
+ ADD_PROP_ASSIGNMENT(SIZE);
+ ADD_PROP_ASSIGNMENT(DATE);
+ ADD_PROP_ASSIGNMENT(TIME);
+ ADD_PROP_ASSIGNMENT(STATE);
+ ADD_PROP_ASSIGNMENT(TRISTATE);
+ ADD_PROP_ASSIGNMENT(HIDDEN_VALUE);
+ ADD_PROP_ASSIGNMENT(TARGET_FRAME);
+ ADD_PROP_ASSIGNMENT(BUTTONTYPE);
+ ADD_PROP_ASSIGNMENT(STRINGITEMLIST);
+ ADD_PROP_ASSIGNMENT(DEFAULT_TEXT);
+ ADD_PROP_ASSIGNMENT(DEFAULTCHECKED);
+ ADD_PROP_ASSIGNMENT(DEFAULT_DATE);
+ ADD_PROP_ASSIGNMENT(DEFAULT_TIME);
+ ADD_PROP_ASSIGNMENT(DEFAULT_VALUE);
+ ADD_PROP_ASSIGNMENT(FORMATKEY);
+ ADD_PROP_ASSIGNMENT(FORMATSSUPPLIER);
+ ADD_PROP_ASSIGNMENT(SUBMIT_ACTION);
+ ADD_PROP_ASSIGNMENT(SUBMIT_TARGET);
+ ADD_PROP_ASSIGNMENT(SUBMIT_METHOD);
+ ADD_PROP_ASSIGNMENT(SUBMIT_ENCODING);
+ ADD_PROP_ASSIGNMENT(IMAGE_URL);
+ ADD_PROP_ASSIGNMENT(EMPTY_IS_NULL);
+ ADD_PROP_ASSIGNMENT(LISTSOURCETYPE);
+ ADD_PROP_ASSIGNMENT(LISTSOURCE);
+ ADD_PROP_ASSIGNMENT(SELECT_SEQ);
+ ADD_PROP_ASSIGNMENT(VALUE_SEQ);
+ ADD_PROP_ASSIGNMENT(DEFAULT_SELECT_SEQ);
+ ADD_PROP_ASSIGNMENT(MULTISELECTION);
+ ADD_PROP_ASSIGNMENT(DECIMAL_ACCURACY);
+ ADD_PROP_ASSIGNMENT(EDITMASK);
+ ADD_PROP_ASSIGNMENT(ISREADONLY);
+ ADD_PROP_ASSIGNMENT(ISREQUIRED);
+ ADD_PROP_ASSIGNMENT(FIELDTYPE);
+ ADD_PROP_ASSIGNMENT(DECIMALS);
+ ADD_PROP_ASSIGNMENT(REFVALUE);
+ ADD_PROP_ASSIGNMENT(STRICTFORMAT);
+ ADD_PROP_ASSIGNMENT(DATASOURCE);
+ ADD_PROP_ASSIGNMENT(ALLOWADDITIONS);
+ ADD_PROP_ASSIGNMENT(ALLOWEDITS);
+ ADD_PROP_ASSIGNMENT(ALLOWDELETIONS);
+ ADD_PROP_ASSIGNMENT(MASTERFIELDS);
+ ADD_PROP_ASSIGNMENT(ISPASSTHROUGH);
+ ADD_PROP_ASSIGNMENT(QUERY);
+ ADD_PROP_ASSIGNMENT(LITERALMASK);
+ ADD_PROP_ASSIGNMENT(SHOWTHOUSANDSEP);
+ ADD_PROP_ASSIGNMENT(CURRENCYSYMBOL);
+ ADD_PROP_ASSIGNMENT(DATEFORMAT);
+ ADD_PROP_ASSIGNMENT(DATEMIN);
+ ADD_PROP_ASSIGNMENT(DATEMAX);
+ ADD_PROP_ASSIGNMENT(DATE_SHOW_CENTURY);
+ ADD_PROP_ASSIGNMENT(TIMEFORMAT);
+ ADD_PROP_ASSIGNMENT(TIMEMIN);
+ ADD_PROP_ASSIGNMENT(TIMEMAX);
+ ADD_PROP_ASSIGNMENT(LINECOUNT);
+ ADD_PROP_ASSIGNMENT(BOUNDCOLUMN);
+ ADD_PROP_ASSIGNMENT(HASNAVIGATION);
+ ADD_PROP_ASSIGNMENT(FONT);
+ ADD_PROP_ASSIGNMENT(BACKGROUNDCOLOR);
+ ADD_PROP_ASSIGNMENT(FILLCOLOR);
+ ADD_PROP_ASSIGNMENT(TEXTCOLOR);
+ ADD_PROP_ASSIGNMENT(LINECOLOR);
+ ADD_PROP_ASSIGNMENT(BORDER);
+ ADD_PROP_ASSIGNMENT(DROPDOWN);
+ ADD_PROP_ASSIGNMENT(MULTI);
+ ADD_PROP_ASSIGNMENT(HSCROLL);
+ ADD_PROP_ASSIGNMENT(VSCROLL);
+ ADD_PROP_ASSIGNMENT(TABSTOP);
+ ADD_PROP_ASSIGNMENT(AUTOCOMPLETE);
+ ADD_PROP_ASSIGNMENT(HARDLINEBREAKS);
+ ADD_PROP_ASSIGNMENT(PRINTABLE);
+ ADD_PROP_ASSIGNMENT(ECHO_CHAR);
+ ADD_PROP_ASSIGNMENT(ROWHEIGHT);
+ ADD_PROP_ASSIGNMENT(HELPTEXT);
+ ADD_PROP_ASSIGNMENT(FONT_NAME);
+ ADD_PROP_ASSIGNMENT(FONT_STYLENAME);
+ ADD_PROP_ASSIGNMENT(FONT_FAMILY);
+ ADD_PROP_ASSIGNMENT(FONT_CHARSET);
+ ADD_PROP_ASSIGNMENT(FONT_HEIGHT);
+ ADD_PROP_ASSIGNMENT(FONT_WEIGHT);
+ ADD_PROP_ASSIGNMENT(FONT_SLANT);
+ ADD_PROP_ASSIGNMENT(FONT_UNDERLINE);
+ ADD_PROP_ASSIGNMENT(FONT_STRIKEOUT);
+ ADD_PROP_ASSIGNMENT(HELPURL);
+ ADD_PROP_ASSIGNMENT(RECORDMARKER);
+ ADD_PROP_ASSIGNMENT(BOUNDFIELD);
+ ADD_PROP_ASSIGNMENT(TREATASNUMERIC);
+ ADD_PROP_ASSIGNMENT(EFFECTIVE_VALUE);
+ ADD_PROP_ASSIGNMENT(EFFECTIVE_DEFAULT);
+ ADD_PROP_ASSIGNMENT(EFFECTIVE_MIN);
+ ADD_PROP_ASSIGNMENT(EFFECTIVE_MAX);
+ ADD_PROP_ASSIGNMENT(HIDDEN);
+ ADD_PROP_ASSIGNMENT(FILTERPROPOSAL);
+ ADD_PROP_ASSIGNMENT(FIELDSOURCE);
+ ADD_PROP_ASSIGNMENT(TABLENAME);
+ ADD_PROP_ASSIGNMENT(FILTERSUPPLIER);
+ ADD_PROP_ASSIGNMENT(CURRENTFILTER);
+ ADD_PROP_ASSIGNMENT(SELECTED_FIELDS);
+ ADD_PROP_ASSIGNMENT(SELECTED_TABLES);
+ ADD_PROP_ASSIGNMENT(THREADSAFE);
+ ADD_PROP_ASSIGNMENT(CONTROLLABEL);
+ ADD_PROP_ASSIGNMENT(CURRSYM_POSITION);
+ ADD_PROP_ASSIGNMENT(SOURCE);
+ ADD_PROP_ASSIGNMENT(CURSORCOLOR);
+ ADD_PROP_ASSIGNMENT(ALWAYSSHOWCURSOR);
+ ADD_PROP_ASSIGNMENT(DISPLAYSYNCHRON);
+ ADD_PROP_ASSIGNMENT(ISMODIFIED);
+ ADD_PROP_ASSIGNMENT(ISNEW);
+ ADD_PROP_ASSIGNMENT(PRIVILEGES);
+ ADD_PROP_ASSIGNMENT(DETAILFIELDS);
+ ADD_PROP_ASSIGNMENT(COMMAND);
+ ADD_PROP_ASSIGNMENT(COMMANDTYPE);
+ ADD_PROP_ASSIGNMENT(RESULTSET_CONCURRENCY);
+ ADD_PROP_ASSIGNMENT(INSERTONLY);
+ ADD_PROP_ASSIGNMENT(RESULTSET_TYPE);
+ ADD_PROP_ASSIGNMENT(ESCAPE_PROCESSING);
+ ADD_PROP_ASSIGNMENT(APPLYFILTER);
+ ADD_PROP_ASSIGNMENT(ISNULLABLE);
+ ADD_PROP_ASSIGNMENT(ACTIVECOMMAND);
+ ADD_PROP_ASSIGNMENT(ISCURRENCY);
+ ADD_PROP_ASSIGNMENT(NUMBER_FORMATS_SUPPLIER);
+ ADD_PROP_ASSIGNMENT(URL);
+ ADD_PROP_ASSIGNMENT(TITLE);
+ ADD_PROP_ASSIGNMENT(ACTIVE_CONNECTION);
+ ADD_PROP_ASSIGNMENT(SCALE);
+ ADD_PROP_ASSIGNMENT(SORT);
+
+ // now sort the array by name
+ PropertyAssignmentNameCompareLess aCompareOp;
+ std::sort(
+ s_AllKnownProperties.begin(),
+ s_AllKnownProperties.end(),
+ aCompareOp
+ );
+}
+
+//==================================================================
+//= instantiation of property strings
+//==================================================================
+
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TABINDEX, "TabIndex");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TAG, "Tag");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_NAME, "Name");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CLASSID, "ClassId");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ROWCOUNT, "RowCount");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ROWCOUNTFINAL, "IsRowCountFinal");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FETCHSIZE, "FetchSize");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_VALUE, "Value");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TEXT, "Text");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_LABEL, "Label");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CANINSERT, "CanInsert");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CANUPDATE, "CanUpdate");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CANDELETE, "CanDelete");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_NAVIGATION, "NavigationBarMode");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_HASNAVIGATION, "HasNavigationBar");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CYCLE, "Cycle");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CONTROLSOURCE, "DataField");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ENABLED, "Enabled");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_READONLY, "ReadOnly");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISREADONLY, "IsReadOnly");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FILTER_CRITERIA, "Filter");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISREQUIRED, "IsRequired");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_AUTOINCREMENT, "IsAutoIncrement");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CACHESIZE, "CacheSize");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DATAENTRY, "DataEntry");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_LASTDIRTY, "LastUpdated");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_STATEMENT, "Statement");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_WIDTH, "Width");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SEARCHABLE, "IsSearchable");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_MULTILINE, "MultiLine");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TARGET_URL, "TargetURL");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TARGET_FRAME, "TargetFrame");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DEFAULTCONTROL, "DefaultControl");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_MAXTEXTLEN, "MaxTextLen");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_EDITMASK, "EditMask");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SIZE, "Size");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SPIN, "Spin");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DATE, "Date");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TIME, "Time");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_STATE, "State");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TRISTATE, "TriState");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_HIDDEN_VALUE, "HiddenValue");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_BUTTONTYPE, "ButtonType");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_STRINGITEMLIST, "StringItemList");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DEFAULT_TEXT, "DefaultText");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DEFAULTCHECKED, "DefaultState");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FORMATKEY, "FormatKey");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FORMATSSUPPLIER, "FormatsSupplier");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SUBMIT_ACTION, "SubmitAction");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SUBMIT_TARGET, "SubmitTarget");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SUBMIT_METHOD, "SubmitMethod");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SUBMIT_ENCODING, "SubmitEncoding");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_IMAGE_URL, "ImageURL");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_EMPTY_IS_NULL, "ConvertEmptyToNull");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_LISTSOURCETYPE, "ListSourceType");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_LISTSOURCE, "ListSource");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SELECT_SEQ, "SelectedItems");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_VALUE_SEQ, "ValueItemList");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DEFAULT_SELECT_SEQ, "DefaultSelection");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_MULTISELECTION, "MultiSelection");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ALIGN, "Align");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DEFAULT_DATE, "DefaultDate");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DEFAULT_TIME, "DefaultTime");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DEFAULT_VALUE, "DefaultValue");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DECIMAL_ACCURACY, "DecimalAccuracy");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CURSORSOURCE, "DataSelection");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CURSORSOURCETYPE, "DataSelectionType");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FIELDTYPE, "Type");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DECIMALS, "Decimals");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_REFVALUE, "RefValue");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_VALUEMIN, "ValueMin");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_VALUEMAX, "ValueMax");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_STRICTFORMAT, "StrictFormat");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ALLOWADDITIONS, "AllowInserts");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ALLOWEDITS, "AllowUpdates");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ALLOWDELETIONS, "AllowDeletes");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_MASTERFIELDS, "MasterFields");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISPASSTHROUGH, "IsPassThrough");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_QUERY, "Query");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_LITERALMASK, "LiteralMask");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_VALUESTEP, "ValueStep");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SHOWTHOUSANDSEP, "ShowThousandsSeparator");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CURRENCYSYMBOL, "CurrencySymbol");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DATEFORMAT, "DateFormat");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DATEMIN, "DateMin");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DATEMAX, "DateMax");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DATE_SHOW_CENTURY, "DateShowCentury");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TIMEFORMAT, "TimeFormat");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TIMEMIN, "TimeMin");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TIMEMAX, "TimeMax");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_LINECOUNT, "LineCount");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_BOUNDCOLUMN, "BoundColumn");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONT, "FontDescriptor");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_BACKGROUNDCOLOR, "BackgroundColor");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FILLCOLOR, "FillColor");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TEXTCOLOR, "TextColor");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_LINECOLOR, "LineColor");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_BORDER, "Border");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DROPDOWN, "Dropdown");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_MULTI, "Multi");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_HSCROLL, "HScroll");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_VSCROLL, "VScroll");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TABSTOP, "Tabstop");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_AUTOCOMPLETE, "Autocomplete");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_HARDLINEBREAKS, "HardLineBreaks");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PRINTABLE, "Printable");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ECHO_CHAR, "EchoChar");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ROWHEIGHT, "RowHeight");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_HELPTEXT, "HelpText");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONT_NAME, "FontName");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONT_STYLENAME, "FontStyleName");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONT_FAMILY, "FontFamily");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONT_CHARSET, "FontCharset");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONT_HEIGHT, "FontHeight");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONT_WEIGHT, "FontWeight");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONT_SLANT, "FontSlant");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONT_UNDERLINE, "FontUnderline");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONT_STRIKEOUT, "FontStrikeout");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_HELPURL, "HelpURL");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_RECORDMARKER, "HasRecordMarker");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_BOUNDFIELD, "BoundField");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TREATASNUMERIC, "TreatAsNumber");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_EFFECTIVE_VALUE, "EffectiveValue");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_EFFECTIVE_DEFAULT, "EffectiveDefault");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_EFFECTIVE_MIN, "EffectiveMin");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_EFFECTIVE_MAX, "EffectiveMax");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_HIDDEN, "Hidden");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FILTERPROPOSAL, "UseFilterValueProposal");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FIELDSOURCE, "FieldSource");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TABLENAME, "TableName");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FILTERSUPPLIER, "FilterSupplier");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CURRENTFILTER, "CurrentFilter");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SELECTED_FIELDS, "SelectedFields");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SELECTED_TABLES, "SelectedTables");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_THREADSAFE, "ThreadSafe");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISFILTERAPPLIED, "IsFilterApplied");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CONTROLLABEL, "LabelControl");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CURRSYM_POSITION, "PrependCurrencySymbol");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SOURCE, "Source");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CURSORCOLOR, "CursorColor");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ALWAYSSHOWCURSOR, "AlwaysShowCursor");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DISPLAYSYNCHRON, "DisplayIsSynchron");
+
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISMODIFIED, "IsModified");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISNEW, "IsNew");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PRIVILEGES, "Privileges");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_COMMAND, "Command");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_COMMANDTYPE, "CommandType");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_RESULTSET_CONCURRENCY, "ResultSetConcurrency");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_INSERTONLY, "IgnoreResult");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_RESULTSET_TYPE, "ResultSetType");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ESCAPE_PROCESSING, "EscapeProcessing");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_APPLYFILTER, "ApplyFilter");
+
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISNULLABLE, "IsNullable");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ACTIVECOMMAND, "ActiveCommand");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISCURRENCY, "IsCurrency");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_NUMBER_FORMATS_SUPPLIER, "NumberFormatsSupplier");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_URL, "URL");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TITLE, "Title");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ACTIVE_CONNECTION, "ActiveConnection");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SCALE, "Scale");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SORT, "Order");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DATASOURCE, "DataSourceName");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DETAILFIELDS, "DetailFields");
+
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_COLUMNSERVICENAME, "ColumnServiceName");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_REALNAME, "RealName");
+IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CONTROLSOURCEPROPERTY, "DataFieldProperty");
+
+//.........................................................................
+}
+//... namespace frm .......................................................
+
diff --git a/forms/source/misc/services.cxx b/forms/source/misc/services.cxx
new file mode 100644
index 000000000000..7e2b04385f40
--- /dev/null
+++ b/forms/source/misc/services.cxx
@@ -0,0 +1,580 @@
+/*************************************************************************
+ *
+ * $RCSfile: services.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:29:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _FRM_SERVICES_HXX_
+#include "services.hxx"
+#endif
+
+//... namespace frm .......................................................
+namespace frm
+{
+//.........................................................................
+
+IMPLEMENT_CONSTASCII_USTRING(AWT_CONTROL_TEXTFIELD, "com.sun.star.awt.TextField");
+
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROL_EDIT, "stardiv.vcl.control.Edit");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROL_LISTBOX, "stardiv.vcl.control.ListBox");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROL_COMBOBOX, "stardiv.vcl.control.ComboBox");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROL_RADIOBUTTON, "stardiv.vcl.control.RadioButton");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROL_GROUPBOX, "stardiv.vcl.control.GroupBox");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROL_FIXEDTEXT, "stardiv.vcl.control.FixedText");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROL_COMMANDBUTTON, "stardiv.vcl.control.Button");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROL_CHECKBOX, "stardiv.vcl.control.CheckBox");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROL_IMAGEBUTTON, "stardiv.vcl.control.ImageButton");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROL_FILECONTROL, "stardiv.vcl.control.FileControl");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROL_TIMEFIELD, "stardiv.vcl.control.TimeField");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROL_DATEFIELD, "stardiv.vcl.control.DateField");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROL_NUMERICFIELD, "stardiv.vcl.control.NumericField");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROL_CURRENCYFIELD, "stardiv.vcl.control.CurrencyField");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROL_PATTERNFIELD, "stardiv.vcl.control.PatternField");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROL_FORMATTEDFIELD, "stardiv.vcl.control.FormattedField");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROL_IMAGECONTROL, "stardiv.vcl.control.ImageControl");
+
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROLMODEL_EDIT, "stardiv.vcl.controlmodel.Edit");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROLMODEL_LISTBOX, "stardiv.vcl.controlmodel.ListBox");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROLMODEL_COMBOBOX, "stardiv.vcl.controlmodel.ComboBox");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROLMODEL_RADIOBUTTON, "stardiv.vcl.controlmodel.RadioButton");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROLMODEL_GROUPBOX, "stardiv.vcl.controlmodel.GroupBox");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROLMODEL_FIXEDTEXT, "stardiv.vcl.controlmodel.FixedText");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROLMODEL_COMMANDBUTTON, "stardiv.vcl.controlmodel.Button");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROLMODEL_CHECKBOX, "stardiv.vcl.controlmodel.CheckBox");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROLMODEL_IMAGEBUTTON, "stardiv.vcl.controlmodel.ImageButton");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROLMODEL_FILECONTROL, "stardiv.vcl.controlmodel.FileControl");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROLMODEL_TIMEFIELD, "stardiv.vcl.controlmodel.TimeField");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROLMODEL_DATEFIELD, "stardiv.vcl.controlmodel.DateField");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROLMODEL_NUMERICFIELD, "stardiv.vcl.controlmodel.NumericField");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROLMODEL_CURRENCYFIELD, "stardiv.vcl.controlmodel.CurrencyField");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROLMODEL_PATTERNFIELD, "stardiv.vcl.controlmodel.PatternField");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROLMODEL_FORMATTEDFIELD, "stardiv.vcl.controlmodel.FormattedField");
+IMPLEMENT_CONSTASCII_USTRING(VCL_CONTROLMODEL_IMAGECONTROL, "stardiv.vcl.controlmodel.ImageControl");
+
+// -----------------------
+// service names for compatibility
+// -----------------------
+IMPLEMENT_CONSTASCII_USTRING(FRM_COMPONENT_FORM, "stardiv.one.form.component.Form");
+IMPLEMENT_CONSTASCII_USTRING(FRM_COMPONENT_EDIT, "stardiv.one.form.component.Edit"); // compatibility
+IMPLEMENT_CONSTASCII_USTRING(FRM_COMPONENT_TEXTFIELD, "stardiv.one.form.component.TextField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_COMPONENT_LISTBOX, "stardiv.one.form.component.ListBox");
+IMPLEMENT_CONSTASCII_USTRING(FRM_COMPONENT_COMBOBOX, "stardiv.one.form.component.ComboBox");
+IMPLEMENT_CONSTASCII_USTRING(FRM_COMPONENT_RADIOBUTTON, "stardiv.one.form.component.RadioButton");
+IMPLEMENT_CONSTASCII_USTRING(FRM_COMPONENT_GROUPBOX, "stardiv.one.form.component.GroupBox"); // compatibility
+IMPLEMENT_CONSTASCII_USTRING(FRM_COMPONENT_FIXEDTEXT, "stardiv.one.form.component.FixedText"); // compatibility
+IMPLEMENT_CONSTASCII_USTRING(FRM_COMPONENT_COMMANDBUTTON, "stardiv.one.form.component.CommandButton");
+IMPLEMENT_CONSTASCII_USTRING(FRM_COMPONENT_CHECKBOX, "stardiv.one.form.component.CheckBox");
+IMPLEMENT_CONSTASCII_USTRING(FRM_COMPONENT_GRID, "stardiv.one.form.component.Grid"); // compatibility
+IMPLEMENT_CONSTASCII_USTRING(FRM_COMPONENT_GRIDCONTROL, "stardiv.one.form.component.GridControl");
+IMPLEMENT_CONSTASCII_USTRING(FRM_COMPONENT_IMAGEBUTTON, "stardiv.one.form.component.ImageButton");
+IMPLEMENT_CONSTASCII_USTRING(FRM_COMPONENT_FILECONTROL, "stardiv.one.form.component.FileControl");
+IMPLEMENT_CONSTASCII_USTRING(FRM_COMPONENT_TIMEFIELD, "stardiv.one.form.component.TimeField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_COMPONENT_DATEFIELD, "stardiv.one.form.component.DateField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_COMPONENT_NUMERICFIELD, "stardiv.one.form.component.NumericField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_COMPONENT_CURRENCYFIELD, "stardiv.one.form.component.CurrencyField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_COMPONENT_PATTERNFIELD, "stardiv.one.form.component.PatternField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_COMPONENT_HIDDEN, "stardiv.one.form.component.Hidden");
+IMPLEMENT_CONSTASCII_USTRING(FRM_COMPONENT_HIDDENCONTROL, "stardiv.one.form.component.HiddenControl");
+IMPLEMENT_CONSTASCII_USTRING(FRM_COMPONENT_IMAGECONTROL, "stardiv.one.form.component.ImageControl");
+IMPLEMENT_CONSTASCII_USTRING(FRM_COMPONENT_FORMATTEDFIELD, "stardiv.one.form.component.FormattedField");
+
+IMPLEMENT_CONSTASCII_USTRING(FRM_CONTROL_EDIT, "stardiv.one.form.control.Edit"); // compatibility
+IMPLEMENT_CONSTASCII_USTRING(FRM_CONTROL_TEXTFIELD, "stardiv.one.form.control.TextField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_CONTROL_LISTBOX, "stardiv.one.form.control.ListBox");
+IMPLEMENT_CONSTASCII_USTRING(FRM_CONTROL_COMBOBOX, "stardiv.one.form.control.ComboBox");
+IMPLEMENT_CONSTASCII_USTRING(FRM_CONTROL_RADIOBUTTON, "stardiv.one.form.control.RadioButton");
+IMPLEMENT_CONSTASCII_USTRING(FRM_CONTROL_GROUPBOX, "stardiv.one.form.control.GroupBox"); // compatibility
+IMPLEMENT_CONSTASCII_USTRING(FRM_CONTROL_FIXEDTEXT, "stardiv.one.form.control.FixedText"); // compatibility
+IMPLEMENT_CONSTASCII_USTRING(FRM_CONTROL_COMMANDBUTTON, "stardiv.one.form.control.CommandButton");
+IMPLEMENT_CONSTASCII_USTRING(FRM_CONTROL_CHECKBOX, "stardiv.one.form.control.CheckBox");
+IMPLEMENT_CONSTASCII_USTRING(FRM_CONTROL_GRID, "stardiv.one.form.control.Grid"); // compatibility
+IMPLEMENT_CONSTASCII_USTRING(FRM_CONTROL_GRIDCONTROL, "stardiv.one.form.control.GridControl");
+IMPLEMENT_CONSTASCII_USTRING(FRM_CONTROL_IMAGEBUTTON, "stardiv.one.form.control.ImageButton");
+IMPLEMENT_CONSTASCII_USTRING(FRM_CONTROL_TIMEFIELD, "stardiv.one.form.control.TimeField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_CONTROL_DATEFIELD, "stardiv.one.form.control.DateField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_CONTROL_NUMERICFIELD, "stardiv.one.form.control.NumericField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_CONTROL_CURRENCYFIELD, "stardiv.one.form.control.CurrencyField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_CONTROL_PATTERNFIELD, "stardiv.one.form.control.PatternField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_CONTROL_IMAGECONTROL, "stardiv.one.form.control.ImageControl");
+IMPLEMENT_CONSTASCII_USTRING(FRM_CONTROL_FORMATTEDFIELD, "stardiv.one.form.control.FormattedField");
+
+// -----------------------
+// new (sun) service names
+// -----------------------
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_COMPONENT_FORM, "com.sun.star.form.component.Form");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_COMPONENT_HTMLFORM, "com.sun.star.form.component.HTMLForm");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_COMPONENT_DATAFORM, "com.sun.star.form.component.DataForm");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_COMPONENT_TEXTFIELD, "com.sun.star.form.component.TextField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_COMPONENT_LISTBOX, "com.sun.star.form.component.ListBox");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_COMPONENT_COMBOBOX, "com.sun.star.form.component.ComboBox");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_COMPONENT_RADIOBUTTON, "com.sun.star.form.component.RadioButton");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_COMPONENT_GROUPBOX, "com.sun.star.form.component.GroupBox");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_COMPONENT_FIXEDTEXT, "com.sun.star.form.component.FixedText");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_COMPONENT_COMMANDBUTTON, "com.sun.star.form.component.CommandButton");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_COMPONENT_CHECKBOX, "com.sun.star.form.component.CheckBox");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_COMPONENT_GRIDCONTROL, "com.sun.star.form.component.GridControl");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_COMPONENT_IMAGEBUTTON, "com.sun.star.form.component.ImageButton");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_COMPONENT_FILECONTROL, "com.sun.star.form.component.FileControl");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_COMPONENT_TIMEFIELD, "com.sun.star.form.component.TimeField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_COMPONENT_DATEFIELD, "com.sun.star.form.component.DateField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_COMPONENT_NUMERICFIELD, "com.sun.star.form.component.NumericField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_COMPONENT_CURRENCYFIELD, "com.sun.star.form.component.CurrencyField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_COMPONENT_PATTERNFIELD, "com.sun.star.form.component.PatternField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_COMPONENT_HIDDENCONTROL, "com.sun.star.form.component.HiddenControl");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_COMPONENT_IMAGECONTROL, "com.sun.star.form.component.ImageControl");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_COMPONENT_FORMATTEDFIELD, "com.sun.star.form.component.FormattedField");
+
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_CONTROL_TEXTFIELD, "com.sun.star.form.control.TextField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_CONTROL_LISTBOX, "com.sun.star.form.control.ListBox");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_CONTROL_COMBOBOX, "com.sun.star.form.control.ComboBox");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_CONTROL_RADIOBUTTON, "com.sun.star.form.control.RadioButton");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_CONTROL_GROUPBOX, "com.sun.star.form.control.GroupBox");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_CONTROL_FIXEDTEXT, "com.sun.star.form.control.FixedText");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_CONTROL_COMMANDBUTTON, "com.sun.star.form.control.CommandButton");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_CONTROL_CHECKBOX, "com.sun.star.form.control.CheckBox");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_CONTROL_GRIDCONTROL, "com.sun.star.form.control.GridControl");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_CONTROL_IMAGEBUTTON, "com.sun.star.form.control.ImageButton");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_CONTROL_TIMEFIELD, "com.sun.star.form.control.TimeField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_CONTROL_DATEFIELD, "com.sun.star.form.control.DateField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_CONTROL_NUMERICFIELD, "com.sun.star.form.control.NumericField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_CONTROL_CURRENCYFIELD, "com.sun.star.form.control.CurrencyField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_CONTROL_PATTERNFIELD, "com.sun.star.form.control.PatternField");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_CONTROL_IMAGECONTROL, "com.sun.star.form.control.ImageControl");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_CONTROL_FORMATTEDFIELD, "com.sun.star.form.control.FormattedField");
+
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_FORMS_COLLECTION, "com.sun.star.form.FormsCollection");
+IMPLEMENT_CONSTASCII_USTRING(FRM_SUN_INTERNATIONAL_INFO, "com.sun.star.deprecated.International");
+
+IMPLEMENT_CONSTASCII_USTRING(FRM_DATA_ENGINE, "com.sun.star.data.DatabaseEngine");
+IMPLEMENT_CONSTASCII_USTRING(FRM_NUMBER_FORMATTER, "com.sun.star.util.NumberFormatter");
+
+IMPLEMENT_CONSTASCII_USTRING(SRV_SDB_ROWSET, "com.sun.star.sdb.RowSet");
+IMPLEMENT_CONSTASCII_USTRING(SRV_SDB_CONNECTION, "com.sun.star.sdb.Connection");
+IMPLEMENT_CONSTASCII_USTRING(SRV_SDBC_STATEMENT, "com.sun.star.sdbc.Statement");
+IMPLEMENT_CONSTASCII_USTRING(SRV_SDB_DATABASE_ENVIRONMENT, "com.sun.star.sdb.DatabaseEnvironment");
+IMPLEMENT_CONSTASCII_USTRING(SRV_SDB_DATABASE_ACCESS_CONNECTION, "com.sun.star.sdb.DatabaseAccessConnection");
+IMPLEMENT_CONSTASCII_USTRING(SRV_SDB_DATABASE_ACCESS_CONTEXT, "com.sun.star.sdb.DatabaseAccessContext");
+
+IMPLEMENT_CONSTASCII_USTRING(SRV_AWT_POINTER, "com.sun.star.awt.Pointer");
+
+//.........................................................................
+}
+//... namespace frm .......................................................
+
+#ifndef _CPPUHELPER_FACTORY_HXX_
+#include <cppuhelper/factory.hxx>
+#endif
+#ifndef _UNO_LBNAMES_H_
+#include <uno/lbnames.h>
+#endif
+#ifndef _OSL_DIAGNOSE_H_
+#include <osl/diagnose.h>
+#endif
+#ifndef _UNO_MAPPING_HXX_
+#include <uno/mapping.hxx>
+#endif
+
+namespace starregistry = ::com::sun::star::registry;
+namespace staruno = ::com::sun::star::uno;
+namespace starlang = ::com::sun::star::lang;
+
+//---------------------------------------------------------------------------------------
+//.......................................................................................
+#define DECLARE_SERVICE_INFO(classImplName) \
+ namespace frm { \
+ extern staruno::Reference<staruno::XInterface> SAL_CALL classImplName##_CreateInstance(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) throw (staruno::RuntimeException); \
+ }
+
+//---------------------------------------------------------------------------------------
+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)
+
+// some special handling for the FormattedFieldWrapper which can act as FormattedModel or as EditModel
+DECLARE_SERVICE_INFO(OFormattedFieldWrapper);
+ // 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 staruno::Reference<staruno::XInterface> SAL_CALL OFormattedFieldWrapper_CreateInstance_ForceFormatted(const staruno::Reference<starlang::XMultiServiceFactory>& _rxFactory) throw (staruno::RuntimeException); \
+}
+
+DECLARE_SERVICE_INFO(OFormsCollection)
+DECLARE_SERVICE_INFO(ODatabaseForm)
+DECLARE_SERVICE_INFO(OInternationalInfo)
+
+//---------------------------------------------------------------------------------------
+
+static staruno::Sequence< ::rtl::OUString > s_aClassImplementationNames;
+static staruno::Sequence<staruno::Sequence< ::rtl::OUString > > s_aClassServiceNames;
+static staruno::Sequence<sal_Int64> s_aFactories;
+ // 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 staruno::Sequence< ::rtl::OUString >& _rServiceNames, // the services supported by this class
+ ::cppu::ComponentInstantiation _pCreateFunction // the method for instantiating such a class
+ )
+{
+ sal_Int32 nCurrentLength = s_aClassImplementationNames.getLength();
+ OSL_ENSHURE((nCurrentLength == s_aClassServiceNames.getLength())
+ && (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::createFromAscii("com.sun.star.form.") + ::rtl::OUString::createFromAscii(#classImplName), \
+ 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;
+ staruno::Sequence< ::rtl::OUString > aServices;
+
+ // ========================================================================
+ // = ControlModels
+ // ------------------------------------------------------------------------
+ // - FixedText
+ REGISTER_CLASS2(OFixedTextModel, FRM_COMPONENT_FIXEDTEXT, FRM_SUN_COMPONENT_FIXEDTEXT);
+
+ // - RadioButton
+ REGISTER_CLASS2(ORadioButtonModel, FRM_COMPONENT_RADIOBUTTON, FRM_SUN_COMPONENT_RADIOBUTTON);
+ // - CheckBox
+ REGISTER_CLASS2(OCheckBoxModel, FRM_COMPONENT_CHECKBOX, FRM_SUN_COMPONENT_CHECKBOX);
+ // - Hidden
+ REGISTER_CLASS3(OHiddenModel, FRM_COMPONENT_HIDDENCONTROL, FRM_SUN_COMPONENT_HIDDENCONTROL, FRM_COMPONENT_HIDDEN);
+ // - GroupBox
+ REGISTER_CLASS2(OGroupBoxModel, FRM_COMPONENT_GROUPBOX, FRM_SUN_COMPONENT_GROUPBOX);
+ // - ListBox
+ REGISTER_CLASS2(OListBoxModel, FRM_COMPONENT_LISTBOX, FRM_SUN_COMPONENT_LISTBOX);
+ // - ComboBox
+ REGISTER_CLASS2(OComboBoxModel, FRM_COMPONENT_COMBOBOX, FRM_SUN_COMPONENT_COMBOBOX);
+ // - EditControl
+ REGISTER_CLASS2(OEditModel, FRM_COMPONENT_TEXTFIELD, FRM_SUN_COMPONENT_TEXTFIELD);
+ // - DateControl
+ REGISTER_CLASS2(ODateModel, FRM_COMPONENT_DATEFIELD, FRM_SUN_COMPONENT_DATEFIELD);
+ // - TimeControl
+ REGISTER_CLASS2(OTimeModel, FRM_COMPONENT_TIMEFIELD, FRM_SUN_COMPONENT_TIMEFIELD);
+ // - NumericField
+ REGISTER_CLASS2(ONumericModel, FRM_COMPONENT_NUMERICFIELD, FRM_SUN_COMPONENT_NUMERICFIELD);
+ // - CurrencyField
+ REGISTER_CLASS2(OCurrencyModel, FRM_COMPONENT_CURRENCYFIELD, FRM_SUN_COMPONENT_CURRENCYFIELD);
+ // - PatternField
+ REGISTER_CLASS2(OPatternModel, FRM_COMPONENT_PATTERNFIELD, FRM_SUN_COMPONENT_PATTERNFIELD);
+ // - Button
+ REGISTER_CLASS2(OButtonModel, FRM_COMPONENT_COMMANDBUTTON, FRM_SUN_COMPONENT_COMMANDBUTTON);
+ // - ImageButton
+ REGISTER_CLASS2(OImageButtonModel, FRM_COMPONENT_IMAGEBUTTON, FRM_SUN_COMPONENT_IMAGEBUTTON);
+ // - ImageControl
+ REGISTER_CLASS2(OImageControlModel, FRM_COMPONENT_IMAGECONTROL, FRM_SUN_COMPONENT_IMAGECONTROL);
+
+ // - FormattedField
+ REGISTER_CLASS1(OFormattedFieldWrapper, FRM_COMPONENT_EDIT);
+ // since SUPD568 both OFormattedModel and OEditModel use FRM_COMPONENT_EDIT for persistence,
+ // 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(2);
+ aServices.getArray()[0] = frm::FRM_COMPONENT_FORMATTEDFIELD;
+ aServices.getArray()[1] = frm::FRM_SUN_COMPONENT_FORMATTEDFIELD;
+ registerClassInfo(::rtl::OUString::createFromAscii("com.sun.star.form.") + ::rtl::OUString::createFromAscii("OFormattedFieldWrapper_ForcedFormatted"),
+ aServices,
+ frm::OFormattedFieldWrapper_CreateInstance_ForceFormatted);
+
+ // - FileControl
+ REGISTER_CLASS2(OFileControlModel, FRM_COMPONENT_FILECONTROL, FRM_SUN_COMPONENT_FILECONTROL);
+ // - GridControl
+ REGISTER_CLASS3(OGridControlModel, FRM_COMPONENT_GRID /* compatibility */, FRM_COMPONENT_GRIDCONTROL, FRM_SUN_COMPONENT_GRIDCONTROL);
+
+ // ========================================================================
+ // = Controls
+ // - RadioButton
+ REGISTER_CLASS2(ORadioButtonControl, FRM_CONTROL_RADIOBUTTON, FRM_SUN_CONTROL_RADIOBUTTON);
+ // - CheckBox
+ REGISTER_CLASS2(OCheckBoxControl, FRM_CONTROL_CHECKBOX, FRM_SUN_CONTROL_CHECKBOX);
+ // - GroupBox
+ REGISTER_CLASS2(OGroupBoxControl, FRM_CONTROL_GROUPBOX, FRM_SUN_CONTROL_GROUPBOX);
+ // - ListBox
+ REGISTER_CLASS2(OListBoxControl, FRM_CONTROL_LISTBOX, FRM_SUN_CONTROL_LISTBOX);
+ // - ComboBox
+ REGISTER_CLASS2(OComboBoxControl, FRM_CONTROL_COMBOBOX, FRM_SUN_CONTROL_COMBOBOX);
+ // - EditControl
+ REGISTER_CLASS3(OEditControl, FRM_CONTROL_TEXTFIELD, FRM_SUN_CONTROL_TEXTFIELD, FRM_CONTROL_EDIT);
+ // - DateControl
+ REGISTER_CLASS2(ODateControl, FRM_CONTROL_DATEFIELD, FRM_SUN_CONTROL_DATEFIELD);
+ // - TimeControl
+ REGISTER_CLASS2(OTimeControl, FRM_CONTROL_TIMEFIELD, FRM_SUN_CONTROL_TIMEFIELD);
+ // - NumericField
+ REGISTER_CLASS2(ONumericControl, FRM_CONTROL_NUMERICFIELD, FRM_SUN_CONTROL_NUMERICFIELD);
+ // - CurrencyField
+ REGISTER_CLASS2(OCurrencyControl, FRM_CONTROL_CURRENCYFIELD, FRM_SUN_CONTROL_CURRENCYFIELD);
+ // - PatternField
+ REGISTER_CLASS2(OPatternControl, FRM_CONTROL_PATTERNFIELD, FRM_SUN_CONTROL_PATTERNFIELD);
+ // - FormattedField
+ REGISTER_CLASS2(OFormattedControl, FRM_CONTROL_FORMATTEDFIELD, FRM_SUN_CONTROL_FORMATTEDFIELD);
+ // - Button
+ REGISTER_CLASS2(OButtonControl, FRM_CONTROL_COMMANDBUTTON, FRM_SUN_CONTROL_COMMANDBUTTON);
+ // - ImageButton
+ REGISTER_CLASS2(OImageButtonControl, FRM_CONTROL_IMAGEBUTTON, FRM_SUN_CONTROL_IMAGEBUTTON);
+ // - ImageControl
+ REGISTER_CLASS2(OImageControlControl, FRM_CONTROL_IMAGECONTROL, FRM_SUN_CONTROL_IMAGECONTROL);
+
+
+ // ========================================================================
+ // = various
+ REGISTER_CLASS1(OFormsCollection, FRM_SUN_FORMS_COLLECTION);
+ REGISTER_CLASS4(ODatabaseForm, FRM_COMPONENT_FORM, FRM_SUN_COMPONENT_FORM, FRM_SUN_COMPONENT_HTMLFORM, FRM_SUN_COMPONENT_DATAFORM);
+ REGISTER_CLASS1(OInternationalInfo, FRM_SUN_INTERNATIONAL_INFO);
+
+}
+
+//---------------------------------------------------------------------------------------
+void registerServiceProvider(const ::rtl::OUString& _rServiceImplName, const staruno::Sequence< ::rtl::OUString >& _rServices, starregistry::XRegistryKey* _pKey)
+{
+ ::rtl::OUString sMainKeyName = ::rtl::OUString::createFromAscii("/");
+ sMainKeyName += _rServiceImplName;
+ sMainKeyName += ::rtl::OUString::createFromAscii("/UNO/SERVICES");
+ staruno::Reference<starregistry::XRegistryKey> xNewKey = _pKey->createKey(sMainKeyName);
+ OSL_ENSHURE(xNewKey.is(), "forms::registerProvider : could not create a registry key !");
+ 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 component_getImplementationEnvironment(const sal_Char** _ppEnvTypeName, uno_Environment** _ppEnv)
+{
+ *_ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
+
+//---------------------------------------------------------------------------------------
+sal_Bool SAL_CALL component_writeInfo(void* _pServiceManager, starregistry::XRegistryKey* _pRegistryKey)
+{
+ if (_pRegistryKey)
+ {
+ try
+ {
+ // collect the class infos
+ ensureClassInfos();
+
+ // both our static sequences should have the same length ...
+ sal_Int32 nClasses = s_aClassImplementationNames.getLength();
+ OSL_ENSHURE(s_aClassServiceNames.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 staruno::Sequence< ::rtl::OUString >* pServices = s_aClassServiceNames.getConstArray();
+
+ 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);
+ return sal_True;
+ }
+ catch (starregistry::InvalidRegistryException &)
+ {
+ OSL_ENSHURE(sal_False, "forms::component_writeInfo : InvalidRegistryException !");
+ }
+ }
+ s_aClassImplementationNames.realloc(0);
+ s_aClassServiceNames.realloc(0);
+ s_aFactories.realloc(0);
+ return sal_False;
+}
+
+//---------------------------------------------------------------------------------------
+void* SAL_CALL component_getFactory(const sal_Char* _pImplName, starlang::XMultiServiceFactory* _pServiceManager, void* /*_pRegistryKey*/)
+{
+ if (!_pServiceManager)
+ return NULL;
+
+ void* pRet = NULL;
+
+ // collect the class infos
+ ensureClassInfos();
+
+ // both our static sequences should have the same length ...
+ sal_Int32 nClasses = s_aClassImplementationNames.getLength();
+ OSL_ENSHURE((s_aClassServiceNames.getLength() == nClasses) &&
+ (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 staruno::Sequence< ::rtl::OUString >* pServices = s_aClassServiceNames.getConstArray();
+ 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);
+
+ staruno::Reference<starlang::XSingleServiceFactory> xFactory(
+ ::cppu::createSingleFactory(
+ _pServiceManager,
+ *pClasses,
+ aCurrentCreateFunction,
+ *pServices
+ )
+ );
+ if (xFactory.is())
+ {
+ xFactory->acquire();
+ pRet = xFactory.get();
+ break;
+ }
+ }
+ }
+
+ return pRet;
+}
+
+}
+