diff options
Diffstat (limited to 'toolkit/inc/toolkit/controls')
20 files changed, 4300 insertions, 0 deletions
diff --git a/toolkit/inc/toolkit/controls/accessiblecontrolcontext.hxx b/toolkit/inc/toolkit/controls/accessiblecontrolcontext.hxx new file mode 100644 index 000000000000..bc5f1e1295a2 --- /dev/null +++ b/toolkit/inc/toolkit/controls/accessiblecontrolcontext.hxx @@ -0,0 +1,136 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef TOOLKIT_ACCESSIBLE_CONTROL_CONTEXT_HXX +#define TOOLKIT_ACCESSIBLE_CONTROL_CONTEXT_HXX + +#include <comphelper/accessiblecomponenthelper.hxx> +#include <comphelper/accimplaccess.hxx> +#include <comphelper/uno3.hxx> +#include <com/sun/star/lang/XEventListener.hpp> +#include <com/sun/star/beans/XPropertySet.hpp> +#include <com/sun/star/awt/XWindow.hpp> + +class Window; +//........................................................................ +namespace toolkit +{ +//........................................................................ + + //==================================================================== + //= OAccessibleControlContext + //==================================================================== + + typedef ::comphelper::OAccessibleComponentHelper OAccessibleControlContext_Base; + typedef ::cppu::ImplHelper1 < ::com::sun::star::lang::XEventListener + > OAccessibleControlContext_IBase; + + /** class implementing the AccessibleContext for an UNO control - to be used in design mode of the control. + <p><b>life time control<b/><br/> + This control should be held weak by the creator (an UNO control), it itself holds a hard reference to the + control model, and a weak reference to the control. The reference to the model is freed when the model + is beeing disposed.</p> + */ + class OAccessibleControlContext + :public ::comphelper::OAccessibleImplementationAccess + ,public OAccessibleControlContext_Base + ,public OAccessibleControlContext_IBase + { + private: + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > + m_xControlModel; // the model of the control which's context we implement + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > + m_xModelPropsInfo; // the cached property set info of the model + + protected: + /// ctor. @see Init + OAccessibleControlContext(); + ~OAccessibleControlContext(); + + /** late ctor + */ + void Init( + const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxCreator + ) SAL_THROW( ( ::com::sun::star::uno::Exception ) ); + + // OCommonAccessibleComponent overridables + virtual ::com::sun::star::awt::Rectangle SAL_CALL implGetBounds( ) throw (::com::sun::star::uno::RuntimeException); + + public: + /** creates an accessible context for an uno control + @param _rxCreator + the uno control's XAccessible interface. This must be an XControl, from which an XControlModel + can be retrieved. + */ + static OAccessibleControlContext* create( + const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _rxCreator + ) SAL_THROW( ( ) ); + + protected: + // XInterface + DECLARE_XINTERFACE( ) + DECLARE_XTYPEPROVIDER( ) + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleDescription( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleStateSet > SAL_CALL getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleComponent + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL grabFocus( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getAccessibleKeyBinding( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException); + + // XEventListener + using comphelper::OAccessibleContextHelper::disposing; + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); + + private: + // retrieves the value of a string property from the model, if the property is present + ::rtl::OUString getModelStringProperty( const sal_Char* _pPropertyName ) SAL_THROW( ( ) ); + + // starts listening at the control model (currently for disposal only) + void startModelListening( ) SAL_THROW( ( ::com::sun::star::uno::Exception ) ); + // stops listening at the control model + void stopModelListening( ) SAL_THROW( ( ::com::sun::star::uno::Exception ) ); + + Window* implGetWindow( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >* _pxUNOWindow = NULL ) const; + }; + +//........................................................................ +} // namespace toolkit +//........................................................................ + +#endif // TOOLKIT_ACCESSIBLE_CONTROL_CONTEXT_HXX + diff --git a/toolkit/inc/toolkit/controls/dialogcontrol.hxx b/toolkit/inc/toolkit/controls/dialogcontrol.hxx new file mode 100644 index 000000000000..f6a0f768bc10 --- /dev/null +++ b/toolkit/inc/toolkit/controls/dialogcontrol.hxx @@ -0,0 +1,312 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef TOOLKIT_DIALOG_CONTROL_HXX +#define TOOLKIT_DIALOG_CONTROL_HXX + +#include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/container/XContainer.hpp> +#include <com/sun/star/awt/XTabControllerModel.hpp> +#include <com/sun/star/awt/XTopWindow.hpp> +#include <com/sun/star/util/XChangesNotifier.hpp> +#include <com/sun/star/util/XChangesListener.hpp> +#include <com/sun/star/util/XModifyListener.hpp> +#include <com/sun/star/beans/XPropertyChangeListener.hpp> +#include <com/sun/star/awt/XDialog2.hpp> +#include <com/sun/star/resource/XStringResourceResolver.hpp> +#include <cppuhelper/implbase6.hxx> +#include <cppuhelper/implbase5.hxx> +#include <toolkit/helper/listenermultiplexer.hxx> +#include <toolkit/controls/unocontrolmodel.hxx> +#include "toolkit/helper/servicenames.hxx" +#include "toolkit/helper/macros.hxx" +#include <toolkit/controls/unocontrolcontainer.hxx> +#include <cppuhelper/propshlp.hxx> +#include <cppuhelper/basemutex.hxx> +#include <list> + +// ---------------------------------------------------- +// class UnoControlDialogModel +// ---------------------------------------------------- +typedef UnoControlModel UnoControlDialogModel_Base; +typedef ::cppu::ImplHelper6 < ::com::sun::star::lang::XMultiServiceFactory + , ::com::sun::star::container::XContainer + , ::com::sun::star::container::XNameContainer + , ::com::sun::star::awt::XTabControllerModel + , ::com::sun::star::util::XChangesNotifier + , ::com::sun::star::beans::XPropertyChangeListener + > UnoControlDialogModel_IBase; + +class UnoControlDialogModel : public UnoControlDialogModel_IBase + , public UnoControlDialogModel_Base +{ +public: + // would like to make this typedef private, too, but the Forte 7 compiler does have + // problems with this ..... + typedef ::std::pair< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >, ::rtl::OUString > + UnoControlModelHolder; +private: + typedef ::std::list< UnoControlModelHolder > UnoControlModelHolderList; + + // for grouping control models (XTabControllerModel::getGroupXXX) + typedef ::std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > > + ModelGroup; + typedef ::std::vector< ModelGroup > AllGroups; + + friend struct CloneControlModel; + friend struct FindControlModel; + friend struct CompareControlModel; + +private: + ContainerListenerMultiplexer maContainerListeners; + ::cppu::OInterfaceContainerHelper maChangeListeners; + UnoControlModelHolderList maModels; + + AllGroups maGroups; + sal_Bool mbGroupsUpToDate; + +protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + + UnoControlModelHolderList::iterator ImplFindElement( const ::rtl::OUString& rName ); + +public: + UnoControlDialogModel(); + UnoControlDialogModel( const UnoControlDialogModel& rModel ); + ~UnoControlDialogModel(); + + UnoControlModel* Clone() const; + + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlModel::queryInterface(rType); } + ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } + void SAL_CALL release() throw() { OWeakAggObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::container::XContainer + void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::container::XElementAcces + ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::container::XIndexContainer, XIndexReplace, XIndexAcces + // void SAL_CALL replaceByIndex( sal_Int32 Index, 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) = 0; + // sal_Int32 SAL_CALL getCount( ) throw(::com::sun::star::uno::RuntimeException) = 0; + // ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) = 0; + // void SAL_CALL insertByIndex( sal_Int32 Index, 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) = 0; + // void SAL_CALL removeByIndex( sal_Int32 Index ) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) = 0; + + // ::com::sun::star::container::XNameContainer, XNameReplace, XNameAccess + void SAL_CALL replaceByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + ::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); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL insertByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) throw(::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::container::ElementExistException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + 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::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XMultiServiceFactory + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstance( const ::rtl::OUString& aServiceSpecifier ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL createInstanceWithArguments( const ::rtl::OUString& ServiceSpecifier, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Arguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getAvailableServiceNames( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // XComponent + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + + // XTabControllerModel + virtual sal_Bool SAL_CALL getGroupControl( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setGroupControl( sal_Bool GroupControl ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setControlModels( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Controls ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > > SAL_CALL getControlModels( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setGroup( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group, const ::rtl::OUString& GroupName ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getGroupCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL getGroup( sal_Int32 nGroup, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group, ::rtl::OUString& Name ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL getGroupByName( const ::rtl::OUString& Name, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group ) throw (::com::sun::star::uno::RuntimeException); + + // XChangesNotifier + virtual void SAL_CALL addChangesListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XChangesListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeChangesListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XChangesListener >& aListener ) throw (::com::sun::star::uno::RuntimeException); + + // XPropertyChangeListener + virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw (::com::sun::star::uno::RuntimeException); + + // XEventListener + using cppu::OPropertySetHelper::disposing; + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& evt ) throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoControlDialogModel,UnoControlDialogModel_Base, szServiceName2_UnoControlDialogModel ) + +protected: + void startControlListening( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& _rxChildModel ); + void stopControlListening( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& _rxChildModel ); + + void implNotifyTabModelChange( const ::rtl::OUString& _rAccessor ); + + void implUpdateGroupStructure(); +}; + +// ---------------------------------------------------- +// class UnoDialogControl +// ---------------------------------------------------- +typedef ::cppu::ImplHelper6 < ::com::sun::star::container::XContainerListener + , ::com::sun::star::awt::XTopWindow + , ::com::sun::star::awt::XDialog2 + , ::com::sun::star::util::XChangesListener + , ::com::sun::star::util::XModifyListener + , ::com::sun::star::awt::XWindowListener + > UnoDialogControl_IBase; + +class ResourceListener :public ::com::sun::star::util::XModifyListener, + public ::cppu::OWeakObject, + public ::cppu::BaseMutex +{ + public: + ResourceListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& xListener ); + virtual ~ResourceListener(); + + void startListening( const ::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceResolver >& rResource ); + void stopListening(); + + // XInterface + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire() throw (); + virtual void SAL_CALL release() throw (); + + // XModifyListener + virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException); + + // XEventListener + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); + + private: + ::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceResolver > m_xResource; + ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xListener; + bool m_bListening; +}; + +class UnoDialogControl :public UnoControlContainer + ,public UnoDialogControl_IBase +{ +private: + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuBar > mxMenuBar; + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController > mxTabController; + ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > mxListener; + TopWindowListenerMultiplexer maTopWindowListeners; + bool mbWindowListener; + bool mbSizeModified; + bool mbPosModified; + +protected: + + void ImplInsertControl( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxModel, const ::rtl::OUString& rName ); + void ImplRemoveControl( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& rxModel ); + void ImplSetPosSize( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& rxCtrl ); + void ImplUpdateResourceResolver(); + void ImplStartListingForResourceEvents(); + +public: + + UnoDialogControl(); + ::rtl::OUString GetComponentServiceName(); + + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlContainer::queryInterface(rType); } + ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } + void SAL_CALL release() throw() { OWeakAggObject::release(); } + + void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XTopWindow + void SAL_CALL addTopWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + void SAL_CALL removeTopWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTopWindowListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); + void SAL_CALL toFront( ) throw (::com::sun::star::uno::RuntimeException); + void SAL_CALL toBack( ) throw (::com::sun::star::uno::RuntimeException); + void SAL_CALL setMenuBar( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMenuBar >& xMenu ) throw (::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XWindowListener + virtual void SAL_CALL windowResized( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL windowMoved( const ::com::sun::star::awt::WindowEvent& e ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL windowShown( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL windowHidden( const ::com::sun::star::lang::EventObject& e ) throw (::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::container::XContainerListener + void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XDialog2 + virtual void SAL_CALL endDialog( ::sal_Int32 Result ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setHelpId( const rtl::OUString& Id ) throw (::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XDialog + void SAL_CALL setTitle( const ::rtl::OUString& Title ) throw(::com::sun::star::uno::RuntimeException); + ::rtl::OUString SAL_CALL getTitle() throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL execute() throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL endExecute() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XControl + sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setDesignMode( sal_Bool bOn ) throw(::com::sun::star::uno::RuntimeException); + + // XChangesListener + virtual void SAL_CALL changesOccurred( const ::com::sun::star::util::ChangesEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + + // XModifyListener + virtual void SAL_CALL modified( const ::com::sun::star::lang::EventObject& aEvent ) throw (::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO( UnoDialogControl, szServiceName2_UnoControlDialog ) + +protected: + virtual void ImplModelPropertiesChanged( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& rEvents ) throw(::com::sun::star::uno::RuntimeException); + virtual void PrepareWindowDescriptor( ::com::sun::star::awt::WindowDescriptor& rDesc ); + +protected: + virtual void removingControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl ); + virtual void addingControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl ); +}; + + +#endif // TOOLKIT_DIALOG_CONTROL_HXX diff --git a/toolkit/inc/toolkit/controls/eventcontainer.hxx b/toolkit/inc/toolkit/controls/eventcontainer.hxx new file mode 100644 index 000000000000..d0b7adbbe497 --- /dev/null +++ b/toolkit/inc/toolkit/controls/eventcontainer.hxx @@ -0,0 +1,142 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + + +#include <osl/diagnose.h> +#ifndef _COM_SUN_STAR_XNAMECONTAINER_HPP_ +#include <com/sun/star/container/XNameContainer.hpp> +#endif +#ifndef _COM_SUN_STAR_XCONTAINER_HPP_ +#include <com/sun/star/container/XContainer.hpp> +#endif + +#include <toolkit/helper/listenermultiplexer.hxx> + +#include <hash_map> +#include <cppuhelper/implbase2.hxx> +typedef ::cppu::WeakImplHelper2< ::com::sun::star::container::XNameContainer, + ::com::sun::star::container::XContainer > NameContainerHelper; + + +namespace toolkit +{ + +// Hashtable to optimize +struct hashName_Impl +{ + size_t operator()(const ::rtl::OUString Str) const + { + return (size_t)Str.hashCode(); + } +}; + +struct eqName_Impl +{ + sal_Bool operator()(const ::rtl::OUString Str1, const ::rtl::OUString Str2) const + { + return ( Str1 == Str2 ); + } +}; + +typedef std::hash_map +< + ::rtl::OUString, + sal_Int32, + hashName_Impl, + eqName_Impl +> +NameContainerNameMap; + + +class NameContainer_Impl : public NameContainerHelper +{ + NameContainerNameMap mHashMap; + ::com::sun::star::uno::Sequence< ::rtl::OUString > mNames; + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > mValues; + sal_Int32 mnElementCount; + ::com::sun::star::uno::Type mType; + + ContainerListenerMultiplexer maContainerListeners; + +public: + NameContainer_Impl( ::com::sun::star::uno::Type const & aType ) + : mnElementCount( 0 ), + mType( aType ), + maContainerListeners( *this ) + { + } + + // Methods 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); + + // Methods 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 ::com::sun::star::uno::Sequence< ::rtl::OUString > 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); + + // Methods XNameReplace + virtual void SAL_CALL replaceByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) + throw(::com::sun::star::lang::IllegalArgumentException, + ::com::sun::star::container::NoSuchElementException, + ::com::sun::star::lang::WrappedTargetException, + ::com::sun::star::uno::RuntimeException); + + // Methods XNameContainer + virtual void SAL_CALL insertByName( const ::rtl::OUString& aName, const ::com::sun::star::uno::Any& aElement ) + 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); + + // Methods XContainer + void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) + throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) + throw(::com::sun::star::uno::RuntimeException); +}; + +class ScriptEventContainer : public NameContainer_Impl +{ +public: + ScriptEventContainer( void ); +}; + + +} // namespace toolkit_namecontainer + diff --git a/toolkit/inc/toolkit/controls/formattedcontrol.hxx b/toolkit/inc/toolkit/controls/formattedcontrol.hxx new file mode 100644 index 000000000000..f589dabd47aa --- /dev/null +++ b/toolkit/inc/toolkit/controls/formattedcontrol.hxx @@ -0,0 +1,127 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef TOOLKIT_FORMATTED_CONTROL_HXX +#define TOOLKIT_FORMATTED_CONTROL_HXX + +#include <toolkit/controls/unocontrols.hxx> +#include <toolkit/controls/unocontrolmodel.hxx> +#include <toolkit/helper/servicenames.hxx> + +#include <com/sun/star/util/XNumberFormatter.hpp> + +//........................................................................ +namespace toolkit +{ +//........................................................................ + + // =================================================================== + // = UnoControlFormattedFieldModel + // =================================================================== + class UnoControlFormattedFieldModel : public UnoControlModel + { + protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + ::com::sun::star::uno::Any m_aCachedFormat; + bool m_bRevokedAsClient; + bool m_bSettingValueAndText; + ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter > + m_xCachedFormatter; + + protected: + sal_Bool SAL_CALL convertFastPropertyValue( + ::com::sun::star::uno::Any& rConvertedValue, + ::com::sun::star::uno::Any& rOldValue, + sal_Int32 nPropId, + const ::com::sun::star::uno::Any& rValue + ) throw (::com::sun::star::lang::IllegalArgumentException); + + void SAL_CALL setFastPropertyValue_NoBroadcast( + sal_Int32 nHandle, + const ::com::sun::star::uno::Any& rValue + ) throw (::com::sun::star::uno::Exception); + + public: + UnoControlFormattedFieldModel(); + UnoControlFormattedFieldModel( const UnoControlFormattedFieldModel& rModel ) : UnoControlModel( rModel ) {;} + + UnoControlModel* Clone() const { return new UnoControlFormattedFieldModel( *this ); } + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoControlFormattedFieldModel, UnoControlModel, szServiceName2_UnoControlFormattedFieldModel ) + + protected: + ~UnoControlFormattedFieldModel(); + + // XComponent + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + + // XPropertySet + void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& PropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Values ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + // UnoControlModel + virtual void ImplNormalizePropertySequence( + const sal_Int32 _nCount, /// the number of entries in the arrays + sal_Int32* _pHandles, /// the handles of the properties to set + ::com::sun::star::uno::Any* _pValues, /// the values of the properties to set + sal_Int32* _pValidHandles /// pointer to the valid handles, allowed to be adjusted + ) const SAL_THROW(()); + private: + void impl_updateTextFromValue_nothrow(); + void impl_updateCachedFormatter_nothrow(); + void impl_updateCachedFormatKey_nothrow(); + }; + + // =================================================================== + // = UnoFormattedFieldControl + // =================================================================== + class UnoFormattedFieldControl : public UnoSpinFieldControl + { + public: + UnoFormattedFieldControl(); + ::rtl::OUString GetComponentServiceName(); + + // ::com::sun::star::awt::XTextListener + void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoFormattedFieldControl, UnoEditControl, szServiceName2_UnoControlFormattedField ) + }; + +//........................................................................ +} // namespace toolkit +//........................................................................ + +#endif // TOOLKIT_FORMATTED_CONTROL_HXX diff --git a/toolkit/inc/toolkit/controls/geometrycontrolmodel.hxx b/toolkit/inc/toolkit/controls/geometrycontrolmodel.hxx new file mode 100644 index 000000000000..05b3016e690a --- /dev/null +++ b/toolkit/inc/toolkit/controls/geometrycontrolmodel.hxx @@ -0,0 +1,262 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _TOOLKIT_HELPERS_GEOMETRYCONTROLMODEL_HXX_ +#define _TOOLKIT_HELPERS_GEOMETRYCONTROLMODEL_HXX_ + +#include <comphelper/broadcasthelper.hxx> +#include <comphelper/uno3.hxx> +#include <comphelper/propagg.hxx> +#include <comphelper/proparrhlp.hxx> +#include <comphelper/propertycontainer.hxx> +#include <cppuhelper/weakagg.hxx> +#include <cppuhelper/compbase2.hxx> +#include <com/sun/star/util/XCloneable.hpp> +#include <com/sun/star/script/XScriptEventsSupplier.hpp> +#include <com/sun/star/resource/XStringResourceResolver.hpp> +#include <cppuhelper/typeprovider.hxx> +#include <comphelper/IdPropArrayHelper.hxx> +#include <comphelper/stl_types.hxx> + +FORWARD_DECLARE_INTERFACE( lang, XMultiServiceFactory ) +FORWARD_DECLARE_INTERFACE( script, XNameContainer ) + +//........................................................................ +// namespace toolkit +// { +//........................................................................ + + //==================================================================== + //= OGeometryControlModel_Base + //==================================================================== + typedef ::cppu::WeakAggComponentImplHelper2 < ::com::sun::star::util::XCloneable + , ::com::sun::star::script::XScriptEventsSupplier + > OGCM_Base; + class OGeometryControlModel_Base + :public ::comphelper::OMutexAndBroadcastHelper + ,public ::comphelper::OPropertySetAggregationHelper + ,public ::comphelper::OPropertyContainer + ,public OGCM_Base + { + protected: + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XAggregation > + m_xAggregate; + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > + mxEventContainer; + + // <properties> + sal_Int32 m_nPosX; + sal_Int32 m_nPosY; + sal_Int32 m_nWidth; + sal_Int32 m_nHeight; + ::rtl::OUString m_aName; + sal_Int16 m_nTabIndex; + sal_Int32 m_nStep; + ::rtl::OUString m_aTag; + ::com::sun::star::uno::Reference< ::com::sun::star::resource::XStringResourceResolver > m_xStrResolver; + // </properties> + + sal_Bool m_bCloneable; + + protected: + virtual ::com::sun::star::uno::Any ImplGetDefaultValueByHandle(sal_Int32 nHandle) const; + virtual ::com::sun::star::uno::Any ImplGetPropertyValueByHandle(sal_Int32 nHandle) const; + virtual void ImplSetPropertyValueByHandle(sal_Int32 nHandle, const :: com::sun::star::uno::Any& aValue); + + protected: + /** + @param _pAggregateInstance + the object to be aggregated. The refcount of the instance given MUST be 0! + */ + OGeometryControlModel_Base(::com::sun::star::uno::XAggregation* _pAggregateInstance); + + /** + @param _rxAggregateInstance + is the object to be aggregated. Must be aquired excatly once (by the reference object given).<br/> + Will be reset to NULL upon leaving + */ + OGeometryControlModel_Base(::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable >& _rxAggregateInstance); + + /** releases the aggregation + <p>Can be used if in a derived class, an exception has to be thrown after this base class here already + did the aggregation</p> + */ + void releaseAggregation(); + + protected: + ~OGeometryControlModel_Base(); + + // XAggregation + ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _aType ) throw(::com::sun::star::uno::RuntimeException); + + // XInterface + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& aType ) throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire( ) throw(); + virtual void SAL_CALL release( ) throw(); + + // XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw (::com::sun::star::uno::RuntimeException); + + // OPropertySetHelper overridables + virtual sal_Bool SAL_CALL convertFastPropertyValue( + ::com::sun::star::uno::Any& _rConvertedValue, ::com::sun::star::uno::Any& _rOldValue, + sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue ) + throw (::com::sun::star::lang::IllegalArgumentException); + + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( + sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue) + throw (::com::sun::star::uno::Exception); + + using comphelper::OPropertySetAggregationHelper::getFastPropertyValue; + virtual void SAL_CALL getFastPropertyValue( + ::com::sun::star::uno::Any& _rValue, sal_Int32 _nHandle) const; + + // OPropertyStateHelper overridables + virtual ::com::sun::star::beans::PropertyState getPropertyStateByHandle(sal_Int32 nHandle); + virtual void setPropertyToDefaultByHandle(sal_Int32 nHandle); + virtual ::com::sun::star::uno::Any getPropertyDefaultByHandle(sal_Int32 nHandle) const; + + // XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() throw(::com::sun::star::uno::RuntimeException); + + // OPropertySetAggregationHelper overridables + using OPropertySetAggregationHelper::getInfoHelper; + + // XCloneable + virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw(::com::sun::star::uno::RuntimeException); + + //XScriptEventsSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameContainer > + SAL_CALL getEvents( ) throw(::com::sun::star::uno::RuntimeException); + + // XCloneable implementation - to be overwritten + virtual OGeometryControlModel_Base* createClone_Impl( + ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable >& _rxAggregateInstance) = 0; + + // XComponent + using comphelper::OPropertySetAggregationHelper::disposing; + virtual void SAL_CALL disposing(); + + private: + void registerProperties(); + }; + + //==================================================================== + //= OTemplateInstanceDisambiguation + //==================================================================== + template <class CONTROLMODEL> + class OTemplateInstanceDisambiguation + { + }; + + //==================================================================== + //= OGeometryControlModel + //==================================================================== + /* example for usage: + Reference< XAggregation > xIFace = new ::toolkit::OGeometryControlModel< UnoControlButtonModel > (); + */ + template <class CONTROLMODEL> + class OGeometryControlModel + :public OGeometryControlModel_Base + ,public ::comphelper::OAggregationArrayUsageHelper< OTemplateInstanceDisambiguation< CONTROLMODEL > > + { + public: + OGeometryControlModel(); + + private: + OGeometryControlModel(::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable >& _rxAggregateInstance); + + protected: + // OAggregationArrayUsageHelper overridables + virtual void fillProperties( + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& _rProps, + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& _rAggregateProps + ) const; + + // OPropertySetAggregationHelper overridables + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + + // OGeometryControlModel_Base + virtual OGeometryControlModel_Base* createClone_Impl( + ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable >& _rxAggregateInstance); + + // XTypeProvider + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (::com::sun::star::uno::RuntimeException); + }; + + //==================================================================== + //= OCommonGeometryControlModel + //==================================================================== + /** allows to extend an arbitrary <type scope="com.sun.star.awt">UnoControlModel</type> with geometry + information. + */ + class OCommonGeometryControlModel + :public OGeometryControlModel_Base + ,public ::comphelper::OIdPropertyArrayUsageHelper< OCommonGeometryControlModel > + { + private: + ::rtl::OUString m_sServiceSpecifier; // the service specifier of our aggregate + sal_Int32 m_nPropertyMapId; // our unique property info id, used to look up in s_aAggregateProperties + + public: + /** instantiate the model + + @param _rxAgg + the instance to aggregate. Must support the <type scope="com.sun.star.awt">UnoControlModel</type> + (this is not checked here) + */ + OCommonGeometryControlModel( + ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable >& _rxAgg, + const ::rtl::OUString& _rxServiceSpecifier + ); + + // OIdPropertyArrayUsageHelper overridables + virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 nId) const; + + // OPropertySetAggregationHelper overridables + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + + // OGeometryControlModel_Base + virtual OGeometryControlModel_Base* createClone_Impl( + ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable >& _rxAggregateInstance); + + // XTypeProvider + virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) throw (::com::sun::star::uno::RuntimeException); + + private: + virtual void SAL_CALL setFastPropertyValue_NoBroadcast( + sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue) + throw (::com::sun::star::uno::Exception); + }; + +#include "toolkit/controls/geometrycontrolmodel_impl.hxx" + +//........................................................................ +// } // namespace toolkit +//........................................................................ + +#endif // _TOOLKIT_HELPERS_GEOMETRYCONTROLMODEL_HXX_ diff --git a/toolkit/inc/toolkit/controls/geometrycontrolmodel_impl.hxx b/toolkit/inc/toolkit/controls/geometrycontrolmodel_impl.hxx new file mode 100644 index 000000000000..d6491877c7ad --- /dev/null +++ b/toolkit/inc/toolkit/controls/geometrycontrolmodel_impl.hxx @@ -0,0 +1,90 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// no include protection. This is included from within geometrycontrolmodel.hxx only + +//==================================================================== +//= OGeometryControlModel +//==================================================================== +//-------------------------------------------------------------------- +template <class CONTROLMODEL> +OGeometryControlModel<CONTROLMODEL>::OGeometryControlModel() + :OGeometryControlModel_Base(new CONTROLMODEL) +{ +} + +//-------------------------------------------------------------------- +template <class CONTROLMODEL> +OGeometryControlModel<CONTROLMODEL>::OGeometryControlModel(::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable >& _rxAggregateInstance) + :OGeometryControlModel_Base(_rxAggregateInstance) +{ +} + +//-------------------------------------------------------------------- +template <class CONTROLMODEL> +::cppu::IPropertyArrayHelper& SAL_CALL OGeometryControlModel<CONTROLMODEL>::getInfoHelper() +{ + return *this->getArrayHelper(); +} + +//-------------------------------------------------------------------- +template <class CONTROLMODEL> +void OGeometryControlModel<CONTROLMODEL>::fillProperties(::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& _rProps, ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& _rAggregateProps) const +{ + // our own properties + OPropertyContainer::describeProperties(_rProps); + // the aggregate properties + if (m_xAggregateSet.is()) + _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties(); +} + +//-------------------------------------------------------------------- +template <class CONTROLMODEL> +::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL OGeometryControlModel<CONTROLMODEL>::getImplementationId( ) throw (::com::sun::star::uno::RuntimeException) +{ + static ::cppu::OImplementationId * pId = NULL; + if ( !pId ) + { + ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); + if ( !pId ) + { + static ::cppu::OImplementationId s_aId; + pId = &s_aId; + } + } + return pId->getImplementationId(); +} + +//-------------------------------------------------------------------- +template <class CONTROLMODEL> +OGeometryControlModel_Base* OGeometryControlModel<CONTROLMODEL>::createClone_Impl( + ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable >& _rxAggregateInstance) +{ + return new OGeometryControlModel<CONTROLMODEL>(_rxAggregateInstance); +} + + diff --git a/toolkit/inc/toolkit/controls/roadmapcontrol.hxx b/toolkit/inc/toolkit/controls/roadmapcontrol.hxx new file mode 100644 index 000000000000..1b86d277fde2 --- /dev/null +++ b/toolkit/inc/toolkit/controls/roadmapcontrol.hxx @@ -0,0 +1,206 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef TOOLKIT_ROADMAP_CONTROL_HXX +#define TOOLKIT_ROADMAP_CONTROL_HXX + + +#include <toolkit/controls/unocontrols.hxx> +#include <toolkit/controls/unocontrolmodel.hxx> +#include <toolkit/helper/servicenames.hxx> +#include <toolkit/controls/roadmapentry.hxx> +#include <com/sun/star/container/XContainer.hpp> +#include <com/sun/star/lang/XSingleServiceFactory.hpp> +#include <com/sun/star/beans/XPropertyChangeListener.hpp> +#include <com/sun/star/container/XIndexContainer.hpp> +#include <com/sun/star/container/XContainerListener.hpp> +#include <com/sun/star/awt/XItemListener.hpp> +#include <com/sun/star/awt/XItemEventBroadcaster.hpp> +#include <cppuhelper/implbase2.hxx> +#include <cppuhelper/implbase3.hxx> +#include <cppuhelper/implbase4.hxx> + + + +#include <comphelper/uno3.hxx> + +typedef GraphicControlModel UnoControlRoadmapModel_Base; + + +typedef ::cppu::ImplHelper3 < ::com::sun::star::lang::XSingleServiceFactory + , ::com::sun::star::container::XContainer + , ::com::sun::star::container::XIndexContainer + > UnoControlRoadmapModel_IBase; + + + +typedef UnoControlBase UnoControlRoadmap_Base; +typedef ::cppu::ImplHelper4 < ::com::sun::star::awt::XItemEventBroadcaster + , ::com::sun::star::container::XContainerListener + , ::com::sun::star::awt::XItemListener + , ::com::sun::star::beans::XPropertyChangeListener + > UnoControlRoadmap_IBase; + + + + +typedef ::cppu::ImplHelper2< ::com::sun::star::container::XContainerListener, + ::com::sun::star::awt::XItemEventBroadcaster> SVTXRoadmap_Base; + + +//........................................................................ + +namespace toolkit{ +//........................................................................ + using namespace ::com::sun::star::uno; + using namespace ::com::sun::star::awt; + using namespace ::com::sun::star::lang; + using namespace ::com::sun::star::beans; + using namespace ::com::sun::star::container; + + + // =================================================================== + // = UnoControlRoadmapModel + // =================================================================== + class UnoControlRoadmapModel : public UnoControlRoadmapModel_Base, + public UnoControlRoadmapModel_IBase + + { + private: +// PropertyChangeListenerMultiplexer maPropertyListeners; + + typedef ::std::vector< Reference< XInterface > > RoadmapItemHolderList; + + ContainerListenerMultiplexer maContainerListeners; + RoadmapItemHolderList maRoadmapItems; + + void MakeRMItemValidation( sal_Int32 Index, Reference< XInterface > xRoadmapItem ); + ContainerEvent GetContainerEvent(sal_Int32 Index, Reference< XInterface > ); + void SetRMItemDefaultProperties( const sal_Int32 _Index, Reference< XInterface > ); + sal_Int16 GetCurrentItemID( Reference< XPropertySet > xPropertySet ); + sal_Int32 GetUniqueID(); + + + protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + + public: + UnoControlRoadmapModel(); + UnoControlRoadmapModel( const UnoControlRoadmapModel& rModel ) : + UnoControlRoadmapModel_Base( rModel ), + UnoControlRoadmapModel_IBase( rModel ), + maContainerListeners( *this ) {} + UnoControlModel* Clone() const { return new UnoControlRoadmapModel( *this ); } + + + // XTypeProvider + DECLARE_XTYPEPROVIDER( ) + + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoControlRoadmapModel, UnoControlRoadmapModel_Base, szServiceName2_UnoControlRoadmapModel ) + + sal_Int32 SAL_CALL getCount() throw (RuntimeException); + virtual Any SAL_CALL getByIndex( sal_Int32 Index ) throw (IndexOutOfBoundsException, WrappedTargetException, RuntimeException ); + + virtual void SAL_CALL insertByIndex( sal_Int32 Index, const Any & _Element) throw (IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetException, RuntimeException ); + virtual void SAL_CALL removeByIndex( sal_Int32 Index ) throw (IndexOutOfBoundsException, WrappedTargetException, RuntimeException ); + virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const Any & _Element) throw (IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetException, RuntimeException ); + + virtual void SAL_CALL addContainerListener( const Reference< XContainerListener >& xListener ) throw (RuntimeException); + virtual void SAL_CALL removeContainerListener( const Reference< XContainerListener >& xListener ) throw (RuntimeException); + + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlRoadmapModel_Base::queryInterface(rType); } + ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { UnoControlRoadmapModel_Base::acquire(); } + void SAL_CALL release() throw() { UnoControlRoadmapModel_Base::release(); } + + + // ::com::sun::star::beans::XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw (::com::sun::star::uno::RuntimeException); + + + virtual Reference< XInterface > SAL_CALL createInstance( ) throw (Exception, RuntimeException); + virtual Reference< XInterface > SAL_CALL createInstanceWithArguments( const Sequence< Any >& aArguments ) throw (Exception, RuntimeException); + + virtual Type SAL_CALL getElementType() throw (RuntimeException); + + virtual sal_Bool SAL_CALL hasElements() throw (RuntimeException); + + }; + + + // =================================================================== + // = UnoRoadmapControl + // =================================================================== + class UnoRoadmapControl : public UnoControlRoadmap_Base, + public UnoControlRoadmap_IBase + { + private: + ItemListenerMultiplexer maItemListeners; + public: + UnoRoadmapControl(); + ::rtl::OUString GetComponentServiceName(); + + void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); } + + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + + + sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model) throw ( ::com::sun::star::uno::RuntimeException ); + + void SAL_CALL elementInserted( const ::com::sun::star::container::ContainerEvent& rEvent )throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL elementRemoved( const ::com::sun::star::container::ContainerEvent& rEvent )throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL elementReplaced( const ::com::sun::star::container::ContainerEvent& rEvent )throw(::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL addItemListener( const Reference< XItemListener >& l ) throw (RuntimeException); + virtual void SAL_CALL removeItemListener( const Reference< XItemListener >& l ) throw (RuntimeException); + + + virtual void SAL_CALL itemStateChanged( const ItemEvent& rEvent ) throw (RuntimeException); + + virtual void SAL_CALL propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw (::com::sun::star::uno::RuntimeException); + + // XTypeProvider + DECLARE_XTYPEPROVIDER( ) + DECLARE_XINTERFACE() + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoRoadmapControl, UnoControlBase, szServiceName2_UnoControlRoadmap ) + }; + +//........................................................................ +} // toolkit +//........................................................................ + + + +#endif // _TOOLKIT_ROADMAP_CONTROL_HXX diff --git a/toolkit/inc/toolkit/controls/roadmapentry.hxx b/toolkit/inc/toolkit/controls/roadmapentry.hxx new file mode 100644 index 000000000000..6f43f0510465 --- /dev/null +++ b/toolkit/inc/toolkit/controls/roadmapentry.hxx @@ -0,0 +1,91 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef _TOOLKIT_ROADMAPENTRY_HXX_ +#define _TOOLKIT_ROADMAPENTRY_HXX_ + +#include <cppuhelper/implbase1.hxx> +#include <comphelper/uno3.hxx> +#include <comphelper/broadcasthelper.hxx> +#include <comphelper/propertycontainer.hxx> +#include <comphelper/proparrhlp.hxx> +#include <comphelper/proparrhlp.hxx> +#include <com/sun/star/lang/XServiceInfo.hpp> + + +#define RM_PROPERTY_ID_LABEL 1 +#define RM_PROPERTY_ID_ID 2 +#define RM_PROPERTY_ID_ENABLED 4 +#define RM_PROPERTY_ID_INTERACTIVE 5 + +typedef ::cppu::WeakImplHelper1 < ::com::sun::star::lang::XServiceInfo + > ORoadmapEntry_Base; + +class ORoadmapEntry :public ORoadmapEntry_Base + ,public ::comphelper::OMutexAndBroadcastHelper + ,public ::comphelper::OPropertyContainer + ,public ::comphelper::OPropertyArrayUsageHelper< ORoadmapEntry > +{ + +public: + ORoadmapEntry(); + +protected: + DECLARE_XINTERFACE() // merge XInterface implementations + DECLARE_XTYPEPROVIDER() // merge XTypeProvider implementations + + /// @see ::com::sun::star::beans::XPropertySet + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > + SAL_CALL getPropertySetInfo() + throw (::com::sun::star::uno::RuntimeException); + + // OPropertySetHelper + virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + + // OPropertyArrayUsageHelper + virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const; + + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException); + + + // other stuff + // ... + // (e.g. DECLARE_SERVICE_INFO();) + +protected: + // <properties> + ::rtl::OUString m_sLabel; + sal_Int32 m_nID; + sal_Bool m_bEnabled; + sal_Bool m_bInteractive; + + // </properties> +}; + +#endif + diff --git a/toolkit/inc/toolkit/controls/stdtabcontroller.hxx b/toolkit/inc/toolkit/controls/stdtabcontroller.hxx new file mode 100644 index 000000000000..9dc5ae1a2d5a --- /dev/null +++ b/toolkit/inc/toolkit/controls/stdtabcontroller.hxx @@ -0,0 +1,94 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _TOOLKIT_CONTROLS_STDTABCONTROLLER_HXX_ +#define _TOOLKIT_CONTROLS_STDTABCONTROLLER_HXX_ + + +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/awt/XTabController.hpp> +#include <com/sun/star/awt/XControl.hpp> +#include <com/sun/star/awt/XControlContainer.hpp> +#include <com/sun/star/lang/XTypeProvider.hpp> +#include <cppuhelper/weakagg.hxx> +#include <osl/mutex.hxx> +#include <toolkit/helper/macros.hxx> +#include <toolkit/helper/servicenames.hxx> + + +class StdTabController : public ::com::sun::star::awt::XTabController, + public ::com::sun::star::lang::XServiceInfo, + public ::com::sun::star::lang::XTypeProvider, + public ::cppu::OWeakAggObject +{ +private: + ::osl::Mutex maMutex; + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabControllerModel > mxModel; + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > mxControlContainer; + +protected: + ::osl::Mutex& GetMutex() { return maMutex; } + sal_Bool ImplCreateComponentSequence( ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > >& rControls, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& rModels, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > >& rComponents, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any>* pTabStops, sal_Bool bPeerComponent ) const; + // wenn rModels kuerzer als rControls ist, werden nur die rModels entsprechenden Elemente geliefert und die korrespondierenden Elemente aus rControls entfernt + void ImplActivateControl( sal_Bool bFirst ) const; + +public: + StdTabController(); + ~StdTabController(); + + static ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > FindControl( ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > >& rCtrls, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > & rxCtrlModel ); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return OWeakAggObject::queryInterface(rType); } + void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } + void SAL_CALL release() throw() { OWeakAggObject::release(); } + + ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // XTabController + void SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabControllerModel >& Model ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabControllerModel > SAL_CALL getModel( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setContainer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer >& Container ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > SAL_CALL getContainer( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > > SAL_CALL getControls( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL autoTabOrder( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL activateTabOrder( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL activateFirst( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL activateLast( ) throw(::com::sun::star::uno::RuntimeException); + + // XServiceInfo + DECLIMPL_SERVICEINFO( StdTabController, szServiceName2_TabController ) +}; + + + +#endif // _TOOLKIT_AWT_STDTABCONTROLLER_HXX_ + diff --git a/toolkit/inc/toolkit/controls/stdtabcontrollermodel.hxx b/toolkit/inc/toolkit/controls/stdtabcontrollermodel.hxx new file mode 100644 index 000000000000..d49fa720d5fd --- /dev/null +++ b/toolkit/inc/toolkit/controls/stdtabcontrollermodel.hxx @@ -0,0 +1,142 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _TOOLKIT_CONTROLS_STDTABCONTROLLERMODEL_HXX_ +#define _TOOLKIT_CONTROLS_STDTABCONTROLLERMODEL_HXX_ + + +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/io/XPersistObject.hpp> +#include <com/sun/star/awt/XTabControllerModel.hpp> +#include <com/sun/star/awt/XWindow.hpp> +#include <com/sun/star/lang/XTypeProvider.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <cppuhelper/weakagg.hxx> +#include <toolkit/helper/macros.hxx> +#include <toolkit/helper/servicenames.hxx> +#include <osl/mutex.hxx> + +#include <tools/list.hxx> +#include <tools/gen.hxx> + +struct UnoControlModelEntry; + +DECLARE_LIST( UnoControlModelEntryListBase, UnoControlModelEntry* ) + +class UnoControlModelEntryList : public UnoControlModelEntryListBase +{ +private: + ::rtl::OUString maGroupName; + +public: + UnoControlModelEntryList(); + ~UnoControlModelEntryList(); + + const ::rtl::OUString& GetName() const { return maGroupName; } + void SetName( const ::rtl::OUString& rName ) { maGroupName = rName; } + + void Reset(); + void DestroyEntry( sal_uInt32 nEntry ); +}; + +struct UnoControlModelEntry +{ + sal_Bool bGroup; + union + { + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >* pxControl; + UnoControlModelEntryList* pGroup; + }; +}; + +// Keine Referenz halten, nur temporaer fuer AutoTabOrder +struct ComponentEntry +{ + ::com::sun::star::awt::XWindow* pComponent; + Point aPos; +}; + +DECLARE_LIST( ComponentEntryList, ComponentEntry* ) + +#define CONTROLPOS_NOTFOUND 0xFFFFFFFF + +class StdTabControllerModel : public ::com::sun::star::awt::XTabControllerModel, + public ::com::sun::star::lang::XServiceInfo, + public ::com::sun::star::io::XPersistObject, + public ::com::sun::star::lang::XTypeProvider, + public ::cppu::OWeakAggObject +{ +private: + ::osl::Mutex maMutex; + UnoControlModelEntryList maControls; + sal_Bool mbGroupControl; + +protected: + ::osl::Mutex& GetMutex() { return maMutex; } + sal_uInt32 ImplGetControlCount( const UnoControlModelEntryList& rList ) const; + void ImplGetControlModels( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > ** pRefs, const UnoControlModelEntryList& rList ) const; + void ImplSetControlModels( UnoControlModelEntryList& rList, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Controls ) const; + sal_uInt32 ImplGetControlPos( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > xCtrl, const UnoControlModelEntryList& rList ) const; + +public: + StdTabControllerModel(); + ~StdTabControllerModel(); + + // ::com::sun::star::uno::XInterface + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return OWeakAggObject::queryInterface(rType); } + void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } + void SAL_CALL release() throw() { OWeakAggObject::release(); } + + ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XTabControllerModel + sal_Bool SAL_CALL getGroupControl( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setGroupControl( sal_Bool GroupControl ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setControlModels( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Controls ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > > SAL_CALL getControlModels( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setGroup( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group, const ::rtl::OUString& GroupName ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getGroupCount( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL getGroup( sal_Int32 nGroup, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group, ::rtl::OUString& Name ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL getGroupByName( const ::rtl::OUString& Name, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > >& Group ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName( ) throw(::com::sun::star::uno::RuntimeException); + 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); + 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); + + // XServiceInfo + DECLIMPL_SERVICEINFO( StdTabControllerModel, szServiceName2_TabControllerModel ) +}; + + + +#endif // _TOOLKIT_HELPER_STDTABCONTROLLERMODEL_HXX_ + diff --git a/toolkit/inc/toolkit/controls/tkscrollbar.hxx b/toolkit/inc/toolkit/controls/tkscrollbar.hxx new file mode 100644 index 000000000000..78795aa240c2 --- /dev/null +++ b/toolkit/inc/toolkit/controls/tkscrollbar.hxx @@ -0,0 +1,124 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef TOOLKIT_TOOLKIT_CONTROLS_TKSCROLLBAR_HXX +#define TOOLKIT_TOOLKIT_CONTROLS_TKSCROLLBAR_HXX + +#include <toolkit/controls/unocontrolmodel.hxx> +#include <toolkit/helper/servicenames.hxx> +#include <toolkit/controls/unocontrolbase.hxx> +#include <toolkit/helper/macros.hxx> +#include <com/sun/star/awt/XScrollBar.hpp> +#include <com/sun/star/awt/XAdjustmentListener.hpp> +#include <com/sun/star/awt/AdjustmentType.hpp> + +//........................................................................ +namespace toolkit +{ +//........................................................................ + + //==================================================================== + //= UnoControlScrollBarModel + //==================================================================== + class UnoControlScrollBarModel : public UnoControlModel + { + protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + + public: + UnoControlScrollBarModel(); + UnoControlScrollBarModel( const UnoControlScrollBarModel& rModel ) : UnoControlModel( rModel ) {;} + + UnoControlModel* Clone() const { return new UnoControlScrollBarModel( *this ); } + + // ::com::sun::star::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoControlScrollBarModel, UnoControlModel, szServiceName2_UnoControlScrollBarModel ) + }; + + //==================================================================== + //= UnoControlScrollBarModel + //==================================================================== + class UnoScrollBarControl : public UnoControlBase, + public ::com::sun::star::awt::XAdjustmentListener, + public ::com::sun::star::awt::XScrollBar + { + private: + AdjustmentListenerMultiplexer maAdjustmentListeners; + + public: + UnoScrollBarControl(); + ::rtl::OUString GetComponentServiceName(); + + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlBase::queryInterface(rType); } + ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } + void SAL_CALL release() throw() { OWeakAggObject::release(); } + void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); } + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XAdjustmentListener + void SAL_CALL adjustmentValueChanged( const ::com::sun::star::awt::AdjustmentEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XScrollBar + void SAL_CALL addAdjustmentListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XAdjustmentListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeAdjustmentListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XAdjustmentListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setValue( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setValues( sal_Int32 nValue, sal_Int32 nVisible, sal_Int32 nMax ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getValue( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMaximum( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getMaximum( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setLineIncrement( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getLineIncrement( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setBlockIncrement( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getBlockIncrement( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setVisibleSize( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getVisibleSize( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setOrientation( sal_Int32 n ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getOrientation( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoScrollBarControl, UnoControlBase, szServiceName2_UnoControlScrollBar ) + }; + + + +//........................................................................ +} // namespacetoolkit +//........................................................................ + +#endif // TOOLKIT_TOOLKIT_CONTROLS_TKSCROLLBAR_HXX diff --git a/toolkit/inc/toolkit/controls/tksimpleanimation.hxx b/toolkit/inc/toolkit/controls/tksimpleanimation.hxx new file mode 100644 index 000000000000..697d1679af45 --- /dev/null +++ b/toolkit/inc/toolkit/controls/tksimpleanimation.hxx @@ -0,0 +1,111 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef TOOLKIT_CONTROLS_TKSIMPLEANIMATION_HXX +#define TOOLKIT_CONTROLS_TKSIMPLEANIMATION_HXX + +#include <toolkit/controls/unocontrolmodel.hxx> +#include <toolkit/helper/servicenames.hxx> +#include <toolkit/controls/unocontrolbase.hxx> +#include <toolkit/helper/macros.hxx> +#include <com/sun/star/graphic/XGraphic.hpp> +#include <com/sun/star/awt/XSimpleAnimation.hpp> +#include <comphelper/uno3.hxx> +#include <cppuhelper/implbase1.hxx> + +//........................................................................ +namespace toolkit +{ +//........................................................................ + + //==================================================================== + //= UnoSimpleAnimationControlModel + //==================================================================== + class UnoSimpleAnimationControlModel : public UnoControlModel + { + protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + + public: + UnoSimpleAnimationControlModel(); + UnoSimpleAnimationControlModel( const UnoSimpleAnimationControlModel& rModel ) : UnoControlModel( rModel ) {;} + + UnoControlModel* Clone() const { return new UnoSimpleAnimationControlModel( *this ); } + + // XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + // XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // XServiceInfo + ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + }; + + //==================================================================== + //= UnoSimpleAnimationControl + //==================================================================== + + typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XSimpleAnimation + > UnoSimpleAnimationControl_Base; + + class UnoSimpleAnimationControl :public UnoControlBase + ,public UnoSimpleAnimationControl_Base + { + private: + + public: + UnoSimpleAnimationControl(); + ::rtl::OUString GetComponentServiceName(); + + DECLARE_UNO3_AGG_DEFAULTS( UnoSimpleAnimationControl, UnoControlBase ); + ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + + void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); } + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XSimpleAnimation + virtual void SAL_CALL start() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL stop() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setImageList( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > >& ImageList ) + throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + }; + +//........................................................................ +} // namespacetoolkit +//........................................................................ + +#endif // TOOLKIT_CONTROLS_TKSIMPLEANIMATION_HXX diff --git a/toolkit/inc/toolkit/controls/tkspinbutton.hxx b/toolkit/inc/toolkit/controls/tkspinbutton.hxx new file mode 100644 index 000000000000..48c602f76cfc --- /dev/null +++ b/toolkit/inc/toolkit/controls/tkspinbutton.hxx @@ -0,0 +1,127 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef TOOLKIT_CONTROLS_TKSPINBUTTON_HXX +#define TOOLKIT_CONTROLS_TKSPINBUTTON_HXX + +#include <toolkit/controls/unocontrolmodel.hxx> +#include <toolkit/helper/servicenames.hxx> +#include <toolkit/controls/unocontrolbase.hxx> +#include <toolkit/helper/macros.hxx> +#include <com/sun/star/awt/XSpinValue.hpp> +#include <com/sun/star/awt/XAdjustmentListener.hpp> +#include <comphelper/uno3.hxx> +#include <cppuhelper/implbase2.hxx> + +//........................................................................ +namespace toolkit +{ +//........................................................................ + + //==================================================================== + //= UnoSpinButtonModel + //==================================================================== + class UnoSpinButtonModel : public UnoControlModel + { + protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + + public: + UnoSpinButtonModel(); + UnoSpinButtonModel( const UnoSpinButtonModel& rModel ) : UnoControlModel( rModel ) {;} + + UnoControlModel* Clone() const { return new UnoSpinButtonModel( *this ); } + + // XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + // XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // XServiceInfo + ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + }; + + //==================================================================== + //= UnoSpinButtonControl + //==================================================================== + + typedef ::cppu::ImplHelper2 < ::com::sun::star::awt::XAdjustmentListener + , ::com::sun::star::awt::XSpinValue + > UnoSpinButtonControl_Base; + + class UnoSpinButtonControl :public UnoControlBase + ,public UnoSpinButtonControl_Base + { + private: + AdjustmentListenerMultiplexer maAdjustmentListeners; + + public: + UnoSpinButtonControl(); + ::rtl::OUString GetComponentServiceName(); + + DECLARE_UNO3_AGG_DEFAULTS( UnoSpinButtonControl, UnoControlBase ); + ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + + void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); } + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XAdjustmentListener + void SAL_CALL adjustmentValueChanged( const ::com::sun::star::awt::AdjustmentEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); + + // XSpinValue + virtual void SAL_CALL addAdjustmentListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XAdjustmentListener >& listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeAdjustmentListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XAdjustmentListener >& listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setValue( sal_Int32 value ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setValues( sal_Int32 minValue, sal_Int32 maxValue, sal_Int32 currentValue ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getValue( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setMinimum( sal_Int32 minValue ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setMaximum( sal_Int32 maxValue ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getMinimum( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getMaximum( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setSpinIncrement( sal_Int32 spinIncrement ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getSpinIncrement( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setOrientation( sal_Int32 orientation ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); + virtual sal_Int32 SAL_CALL getOrientation( ) throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + }; + + + +//........................................................................ +} // namespacetoolkit +//........................................................................ + +#endif // TOOLKIT_CONTROLS_TKSPINBUTTON_HXX diff --git a/toolkit/inc/toolkit/controls/tkthrobber.hxx b/toolkit/inc/toolkit/controls/tkthrobber.hxx new file mode 100644 index 000000000000..d6c3a3d8a511 --- /dev/null +++ b/toolkit/inc/toolkit/controls/tkthrobber.hxx @@ -0,0 +1,109 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef TOOLKIT_CONTROLS_TKTHROBBER_HXX +#define TOOLKIT_CONTROLS_TKTHROBBER_HXX + +#include <toolkit/controls/unocontrolmodel.hxx> +#include <toolkit/helper/servicenames.hxx> +#include <toolkit/controls/unocontrolbase.hxx> +#include <toolkit/helper/macros.hxx> +#include <com/sun/star/graphic/XGraphic.hpp> +#include <com/sun/star/awt/XThrobber.hpp> +#include <comphelper/uno3.hxx> +#include <cppuhelper/implbase1.hxx> + +//........................................................................ +namespace toolkit +{ +//........................................................................ + + //==================================================================== + //= UnoThrobberControlModel + //==================================================================== + class UnoThrobberControlModel : public UnoControlModel + { + protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + + public: + UnoThrobberControlModel(); + UnoThrobberControlModel( const UnoThrobberControlModel& rModel ) : UnoControlModel( rModel ) {;} + + UnoControlModel* Clone() const { return new UnoThrobberControlModel( *this ); } + + // XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + // XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // XServiceInfo + ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + }; + + //==================================================================== + //= UnoThrobberControl + //==================================================================== + + typedef ::cppu::ImplHelper1 < ::com::sun::star::awt::XThrobber + > UnoThrobberControl_Base; + + class UnoThrobberControl :public UnoControlBase + ,public UnoThrobberControl_Base + { + private: + + public: + UnoThrobberControl(); + ::rtl::OUString GetComponentServiceName(); + + DECLARE_UNO3_AGG_DEFAULTS( UnoThrobberControl, UnoControlBase ); + ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + + void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); } + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XThrobber + virtual void SAL_CALL start() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL stop() throw (::com::sun::star::uno::RuntimeException); + + // XServiceInfo + ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + }; + +//........................................................................ +} // namespacetoolkit +//........................................................................ + +#endif // TOOLKIT_CONTROLS_TKTHROBBER_HXX diff --git a/toolkit/inc/toolkit/controls/unocontrol.hxx b/toolkit/inc/toolkit/controls/unocontrol.hxx new file mode 100644 index 000000000000..6bcfa519ed3d --- /dev/null +++ b/toolkit/inc/toolkit/controls/unocontrol.hxx @@ -0,0 +1,245 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _TOOLKIT_CONTROLS_UNOCONTROL_HXX_ +#define _TOOLKIT_CONTROLS_UNOCONTROL_HXX_ + +#include <toolkit/dllapi.h> +#include <com/sun/star/awt/XControl.hpp> +#include <com/sun/star/awt/XWindow2.hpp> +#ifndef _COM_SUN_STAR_AWT_XView_HPP_ +#include <com/sun/star/awt/XView.hpp> +#endif +#include <com/sun/star/beans/XPropertiesChangeListener.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/lang/XTypeProvider.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/awt/XUnitConversion.hpp> +#include <com/sun/star/awt/XStyleSettingsSupplier.hpp> +#include <com/sun/star/accessibility/XAccessible.hpp> +#include <cppuhelper/weakagg.hxx> +#include <osl/mutex.hxx> +#include <toolkit/helper/mutexandbroadcasthelper.hxx> +#include <toolkit/helper/listenermultiplexer.hxx> +#include <cppuhelper/propshlp.hxx> +#include <cppuhelper/interfacecontainer.hxx> +#include <cppuhelper/weakref.hxx> +#include <cppuhelper/implbase9.hxx> +#include <com/sun/star/util/XModeChangeBroadcaster.hpp> +#include <com/sun/star/awt/XVclWindowPeer.hpp> + + +struct UnoControlComponentInfos +{ + sal_Bool bVisible; + sal_Bool bEnable; + long nX, nY, nWidth, nHeight; + sal_uInt16 nFlags; + float nZoomX, nZoomY; + + UnoControlComponentInfos() + { + bVisible = sal_True; + bEnable = sal_True; + nX = nY = nWidth = nHeight = 0; + nFlags = 0; // POSSIZE_POSSIZE; + nZoomX = nZoomY = 1.0f; + } +}; + +struct UnoControl_Data; +// ---------------------------------------------------- +// class UnoControl +// ---------------------------------------------------- +typedef ::cppu::WeakAggImplHelper9 < ::com::sun::star::awt::XControl + , ::com::sun::star::awt::XWindow2 + , ::com::sun::star::awt::XView + , ::com::sun::star::beans::XPropertiesChangeListener + , ::com::sun::star::lang::XServiceInfo + , ::com::sun::star::accessibility::XAccessible + , ::com::sun::star::util::XModeChangeBroadcaster + , ::com::sun::star::awt::XUnitConversion + , ::com::sun::star::awt::XStyleSettingsSupplier + > UnoControl_Base; + +class TOOLKIT_DLLPUBLIC UnoControl : public UnoControl_Base +{ +private: + ::osl::Mutex maMutex; + + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > mxPeer; + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XVclWindowPeer > mxVclWindowPeer; // just to avoid the query_interface thing + +protected: + EventListenerMultiplexer maDisposeListeners; + WindowListenerMultiplexer maWindowListeners; + FocusListenerMultiplexer maFocusListeners; + KeyListenerMultiplexer maKeyListeners; + MouseListenerMultiplexer maMouseListeners; + MouseMotionListenerMultiplexer maMouseMotionListeners; + PaintListenerMultiplexer maPaintListeners; + ::cppu::OInterfaceContainerHelper maModeChangeListeners; + + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxContext; + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > mxModel; + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > mxGraphics; + + ::com::sun::star::uno::WeakReferenceHelper + maAccessibleContext; /// our most recent XAccessibleContext instance + + sal_Bool mbDisposePeer; + sal_Bool mbRefeshingPeer; + sal_Bool mbCreatingPeer; + sal_Bool mbCreatingCompatiblePeer; + sal_Bool mbDesignMode; + + UnoControlComponentInfos maComponentInfos; + UnoControl_Data* mpData; + + ::osl::Mutex& GetMutex() { return maMutex; } + + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow > getParentPeer() const; + virtual void updateFromModel(); + void peerCreated(); + bool ImplCheckLocalize( ::rtl::OUString& _rPossiblyLocalizable ); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > ImplGetCompatiblePeer( sal_Bool bAcceptExistingPeer ); + virtual void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal ); + virtual void PrepareWindowDescriptor( ::com::sun::star::awt::WindowDescriptor& rDesc ); + virtual void ImplModelPropertiesChanged( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& rEvents ); + + void ImplLockPropertyChangeNotification( const ::rtl::OUString& rPropertyName, bool bLock ); + void ImplLockPropertyChangeNotifications( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& rPropertyNames, bool bLock ); + + void disposeAccessibleContext(); + + inline void setPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& _xPeer) + { + mxPeer = _xPeer; + mxVclWindowPeer = ::com::sun::star::uno::Reference< ::com::sun::star::awt::XVclWindowPeer >(mxPeer,::com::sun::star::uno::UNO_QUERY); // just to avoid the query_interface thing + } + + virtual sal_Bool requiresNewPeer( const ::rtl::OUString& _rPropertyName ) const; + +public: + UnoControl(); + ~UnoControl(); + + UnoControlComponentInfos& GetComponentInfos() { return maComponentInfos; } + + + virtual ::rtl::OUString GetComponentServiceName(); + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XComponent + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException); + + // XEventListener + void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XWindow2 + virtual void SAL_CALL setOutputSize( const ::com::sun::star::awt::Size& aSize ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::Size SAL_CALL getOutputSize( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isVisible( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isActive( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL isEnabled( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::sal_Bool SAL_CALL hasFocus( ) throw (::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XWindow + void SAL_CALL setPosSize( sal_Int32 X, sal_Int32 Y, sal_Int32 Width, sal_Int32 Height, sal_Int16 Flags ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Rectangle SAL_CALL getPosSize( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setVisible( sal_Bool Visible ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setEnable( sal_Bool Enable ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setFocus( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeWindowListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeFocusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFocusListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeKeyListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XKeyListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeMouseListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeMouseMotionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XMouseMotionListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addPaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removePaintListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XPaintListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XView + sal_Bool SAL_CALL setGraphics( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics >& aDevice ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XGraphics > SAL_CALL getGraphics( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL getSize( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL draw( sal_Int32 nX, sal_Int32 nY ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setZoom( float fZoomX, float fZoomY ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XControl + void SAL_CALL setContext( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Context ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getContext( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > SAL_CALL getPeer( ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL setModel( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > SAL_CALL getModel( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XView > SAL_CALL getView( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setDesignMode( sal_Bool bOn ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isDesignMode( ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); + + // XAccessible + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (::com::sun::star::uno::RuntimeException); + + // XModeChangeBroadcaster + virtual void SAL_CALL addModeChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModeChangeListener >& _rxListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeModeChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModeChangeListener >& _rxListener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addModeChangeApproveListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModeChangeApproveListener >& _rxListener ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeModeChangeApproveListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModeChangeApproveListener >& _rxListener ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException); + + // XUnitConversion + virtual ::com::sun::star::awt::Point SAL_CALL convertPointToLogic( const ::com::sun::star::awt::Point& Point, ::sal_Int16 TargetUnit ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::Point SAL_CALL convertPointToPixel( const ::com::sun::star::awt::Point& aPoint, ::sal_Int16 SourceUnit ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::Size SAL_CALL convertSizeToLogic( const ::com::sun::star::awt::Size& aSize, ::sal_Int16 TargetUnit ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::awt::Size SAL_CALL convertSizeToPixel( const ::com::sun::star::awt::Size& aSize, ::sal_Int16 SourceUnit ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException); + + // XStyleSettingsSupplier + virtual ::com::sun::star::uno::Reference< ::com::sun::star::awt::XStyleSettings > SAL_CALL getStyleSettings() throw (::com::sun::star::uno::RuntimeException); + +private: + // ::com::sun::star::beans::XPropertiesChangeListener + void SAL_CALL propertiesChange( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyChangeEvent >& evt ) throw(::com::sun::star::uno::RuntimeException); +}; + + + + +#endif // _TOOLKIT_CONTROLS_UNOCONTROL_HXX_ + diff --git a/toolkit/inc/toolkit/controls/unocontrolbase.hxx b/toolkit/inc/toolkit/controls/unocontrolbase.hxx new file mode 100644 index 000000000000..f12dd23a5c67 --- /dev/null +++ b/toolkit/inc/toolkit/controls/unocontrolbase.hxx @@ -0,0 +1,69 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _TOOLKIT_AWT_UNOCONTROLBASE_HXX_ +#define _TOOLKIT_AWT_UNOCONTROLBASE_HXX_ + +#include <com/sun/star/awt/Size.hpp> + +#include <toolkit/controls/unocontrol.hxx> + +// ---------------------------------------------------- +// class UnoControlBase +// ---------------------------------------------------- + +class TOOLKIT_DLLPUBLIC UnoControlBase : public UnoControl +{ +protected: + sal_Bool ImplHasProperty( sal_uInt16 nProp ); + sal_Bool ImplHasProperty( const ::rtl::OUString& aPropertyName ); + void ImplSetPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue, sal_Bool bUpdateThis ); + void ImplSetPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues, sal_Bool bUpdateThis ); + ::com::sun::star::uno::Any ImplGetPropertyValue( const ::rtl::OUString& aPropertyName ); + + sal_Bool ImplGetPropertyValue_BOOL( sal_uInt16 nProp ); + sal_Int16 ImplGetPropertyValue_INT16( sal_uInt16 nProp ); + sal_uInt16 ImplGetPropertyValue_UINT16( sal_uInt16 nProp ); + sal_Int32 ImplGetPropertyValue_INT32( sal_uInt16 nProp ); + sal_uInt32 ImplGetPropertyValue_UINT32( sal_uInt16 nProp ); + double ImplGetPropertyValue_DOUBLE( sal_uInt16 nProp ); + ::rtl::OUString ImplGetPropertyValue_UString( sal_uInt16 nProp ); + + // XLayoutConstrains (nur wenn das Control es unterstuetzt!) + ::com::sun::star::awt::Size Impl_getMinimumSize(); + ::com::sun::star::awt::Size Impl_getPreferredSize(); + ::com::sun::star::awt::Size Impl_calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ); + + // XTextLayoutConstrains (nur wenn das Control es unterstuetzt!) + ::com::sun::star::awt::Size Impl_getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ); + void Impl_getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ); +}; + + + +#endif // _TOOLKIT_AWT_UNOCONTROLBASE_HXX_ + diff --git a/toolkit/inc/toolkit/controls/unocontrolcontainer.hxx b/toolkit/inc/toolkit/controls/unocontrolcontainer.hxx new file mode 100644 index 000000000000..1175d0e85abb --- /dev/null +++ b/toolkit/inc/toolkit/controls/unocontrolcontainer.hxx @@ -0,0 +1,166 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _TOOLKIT_CONTROLS_UNOCONTROLCONTAINER_HXX_ +#define _TOOLKIT_CONTROLS_UNOCONTROLCONTAINER_HXX_ + + +#include <com/sun/star/awt/XControlContainer.hpp> +#include <com/sun/star/awt/XUnoControlContainer.hpp> +#include <com/sun/star/container/XContainer.hpp> +#include <com/sun/star/container/XIdentifierContainer.hpp> + +#include <toolkit/controls/unocontrol.hxx> +#include <toolkit/controls/unocontrolbase.hxx> +#include <toolkit/helper/macros.hxx> +#include <toolkit/helper/servicenames.hxx> + +#include <cppuhelper/implbase4.hxx> + +class UnoControlHolderList; + +// ---------------------------------------------------- +// class UnoControlContainer +// ---------------------------------------------------- +typedef ::cppu::AggImplInheritanceHelper4 < UnoControlBase + , ::com::sun::star::awt::XUnoControlContainer + , ::com::sun::star::awt::XControlContainer + , ::com::sun::star::container::XContainer + , ::com::sun::star::container::XIdentifierContainer + > UnoControlContainer_Base; + +class UnoControlContainer : public UnoControlContainer_Base +{ +private: + UnoControlHolderList* mpControls; + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController > > maTabControllers; + ContainerListenerMultiplexer maCListeners; + +protected: + void ImplActivateTabControllers(); + +public: + UnoControlContainer(); + UnoControlContainer( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > xPeer ); + ~UnoControlContainer(); + + + // ::com::sun::star::lang::XComponent + void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XEventListener + void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::container::XContainer + void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::container::XIdentifierContainer + virtual ::sal_Int32 SAL_CALL insert( const ::com::sun::star::uno::Any& aElement ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::container::XIdentifierReplace + virtual void SAL_CALL removeByIdentifier( ::sal_Int32 Identifier ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL replaceByIdentifer( ::sal_Int32 Identifier, const ::com::sun::star::uno::Any& aElement ) 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::XIdentifierAccess + virtual ::com::sun::star::uno::Any SAL_CALL getByIdentifier( ::sal_Int32 Identifierr ) throw (::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::sal_Int32 > SAL_CALL getIdentifiers( ) 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::awt::XControlContainer + void SAL_CALL setStatusText( const ::rtl::OUString& StatusText ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > > SAL_CALL getControls( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > SAL_CALL getControl( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addControl( const ::rtl::OUString& Name, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& Control ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& Control ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XUnoControlContainer + void SAL_CALL setTabControllers( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController > >& TabControllers ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController > > SAL_CALL getTabControllers( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addTabController( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController >& TabController ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeTabController( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTabController >& TabController ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XControl + void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XWindow + void SAL_CALL setVisible( sal_Bool Visible ) throw(::com::sun::star::uno::RuntimeException); + + DECLIMPL_SERVICEINFO_DERIVED( UnoControlContainer, UnoControlBase, szServiceName2_UnoControlContainer ) + +protected: + virtual void removingControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl ); + virtual void addingControl( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl ); + +private: + /** adds the control to the container, does necessary notifications, and the like + @param _rxControl + the control to add. Must not be <NULL/> + @param _pName + Pointer to a name for the control. Might be <NULL/>, in this case an auotmatic name is generated + @return + the ID of the newly added control + */ + sal_Int32 impl_addControl( + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl, + const ::rtl::OUString* _pName = NULL + ); + + /** removes the given control from the container, including necessary notifications and the like + @param _nId + the ID of the control to remove + @param _rxControl + the control itself. Must be the one which is stored under the given ID. This parameter could also be + obtained inside the method, but callers usually have obtained it, anyway. + @param _pNameAccessor + the name which the control was registered for. Might be <NULL/>, in this case + container event broadcasts use the ID as accessor. + */ + void impl_removeControl( + sal_Int32 _nId, + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl, + const ::rtl::OUString* _pNameAccessor + ); + + /** ensures that the given control has a peer, if necessary and possible + @param _rxControl + an ->XControl which has just been inserted into the container. Must not be <NULL/>. + @precond + our mutex is locked + */ + void impl_createControlPeerIfNecessary( + const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >& _rxControl + ); +}; + + + +#endif // _TOOLKIT_CONTROLS_UNOCONTROLCONTAINER_HXX_ + diff --git a/toolkit/inc/toolkit/controls/unocontrolcontainermodel.hxx b/toolkit/inc/toolkit/controls/unocontrolcontainermodel.hxx new file mode 100644 index 000000000000..ef0d9a4068ee --- /dev/null +++ b/toolkit/inc/toolkit/controls/unocontrolcontainermodel.hxx @@ -0,0 +1,66 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _TOOLKIT_CONTROLS_UNOCONTROLCONTAINERMODEL_HXX_ +#define _TOOLKIT_CONTROLS_UNOCONTROLCONTAINERMODEL_HXX_ + + +#include <toolkit/controls/unocontrolmodel.hxx> +#include <toolkit/helper/macros.hxx> +#include <toolkit/helper/servicenames.hxx> + + +// ---------------------------------------------------- +// class ::com::sun::star::awt::UnoControlContainerModel +// ---------------------------------------------------- +class UnoControlContainerModel : public UnoControlModel +{ +protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > getPropertySetInfo() const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +public: + UnoControlContainerModel(); + UnoControlContainerModel( const UnoControlContainerModel& rModel ) : UnoControlModel( rModel ) {;} + + UnoControlModel* Clone() const { return new UnoControlContainerModel( *this ); } + + // ::com::sun::star::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoControlContainerModel, UnoControlModel, szServiceName2_UnoControlContainerModel ) +}; + + + +#endif // _TOOLKIT_CONTROLS_UNOCONTROLCONTAINERMODEL_HXX_ + diff --git a/toolkit/inc/toolkit/controls/unocontrolmodel.hxx b/toolkit/inc/toolkit/controls/unocontrolmodel.hxx new file mode 100644 index 000000000000..5ac3c33aa1c9 --- /dev/null +++ b/toolkit/inc/toolkit/controls/unocontrolmodel.hxx @@ -0,0 +1,176 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _TOOLKIT_AWT_UNOCONTROLMODEL_HXX_ +#define _TOOLKIT_AWT_UNOCONTROLMODEL_HXX_ + +#include <com/sun/star/awt/XControlModel.hpp> +#include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/lang/XServiceInfo.hpp> +#include <com/sun/star/beans/XPropertyState.hpp> +#include <com/sun/star/io/XPersistObject.hpp> +#include <com/sun/star/lang/XTypeProvider.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/util/XCloneable.hpp> +#include <cppuhelper/weakagg.hxx> +#include <osl/mutex.hxx> + +#include <toolkit/helper/mutexandbroadcasthelper.hxx> +#include <toolkit/helper/listenermultiplexer.hxx> + +#include <cppuhelper/propshlp.hxx> +#include <cppuhelper/interfacecontainer.hxx> + +#include <list> + +class ImplPropertyTable; + +// ---------------------------------------------------- +// class UnoControlModel +// ---------------------------------------------------- + +class TOOLKIT_DLLPUBLIC UnoControlModel : public ::com::sun::star::awt::XControlModel, + public ::com::sun::star::beans::XPropertyState, + public ::com::sun::star::io::XPersistObject, + public ::com::sun::star::lang::XComponent, + public ::com::sun::star::lang::XServiceInfo, + public ::com::sun::star::lang::XTypeProvider, + public ::com::sun::star::lang::XUnoTunnel, + public ::com::sun::star::util::XCloneable, + public MutexAndBroadcastHelper, + public ::cppu::OPropertySetHelper, + public ::cppu::OWeakAggObject +{ +private: + ImplPropertyTable* mpData; + EventListenerMultiplexer maDisposeListeners; + +protected: + void ImplRegisterProperty( sal_uInt16 nPropType ); + void ImplRegisterProperties( const std::list< sal_uInt16 > &rIds ); + void ImplRegisterProperty( sal_uInt16 nPropId, const ::com::sun::star::uno::Any& rDefault ); + ::com::sun::star::uno::Sequence<sal_Int32> ImplGetPropertyIds() const; + virtual ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + sal_Bool ImplHasProperty( sal_uInt16 nPropId ) const; + + /** called before setting multiple properties, allows to care for property dependencies + + <p>When multiple property values are set (e.g. XPropertySet::setPropertyValues), it may happen that some + of them are dependent. For this, derivees which know such dependencies can affect the order in which + the properties are internally really set.</p> + */ + virtual void ImplNormalizePropertySequence( + const sal_Int32 _nCount, /// the number of entries in the arrays + sal_Int32* _pHandles, /// the handles of the properties to set + ::com::sun::star::uno::Any* _pValues, /// the values of the properties to set + sal_Int32* _pValidHandles /// pointer to the valid handles, allowed to be adjusted + ) const SAL_THROW(()); + + /// ensures that two property values in a sequence have a certain order + void ImplEnsureHandleOrder( + const sal_Int32 _nCount, /// number of entries in the array + sal_Int32* _pHandles, /// pointer to the handles + ::com::sun::star::uno::Any* _pValues, /// pointer to the values + sal_Int32 _nFirstHandle, /// first handle, which should precede _nSecondHandle in the sequence + sal_Int32 _nSecondHandle /// second handle, which should supersede _nFirstHandle in the sequence + ) const; + +public: + UnoControlModel(); + UnoControlModel( const UnoControlModel& rModel ); + ~UnoControlModel(); + + virtual UnoControlModel* Clone() const = 0; + + // ::com::sun::star::uno::XAggregation + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return OWeakAggObject::queryInterface(rType); } + void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } + void SAL_CALL release() throw() { OWeakAggObject::release(); } + + ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XUnoTunnel + static const ::com::sun::star::uno::Sequence< sal_Int8 >& GetUnoTunnelId() throw(); + static UnoControlModel* GetImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& rxIFace ) throw(); + sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::util::XCloneable + ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XControlModel + + // ::com::sun::star::lang::XComponent + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& xListener ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener >& aListener ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::beans::XPropertyState + ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + 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); + 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::XServiceInfo + ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + + // ::cppu::OPropertySetHelper + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() = 0; + sal_Bool SAL_CALL convertFastPropertyValue( ::com::sun::star::uno::Any & rConvertedValue, ::com::sun::star::uno::Any & rOldValue, sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::lang::IllegalArgumentException); + void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception); + using cppu::OPropertySetHelper::getFastPropertyValue; + void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const; + + // setValue-Methoden ueberladen, um die Einzelproperties des FontDescriptors abzufangen + // ::com::sun::star::beans::XPropertySet + void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + // ::com::sun::star::beans::XFastPropertySet + void SAL_CALL setFastPropertyValue( sal_Int32 nHandle, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); + // ::com::sun::star::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& PropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& Values ) throw(::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); +}; + +#define UNO_CONTROL_MODEL_REGISTER_PROPERTIES(a) \ + do { \ + std::list< sal_uInt16 > aIds; \ + a::ImplGetPropertyIds( aIds ); \ + ImplRegisterProperties( aIds ); \ + } while (0) + +#endif // _TOOLKIT_AWT_UNOCONTROLMODEL_HXX_ + diff --git a/toolkit/inc/toolkit/controls/unocontrols.hxx b/toolkit/inc/toolkit/controls/unocontrols.hxx new file mode 100644 index 000000000000..01ff047ee3de --- /dev/null +++ b/toolkit/inc/toolkit/controls/unocontrols.hxx @@ -0,0 +1,1505 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef _TOOLKIT_HELPER_UNOCONTROLS_HXX_ +#define _TOOLKIT_HELPER_UNOCONTROLS_HXX_ + +#include <toolkit/dllapi.h> +#include <com/sun/star/awt/XTextComponent.hpp> +#include <com/sun/star/awt/XTextListener.hpp> +#include <com/sun/star/awt/XLayoutConstrains.hpp> +#include <com/sun/star/awt/XTextLayoutConstrains.hpp> +#include <com/sun/star/awt/XButton.hpp> +#include <com/sun/star/awt/XToggleButton.hpp> +#include <com/sun/star/awt/XRadioButton.hpp> +#include <com/sun/star/awt/XItemListener.hpp> +#include <com/sun/star/awt/XCheckBox.hpp> +#include <com/sun/star/awt/XFixedHyperlink.hpp> +#include <com/sun/star/awt/XFixedText.hpp> +#include <com/sun/star/awt/XListBox.hpp> +#include <com/sun/star/awt/XComboBox.hpp> +#include <com/sun/star/awt/XDateField.hpp> +#include <com/sun/star/awt/XSpinField.hpp> +#include <com/sun/star/awt/XTimeField.hpp> +#include <com/sun/star/awt/XNumericField.hpp> +#include <com/sun/star/awt/XCurrencyField.hpp> +#include <com/sun/star/awt/XPatternField.hpp> +#include <com/sun/star/awt/XProgressBar.hpp> +#include <com/sun/star/awt/XItemList.hpp> +#include <com/sun/star/graphic/XGraphicObject.hpp> +#include <toolkit/controls/unocontrolmodel.hxx> +#include <toolkit/controls/unocontrolbase.hxx> +#include <toolkit/helper/macros.hxx> +#include <toolkit/helper/servicenames.hxx> +#include <vcl/bitmapex.hxx> +#include <cppuhelper/implbase5.hxx> +#include <cppuhelper/implbase4.hxx> +#include <cppuhelper/implbase2.hxx> +#include <cppuhelper/implbase1.hxx> +#include <comphelper/uno3.hxx> + +#include <list> +#include <vector> + +#include <boost/scoped_ptr.hpp> +#include <boost/optional.hpp> + +#define UNO_NAME_GRAPHOBJ_URLPREFIX "vnd.sun.star.GraphicObject:" +#define UNO_NAME_GRAPHOBJ_URLPKGPREFIX "vnd.sun.star.Package:" + + +// ---------------------------------------------------- +// class UnoControlEditModel +// ---------------------------------------------------- +class UnoControlEditModel : public UnoControlModel +{ +protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +public: + UnoControlEditModel(); + UnoControlEditModel( const UnoControlEditModel& rModel ) : UnoControlModel( rModel ) {;} + + UnoControlModel* Clone() const { return new UnoControlEditModel( *this ); } + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + + // XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoControlEditModel, UnoControlModel, szServiceName2_UnoControlEditModel ) +}; + +// ---------------------------------------------------- +// class UnoEditControl +// ---------------------------------------------------- +typedef ::cppu::ImplHelper4 < ::com::sun::star::awt::XTextComponent + , ::com::sun::star::awt::XTextListener + , ::com::sun::star::awt::XLayoutConstrains + , ::com::sun::star::awt::XTextLayoutConstrains + > UnoEditControl_Base; +class TOOLKIT_DLLPUBLIC UnoEditControl :public UnoControlBase + ,public UnoEditControl_Base +{ +private: + TextListenerMultiplexer maTextListeners; + + // Not all fields derived from UnoEditCOntrol have the property "Text" + // They only support XTextComponent, so keep the text + // here, maybe there is no Peer when calling setText()... + ::rtl::OUString maText; + USHORT mnMaxTextLen; + + sal_Bool mbSetTextInPeer; + sal_Bool mbSetMaxTextLenInPeer; + sal_Bool mbHasTextProperty; + +public: + + UnoEditControl(); + ::rtl::OUString GetComponentServiceName(); + TextListenerMultiplexer& GetTextListeners() { return maTextListeners; } + + void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal ); + + void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); } + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + + // disambiguate XInterface + DECLARE_XINTERFACE() + + // XAggregation + ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + + // XTypeProvider + DECLARE_XTYPEPROVIDER() + + // XTextListener + void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); + + // XTextComponent + void SAL_CALL addTextListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeTextListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setText( const ::rtl::OUString& aText ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL insertText( const ::com::sun::star::awt::Selection& Sel, const ::rtl::OUString& Text ) throw(::com::sun::star::uno::RuntimeException); + ::rtl::OUString SAL_CALL getText( ) throw(::com::sun::star::uno::RuntimeException); + ::rtl::OUString SAL_CALL getSelectedText( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setSelection( const ::com::sun::star::awt::Selection& aSelection ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Selection SAL_CALL getSelection( ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isEditable( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setEditable( sal_Bool bEditable ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMaxTextLen( sal_Int16 nLen ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getMaxTextLen( ) throw(::com::sun::star::uno::RuntimeException); + + // XLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException); + + // XTextLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) throw(::com::sun::star::uno::RuntimeException); + + // XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoEditControl, UnoControlBase, szServiceName2_UnoControlEdit ) + + sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model) throw ( ::com::sun::star::uno::RuntimeException ); +}; + +// ---------------------------------------------------- +// class UnoControlFileControlModel +// ---------------------------------------------------- +class UnoControlFileControlModel : public UnoControlModel +{ +protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +public: + UnoControlFileControlModel(); + UnoControlFileControlModel( const UnoControlFileControlModel& rModel ) : UnoControlModel( rModel ) {;} + + UnoControlModel* Clone() const { return new UnoControlFileControlModel( *this ); } + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoControlFileControlModel, UnoControlModel, szServiceName2_UnoControlFileControlModel ) +}; + +// ---------------------------------------------------- +// class UnoFileControl +// ---------------------------------------------------- +class UnoFileControl : public UnoEditControl +{ +public: + UnoFileControl(); + ::rtl::OUString GetComponentServiceName(); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoFileControl, UnoEditControl, szServiceName2_UnoControlFileControl ) +}; + +// ---------------------------------------------------- +// class GraphicControlModel +// ---------------------------------------------------- +class GraphicControlModel : public UnoControlModel +{ +private: + bool mbAdjustingImagePosition; + bool mbAdjustingGraphic; + + ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphicObject > mxGrfObj; + ::com::sun::star::uno::Reference< ::com::sun::star::graphic::XGraphic > getGraphicFromURL_nothrow( const ::rtl::OUString& _rURL ); + +protected: + GraphicControlModel() : mbAdjustingImagePosition( false ), mbAdjustingGraphic( false ) { } + GraphicControlModel( const GraphicControlModel& _rSource ) : UnoControlModel( _rSource ), mbAdjustingImagePosition( false ), mbAdjustingGraphic( false ) { } + + // ::cppu::OPropertySetHelper + void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception); + + // UnoControlModel + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + +private: + GraphicControlModel& operator=( const GraphicControlModel& ); // never implemented +}; + +// ---------------------------------------------------- +// class UnoControlButtonModel +// ---------------------------------------------------- +class UnoControlButtonModel : public GraphicControlModel +{ +protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +public: + UnoControlButtonModel(); + UnoControlButtonModel( const UnoControlButtonModel& rModel ) : GraphicControlModel( rModel ) {;} + + UnoControlModel* Clone() const { return new UnoControlButtonModel( *this ); } + + // ::com::sun::star::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoControlButtonModel, GraphicControlModel, szServiceName2_UnoControlButtonModel ) +}; + +// ---------------------------------------------------- +// class UnoButtonControl +// ---------------------------------------------------- +typedef ::cppu::AggImplInheritanceHelper4 < UnoControlBase + , ::com::sun::star::awt::XButton + , ::com::sun::star::awt::XToggleButton + , ::com::sun::star::awt::XLayoutConstrains + , ::com::sun::star::awt::XItemListener + > UnoButtonControl_Base; +class UnoButtonControl : public UnoButtonControl_Base +{ +private: + ActionListenerMultiplexer maActionListeners; + ItemListenerMultiplexer maItemListeners; + ::rtl::OUString maActionCommand; + +public: + + UnoButtonControl(); + ::rtl::OUString GetComponentServiceName(); + + void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XButton + void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setLabel( const ::rtl::OUString& Label ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setActionCommand( const ::rtl::OUString& Command ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XToggleButton + // ::com::sun::star::awt::XItemEventBroadcaster + void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XEventListener + virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); + + // XItemListener + virtual void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoButtonControl, UnoControlBase, szServiceName2_UnoControlButton ) +}; + +// ---------------------------------------------------- +// class UnoControlImageControlModel +// ---------------------------------------------------- +class UnoControlImageControlModel : public GraphicControlModel +{ +private: + bool mbAdjustingImageScaleMode; + +protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +public: + UnoControlImageControlModel(); + UnoControlImageControlModel( const UnoControlImageControlModel& rModel ) : GraphicControlModel( rModel ), mbAdjustingImageScaleMode( false ) { } + + UnoControlModel* Clone() const { return new UnoControlImageControlModel( *this ); } + + // ::com::sun::star::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoControlImageControlModel, GraphicControlModel, szServiceName2_UnoControlImageControlModel ) + + // ::cppu::OPropertySetHelper + void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception); +}; + +// ---------------------------------------------------- +// class UnoImageControlControl +// ---------------------------------------------------- +typedef ::cppu::AggImplInheritanceHelper1 < UnoControlBase + , ::com::sun::star::awt::XLayoutConstrains + > UnoImageControlControl_Base; +class UnoImageControlControl : public UnoImageControlControl_Base +{ +private: + ActionListenerMultiplexer maActionListeners; + ::rtl::OUString maActionCommand; + +public: + + UnoImageControlControl(); + ::rtl::OUString GetComponentServiceName(); + + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XControl + sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoImageControlControl, UnoControlBase, szServiceName2_UnoControlImageControl ) +}; + +// ---------------------------------------------------- +// class UnoControlRadioButtonModel +// ---------------------------------------------------- +class UnoControlRadioButtonModel : public GraphicControlModel + +{ +protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +public: + UnoControlRadioButtonModel(); + UnoControlRadioButtonModel( const UnoControlRadioButtonModel& rModel ) : GraphicControlModel( rModel ) {;} + + UnoControlModel* Clone() const { return new UnoControlRadioButtonModel( *this ); } + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoControlRadioButtonModel, GraphicControlModel, szServiceName2_UnoControlRadioButtonModel ) + +}; + +// ---------------------------------------------------- +// class UnoRadioButtonControl +// ---------------------------------------------------- +typedef ::cppu::AggImplInheritanceHelper4 < UnoControlBase + , ::com::sun::star::awt::XButton + , ::com::sun::star::awt::XRadioButton + , ::com::sun::star::awt::XItemListener + , ::com::sun::star::awt::XLayoutConstrains + > UnoRadioButtonControl_Base; +class UnoRadioButtonControl : public UnoRadioButtonControl_Base +{ +private: + ItemListenerMultiplexer maItemListeners; + ActionListenerMultiplexer maActionListeners; + ::rtl::OUString maActionCommand; + +public: + + UnoRadioButtonControl(); + ::rtl::OUString GetComponentServiceName(); + + void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); } + + // ::com::sun::star::awt::XControl + sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XButton + void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setActionCommand( const ::rtl::OUString& Command ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XRadioButton + void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL getState( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setState( sal_Bool b ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setLabel( const ::rtl::OUString& Label ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XItemListener + void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoRadioButtonControl, UnoControlBase, szServiceName2_UnoControlRadioButton ) + +}; + +// ---------------------------------------------------- +// class UnoControlCheckBoxModel +// ---------------------------------------------------- +class UnoControlCheckBoxModel : public GraphicControlModel +{ +protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +public: + UnoControlCheckBoxModel(); + UnoControlCheckBoxModel( const UnoControlCheckBoxModel& rModel ) : GraphicControlModel( rModel ) {;} + + UnoControlModel* Clone() const { return new UnoControlCheckBoxModel( *this ); } + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoControlCheckBoxModel, GraphicControlModel, szServiceName2_UnoControlCheckBoxModel ) +}; + +// ---------------------------------------------------- +// class UnoCheckBoxControl +// ---------------------------------------------------- +typedef ::cppu::AggImplInheritanceHelper4 < UnoControlBase + , ::com::sun::star::awt::XButton + , ::com::sun::star::awt::XCheckBox + , ::com::sun::star::awt::XItemListener + , ::com::sun::star::awt::XLayoutConstrains + > UnoCheckBoxControl_Base; +class UnoCheckBoxControl : public UnoCheckBoxControl_Base +{ +private: + ItemListenerMultiplexer maItemListeners; + ActionListenerMultiplexer maActionListeners; + ::rtl::OUString maActionCommand; + +public: + + UnoCheckBoxControl(); + ~UnoCheckBoxControl(){;} + ::rtl::OUString GetComponentServiceName(); + + void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); } + + // ::com::sun::star::awt::XControl + sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XButton + void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setActionCommand( const ::rtl::OUString& Command ) throw(::com::sun::star::uno::RuntimeException); + + virtual void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw (::com::sun::star::uno::RuntimeException); + + + sal_Int16 SAL_CALL getState( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setState( sal_Int16 n ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setLabel( const ::rtl::OUString& Label ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL enableTriState( sal_Bool b ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XItemListener + void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoCheckBoxControl, UnoControlBase, szServiceName2_UnoControlCheckBox ) + +}; + +// ---------------------------------------------------- +// class UnoControlFixedTextModel +// ---------------------------------------------------- +class UnoControlFixedHyperlinkModel : public UnoControlModel +{ +protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +public: + UnoControlFixedHyperlinkModel(); + UnoControlFixedHyperlinkModel( const UnoControlFixedHyperlinkModel& rModel ) : UnoControlModel( rModel ) {;} + + UnoControlModel* Clone() const { return new UnoControlFixedHyperlinkModel( *this ); } + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoControlFixedHyperlinkModel, UnoControlModel, szServiceName_UnoControlFixedHyperlinkModel ) +}; + +// ---------------------------------------------------- +// class UnoFixedHyperlinkControl +// ---------------------------------------------------- +class UnoFixedHyperlinkControl : public UnoControlBase, + public ::com::sun::star::awt::XFixedHyperlink, + public ::com::sun::star::awt::XLayoutConstrains +{ +private: + ActionListenerMultiplexer maActionListeners; + +public: + UnoFixedHyperlinkControl(); + + ::rtl::OUString GetComponentServiceName(); + + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlBase::queryInterface(rType); } + ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } + void SAL_CALL release() throw() { OWeakAggObject::release(); } + + void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XControl + sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XFixedHyperlink + void SAL_CALL setText( const ::rtl::OUString& Text ) throw(::com::sun::star::uno::RuntimeException); + ::rtl::OUString SAL_CALL getText( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setURL( const ::rtl::OUString& URL ) throw(::com::sun::star::uno::RuntimeException); + ::rtl::OUString SAL_CALL getURL( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setAlignment( sal_Int16 nAlign ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getAlignment( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoFixedHyperlinkControl, UnoControlBase, szServiceName_UnoControlFixedHyperlink ) +}; + +// ---------------------------------------------------- +// class UnoControlFixedTextModel +// ---------------------------------------------------- +class UnoControlFixedTextModel : public UnoControlModel +{ +protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +public: + UnoControlFixedTextModel(); + UnoControlFixedTextModel( const UnoControlFixedTextModel& rModel ) : UnoControlModel( rModel ) {;} + + UnoControlModel* Clone() const { return new UnoControlFixedTextModel( *this ); } + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoControlFixedTextModel, UnoControlModel, szServiceName2_UnoControlFixedTextModel ) + +}; + +// ---------------------------------------------------- +// class UnoFixedTextControl +// ---------------------------------------------------- +class UnoFixedTextControl : public UnoControlBase, + public ::com::sun::star::awt::XFixedText, + public ::com::sun::star::awt::XLayoutConstrains +{ +public: + UnoFixedTextControl(); + ::rtl::OUString GetComponentServiceName(); + + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlBase::queryInterface(rType); } + ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } + void SAL_CALL release() throw() { OWeakAggObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XControl + sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XFixedText + void SAL_CALL setText( const ::rtl::OUString& Text ) throw(::com::sun::star::uno::RuntimeException); + ::rtl::OUString SAL_CALL getText( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setAlignment( sal_Int16 nAlign ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getAlignment( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoFixedTextControl, UnoControlBase, szServiceName2_UnoControlFixedText ) + +}; + +// ---------------------------------------------------- +// class UnoControlGroupBoxModel +// ---------------------------------------------------- +class UnoControlGroupBoxModel : public UnoControlModel +{ +protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +public: + UnoControlGroupBoxModel(); + UnoControlGroupBoxModel( const UnoControlGroupBoxModel& rModel ) : UnoControlModel( rModel ) {;} + + UnoControlModel* Clone() const { return new UnoControlGroupBoxModel( *this ); } + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoControlGroupBoxModel, UnoControlModel, szServiceName2_UnoControlGroupBoxModel ) + +}; + +// ---------------------------------------------------- +// class UnoGroupBoxControl +// ---------------------------------------------------- +class UnoGroupBoxControl : public UnoControlBase +{ +public: + UnoGroupBoxControl(); + ::rtl::OUString GetComponentServiceName(); + + sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoGroupBoxControl, UnoControlBase, szServiceName2_UnoControlGroupBox ) + +}; + +// ---------------------------------------------------- +// class UnoControlListBoxModel +// ---------------------------------------------------- +struct UnoControlListBoxModel_Data; +typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel + , ::com::sun::star::awt::XItemList + > UnoControlListBoxModel_Base; +class TOOLKIT_DLLPUBLIC UnoControlListBoxModel :public UnoControlListBoxModel_Base +{ +protected: + UnoControlListBoxModel(bool asComboBox); +public: + UnoControlListBoxModel(); + UnoControlListBoxModel( const UnoControlListBoxModel& i_rSource ); + ~UnoControlListBoxModel(); + + UnoControlModel* Clone() const { return new UnoControlListBoxModel( *this ); } + + virtual void ImplNormalizePropertySequence( + const sal_Int32 _nCount, /// the number of entries in the arrays + sal_Int32* _pHandles, /// the handles of the properties to set + ::com::sun::star::uno::Any* _pValues, /// the values of the properties to set + sal_Int32* _pValidHandles /// pointer to the valid handles, allowed to be adjusted + ) const SAL_THROW(()); + + // ::com::sun::star::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + //DECLIMPL_SERVICEINFO_DERIVED( UnoControlListBoxModel, UnoControlModel, szServiceName2_UnoControlListBoxModel ) + ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XItemList + virtual ::sal_Int32 SAL_CALL getItemCount() throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL insertItem( ::sal_Int32 Position, const ::rtl::OUString& ItemText, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL insertItemText( ::sal_Int32 Position, const ::rtl::OUString& ItemText ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL insertItemImage( ::sal_Int32 Position, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeItem( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeAllItems( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setItemText( ::sal_Int32 Position, const ::rtl::OUString& ItemText ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setItemImage( ::sal_Int32 Position, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setItemTextAndImage( ::sal_Int32 Position, const ::rtl::OUString& ItemText, const ::rtl::OUString& ItemImageURL ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL setItemData( ::sal_Int32 Position, const ::com::sun::star::uno::Any& DataValue ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getItemText( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::rtl::OUString SAL_CALL getItemImage( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::beans::Pair< ::rtl::OUString, ::rtl::OUString > SAL_CALL getItemTextAndImage( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Any SAL_CALL getItemData( ::sal_Int32 Position ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Pair< ::rtl::OUString, ::rtl::OUString > > SAL_CALL getAllItems( ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL addItemListListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL removeItemListListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListListener >& Listener ) throw (::com::sun::star::uno::RuntimeException); + + // OPropertySetHelper + void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception); + +protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +private: + void impl_notifyItemListEvent_nolck( + const sal_Int32 i_nItemPosition, + const ::boost::optional< ::rtl::OUString >& i_rItemText, + const ::boost::optional< ::rtl::OUString >& i_rItemImageURL, + void ( SAL_CALL ::com::sun::star::awt::XItemListListener::*NotificationMethod )( const ::com::sun::star::awt::ItemListEvent& ) + ); + + void impl_handleInsert( + const sal_Int32 i_nItemPosition, + const ::boost::optional< ::rtl::OUString >& i_rItemText, + const ::boost::optional< ::rtl::OUString >& i_rItemImageURL, + ::osl::ClearableMutexGuard& i_rClearBeforeNotify + ); + + void impl_handleRemove( + const sal_Int32 i_nItemPosition, + ::osl::ClearableMutexGuard& i_rClearBeforeNotify + ); + + void impl_handleModify( + const sal_Int32 i_nItemPosition, + const ::boost::optional< ::rtl::OUString >& i_rItemText, + const ::boost::optional< ::rtl::OUString >& i_rItemImageURL, + ::osl::ClearableMutexGuard& i_rClearBeforeNotify + ); + + void impl_getStringItemList( ::std::vector< ::rtl::OUString >& o_rStringItems ) const; + void impl_setStringItemList_nolck( const ::std::vector< ::rtl::OUString >& i_rStringItems ); + +protected: + ::boost::scoped_ptr< UnoControlListBoxModel_Data > m_pData; + ::cppu::OInterfaceContainerHelper m_aItemListListeners; +}; + +// ---------------------------------------------------- +// class UnoListBoxControl +// ---------------------------------------------------- +typedef ::cppu::AggImplInheritanceHelper5 < UnoControlBase + , ::com::sun::star::awt::XListBox + , ::com::sun::star::awt::XItemListener + , ::com::sun::star::awt::XLayoutConstrains + , ::com::sun::star::awt::XTextLayoutConstrains + , ::com::sun::star::awt::XItemListListener + > UnoListBoxControl_Base; +class TOOLKIT_DLLPUBLIC UnoListBoxControl : public UnoListBoxControl_Base +{ +public: + UnoListBoxControl(); + ::rtl::OUString GetComponentServiceName(); + + void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoControlBase::disposing( Source ); } + + // ::com::sun::star::awt::XListBox + void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addItem( const ::rtl::OUString& aItem, sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addItems( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aItems, sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeItems( sal_Int16 nPos, sal_Int16 nCount ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getItemCount( ) throw(::com::sun::star::uno::RuntimeException); + ::rtl::OUString SAL_CALL getItem( sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getItems( ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getSelectedItemPos( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL getSelectedItemsPos( ) throw(::com::sun::star::uno::RuntimeException); + ::rtl::OUString SAL_CALL getSelectedItem( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSelectedItems( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL selectItemPos( sal_Int16 nPos, sal_Bool bSelect ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL selectItemsPos( const ::com::sun::star::uno::Sequence< sal_Int16 >& aPositions, sal_Bool bSelect ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL selectItem( const ::rtl::OUString& aItem, sal_Bool bSelect ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isMutipleMode( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMultipleMode( sal_Bool bMulti ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getDropDownLineCount( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setDropDownLineCount( sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL makeVisible( sal_Int16 nEntry ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XItemListener + void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL getPreferredSize( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::awt::Size SAL_CALL calcAdjustedSize( const ::com::sun::star::awt::Size& aNewSize ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XTextLayoutConstrains + ::com::sun::star::awt::Size SAL_CALL getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) throw(::com::sun::star::uno::RuntimeException); + + // XUnoControl + sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model) throw ( ::com::sun::star::uno::RuntimeException ); + + // XItemListListener + virtual void SAL_CALL listItemInserted( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemRemoved( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemModified( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL allItemsRemoved( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL itemListChanged( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + // DECLIMPL_SERVICEINFO_DERIVED( UnoListBoxControl, UnoControlBase, szServiceName2_UnoControlListBox ) + ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + +protected: + void ImplUpdateSelectedItemsProperty(); + virtual void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal ); + virtual void updateFromModel(); + + ActionListenerMultiplexer& getActionListeners(); + ItemListenerMultiplexer& getItemListeners(); +private: + ActionListenerMultiplexer maActionListeners; + ItemListenerMultiplexer maItemListeners; +}; + +// ---------------------------------------------------- +// class UnoControlComboBoxModel +// ---------------------------------------------------- +class UnoControlComboBoxModel : public UnoControlListBoxModel +{ +protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +public: + UnoControlComboBoxModel(); + UnoControlComboBoxModel( const UnoControlComboBoxModel& rModel ) : UnoControlListBoxModel( rModel ) {;} + + UnoControlModel* Clone() const { return new UnoControlComboBoxModel( *this ); } + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + // OPropertySetHelper + void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception); + + // ::com::sun::star::lang::XServiceInfo + ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + // DECLIMPL_SERVICEINFO_DERIVED( UnoControlComboBoxModel, UnoControlModel, szServiceName2_UnoControlComboBoxModel ) + +}; + +// ---------------------------------------------------- +// class UnoComboBoxControl +// ---------------------------------------------------- +class UnoComboBoxControl : public UnoEditControl + , public ::com::sun::star::awt::XComboBox + , public ::com::sun::star::awt::XItemListener + , public ::com::sun::star::awt::XItemListListener +{ +private: + ActionListenerMultiplexer maActionListeners; + ItemListenerMultiplexer maItemListeners; + +public: + + UnoComboBoxControl(); + ::rtl::OUString GetComponentServiceName(); + + void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException) { UnoEditControl::disposing( Source ); } + void SAL_CALL dispose( ) throw(::com::sun::star::uno::RuntimeException); + + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoEditControl::queryInterface(rType); } + ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } + void SAL_CALL release() throw() { OWeakAggObject::release(); } + + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XComboBox + void SAL_CALL addItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeItemListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XItemListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeActionListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XActionListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addItem( const ::rtl::OUString& aItem, sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL addItems( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aItems, sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeItems( sal_Int16 nPos, sal_Int16 nCount ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getItemCount( ) throw(::com::sun::star::uno::RuntimeException); + ::rtl::OUString SAL_CALL getItem( sal_Int16 nPos ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getItems( ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getDropDownLineCount( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setDropDownLineCount( sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException); + + // XUnoControl + virtual sal_Bool SAL_CALL setModel(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& Model) throw ( ::com::sun::star::uno::RuntimeException ); + + // XItemListListener + virtual void SAL_CALL listItemInserted( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemRemoved( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL listItemModified( const ::com::sun::star::awt::ItemListEvent& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL allItemsRemoved( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL itemListChanged( const ::com::sun::star::lang::EventObject& Event ) throw (::com::sun::star::uno::RuntimeException); + + // XItemListener + virtual void SAL_CALL itemStateChanged( const ::com::sun::star::awt::ItemEvent& rEvent ) throw (::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException); + //DECLIMPL_SERVICEINFO_DERIVED( UnoComboBoxControl, UnoEditControl, szServiceName2_UnoControlComboBox ) +protected: + virtual void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal ); + virtual void updateFromModel(); + ActionListenerMultiplexer& getActionListeners(); + ItemListenerMultiplexer& getItemListeners(); + +}; + +// ---------------------------------------------------- +// class UnoSpinFieldControl +// ---------------------------------------------------- +class UnoSpinFieldControl : public UnoEditControl, + public ::com::sun::star::awt::XSpinField +{ +private: + SpinListenerMultiplexer maSpinListeners; + BOOL mbRepeat; + +public: + UnoSpinFieldControl(); + + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoEditControl::queryInterface(rType); } + ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } + void SAL_CALL release() throw() { OWeakAggObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XSpinField + void SAL_CALL addSpinListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XSpinListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL removeSpinListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XSpinListener >& l ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL up() throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL down() throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL first() throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL last() throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL enableRepeat( sal_Bool bRepeat ) throw(::com::sun::star::uno::RuntimeException); + + + // ::com::sun::star::lang::XServiceInfo + // No service info, only base class for other fields. +}; + + +// ---------------------------------------------------- +// class UnoControlDateFieldModel +// ---------------------------------------------------- +class UnoControlDateFieldModel : public UnoControlModel +{ +protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +public: + UnoControlDateFieldModel(); + UnoControlDateFieldModel( const UnoControlDateFieldModel& rModel ) : UnoControlModel( rModel ) {;} + + UnoControlModel* Clone() const { return new UnoControlDateFieldModel( *this ); } + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoControlDateFieldModel, UnoControlModel, szServiceName2_UnoControlDateFieldModel ) + +}; + +// ---------------------------------------------------- +// class UnoDateFieldControl +// ---------------------------------------------------- +class UnoDateFieldControl : public UnoSpinFieldControl, + public ::com::sun::star::awt::XDateField +{ +private: + sal_Int32 mnFirst; + sal_Int32 mnLast; + sal_Bool mbLongFormat; +public: + UnoDateFieldControl(); + ::rtl::OUString GetComponentServiceName(); + + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); } + ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } + void SAL_CALL release() throw() { OWeakAggObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XTextListener + void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); + + //XDateField + void SAL_CALL setDate( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getDate( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMin( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMax( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setFirst( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setLast( sal_Int32 Date ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setLongFormat( sal_Bool bLong ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isLongFormat( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setEmpty( ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isEmpty( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoDateFieldControl, UnoSpinFieldControl, szServiceName2_UnoControlDateField ) +}; + +// ---------------------------------------------------- +// class UnoControlTimeFieldModel +// ---------------------------------------------------- +class UnoControlTimeFieldModel : public UnoControlModel +{ +protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +public: + UnoControlTimeFieldModel(); + UnoControlTimeFieldModel( const UnoControlTimeFieldModel& rModel ) : UnoControlModel( rModel ) {;} + + UnoControlModel* Clone() const { return new UnoControlTimeFieldModel( *this ); } + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoControlTimeFieldModel, UnoControlModel, szServiceName2_UnoControlTimeFieldModel ) + +}; + +// ---------------------------------------------------- +// class UnoTimeFieldControl +// ---------------------------------------------------- +class UnoTimeFieldControl : public UnoSpinFieldControl, + public ::com::sun::star::awt::XTimeField +{ +private: + sal_Int32 mnFirst; + sal_Int32 mnLast; + +public: + UnoTimeFieldControl(); + ::rtl::OUString GetComponentServiceName(); + + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); } + ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } + void SAL_CALL release() throw() { OWeakAggObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XTextListener + void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); + + //XTimeField + void SAL_CALL setTime( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getTime( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMin( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMax( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setFirst( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setLast( sal_Int32 Time ) throw(::com::sun::star::uno::RuntimeException); + sal_Int32 SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setEmpty( ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isEmpty( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoTimeFieldControl, UnoSpinFieldControl, szServiceName2_UnoControlTimeField ) + +}; + +// ---------------------------------------------------- +// class UnoControlNumericFieldModel +// ---------------------------------------------------- +class UnoControlNumericFieldModel : public UnoControlModel +{ +protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +public: + UnoControlNumericFieldModel(); + UnoControlNumericFieldModel( const UnoControlNumericFieldModel& rModel ) : UnoControlModel( rModel ) {;} + + UnoControlModel* Clone() const { return new UnoControlNumericFieldModel( *this ); } + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoControlNumericFieldModel, UnoControlModel, szServiceName2_UnoControlNumericFieldModel ) + +}; + +// ---------------------------------------------------- +// class UnoNumericFieldControl +// ---------------------------------------------------- +class UnoNumericFieldControl : public UnoSpinFieldControl, + public ::com::sun::star::awt::XNumericField +{ +private: + double mnFirst; + double mnLast; + +public: + UnoNumericFieldControl(); + ::rtl::OUString GetComponentServiceName(); + + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); } + ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } + void SAL_CALL release() throw() { OWeakAggObject::release(); } + + void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XTextListener + void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XNumericField + void SAL_CALL setValue( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getValue( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMin( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMax( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setFirst( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setLast( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setSpinSize( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getSpinSize( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setDecimalDigits( sal_Int16 nDigits ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getDecimalDigits( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoNumericFieldControl, UnoSpinFieldControl, szServiceName2_UnoControlNumericField ) + +}; + +// ---------------------------------------------------- +// class UnoControlCurrencyFieldModel +// ---------------------------------------------------- +class UnoControlCurrencyFieldModel : public UnoControlModel +{ +protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +public: + UnoControlCurrencyFieldModel(); + UnoControlCurrencyFieldModel( const UnoControlCurrencyFieldModel& rModel ) : UnoControlModel( rModel ) {;} + + UnoControlModel* Clone() const { return new UnoControlCurrencyFieldModel( *this ); } + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoControlCurrencyFieldModel, UnoControlModel, szServiceName2_UnoControlCurrencyFieldModel ) + +}; + +// ---------------------------------------------------- +// class UnoCurrencyFieldControl +// ---------------------------------------------------- +class UnoCurrencyFieldControl : public UnoSpinFieldControl, + public ::com::sun::star::awt::XCurrencyField +{ +private: + double mnFirst; + double mnLast; + +public: + UnoCurrencyFieldControl(); + ::rtl::OUString GetComponentServiceName(); + + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); } + ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } + void SAL_CALL release() throw() { OWeakAggObject::release(); } + + void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& Toolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& Parent ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XTextListener + void SAL_CALL textChanged( const ::com::sun::star::awt::TextEvent& rEvent ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XCurrencyField + void SAL_CALL setValue( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getValue( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMin( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getMin( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setMax( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getMax( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setFirst( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getFirst( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setLast( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getLast( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setSpinSize( double Value ) throw(::com::sun::star::uno::RuntimeException); + double SAL_CALL getSpinSize( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setDecimalDigits( sal_Int16 nDigits ) throw(::com::sun::star::uno::RuntimeException); + sal_Int16 SAL_CALL getDecimalDigits( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoCurrencyFieldControl, UnoSpinFieldControl, szServiceName2_UnoControlCurrencyField ) +}; + +// ---------------------------------------------------- +// class UnoControlPatternFieldModel +// ---------------------------------------------------- +class UnoControlPatternFieldModel : public UnoControlModel +{ +protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +public: + UnoControlPatternFieldModel(); + UnoControlPatternFieldModel( const UnoControlPatternFieldModel& rModel ) : UnoControlModel( rModel ) {;} + + UnoControlModel* Clone() const { return new UnoControlPatternFieldModel( *this ); } + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoControlPatternFieldModel, UnoControlModel, szServiceName2_UnoControlPatternFieldModel ) + +}; + +// ---------------------------------------------------- +// class UnoPatternFieldControl +// ---------------------------------------------------- +class UnoPatternFieldControl : public UnoSpinFieldControl, + public ::com::sun::star::awt::XPatternField +{ +protected: + void ImplSetPeerProperty( const ::rtl::OUString& rPropName, const ::com::sun::star::uno::Any& rVal ); + +public: + UnoPatternFieldControl(); + ::rtl::OUString GetComponentServiceName(); + + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoSpinFieldControl::queryInterface(rType); } + ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } + void SAL_CALL release() throw() { OWeakAggObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XPatternField + void SAL_CALL setMasks( const ::rtl::OUString& EditMask, const ::rtl::OUString& LiteralMask ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL getMasks( ::rtl::OUString& EditMask, ::rtl::OUString& LiteralMask ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setString( const ::rtl::OUString& Str ) throw(::com::sun::star::uno::RuntimeException); + ::rtl::OUString SAL_CALL getString( ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException); + sal_Bool SAL_CALL isStrictFormat( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoPatternFieldControl, UnoSpinFieldControl, szServiceName2_UnoControlPatternField ) + +}; + +// ---------------------------------------------------- +// class UnoControlProgressBarModel +// ---------------------------------------------------- +class UnoControlProgressBarModel : public UnoControlModel +{ +protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +public: + UnoControlProgressBarModel(); + UnoControlProgressBarModel( const UnoControlProgressBarModel& rModel ) : UnoControlModel( rModel ) {;} + + UnoControlModel* Clone() const { return new UnoControlProgressBarModel( *this ); } + + // ::com::sun::star::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoControlProgressBarModel, UnoControlModel, szServiceName2_UnoControlProgressBarModel ) +}; + +// ---------------------------------------------------- +// class UnoProgressBarControl +// ---------------------------------------------------- +class UnoProgressBarControl : public UnoControlBase, + public ::com::sun::star::awt::XProgressBar +{ +public: + UnoProgressBarControl(); + ::rtl::OUString GetComponentServiceName(); + + ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) { return UnoControlBase::queryInterface(rType); } + ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL acquire() throw() { OWeakAggObject::acquire(); } + void SAL_CALL release() throw() { OWeakAggObject::release(); } + + // ::com::sun::star::lang::XTypeProvider + ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw(::com::sun::star::uno::RuntimeException); + ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::awt::XProgressBar + void SAL_CALL setForegroundColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setBackgroundColor( sal_Int32 nColor ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setValue( sal_Int32 nValue ) throw(::com::sun::star::uno::RuntimeException); + void SAL_CALL setRange( sal_Int32 nMin, sal_Int32 nMax ) throw(::com::sun::star::uno::RuntimeException ); + sal_Int32 SAL_CALL getValue() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoProgressBarControl, UnoControlBase, szServiceName2_UnoControlProgressBar ) +}; + + +// ---------------------------------------------------- +// class UnoControlFixedLineModel +// ---------------------------------------------------- +class UnoControlFixedLineModel : public UnoControlModel +{ +protected: + ::com::sun::star::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const; + ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper(); + +public: + UnoControlFixedLineModel(); + UnoControlFixedLineModel( const UnoControlFixedLineModel& rModel ) : UnoControlModel( rModel ) {;} + + UnoControlModel* Clone() const { return new UnoControlFixedLineModel( *this ); } + + // ::com::sun::star::beans::XMultiPropertySet + ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::io::XPersistObject + ::rtl::OUString SAL_CALL getServiceName() throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoControlFixedLineModel, UnoControlModel, szServiceName2_UnoControlFixedLineModel ) + +}; + +// ---------------------------------------------------- +// class UnoFixedLineControl +// ---------------------------------------------------- +class UnoFixedLineControl : public UnoControlBase +{ +public: + UnoFixedLineControl(); + ::rtl::OUString GetComponentServiceName(); + + sal_Bool SAL_CALL isTransparent( ) throw(::com::sun::star::uno::RuntimeException); + + // ::com::sun::star::lang::XServiceInfo + DECLIMPL_SERVICEINFO_DERIVED( UnoFixedLineControl, UnoControlBase, szServiceName2_UnoControlFixedLine ) + +}; + + +#endif // _TOOLKIT_HELPER_UNOCONTROLS_HXX_ + |