diff options
Diffstat (limited to 'bf_forms/source/inc')
-rw-r--r-- | bf_forms/source/inc/InterfaceContainer.hxx | 291 | ||||
-rw-r--r-- | bf_forms/source/inc/formsmodule.hxx | 198 | ||||
-rw-r--r-- | bf_forms/source/inc/frm_resource.hrc | 52 | ||||
-rw-r--r-- | bf_forms/source/inc/frm_resource.hxx | 72 | ||||
-rw-r--r-- | bf_forms/source/inc/ids.hxx | 31 | ||||
-rw-r--r-- | bf_forms/source/inc/limitedformats.hxx | 99 | ||||
-rw-r--r-- | bf_forms/source/inc/property.hrc | 396 | ||||
-rw-r--r-- | bf_forms/source/inc/property.hxx | 191 | ||||
-rw-r--r-- | bf_forms/source/inc/services.hxx | 204 | ||||
-rw-r--r-- | bf_forms/source/inc/strings.hxx | 79 |
10 files changed, 1613 insertions, 0 deletions
diff --git a/bf_forms/source/inc/InterfaceContainer.hxx b/bf_forms/source/inc/InterfaceContainer.hxx new file mode 100644 index 000000000..9ae7245b6 --- /dev/null +++ b/bf_forms/source/inc/InterfaceContainer.hxx @@ -0,0 +1,291 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _FRM_INTERFACE_CONTAINER_HXX_ +#define _FRM_INTERFACE_CONTAINER_HXX_ + +#include <boost/unordered_map.hpp> + +#include <comphelper/stl_types.hxx> +#include <comphelper/uno3.hxx> + +#include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/container/XEnumerationAccess.hpp> +#include <com/sun/star/io/XPersistObject.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/script/XEventAttacherManager.hpp> +#include <com/sun/star/container/XContainer.hpp> +#include <com/sun/star/container/XIndexContainer.hpp> +#include <com/sun/star/form/XFormComponent.hpp> + + +#include <cppuhelper/component.hxx> +#include <cppuhelper/implbase7.hxx> +namespace binfilter { + + using namespace ::comphelper; + +//......................................................................... +namespace frm +{ +//......................................................................... + + +//================================================================== + struct ElementDescription + { + public: + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xInterface; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xPropertySet; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XChild > xChild; + ::com::sun::star::uno::Any aElementTypeInterface; + + public: + ElementDescription( ); + virtual ~ElementDescription(); + + private: + ElementDescription( const ElementDescription& ); // never implemented + ElementDescription& operator=( const ElementDescription& ); // never implemented + }; + +typedef ::std::vector<InterfaceRef> OInterfaceArray; +typedef ::boost::unordered_multimap< ::rtl::OUString, InterfaceRef, ::rtl::OUStringHash, ::comphelper::UStringEqual> OInterfaceMap; + +//================================================================== +// OInterfaceContainer +// implements a container for form components +//================================================================== +typedef ::cppu::ImplHelper7< ::com::sun::star::container::XNameContainer, + ::com::sun::star::container::XIndexContainer, + ::com::sun::star::container::XContainer, + ::com::sun::star::container::XEnumerationAccess, + ::com::sun::star::script::XEventAttacherManager, + ::com::sun::star::beans::XPropertyChangeListener, + ::com::sun::star::io::XPersistObject > OInterfaceContainer_BASE; + +class OInterfaceContainer : public OInterfaceContainer_BASE +{ +protected: + OInterfaceArray m_aItems; + OInterfaceMap m_aMap; + ::cppu::OInterfaceContainerHelper m_aContainerListeners; + + ::osl::Mutex& m_rMutex; + ::com::sun::star::uno::Type m_aElementType; + + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory> m_xServiceFactory; + + + // EventManager + ::com::sun::star::uno::Reference< ::com::sun::star::script::XEventAttacherManager> m_xEventAttacher; + + OInterfaceContainer( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory, + ::osl::Mutex& _rMutex, + const ::com::sun::star::uno::Type& _rElementType); + + ~OInterfaceContainer() {} + +public: +// ::com::sun::star::io::XPersistObject + virtual ::rtl::OUString SAL_CALL getServiceName( ) throw(::com::sun::star::uno::RuntimeException) = 0; + virtual void SAL_CALL write( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream >& OutStream ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL read( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream >& InStream ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::lang::XEventListener + virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::beans::XPropertyChangeListener + virtual void SAL_CALL propertyChange(const ::com::sun::star::beans::PropertyChangeEvent& evt) throw (::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::container::XElementAccess + virtual ::com::sun::star::uno::Type SAL_CALL getElementType() throw(::com::sun::star::uno::RuntimeException) ; + virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::container::XEnumerationAccess + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration> SAL_CALL createEnumeration() throw(::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::container::XNameAccess + virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual StringSequence SAL_CALL getElementNames( ) throw(::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::container::XNameReplace + virtual void SAL_CALL replaceByName(const ::rtl::OUString& Name, const ::com::sun::star::uno::Any& _rElement) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::container::XNameContainer + virtual void SAL_CALL insertByName(const ::rtl::OUString& Name, const ::com::sun::star::uno::Any& _rElement) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeByName(const ::rtl::OUString& Name) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::container::XIndexAccess + virtual sal_Int32 SAL_CALL getCount() throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getByIndex(sal_Int32 _nIndex) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::container::XIndexReplace + virtual void SAL_CALL replaceByIndex(sal_Int32 _nIndex, const ::com::sun::star::uno::Any& _rElement) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::container::XIndexContainer + virtual void SAL_CALL insertByIndex(sal_Int32 _nIndex, const ::com::sun::star::uno::Any& Element) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeByIndex(sal_Int32 _nIndex) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::container::XContainer + virtual void SAL_CALL addContainerListener(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeContainerListener(const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener>& _rxListener) throw(::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::script::XEventAttacherManager + virtual void SAL_CALL registerScriptEvent( sal_Int32 nIndex, const ::com::sun::star::script::ScriptEventDescriptor& aScriptEvent ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL registerScriptEvents( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor >& aScriptEvents ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL revokeScriptEvent( sal_Int32 nIndex, const ::rtl::OUString& aListenerType, const ::rtl::OUString& aEventMethod, const ::rtl::OUString& aRemoveListenerParam ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL revokeScriptEvents( sal_Int32 nIndex ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL insertEntry( sal_Int32 nIndex ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeEntry( sal_Int32 nIndex ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::script::ScriptEventDescriptor > SAL_CALL getScriptEvents( sal_Int32 Index ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL attach( sal_Int32 nIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xObject, const ::com::sun::star::uno::Any& aHelper ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::ServiceNotRegisteredException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL detach( sal_Int32 nIndex, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& xObject ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addScriptListener( const ::com::sun::star::uno::Reference< ::com::sun::star::script::XScriptListener >& xListener ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeScriptListener( const ::com::sun::star::uno::Reference< ::com::sun::star::script::XScriptListener >& Listener ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + +protected: + // helper + virtual void SAL_CALL disposing(); + virtual void removeElementsNoEvents(sal_Int32 nIndex); + + /** to be overridden if elements which are to be inserted into the container shall be checked + + <p>the ElementDescription given can be used to cache information about the object - it will be passed + later on to implInserted/implReplaced.</p> + */ + virtual void approveNewElement( + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObject, + ElementDescription* _pElement + ); + + virtual ElementDescription* createElementMetaData( ); + + /** inserts an object into our internal structures + + @param _nIndex + the index at which position it should be inserted + @param _bEvents + if <TRUE/>, event knittings will be done + @param _pApprovalResult + must contain the result of an approveNewElement call. Can be <NULL/>, in this case, the approval + is done within implInsert. + @param _bFire + if <TRUE/>, a notification about the insertion will be fired + */ + void implInsert( + sal_Int32 _nIndex, + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObject, + sal_Bool _bEvents /* = sal_True */, + ElementDescription* _pApprovalResult /* = NULL */ , + sal_Bool _bFire /* = sal_True */ + ) throw(::com::sun::star::lang::IllegalArgumentException); + + // called after the object is inserted, but before the "real listeners" are notified + virtual void implInserted( const ElementDescription* /*_pElement*/ ) { } + // called after the object is removed, but before the "real listeners" are notified + virtual void implRemoved(const InterfaceRef& /*_rxObject*/) { } + // called after an object was replaced, but before the "real listeners" are notified + virtual void implReplaced( const InterfaceRef& /*_rxReplacedObject*/, const ElementDescription* /*_pElement*/ ) { } + + void SAL_CALL writeEvents(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream); + void SAL_CALL readEvents(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream); + + /** replace an element, specified by position + + @precond <arg>_nIndex</arg> is a valid index + @precond our mutex is locked exactly once, by the guard specified with <arg>_rClearBeforeNotify</arg> + + */ + void implReplaceByIndex( + const sal_Int32 _nIndex, + const ::com::sun::star::uno::Any& _rNewElement, + ::osl::ClearableMutexGuard& _rClearBeforeNotify + ); + + /** removes an element, specified by position + + @precond <arg>_nIndex</arg> is a valid index + @precond our mutex is locked exactly once, by the guard specified with <arg>_rClearBeforeNotify</arg> + + */ + void implRemoveByIndex( + const sal_Int32 _nIndex, + ::osl::ClearableMutexGuard& _rClearBeforeNotify + ); + + /** validates the given index + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if the given index does not denote a valid position in our childs array + */ + void implCheckIndex( const sal_Int32 _nIndex ) SAL_THROW( ( ::com::sun::star::lang::IndexOutOfBoundsException ) ); + +private: + // the runtime event format has changed from version SO5.2 to OOo + enum EventFormat + { + efVersionSO5x, + efVersionSO6x + }; + void transformEvents( const EventFormat _eTargetFormat ); +}; + +//================================================================== +//= OFormComponents +//================================================================== +typedef ::cppu::ImplHelper1< ::com::sun::star::form::XFormComponent> OFormComponents_BASE; +typedef ::cppu::OComponentHelper FormComponentsBase; + // else MSVC kills itself on some statements +class OFormComponents : public FormComponentsBase, + public OInterfaceContainer, + public OFormComponents_BASE +{ +protected: + ::osl::Mutex m_aMutex; + ::comphelper::InterfaceRef m_xParent; + +public: + OFormComponents(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory); + virtual ~OFormComponents(); + + DECLARE_UNO3_AGG_DEFAULTS(OFormComponents, FormComponentsBase); + + virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException); + +// OComponentHelper + virtual void SAL_CALL disposing(); + +// ::com::sun::star::form::XFormComponent + virtual ::comphelper::InterfaceRef SAL_CALL getParent() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setParent(const ::comphelper::InterfaceRef& Parent) throw(::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); + + // XEventListener + using OInterfaceContainer::disposing; +}; +//......................................................................... +} // namespace frm +//......................................................................... + +}//end of namespace binfilter +#endif // _FRM_INTERFACE_CONTAINER_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/inc/formsmodule.hxx b/bf_forms/source/inc/formsmodule.hxx new file mode 100644 index 000000000..56b734cda --- /dev/null +++ b/bf_forms/source/inc/formsmodule.hxx @@ -0,0 +1,198 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef FORMS_MODULE_HXX +#define FORMS_MODULE_HXX + +#include <cppuhelper/factory.hxx> +namespace binfilter { + +//......................................................................... +namespace frm +{ +//......................................................................... + +typedef ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > (SAL_CALL *FactoryInstantiation) + ( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rServiceManager, + const ::rtl::OUString & _rComponentName, + ::cppu::ComponentInstantiation _pCreateFunction, + const ::com::sun::star::uno::Sequence< ::rtl::OUString > & _rServiceNames, + rtl_ModuleCount* _pModuleCounter + ); + + //========================================================================= + //= OFormsModule + //========================================================================= + class OFormsModule + { + private: + OFormsModule(); + // not implemented. OFormsModule is a static class + + protected: + // auto registration administration + static ::com::sun::star::uno::Sequence< ::rtl::OUString >* + s_pImplementationNames; + static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > >* + s_pSupportedServices; + static ::com::sun::star::uno::Sequence< sal_Int64 >* + s_pCreationFunctionPointers; + static ::com::sun::star::uno::Sequence< sal_Int64 >* + s_pFactoryFunctionPointers; + + public: + /** register a component implementing a service with the given data. + @param _rImplementationName + the implementation name of the component + @param _rServiceNames + the services the component supports + @param _pCreateFunction + a function for creating an instance of the component + @param _pFactoryFunction + a function for creating a factory for that component + @see revokeComponent + */ + static void registerComponent( + const ::rtl::OUString& _rImplementationName, + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rServiceNames, + ::cppu::ComponentInstantiation _pCreateFunction, + FactoryInstantiation _pFactoryFunction); + + /** revoke the registration for the specified component + @param _rImplementationName + the implementation name of the component + */ + static void revokeComponent( + const ::rtl::OUString& _rImplementationName); + + /** creates a Factory for the component with the given implementation name. + <p>Usually used from within component_getFactory.<p/> + @param _rxServiceManager + a pointer to an XMultiServiceFactory interface as got in component_getFactory + @param _pImplementationName + the implementation name of the component + @return + the XInterface access to a factory for the component + */ + static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getComponentFactory( + const ::rtl::OUString& _rImplementationName, + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxServiceManager + ); + + private: + /** ensure that the impl class exists + @precond m_aMutex is guarded when this method gets called + */ + static void ensureImpl(); + }; + + //========================================================================== + //= OMultiInstanceAutoRegistration + //========================================================================== + template <class TYPE> + class OMultiInstanceAutoRegistration + { + public: + /** automatically registeres a multi instance component + <p>Assumed that the template argument has the three methods + <ul> + <li><code>static ::rtl::OUString getImplementationName_Static()</code><li/> + <li><code>static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static()</code><li/> + <li><code>static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > + Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&)</code> + </li> + <ul/> + the instantiation of this object will automatically register the class via <method>OFormsModule::registerComponent</method>. + <p/> + <p>The factory creation function used is <code>::cppu::createSingleFactory</code>.</p> + + @see OOneInstanceAutoRegistration + */ + OMultiInstanceAutoRegistration(); + ~OMultiInstanceAutoRegistration(); + }; + + template <class TYPE> + OMultiInstanceAutoRegistration<TYPE>::OMultiInstanceAutoRegistration() + { + OFormsModule::registerComponent( + TYPE::getImplementationName_Static(), + TYPE::getSupportedServiceNames_Static(), + TYPE::Create, + ::cppu::createSingleFactory + ); + } + + template <class TYPE> + OMultiInstanceAutoRegistration<TYPE>::~OMultiInstanceAutoRegistration() + { + OFormsModule::revokeComponent(TYPE::getImplementationName_Static()); + } + + //========================================================================== + //= OOneInstanceAutoRegistration + //========================================================================== + template <class TYPE> + class OOneInstanceAutoRegistration + { + public: + /** automatically registeres a single instance component + <p>Assumed that the template argument has the three methods + <ul> + <li><code>static ::rtl::OUString getImplementationName_Static()</code><li/> + <li><code>static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static()</code><li/> + <li><code>static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > + Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&)</code> + </li> + <ul/> + the instantiation of this object will automatically register the class via <method>OFormsModule::registerComponent</method>. + <p/> + The factory creation function used is <code>::cppu::createOneInstanceFactory</code>. + @see OOneInstanceAutoRegistration + */ + OOneInstanceAutoRegistration(); + ~OOneInstanceAutoRegistration(); + }; + + template <class TYPE> + OOneInstanceAutoRegistration<TYPE>::OOneInstanceAutoRegistration() + { + OFormsModule::registerComponent( + TYPE::getImplementationName_Static(), + TYPE::getSupportedServiceNames_Static(), + TYPE::Create, + ::cppu::createOneInstanceFactory + ); + } + + template <class TYPE> + OOneInstanceAutoRegistration<TYPE>::~OOneInstanceAutoRegistration() + { + OFormsModule::revokeComponent(TYPE::getImplementationName_Static()); + } + +//......................................................................... +} // namespace frm +//......................................................................... + +}//end of namespace binfilter +#endif // FORMS_MODULE_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/inc/frm_resource.hrc b/bf_forms/source/inc/frm_resource.hrc new file mode 100644 index 000000000..1e206cc3a --- /dev/null +++ b/bf_forms/source/inc/frm_resource.hrc @@ -0,0 +1,52 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _FRM_RESOURCE_HRC_ +#define _FRM_RESOURCE_HRC_ + +#ifndef _SOLAR_HRC +#include <bf_svtools/solar.hrc> +#endif + +//------------------------------------------------------------------------------ +#define RID_FRM_STRINGS_START RID_FORMLAYER_START + + + +//------------------------------------------------------------------------------ +//- String-IDs +#define RID_BASELISTBOX_ERROR_FILLLIST ( RID_FRM_STRINGS_START + 0 ) +#define RID_STR_IMPORT_GRAPHIC ( RID_FRM_STRINGS_START + 1 ) +#define RID_STR_CONTROL_SUBSTITUTED_NAME ( RID_FRM_STRINGS_START + 2 ) +#define RID_STR_CONTROL_SUBSTITUTED_EPXPLAIN ( RID_FRM_STRINGS_START + 3 ) +#define RID_STR_READERROR ( RID_FRM_STRINGS_START + 4 ) +#define RID_STR_CONNECTERROR ( RID_FRM_STRINGS_START + 5 ) +#define RID_ERR_LOADING_FORM ( RID_FRM_STRINGS_START + 6 ) +#define RID_ERR_REFRESHING_FORM ( RID_FRM_STRINGS_START + 7 ) +#define RID_STR_ERR_INSERTRECORD ( RID_FRM_STRINGS_START + 8 ) +#define RID_STR_ERR_UPDATERECORD ( RID_FRM_STRINGS_START + 9 ) +#define RID_STR_ERR_DELETERECORD ( RID_FRM_STRINGS_START + 10 ) +#define RID_STR_ERR_DELETERECORDS ( RID_FRM_STRINGS_START + 11 ) +#define RID_STR_NEED_NON_NULL_OBJECT ( RID_FRM_STRINGS_START + 12 ) +#define RID_STR_OPEN_GRAPHICS ( RID_FRM_STRINGS_START + 13 ) +#define RID_STR_CLEAR_GRAPHICS ( RID_FRM_STRINGS_START + 14 ) +#define RID_STR_INVALIDSTREAM ( RID_FRM_STRINGS_START + 15 ) +#define RID_STR_SYNTAXERROR ( RID_FRM_STRINGS_START + 16 ) + +#endif // _FRM_RESOURCE_HRC_ + diff --git a/bf_forms/source/inc/frm_resource.hxx b/bf_forms/source/inc/frm_resource.hxx new file mode 100644 index 000000000..91aa67929 --- /dev/null +++ b/bf_forms/source/inc/frm_resource.hxx @@ -0,0 +1,72 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _FRM_RESOURCE_HXX_ +#define _FRM_RESOURCE_HXX_ + +#include <rtl/ustring.hxx> +class SimpleResMgr; +namespace binfilter { + +//......................................................................... +namespace frm +{ + +#define FRM_RES_STRING(id) ResourceManager::loadString(id) + + //================================================================== + //= ResourceManager + //= handling ressources within the FormLayer library + //================================================================== + class ResourceManager + { + static SimpleResMgr* m_pImpl; + + private: + // no instantiation allowed + ResourceManager() { } + ~ResourceManager() { } + + // we'll instantiate one static member of the following class, which, in it's dtor, + // ensures that m_pImpl will be deleted + class EnsureDelete + { + public: + EnsureDelete() { } + ~EnsureDelete(); + }; + friend class EnsureDelete; + + protected: + static void ensureImplExists(); + + public: + /** loads the string with the specified resource id from the FormLayer resource file + */ + static ::rtl::OUString loadString(sal_uInt16 _nResId); + }; + +//......................................................................... +} +//......................................................................... + +}//end of namespace binfilter +#endif // _FRM_RESOURCE_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/inc/ids.hxx b/bf_forms/source/inc/ids.hxx new file mode 100644 index 000000000..d71d11409 --- /dev/null +++ b/bf_forms/source/inc/ids.hxx @@ -0,0 +1,31 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _FRM_IDS_HXX_ +#define _FRM_IDS_HXX_ + +#include <bf_svtools/idhelper.hxx> +namespace binfilter { + +DECLARE_IMPLEMENTATIONID_HELPER_SMALL(frm, OImplementationIds) + +}//end of namespace binfilter +#endif // _FRM_IDS_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/inc/limitedformats.hxx b/bf_forms/source/inc/limitedformats.hxx new file mode 100644 index 000000000..d5978fda8 --- /dev/null +++ b/bf_forms/source/inc/limitedformats.hxx @@ -0,0 +1,99 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _FORMS_LIMITED_FORMATS_HXX_ +#define _FORMS_LIMITED_FORMATS_HXX_ + +#include <com/sun/star/util/XNumberFormatsSupplier.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <com/sun/star/beans/XFastPropertySet.hpp> +namespace binfilter { + +//......................................................................... +namespace frm +{ +//......................................................................... + + //===================================================================== + //= OLimitedFormats + //===================================================================== + /** maintains translation tables format key <-> enum value + <p>Used for controls which provide a limited number for (standard) formats, which + should be available as format keys.</p> + */ + class OLimitedFormats + { + private: + static sal_Int32 s_nInstanceCount; + static ::osl::Mutex s_aMutex; + static ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > + s_xStandardFormats; + + protected: + sal_Int32 m_nFormatEnumPropertyHandle; + const sal_Int16 m_nTableId; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XFastPropertySet > + m_xAggregate; + + protected: + /** ctor + <p>The class id is used to determine the translation table to use. All instances which + pass the same value here share one table.</p> + */ + OLimitedFormats( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB, + const sal_Int16 _nClassId + ); + ~OLimitedFormats(); + + protected: + void setAggregateSet( + const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XFastPropertySet >& _rxAggregate, + sal_Int32 _nOriginalPropertyHandle + ); + + protected: + void getFormatKeyPropertyValue( ::com::sun::star::uno::Any& _rValue ) const; + sal_Bool convertFormatKeyPropertyValue( + ::com::sun::star::uno::Any& _rConvertedValue, + ::com::sun::star::uno::Any& _rOldValue, + const ::com::sun::star::uno::Any& _rNewValue + ); + void setFormatKeyPropertyValue( const ::com::sun::star::uno::Any& _rNewValue ); + // setFormatKeyPropertyValue should only be called with a value got from convertFormatKeyPropertyValue! + + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > + getFormatsSupplier() const { return s_xStandardFormats; } + + private: + void acquireSupplier(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB); + void releaseSupplier(); + + static void ensureTableInitialized(const sal_Int16 _nTableId); + static void clearTable(const sal_Int16 _nTableId); + }; + +//......................................................................... +} // namespace frm +//......................................................................... + +}//end of namespace binfilter +#endif // _FORMS_LIMITED_FORMATS_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/inc/property.hrc b/bf_forms/source/inc/property.hrc new file mode 100644 index 000000000..37d7e32d6 --- /dev/null +++ b/bf_forms/source/inc/property.hrc @@ -0,0 +1,396 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _FRM_PROPERTY_HRC_ +#define _FRM_PROPERTY_HRC_ + +#ifndef _RTL_USTRING_HXX_ +#include <rtl/ustring.hxx> +#endif + +#ifndef _FRM_STRINGS_HXX_ +#include "strings.hxx" +#endif + +namespace binfilter { + +//......................................................................... +namespace frm +{ +//......................................................................... + +// PropertyId's, welche eine Zuordnung zu einen PropertyName haben +#define PROPERTY_ID_START 0 + +#define PROPERTY_ID_NAME (PROPERTY_ID_START + 1) +#define PROPERTY_ID_TABINDEX (PROPERTY_ID_START + 2) +#define PROPERTY_ID_CONTROLSOURCE (PROPERTY_ID_START + 3) +#define PROPERTY_ID_MASTERFIELDS (PROPERTY_ID_START + 4) +#define PROPERTY_ID_DATASOURCE (PROPERTY_ID_START + 6) +#define PROPERTY_ID_CLASSID (PROPERTY_ID_START + 9) +#define PROPERTY_ID_CURSORTYPE (PROPERTY_ID_START + 10) +#define PROPERTY_ID_READONLY (PROPERTY_ID_START + 11) +#define PROPERTY_ID_NAVIGATION (PROPERTY_ID_START + 13) +#define PROPERTY_ID_CYCLE (PROPERTY_ID_START + 14) +#define PROPERTY_ID_ALLOWADDITIONS (PROPERTY_ID_START + 15) +#define PROPERTY_ID_ALLOWEDITS (PROPERTY_ID_START + 16) +#define PROPERTY_ID_ALLOWDELETIONS (PROPERTY_ID_START + 17) +#define PROPERTY_ID_CACHESIZE (PROPERTY_ID_START + 19) +#define PROPERTY_ID_LASTDIRTY (PROPERTY_ID_START + 24) +#define PROPERTY_ID_VALUE (PROPERTY_ID_START + 31) // INT32 +#define PROPERTY_ID_FORMATKEY (PROPERTY_ID_START + 33) // UINT32 +#define PROPERTY_ID_SIZE (PROPERTY_ID_START + 37) // UINT32 + // free +#define PROPERTY_ID_WIDTH (PROPERTY_ID_START + 42) // UINT16 +#define PROPERTY_ID_DEFAULTCONTROL (PROPERTY_ID_START + 43) // string +#define PROPERTY_ID_BOUNDCOLUMN (PROPERTY_ID_START + 44) // UINT16 may be null +#define PROPERTY_ID_LISTSOURCETYPE (PROPERTY_ID_START + 45) // UINT16 +#define PROPERTY_ID_LISTSOURCE (PROPERTY_ID_START + 46) // string + // free +#define PROPERTY_ID_TEXT (PROPERTY_ID_START + 48) // string +#define PROPERTY_ID_STRINGITEMLIST (PROPERTY_ID_START + 49) // wsstringsequence +#define PROPERTY_ID_LABEL (PROPERTY_ID_START + 50) // string +#define PROPERTY_ID_STATE (PROPERTY_ID_START + 52) // UINT16 + // free +#define PROPERTY_ID_FONT (PROPERTY_ID_START + 54) // font +#define PROPERTY_ID_HASNAVIGATION (PROPERTY_ID_START + 55) +#define PROPERTY_ID_ROWHEIGHT (PROPERTY_ID_START + 57) // UINT16 +#define PROPERTY_ID_BACKGROUNDCOLOR (PROPERTY_ID_START + 58) // UINT32 +#define PROPERTY_ID_FILLCOLOR (PROPERTY_ID_START + 59) // UINT32 +#define PROPERTY_ID_TEXTCOLOR (PROPERTY_ID_START + 60) // UINT32 +#define PROPERTY_ID_LINECOLOR (PROPERTY_ID_START + 61) // UINT32 +#define PROPERTY_ID_BORDER (PROPERTY_ID_START + 62) // UINT16 +#define PROPERTY_ID_ALIGN (PROPERTY_ID_START + 63) // UINT16 +#define PROPERTY_ID_DROPDOWN (PROPERTY_ID_START + 64) // BOOL +#define PROPERTY_ID_MULTI (PROPERTY_ID_START + 65) // BOOL +#define PROPERTY_ID_HSCROLL (PROPERTY_ID_START + 66) // BOOL +#define PROPERTY_ID_VSCROLL (PROPERTY_ID_START + 67) // BOOL +#define PROPERTY_ID_TABSTOP (PROPERTY_ID_START + 68) // BOOL +#define PROPERTY_ID_REFVALUE (PROPERTY_ID_START + 69) // ::rtl::OUString +#define PROPERTY_ID_BUTTONTYPE (PROPERTY_ID_START + 70) // UINT16 +#define PROPERTY_ID_DEFAULT_TEXT (PROPERTY_ID_START + 71) // ::rtl::OUString +#define PROPERTY_ID_SUBMIT_ACTION (PROPERTY_ID_START + 72) // string +#define PROPERTY_ID_SUBMIT_METHOD (PROPERTY_ID_START + 73) // FmSubmitMethod +#define PROPERTY_ID_SUBMIT_ENCODING (PROPERTY_ID_START + 74) // FmSubmitEncoding +#define PROPERTY_ID_DEFAULT_VALUE (PROPERTY_ID_START + 75) // ::rtl::OUString +#define PROPERTY_ID_SUBMIT_TARGET (PROPERTY_ID_START + 76) // ::rtl::OUString +#define PROPERTY_ID_DEFAULTCHECKED (PROPERTY_ID_START + 77) // UINT16 +#define PROPERTY_ID_VALUE_SEQ (PROPERTY_ID_START + 78) // StringSeq +#define PROPERTY_ID_IMAGE_URL (PROPERTY_ID_START + 79) // ::rtl::OUString +#define PROPERTY_ID_SELECT_SEQ (PROPERTY_ID_START + 91) // INT16Seq +#define PROPERTY_ID_DEFAULT_SELECT_SEQ (PROPERTY_ID_START + 92) // INT16Seq +#define PROPERTY_ID_MULTISELECTION (PROPERTY_ID_START + 93) // BOOL +#define PROPERTY_ID_MULTILINE (PROPERTY_ID_START + 94) // BOOL +#define PROPERTY_ID_DATE (PROPERTY_ID_START + 95) // UINT32 +#define PROPERTY_ID_DATEMIN (PROPERTY_ID_START + 96) // UINT32 +#define PROPERTY_ID_DATEMAX (PROPERTY_ID_START + 97) // UINT32 +#define PROPERTY_ID_DATEFORMAT (PROPERTY_ID_START + 98) // UINT16 +#define PROPERTY_ID_TIME (PROPERTY_ID_START + 99) // UINT32 +#define PROPERTY_ID_TIMEMIN (PROPERTY_ID_START +100) // UINT32 +#define PROPERTY_ID_TIMEMAX (PROPERTY_ID_START +101) // UINT32 +#define PROPERTY_ID_TIMEFORMAT (PROPERTY_ID_START +102) // UINT16 +#define PROPERTY_ID_VALUEMIN (PROPERTY_ID_START +103) // INT32 +#define PROPERTY_ID_VALUEMAX (PROPERTY_ID_START +104) // INT32 +#define PROPERTY_ID_VALUESTEP (PROPERTY_ID_START +105) // INT32 +#define PROPERTY_ID_CURRENCYSYMBOL (PROPERTY_ID_START +106) // ::rtl::OUString +#define PROPERTY_ID_EDITMASK (PROPERTY_ID_START +107) // ::rtl::OUString +#define PROPERTY_ID_LITERALMASK (PROPERTY_ID_START +108) // ::rtl::OUString +#define PROPERTY_ID_ENABLED (PROPERTY_ID_START +109) // BOOL +#define PROPERTY_ID_AUTOCOMPLETE (PROPERTY_ID_START +110) // BOOL +#define PROPERTY_ID_LINECOUNT (PROPERTY_ID_START +111) // UINT16 +#define PROPERTY_ID_MAXTEXTLEN (PROPERTY_ID_START +112) // UINT16 +#define PROPERTY_ID_SPIN (PROPERTY_ID_START +113) // BOOL +#define PROPERTY_ID_STRICTFORMAT (PROPERTY_ID_START +114) // BOOL +#define PROPERTY_ID_SHOWTHOUSANDSEP (PROPERTY_ID_START +115) // BOOL +#define PROPERTY_ID_HARDLINEBREAKS (PROPERTY_ID_START +116) // BOOL +#define PROPERTY_ID_PRINTABLE (PROPERTY_ID_START +117) // BOOL +#define PROPERTY_ID_TARGET_URL (PROPERTY_ID_START +118) // ::rtl::OUString +#define PROPERTY_ID_TARGET_FRAME (PROPERTY_ID_START +119) // ::rtl::OUString +#define PROPERTY_ID_TAG (PROPERTY_ID_START +120) // ::rtl::OUString +#define PROPERTY_ID_ECHO_CHAR (PROPERTY_ID_START +121) // UINT16 +#define PROPERTY_ID_EMPTY_IS_NULL (PROPERTY_ID_START +126) // Bool +#define PROPERTY_ID_DECIMAL_ACCURACY (PROPERTY_ID_START +127) // UINT16 +#define PROPERTY_ID_DATE_SHOW_CENTURY (PROPERTY_ID_START +128) // Bool +#define PROPERTY_ID_TRISTATE (PROPERTY_ID_START +129) // Bool +#define PROPERTY_ID_DEFAULT_BUTTON (PROPERTY_ID_START +130) // Bool +#define PROPERTY_ID_HIDDEN_VALUE (PROPERTY_ID_START +131) // ::rtl::OUString +#define PROPERTY_ID_DECIMALS (PROPERTY_ID_START +132) // UINT16 +#define PROPERTY_ID_AUTOINCREMENT (PROPERTY_ID_START +133) // UINT16 +#define PROPERTY_ID_FILTER_CRITERIA (PROPERTY_ID_START +135) // ::rtl::OUString +#define PROPERTY_ID_QUERY (PROPERTY_ID_START +137) // ::rtl::OUString +#define PROPERTY_ID_DEFAULT_LONG_VALUE (PROPERTY_ID_START +138) // Double +#define PROPERTY_ID_DEFAULT_DATE (PROPERTY_ID_START +139) // UINT32 +#define PROPERTY_ID_DEFAULT_TIME (PROPERTY_ID_START +140) +#define PROPERTY_ID_HELPTEXT (PROPERTY_ID_START +141) +#define PROPERTY_ID_FONT_NAME (PROPERTY_ID_START +142) +#define PROPERTY_ID_FONT_STYLENAME (PROPERTY_ID_START +143) +#define PROPERTY_ID_FONT_FAMILY (PROPERTY_ID_START +144) +#define PROPERTY_ID_FONT_CHARSET (PROPERTY_ID_START +145) +#define PROPERTY_ID_FONT_HEIGHT (PROPERTY_ID_START +146) +#define PROPERTY_ID_FONT_WEIGHT (PROPERTY_ID_START +147) +#define PROPERTY_ID_FONT_SLANT (PROPERTY_ID_START +148) +#define PROPERTY_ID_FONT_UNDERLINE (PROPERTY_ID_START +149) +#define PROPERTY_ID_FONT_STRIKEOUT (PROPERTY_ID_START +150) +#define PROPERTY_ID_ISPASSTHROUGH (PROPERTY_ID_START +151) +#define PROPERTY_ID_HELPURL (PROPERTY_ID_START +152) // ::rtl::OUString +#define PROPERTY_ID_RECORDMARKER (PROPERTY_ID_START +153) +#define PROPERTY_ID_BOUNDFIELD (PROPERTY_ID_START +154) +#define PROPERTY_ID_FORMATSSUPPLIER (PROPERTY_ID_START +155) // XNumberFormatsSupplier +#define PROPERTY_ID_TREATASNUMERIC (PROPERTY_ID_START +156) // BOOL +#define PROPERTY_ID_EFFECTIVE_VALUE (PROPERTY_ID_START +157) // ANY (string or double) +#define PROPERTY_ID_EFFECTIVE_DEFAULT (PROPERTY_ID_START +158) // dito +#define PROPERTY_ID_EFFECTIVE_MIN (PROPERTY_ID_START +159) // dito +#define PROPERTY_ID_EFFECTIVE_MAX (PROPERTY_ID_START +160) // dito +#define PROPERTY_ID_HIDDEN (PROPERTY_ID_START +161) // BOOL +#define PROPERTY_ID_FILTERPROPOSAL (PROPERTY_ID_START +162) // BOOL +#define PROPERTY_ID_FIELDSOURCE (PROPERTY_ID_START +163) // String +#define PROPERTY_ID_TABLENAME (PROPERTY_ID_START +164) // String +#define PROPERTY_ID_FILTERSUPPLIER (PROPERTY_ID_START +165) // XIndexAccess +#define PROPERTY_ID_CURRENTFILTER (PROPERTY_ID_START +166) // INT32 +#define PROPERTY_ID_SELECTED_FIELDS (PROPERTY_ID_START +167) +#define PROPERTY_ID_SELECTED_TABLES (PROPERTY_ID_START +168) +#define PROPERTY_ID_THREADSAFE (PROPERTY_ID_START +169) // BOOL +#define PROPERTY_ID_CONTROLLABEL (PROPERTY_ID_START +171) // XPropertySet +#define PROPERTY_ID_CURRSYM_POSITION (PROPERTY_ID_START +172) // String +#define PROPERTY_ID_SOURCE (PROPERTY_ID_START +173) // XInterface +#define PROPERTY_ID_CURSORCOLOR (PROPERTY_ID_START +174) // INT32 +#define PROPERTY_ID_ALWAYSSHOWCURSOR (PROPERTY_ID_START +175) // BOOL +#define PROPERTY_ID_DISPLAYSYNCHRON (PROPERTY_ID_START +176) // BOOL + +#define PROPERTY_ID_ISMODIFIED (PROPERTY_ID_START +177) // BOOL +#define PROPERTY_ID_ISNEW (PROPERTY_ID_START +178) // BOOL +#define PROPERTY_ID_PRIVILEGES (PROPERTY_ID_START +179) // INT32 +#define PROPERTY_ID_DETAILFIELDS (PROPERTY_ID_START +180) // Sequence< ::rtl::OUString > +#define PROPERTY_ID_COMMAND (PROPERTY_ID_START +181) // String +#define PROPERTY_ID_COMMANDTYPE (PROPERTY_ID_START +182) // INT32 (com::sun::star::sdb::CommandType) +#define PROPERTY_ID_RESULTSET_CONCURRENCY (PROPERTY_ID_START +183)// INT32 (com::sun::star::sdbc::ResultSetConcurrency) +#define PROPERTY_ID_INSERTONLY (PROPERTY_ID_START +184) // BOOL +#define PROPERTY_ID_RESULTSET_TYPE (PROPERTY_ID_START +185) // INT32 (com::sun::star::sdbc::ResultSetType) +#define PROPERTY_ID_ESCAPE_PROCESSING (PROPERTY_ID_START +186) // BOOL +#define PROPERTY_ID_APPLYFILTER (PROPERTY_ID_START +187) // BOOL + +#define PROPERTY_ID_ISNULLABLE (PROPERTY_ID_START +188) // BOOL +#define PROPERTY_ID_ACTIVECOMMAND (PROPERTY_ID_START +189) // String +#define PROPERTY_ID_ISCURRENCY (PROPERTY_ID_START +190) // BOOL +#define PROPERTY_ID_URL (PROPERTY_ID_START +192) // String +#define PROPERTY_ID_TITLE (PROPERTY_ID_START +193) // String +#define PROPERTY_ID_ACTIVE_CONNECTION (PROPERTY_ID_START +194) // com::sun::star::sdbc::XConnection +#define PROPERTY_ID_SCALE (PROPERTY_ID_START +195) // INT32 +#define PROPERTY_ID_SORT (PROPERTY_ID_START +196) // String + +#define PROPERTY_ID_ROWCOUNT (PROPERTY_ID_START +197) +#define PROPERTY_ID_ROWCOUNTFINAL (PROPERTY_ID_START +198) +#define PROPERTY_ID_FETCHSIZE (PROPERTY_ID_START +199) +#define PROPERTY_ID_STATEMENT (PROPERTY_ID_START +200) +#define PROPERTY_ID_SEARCHABLE (PROPERTY_ID_START +201) +#define PROPERTY_ID_ISREADONLY (PROPERTY_ID_START +202) +#define PROPERTY_ID_ISREQUIRED (PROPERTY_ID_START +203) +#define PROPERTY_ID_FIELDTYPE (PROPERTY_ID_START +204) +#define PROPERTY_ID_COLUMNSERVICENAME (PROPERTY_ID_START +205) +#define PROPERTY_ID_CONTROLSOURCEPROPERTY (PROPERTY_ID_START +206) +#define PROPERTY_ID_REALNAME (PROPERTY_ID_START +207) +#define PROPERTY_ID_FONT_WORDLINEMODE (PROPERTY_ID_START +208) +#define PROPERTY_ID_TEXTLINECOLOR (PROPERTY_ID_START +209) +#define PROPERTY_ID_FONTEMPHASISMARK (PROPERTY_ID_START +210) +#define PROPERTY_ID_FONTRELIEF (PROPERTY_ID_START +211) + +#define PROPERTY_ID_DISPATCHURLINTERNAL (PROPERTY_ID_START +212) // BOOL + +#define PROPERTY_ID_PERSISTENCE_MAXTEXTLENGTH (PROPERTY_ID_START +213) // sal_Int16 + + +// start ID fuer aggregierte Properties +#define PROPERTY_ID_AGGREGATE_ID (PROPERTY_ID_START + 10000) + +// extern declaration fuer vordefinierte Strings, laengst nicht vollstaendig +DECLARE_CONSTASCII_USTRING(PROPERTY_NAME); +DECLARE_CONSTASCII_USTRING(PROPERTY_TAG); +DECLARE_CONSTASCII_USTRING(PROPERTY_TABINDEX); +DECLARE_CONSTASCII_USTRING(PROPERTY_CLASSID); +DECLARE_CONSTASCII_USTRING(PROPERTY_ALIGN); +DECLARE_CONSTASCII_USTRING(PROPERTY_ROWCOUNT); +DECLARE_CONSTASCII_USTRING(PROPERTY_ROWCOUNTFINAL); +DECLARE_CONSTASCII_USTRING(PROPERTY_FETCHSIZE); +DECLARE_CONSTASCII_USTRING(PROPERTY_VALUE); +DECLARE_CONSTASCII_USTRING(PROPERTY_VALUEMIN); +DECLARE_CONSTASCII_USTRING(PROPERTY_VALUEMAX); +DECLARE_CONSTASCII_USTRING(PROPERTY_VALUESTEP); +DECLARE_CONSTASCII_USTRING(PROPERTY_TEXT); +DECLARE_CONSTASCII_USTRING(PROPERTY_LABEL); +DECLARE_CONSTASCII_USTRING(PROPERTY_NAVIGATION); +DECLARE_CONSTASCII_USTRING(PROPERTY_CYCLE); +DECLARE_CONSTASCII_USTRING(PROPERTY_CONTROLSOURCE); +DECLARE_CONSTASCII_USTRING(PROPERTY_ENABLED); +DECLARE_CONSTASCII_USTRING(PROPERTY_SPIN); +DECLARE_CONSTASCII_USTRING(PROPERTY_READONLY); +DECLARE_CONSTASCII_USTRING(PROPERTY_FILTER_CRITERIA); +DECLARE_CONSTASCII_USTRING(PROPERTY_AUTOINCREMENT); +DECLARE_CONSTASCII_USTRING(PROPERTY_CACHESIZE); +DECLARE_CONSTASCII_USTRING(PROPERTY_LASTDIRTY); +DECLARE_CONSTASCII_USTRING(PROPERTY_STATEMENT); +DECLARE_CONSTASCII_USTRING(PROPERTY_WIDTH); +DECLARE_CONSTASCII_USTRING(PROPERTY_SEARCHABLE); +DECLARE_CONSTASCII_USTRING(PROPERTY_MULTILINE); +DECLARE_CONSTASCII_USTRING(PROPERTY_TARGET_URL); +DECLARE_CONSTASCII_USTRING(PROPERTY_DEFAULTCONTROL); +DECLARE_CONSTASCII_USTRING(PROPERTY_MAXTEXTLEN); +DECLARE_CONSTASCII_USTRING(PROPERTY_SIZE); +DECLARE_CONSTASCII_USTRING(PROPERTY_DATE); +DECLARE_CONSTASCII_USTRING(PROPERTY_TIME); +DECLARE_CONSTASCII_USTRING(PROPERTY_STATE); +DECLARE_CONSTASCII_USTRING(PROPERTY_TRISTATE); +DECLARE_CONSTASCII_USTRING(PROPERTY_HIDDEN_VALUE); +DECLARE_CONSTASCII_USTRING(PROPERTY_TARGET_FRAME); +DECLARE_CONSTASCII_USTRING(PROPERTY_BUTTONTYPE); +DECLARE_CONSTASCII_USTRING(PROPERTY_STRINGITEMLIST); +DECLARE_CONSTASCII_USTRING(PROPERTY_DEFAULT_TEXT); +DECLARE_CONSTASCII_USTRING(PROPERTY_DEFAULTCHECKED); +DECLARE_CONSTASCII_USTRING(PROPERTY_DEFAULT_DATE); +DECLARE_CONSTASCII_USTRING(PROPERTY_DEFAULT_TIME); +DECLARE_CONSTASCII_USTRING(PROPERTY_DEFAULT_VALUE); +DECLARE_CONSTASCII_USTRING(PROPERTY_FORMATKEY); +DECLARE_CONSTASCII_USTRING(PROPERTY_FORMATSSUPPLIER); +DECLARE_CONSTASCII_USTRING(PROPERTY_SUBMIT_ACTION); +DECLARE_CONSTASCII_USTRING(PROPERTY_SUBMIT_TARGET); +DECLARE_CONSTASCII_USTRING(PROPERTY_SUBMIT_METHOD); +DECLARE_CONSTASCII_USTRING(PROPERTY_SUBMIT_ENCODING); +DECLARE_CONSTASCII_USTRING(PROPERTY_IMAGE_URL); +DECLARE_CONSTASCII_USTRING(PROPERTY_EMPTY_IS_NULL); +DECLARE_CONSTASCII_USTRING(PROPERTY_LISTSOURCETYPE); +DECLARE_CONSTASCII_USTRING(PROPERTY_LISTSOURCE); +DECLARE_CONSTASCII_USTRING(PROPERTY_SELECT_SEQ); +DECLARE_CONSTASCII_USTRING(PROPERTY_VALUE_SEQ); +DECLARE_CONSTASCII_USTRING(PROPERTY_DEFAULT_SELECT_SEQ); +DECLARE_CONSTASCII_USTRING(PROPERTY_MULTISELECTION); +DECLARE_CONSTASCII_USTRING(PROPERTY_DECIMAL_ACCURACY); +DECLARE_CONSTASCII_USTRING(PROPERTY_EDITMASK); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISREADONLY); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISREQUIRED); +DECLARE_CONSTASCII_USTRING(PROPERTY_FIELDTYPE); +DECLARE_CONSTASCII_USTRING(PROPERTY_DECIMALS); +DECLARE_CONSTASCII_USTRING(PROPERTY_REFVALUE); +DECLARE_CONSTASCII_USTRING(PROPERTY_STRICTFORMAT); +DECLARE_CONSTASCII_USTRING(PROPERTY_DATASOURCE); +DECLARE_CONSTASCII_USTRING(PROPERTY_ALLOWADDITIONS); +DECLARE_CONSTASCII_USTRING(PROPERTY_ALLOWEDITS); +DECLARE_CONSTASCII_USTRING(PROPERTY_ALLOWDELETIONS); +DECLARE_CONSTASCII_USTRING(PROPERTY_MASTERFIELDS); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISPASSTHROUGH); +DECLARE_CONSTASCII_USTRING(PROPERTY_QUERY); +DECLARE_CONSTASCII_USTRING(PROPERTY_LITERALMASK); +DECLARE_CONSTASCII_USTRING(PROPERTY_SHOWTHOUSANDSEP); +DECLARE_CONSTASCII_USTRING(PROPERTY_CURRENCYSYMBOL); +DECLARE_CONSTASCII_USTRING(PROPERTY_DATEFORMAT); +DECLARE_CONSTASCII_USTRING(PROPERTY_DATEMIN); +DECLARE_CONSTASCII_USTRING(PROPERTY_DATEMAX); +DECLARE_CONSTASCII_USTRING(PROPERTY_DATE_SHOW_CENTURY); +DECLARE_CONSTASCII_USTRING(PROPERTY_TIMEFORMAT); +DECLARE_CONSTASCII_USTRING(PROPERTY_TIMEMIN); +DECLARE_CONSTASCII_USTRING(PROPERTY_TIMEMAX); +DECLARE_CONSTASCII_USTRING(PROPERTY_LINECOUNT); +DECLARE_CONSTASCII_USTRING(PROPERTY_BOUNDCOLUMN); +DECLARE_CONSTASCII_USTRING(PROPERTY_HASNAVIGATION); +DECLARE_CONSTASCII_USTRING(PROPERTY_FONT); +DECLARE_CONSTASCII_USTRING(PROPERTY_BACKGROUNDCOLOR); +DECLARE_CONSTASCII_USTRING(PROPERTY_FILLCOLOR); +DECLARE_CONSTASCII_USTRING(PROPERTY_TEXTCOLOR); +DECLARE_CONSTASCII_USTRING(PROPERTY_LINECOLOR); +DECLARE_CONSTASCII_USTRING(PROPERTY_BORDER); +DECLARE_CONSTASCII_USTRING(PROPERTY_DROPDOWN); +DECLARE_CONSTASCII_USTRING(PROPERTY_MULTI); +DECLARE_CONSTASCII_USTRING(PROPERTY_HSCROLL); +DECLARE_CONSTASCII_USTRING(PROPERTY_VSCROLL); +DECLARE_CONSTASCII_USTRING(PROPERTY_TABSTOP); +DECLARE_CONSTASCII_USTRING(PROPERTY_AUTOCOMPLETE); +DECLARE_CONSTASCII_USTRING(PROPERTY_HARDLINEBREAKS); +DECLARE_CONSTASCII_USTRING(PROPERTY_PRINTABLE); +DECLARE_CONSTASCII_USTRING(PROPERTY_ECHO_CHAR); +DECLARE_CONSTASCII_USTRING(PROPERTY_ROWHEIGHT); +DECLARE_CONSTASCII_USTRING(PROPERTY_HELPTEXT); +DECLARE_CONSTASCII_USTRING(PROPERTY_FONT_NAME); +DECLARE_CONSTASCII_USTRING(PROPERTY_FONT_STYLENAME); +DECLARE_CONSTASCII_USTRING(PROPERTY_FONT_FAMILY); +DECLARE_CONSTASCII_USTRING(PROPERTY_FONT_CHARSET); +DECLARE_CONSTASCII_USTRING(PROPERTY_FONT_HEIGHT); +DECLARE_CONSTASCII_USTRING(PROPERTY_FONT_WEIGHT); +DECLARE_CONSTASCII_USTRING(PROPERTY_FONT_SLANT); +DECLARE_CONSTASCII_USTRING(PROPERTY_FONT_UNDERLINE); +DECLARE_CONSTASCII_USTRING(PROPERTY_FONT_WORDLINEMODE); +DECLARE_CONSTASCII_USTRING(PROPERTY_FONT_STRIKEOUT); +DECLARE_CONSTASCII_USTRING(PROPERTY_TEXTLINECOLOR); +DECLARE_CONSTASCII_USTRING(PROPERTY_FONTEMPHASISMARK); +DECLARE_CONSTASCII_USTRING(PROPERTY_FONTRELIEF); +DECLARE_CONSTASCII_USTRING(PROPERTY_HELPURL); +DECLARE_CONSTASCII_USTRING(PROPERTY_RECORDMARKER); +DECLARE_CONSTASCII_USTRING(PROPERTY_BOUNDFIELD); +DECLARE_CONSTASCII_USTRING(PROPERTY_TREATASNUMERIC); +DECLARE_CONSTASCII_USTRING(PROPERTY_EFFECTIVE_VALUE); +DECLARE_CONSTASCII_USTRING(PROPERTY_EFFECTIVE_DEFAULT); +DECLARE_CONSTASCII_USTRING(PROPERTY_EFFECTIVE_MIN); +DECLARE_CONSTASCII_USTRING(PROPERTY_EFFECTIVE_MAX); +DECLARE_CONSTASCII_USTRING(PROPERTY_HIDDEN); +DECLARE_CONSTASCII_USTRING(PROPERTY_FILTERPROPOSAL); +DECLARE_CONSTASCII_USTRING(PROPERTY_FIELDSOURCE); +DECLARE_CONSTASCII_USTRING(PROPERTY_TABLENAME); +DECLARE_CONSTASCII_USTRING(PROPERTY_FILTERSUPPLIER); +DECLARE_CONSTASCII_USTRING(PROPERTY_CURRENTFILTER); +DECLARE_CONSTASCII_USTRING(PROPERTY_SELECTED_FIELDS); +DECLARE_CONSTASCII_USTRING(PROPERTY_SELECTED_TABLES); +DECLARE_CONSTASCII_USTRING(PROPERTY_THREADSAFE); +DECLARE_CONSTASCII_USTRING(PROPERTY_CONTROLLABEL); +DECLARE_CONSTASCII_USTRING(PROPERTY_CURRSYM_POSITION); +DECLARE_CONSTASCII_USTRING(PROPERTY_SOURCE); +DECLARE_CONSTASCII_USTRING(PROPERTY_CURSORCOLOR); +DECLARE_CONSTASCII_USTRING(PROPERTY_ALWAYSSHOWCURSOR); +DECLARE_CONSTASCII_USTRING(PROPERTY_DISPLAYSYNCHRON); + +DECLARE_CONSTASCII_USTRING(PROPERTY_ISMODIFIED); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISNEW); +DECLARE_CONSTASCII_USTRING(PROPERTY_PRIVILEGES); +DECLARE_CONSTASCII_USTRING(PROPERTY_DETAILFIELDS); +DECLARE_CONSTASCII_USTRING(PROPERTY_COMMAND); +DECLARE_CONSTASCII_USTRING(PROPERTY_COMMANDTYPE); +DECLARE_CONSTASCII_USTRING(PROPERTY_RESULTSET_CONCURRENCY); +DECLARE_CONSTASCII_USTRING(PROPERTY_INSERTONLY); +DECLARE_CONSTASCII_USTRING(PROPERTY_RESULTSET_TYPE); +DECLARE_CONSTASCII_USTRING(PROPERTY_ESCAPE_PROCESSING); +DECLARE_CONSTASCII_USTRING(PROPERTY_APPLYFILTER); + +DECLARE_CONSTASCII_USTRING(PROPERTY_ISNULLABLE); +DECLARE_CONSTASCII_USTRING(PROPERTY_ACTIVECOMMAND); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISCURRENCY); +DECLARE_CONSTASCII_USTRING(PROPERTY_URL); +DECLARE_CONSTASCII_USTRING(PROPERTY_TITLE); +DECLARE_CONSTASCII_USTRING(PROPERTY_ACTIVE_CONNECTION); +DECLARE_CONSTASCII_USTRING(PROPERTY_SCALE); +DECLARE_CONSTASCII_USTRING(PROPERTY_SORT); +DECLARE_CONSTASCII_USTRING(PROPERTY_COLUMNSERVICENAME); +DECLARE_CONSTASCII_USTRING(PROPERTY_CONTROLSOURCEPROPERTY); +DECLARE_CONSTASCII_USTRING(PROPERTY_REALNAME); +DECLARE_CONSTASCII_USTRING(PROPERTY_USER); +DECLARE_CONSTASCII_USTRING(PROPERTY_PASSWORD); +DECLARE_CONSTASCII_USTRING(PROPERTY_DISPATCHURLINTERNAL); + +DECLARE_CONSTASCII_USTRING(PROPERTY_PERSISTENCE_MAXTEXTLENGTH); + +//......................................................................... +} +//......................................................................... +}// namespace binfilter + +#endif // _FRM_PROPERTY_HRC_ + diff --git a/bf_forms/source/inc/property.hxx b/bf_forms/source/inc/property.hxx new file mode 100644 index 000000000..18e45e547 --- /dev/null +++ b/bf_forms/source/inc/property.hxx @@ -0,0 +1,191 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _FRM_PROPERTY_HXX_ +#define _FRM_PROPERTY_HXX_ + + + +#include <comphelper/propagg.hxx> +#include <comphelper/stl_types.hxx> +namespace binfilter { + + using namespace ::comphelper; + +//========================================================================= +//= property helper classes +//========================================================================= + +//... namespace frm ....................................................... +namespace frm +{ +//......................................................................... + +//================================================================== +//= assigment property handle <-> property name +//= used by the PropertySetAggregationHelper +//================================================================== + +class PropertyInfoService +{ + //.................................................................. + struct PropertyAssignment + { + ::rtl::OUString sName; + sal_Int32 nHandle; + + PropertyAssignment() { nHandle = -1; } + PropertyAssignment(const PropertyAssignment& _rSource) + :sName(_rSource.sName), nHandle(_rSource.nHandle) { } + PropertyAssignment(const ::rtl::OUString& _rName, sal_Int32 _nHandle) + :sName(_rName), nHandle(_nHandle) { } + + }; + + DECLARE_STL_VECTOR(PropertyAssignment, PropertyMap); + static PropertyMap s_AllKnownProperties; + + //.................................................................. + // comparing two PropertyAssignment's +public: + typedef PropertyAssignment PUBLIC_SOLARIS_COMPILER_HACK; + // did not get the following compiled under with SUNPRO 5 without this + // public typedef +private: + friend struct PropertyAssignmentNameCompareLess; + typedef ::std::binary_function< PUBLIC_SOLARIS_COMPILER_HACK, PUBLIC_SOLARIS_COMPILER_HACK, sal_Bool > PropertyAssignmentNameCompareLess_Base; + struct PropertyAssignmentNameCompareLess : public PropertyAssignmentNameCompareLess_Base + { + inline sal_Bool operator() (const PUBLIC_SOLARIS_COMPILER_HACK& _rL, const PUBLIC_SOLARIS_COMPILER_HACK& _rR) const + { + return (_rL.sName.compareTo(_rR.sName) < 0); + } + }; + +public: + PropertyInfoService() { } + +public: + static sal_Int32 getPropertyId(const ::rtl::OUString& _rName); + static ::rtl::OUString getPropertyName(sal_Int32 _nHandle); + +private: + static void initialize(); +}; + +//.................................................................. +// a class implementing the comphelper::IPropertyInfoService +class ConcretInfoService : public ::comphelper::IPropertyInfoService +{ +public: + virtual ~ConcretInfoService() {} + + virtual sal_Int32 getPreferedPropertyId(const ::rtl::OUString& _rName); +}; + +//------------------------------------------------------------------------------ +#define DECL_PROP_IMPL(varname, type) \ + pProps[nPos++] = com::sun::star::beans::Property(PROPERTY_##varname, PROPERTY_ID_##varname, ::getCppuType(reinterpret_cast< type* >(NULL)), + +//------------------------------------------------------------------------------ +#define DECL_BOOL_PROP_IMPL(varname) \ +pProps[nPos++] = com::sun::star::beans::Property(PROPERTY_##varname, PROPERTY_ID_##varname, ::getBooleanCppuType(), + +//------------------------------------------------------------------------------ +#define DECL_IFACE_PROP_IMPL(varname, type) \ +pProps[nPos++] = com::sun::star::beans::Property(PROPERTY_##varname, PROPERTY_ID_##varname, ::getCppuType(reinterpret_cast< com::sun::star::uno::Reference< type >* >(NULL)), + +//------------------------------------------------------------------------------ +#define BEGIN_AGGREGATION_PROPERTY_HELPER(count, aggregate) \ + _rProps.realloc(count); \ + com::sun::star::beans::Property* pProps = _rProps.getArray(); \ + sal_Int32 nPos = 0; \ + \ + if (aggregate.is()) \ + _rAggregateProps = aggregate->getPropertySetInfo()->getProperties(); \ + +// === +//------------------------------------------------------------------------------ +#define DECL_PROP0(varname, type) \ + DECL_PROP_IMPL(varname, type) 0) + +//------------------------------------------------------------------------------ +#define DECL_PROP1(varname, type, attrib1) \ + DECL_PROP_IMPL(varname, type) com::sun::star::beans::PropertyAttribute::attrib1) + +//------------------------------------------------------------------------------ +#define DECL_PROP2(varname, type, attrib1, attrib2) \ + DECL_PROP_IMPL(varname, type) com::sun::star::beans::PropertyAttribute::attrib1 | com::sun::star::beans::PropertyAttribute::attrib2) + +//------------------------------------------------------------------------------ +#define DECL_PROP3(varname, type, attrib1, attrib2, attrib3) \ + DECL_PROP_IMPL(varname, type) com::sun::star::beans::PropertyAttribute::attrib1 | com::sun::star::beans::PropertyAttribute::attrib2 | com::sun::star::beans::PropertyAttribute::attrib3) + +//------------------------------------------------------------------------------ +#define DECL_PROP4(varname, type, attrib1, attrib2, attrib3, attrib4) \ + DECL_PROP_IMPL(varname, type) com::sun::star::beans::PropertyAttribute::attrib1 | com::sun::star::beans::PropertyAttribute::attrib2 | com::sun::star::beans::PropertyAttribute::attrib3 | com::sun::star::beans::PropertyAttribute::attrib4) + +// === some property types require special handling +// === such as interfaces +//------------------------------------------------------------------------------ +#define DECL_IFACE_PROP0(varname, type) \ + DECL_IFACE_PROP_IMPL(varname, type) 0) + +//------------------------------------------------------------------------------ +#define DECL_IFACE_PROP1(varname, type, attrib1) \ + DECL_IFACE_PROP_IMPL(varname, type) starbeans::PropertyAttribute::attrib1) + +//------------------------------------------------------------------------------ +#define DECL_IFACE_PROP2(varname, type, attrib1, attrib2) \ + DECL_IFACE_PROP_IMPL(varname, type) com::sun::star::beans::PropertyAttribute::attrib1 | com::sun::star::beans::PropertyAttribute::attrib2) + +//------------------------------------------------------------------------------ +#define DECL_IFACE_PROP3(varname, type, attrib1, attrib2, attrib3) \ + DECL_IFACE_PROP_IMPL(varname, type) starbeans::PropertyAttribute::attrib1 | starbeans::PropertyAttribute::attrib2 | starbeans::PropertyAttribute::attrib3) + +//------------------------------------------------------------------------------ +#define DECL_IFACE_PROP4(varname, type, attrib1, attrib2, attrib3, attrib4) \ + DECL_IFACE_PROP_IMPL(varname, type) starbeans::PropertyAttribute::attrib1 | starbeans::PropertyAttribute::attrib2 | starbeans::PropertyAttribute::attrib3 | PropertyAttribute::attrib4) + +// === or Boolean properties +//------------------------------------------------------------------------------ +#define DECL_BOOL_PROP0(varname) \ + DECL_BOOL_PROP_IMPL(varname) 0) + +//------------------------------------------------------------------------------ +#define DECL_BOOL_PROP1(varname, attrib1) \ + DECL_BOOL_PROP_IMPL(varname) com::sun::star::beans::PropertyAttribute::attrib1) + +//------------------------------------------------------------------------------ +#define DECL_BOOL_PROP2(varname, attrib1, attrib2) \ + DECL_BOOL_PROP_IMPL(varname) com::sun::star::beans::PropertyAttribute::attrib1 | com::sun::star::beans::PropertyAttribute::attrib2) + +// === +//------------------------------------------------------------------------------ +#define END_AGGREGATION_PROPERTY_HELPER() \ + DBG_ASSERT(nPos == _rProps.getLength(), "<...>::getInfohelper : forgot to adjust the count ?"); \ + +//......................................................................... +} +//... namespace frm ....................................................... + +}//end of namespace binfilter +#endif // _FRM_PROPERTY_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/inc/services.hxx b/bf_forms/source/inc/services.hxx new file mode 100644 index 000000000..bde7e3354 --- /dev/null +++ b/bf_forms/source/inc/services.hxx @@ -0,0 +1,204 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _FRM_SERVICES_HXX_ +#define _FRM_SERVICES_HXX_ + +#include <rtl/ustring.hxx> + +#include "strings.hxx" +namespace binfilter { + +//... namespace frm ....................................................... +namespace frm +{ +//......................................................................... + +// alle serviceNamen +DECLARE_CONSTASCII_USTRING(FRM_NUMBER_FORMATTER); +DECLARE_CONSTASCII_USTRING(FRM_NUMBER_FORMATS_SUPPLIER); + +DECLARE_CONSTASCII_USTRING(VCL_CONTROL_EDIT); +DECLARE_CONSTASCII_USTRING(VCL_CONTROL_LISTBOX); +DECLARE_CONSTASCII_USTRING(VCL_CONTROL_COMBOBOX); +DECLARE_CONSTASCII_USTRING(VCL_CONTROL_RADIOBUTTON); +DECLARE_CONSTASCII_USTRING(VCL_CONTROL_GROUPBOX); +DECLARE_CONSTASCII_USTRING(VCL_CONTROL_FIXEDTEXT); +DECLARE_CONSTASCII_USTRING(VCL_CONTROL_COMMANDBUTTON); +DECLARE_CONSTASCII_USTRING(VCL_CONTROL_CHECKBOX); +DECLARE_CONSTASCII_USTRING(VCL_CONTROL_IMAGEBUTTON); +DECLARE_CONSTASCII_USTRING(VCL_CONTROL_FILECONTROL); +DECLARE_CONSTASCII_USTRING(VCL_CONTROL_TIMEFIELD); +DECLARE_CONSTASCII_USTRING(VCL_CONTROL_DATEFIELD); +DECLARE_CONSTASCII_USTRING(VCL_CONTROL_NUMERICFIELD); +DECLARE_CONSTASCII_USTRING(VCL_CONTROL_CURRENCYFIELD); +DECLARE_CONSTASCII_USTRING(VCL_CONTROL_PATTERNFIELD); +DECLARE_CONSTASCII_USTRING(VCL_CONTROL_FORMATTEDFIELD); +DECLARE_CONSTASCII_USTRING(VCL_CONTROL_IMAGECONTROL); + +DECLARE_CONSTASCII_USTRING(VCL_CONTROLMODEL_EDIT); +DECLARE_CONSTASCII_USTRING(VCL_CONTROLMODEL_LISTBOX); +DECLARE_CONSTASCII_USTRING(VCL_CONTROLMODEL_COMBOBOX); +DECLARE_CONSTASCII_USTRING(VCL_CONTROLMODEL_RADIOBUTTON); +DECLARE_CONSTASCII_USTRING(VCL_CONTROLMODEL_GROUPBOX); +DECLARE_CONSTASCII_USTRING(VCL_CONTROLMODEL_FIXEDTEXT); +DECLARE_CONSTASCII_USTRING(VCL_CONTROLMODEL_COMMANDBUTTON); +DECLARE_CONSTASCII_USTRING(VCL_CONTROLMODEL_CHECKBOX); +DECLARE_CONSTASCII_USTRING(VCL_CONTROLMODEL_IMAGEBUTTON); +DECLARE_CONSTASCII_USTRING(VCL_CONTROLMODEL_FILECONTROL); +DECLARE_CONSTASCII_USTRING(VCL_CONTROLMODEL_TIMEFIELD); +DECLARE_CONSTASCII_USTRING(VCL_CONTROLMODEL_DATEFIELD); +DECLARE_CONSTASCII_USTRING(VCL_CONTROLMODEL_NUMERICFIELD); +DECLARE_CONSTASCII_USTRING(VCL_CONTROLMODEL_CURRENCYFIELD); +DECLARE_CONSTASCII_USTRING(VCL_CONTROLMODEL_PATTERNFIELD); +DECLARE_CONSTASCII_USTRING(VCL_CONTROLMODEL_FORMATTEDFIELD); +DECLARE_CONSTASCII_USTRING(VCL_CONTROLMODEL_IMAGECONTROL); + +DECLARE_CONSTASCII_USTRING(AWT_CONTROL_TEXTFIELD); + +DECLARE_CONSTASCII_USTRING(FRM_COMPONENT_FORM); + +DECLARE_CONSTASCII_USTRING(FRM_COMPONENT_EDIT); // alter service name (5.0) +DECLARE_CONSTASCII_USTRING(FRM_COMPONENT_TEXTFIELD); + +DECLARE_CONSTASCII_USTRING(FRM_COMPONENT_LISTBOX); +DECLARE_CONSTASCII_USTRING(FRM_COMPONENT_COMBOBOX); +DECLARE_CONSTASCII_USTRING(FRM_COMPONENT_RADIOBUTTON); +DECLARE_CONSTASCII_USTRING(FRM_COMPONENT_GROUPBOX); +DECLARE_CONSTASCII_USTRING(FRM_COMPONENT_FIXEDTEXT); +DECLARE_CONSTASCII_USTRING(FRM_COMPONENT_COMMANDBUTTON); +DECLARE_CONSTASCII_USTRING(FRM_COMPONENT_CHECKBOX); + +DECLARE_CONSTASCII_USTRING(FRM_COMPONENT_GRID); // alter service name (5.0) +DECLARE_CONSTASCII_USTRING(FRM_COMPONENT_GRIDCONTROL); + +DECLARE_CONSTASCII_USTRING(FRM_COMPONENT_IMAGEBUTTON); +DECLARE_CONSTASCII_USTRING(FRM_COMPONENT_FILECONTROL); +DECLARE_CONSTASCII_USTRING(FRM_COMPONENT_TIMEFIELD); +DECLARE_CONSTASCII_USTRING(FRM_COMPONENT_DATEFIELD); +DECLARE_CONSTASCII_USTRING(FRM_COMPONENT_NUMERICFIELD); +DECLARE_CONSTASCII_USTRING(FRM_COMPONENT_CURRENCYFIELD); +DECLARE_CONSTASCII_USTRING(FRM_COMPONENT_PATTERNFIELD); +DECLARE_CONSTASCII_USTRING(FRM_COMPONENT_FORMATTEDFIELD); + +DECLARE_CONSTASCII_USTRING(FRM_COMPONENT_HIDDEN); // alter service name (5.0) +DECLARE_CONSTASCII_USTRING(FRM_COMPONENT_HIDDENCONTROL); + +DECLARE_CONSTASCII_USTRING(FRM_COMPONENT_IMAGECONTROL); + +DECLARE_CONSTASCII_USTRING(FRM_CONTROL_LISTBOX); +DECLARE_CONSTASCII_USTRING(FRM_CONTROL_RADIOBUTTON); +DECLARE_CONSTASCII_USTRING(FRM_CONTROL_COMBOBOX); +DECLARE_CONSTASCII_USTRING(FRM_CONTROL_GROUPBOX); +DECLARE_CONSTASCII_USTRING(FRM_CONTROL_CHECKBOX); +DECLARE_CONSTASCII_USTRING(FRM_CONTROL_FIXEDTEXT); +DECLARE_CONSTASCII_USTRING(FRM_CONTROL_COMMANDBUTTON); + +DECLARE_CONSTASCII_USTRING(FRM_CONTROL_GRID); +DECLARE_CONSTASCII_USTRING(FRM_CONTROL_GRIDCONTROL); + +DECLARE_CONSTASCII_USTRING(FRM_CONTROL_IMAGEBUTTON); + +DECLARE_CONSTASCII_USTRING(FRM_CONTROL_EDIT); // alt +DECLARE_CONSTASCII_USTRING(FRM_CONTROL_TEXTFIELD); + +DECLARE_CONSTASCII_USTRING(FRM_CONTROL_TIMEFIELD); +DECLARE_CONSTASCII_USTRING(FRM_CONTROL_DATEFIELD); +DECLARE_CONSTASCII_USTRING(FRM_CONTROL_NUMERICFIELD); +DECLARE_CONSTASCII_USTRING(FRM_CONTROL_CURRENCYFIELD); +DECLARE_CONSTASCII_USTRING(FRM_CONTROL_PATTERNFIELD); +DECLARE_CONSTASCII_USTRING(FRM_CONTROL_FILECONTROL); +DECLARE_CONSTASCII_USTRING(FRM_CONTROL_IMAGECONTROL); +DECLARE_CONSTASCII_USTRING(FRM_CONTROL_FORMATTEDFIELD); + +DECLARE_CONSTASCII_USTRING(SRV_SDB_ROWSET); +DECLARE_CONSTASCII_USTRING(SRV_SDB_CONNECTION); +DECLARE_CONSTASCII_USTRING(SRV_SDBC_STATEMENT); + +DECLARE_CONSTASCII_USTRING(SRV_AWT_POINTER); +DECLARE_CONSTASCII_USTRING(SRV_AWT_IMAGEPRODUCER); + + +DECLARE_CONSTASCII_USTRING(FRM_SUN_COMPONENT_FORM); +DECLARE_CONSTASCII_USTRING(FRM_SUN_COMPONENT_HTMLFORM); +DECLARE_CONSTASCII_USTRING(FRM_SUN_COMPONENT_DATAFORM); +DECLARE_CONSTASCII_USTRING(FRM_SUN_COMPONENT_TEXTFIELD); +DECLARE_CONSTASCII_USTRING(FRM_SUN_COMPONENT_LISTBOX); +DECLARE_CONSTASCII_USTRING(FRM_SUN_COMPONENT_COMBOBOX); +DECLARE_CONSTASCII_USTRING(FRM_SUN_COMPONENT_RADIOBUTTON); +DECLARE_CONSTASCII_USTRING(FRM_SUN_COMPONENT_GROUPBOX); +DECLARE_CONSTASCII_USTRING(FRM_SUN_COMPONENT_FIXEDTEXT); +DECLARE_CONSTASCII_USTRING(FRM_SUN_COMPONENT_COMMANDBUTTON); +DECLARE_CONSTASCII_USTRING(FRM_SUN_COMPONENT_CHECKBOX); +DECLARE_CONSTASCII_USTRING(FRM_SUN_COMPONENT_GRIDCONTROL); +DECLARE_CONSTASCII_USTRING(FRM_SUN_COMPONENT_IMAGEBUTTON); +DECLARE_CONSTASCII_USTRING(FRM_SUN_COMPONENT_FILECONTROL); +DECLARE_CONSTASCII_USTRING(FRM_SUN_COMPONENT_TIMEFIELD); +DECLARE_CONSTASCII_USTRING(FRM_SUN_COMPONENT_DATEFIELD); +DECLARE_CONSTASCII_USTRING(FRM_SUN_COMPONENT_NUMERICFIELD); +DECLARE_CONSTASCII_USTRING(FRM_SUN_COMPONENT_CURRENCYFIELD); +DECLARE_CONSTASCII_USTRING(FRM_SUN_COMPONENT_PATTERNFIELD); +DECLARE_CONSTASCII_USTRING(FRM_SUN_COMPONENT_HIDDENCONTROL); +DECLARE_CONSTASCII_USTRING(FRM_SUN_COMPONENT_FORMATTEDFIELD); + +DECLARE_CONSTASCII_USTRING( FRM_SUN_COMPONENT_IMAGECONTROL ); +DECLARE_CONSTASCII_USTRING( FRM_SUN_COMPONENT_DATABASE_RADIOBUTTON ); +DECLARE_CONSTASCII_USTRING( FRM_SUN_COMPONENT_DATABASE_CHECKBOX ); +DECLARE_CONSTASCII_USTRING( FRM_SUN_COMPONENT_DATABASE_LISTBOX ); +DECLARE_CONSTASCII_USTRING( FRM_SUN_COMPONENT_DATABASE_COMBOBOX ); +DECLARE_CONSTASCII_USTRING( FRM_SUN_COMPONENT_DATABASE_TEXTFIELD ); +DECLARE_CONSTASCII_USTRING( FRM_SUN_COMPONENT_DATABASE_DATEFIELD ); +DECLARE_CONSTASCII_USTRING( FRM_SUN_COMPONENT_DATABASE_TIMEFIELD ); +DECLARE_CONSTASCII_USTRING( FRM_SUN_COMPONENT_DATABASE_NUMERICFIELD ); +DECLARE_CONSTASCII_USTRING( FRM_SUN_COMPONENT_DATABASE_CURRENCYFIELD ); +DECLARE_CONSTASCII_USTRING( FRM_SUN_COMPONENT_DATABASE_PATTERNFIELD ); + +DECLARE_CONSTASCII_USTRING(FRM_SUN_CONTROL_TEXTFIELD); +DECLARE_CONSTASCII_USTRING(FRM_SUN_CONTROL_LISTBOX); +DECLARE_CONSTASCII_USTRING(FRM_SUN_CONTROL_COMBOBOX); +DECLARE_CONSTASCII_USTRING(FRM_SUN_CONTROL_RADIOBUTTON); +DECLARE_CONSTASCII_USTRING(FRM_SUN_CONTROL_GROUPBOX); +DECLARE_CONSTASCII_USTRING(FRM_SUN_CONTROL_FIXEDTEXT); +DECLARE_CONSTASCII_USTRING(FRM_SUN_CONTROL_COMMANDBUTTON); +DECLARE_CONSTASCII_USTRING(FRM_SUN_CONTROL_CHECKBOX); +DECLARE_CONSTASCII_USTRING(FRM_SUN_CONTROL_GRIDCONTROL); +DECLARE_CONSTASCII_USTRING(FRM_SUN_CONTROL_IMAGEBUTTON); +DECLARE_CONSTASCII_USTRING(FRM_SUN_CONTROL_TIMEFIELD); +DECLARE_CONSTASCII_USTRING(FRM_SUN_CONTROL_DATEFIELD); +DECLARE_CONSTASCII_USTRING(FRM_SUN_CONTROL_NUMERICFIELD); +DECLARE_CONSTASCII_USTRING(FRM_SUN_CONTROL_CURRENCYFIELD); +DECLARE_CONSTASCII_USTRING(FRM_SUN_CONTROL_PATTERNFIELD); +DECLARE_CONSTASCII_USTRING(FRM_SUN_CONTROL_IMAGECONTROL); +DECLARE_CONSTASCII_USTRING(FRM_SUN_CONTROL_FORMATTEDFIELD); + +DECLARE_CONSTASCII_USTRING(FRM_SUN_FORMS_COLLECTION); +DECLARE_CONSTASCII_USTRING(FRM_SUN_INTERNATIONAL_INFO); + + +DECLARE_CONSTASCII_USTRING(FRM_SUN_FORMCOMPONENT); + + +//......................................................................... +} +//... namespace frm ....................................................... + +}//end of namespace binfilter +#endif // _FRM_SERVICES_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bf_forms/source/inc/strings.hxx b/bf_forms/source/inc/strings.hxx new file mode 100644 index 000000000..8783a8f36 --- /dev/null +++ b/bf_forms/source/inc/strings.hxx @@ -0,0 +1,79 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef _FRM_STRINGS_HXX_ +#define _FRM_STRINGS_HXX_ + +namespace binfilter { +//......................................................................... +namespace frm +{ +//......................................................................... + +struct ConstAsciiString +{ + const sal_Char* ascii; + sal_Int32 length; + + inline operator const ::rtl::OUString () const; + inline operator const sal_Char* () const { return ascii; } + + inline ConstAsciiString(const sal_Char* _pAsciiZeroTerminated, const sal_Int32 _nLength); + inline ~ConstAsciiString(); + +private: + mutable ::rtl::OUString* ustring; +}; + +//------------------------------------------------------------ +inline ConstAsciiString::ConstAsciiString(const sal_Char* _pAsciiZeroTerminated, const sal_Int32 _nLength) + :ascii(_pAsciiZeroTerminated) + ,length(_nLength) + ,ustring(NULL) +{ +} + +//------------------------------------------------------------ +inline ConstAsciiString::~ConstAsciiString() +{ + delete ustring; + ustring = NULL; +} + +//------------------------------------------------------------ +inline ConstAsciiString::operator const ::rtl::OUString () const +{ + if (!ustring) + ustring = new ::rtl::OUString(ascii, length, RTL_TEXTENCODING_ASCII_US); + return *ustring; +} + +#define DECLARE_CONSTASCII_USTRING(name) \ + extern ::binfilter::frm::ConstAsciiString name + +#define IMPLEMENT_CONSTASCII_USTRING(name, asciivalue) \ + ::binfilter::frm::ConstAsciiString name(asciivalue, sizeof(asciivalue) - 1) + +} // namespace frm +//......................................................................... + +}//end of namespace binfilter +#endif // _FRM_STRINGS_HXX_ + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |