summaryrefslogtreecommitdiffstats
path: root/toolkit/inc/controls
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
commit267c6f2ac71f92999e969232431ba04678e7437e (patch)
tree358c9467650e1d0a1d7227a21dac2e3d08b622b2 /toolkit/inc/controls
parentInitial commit. (diff)
downloadlibreoffice-267c6f2ac71f92999e969232431ba04678e7437e.tar.xz
libreoffice-267c6f2ac71f92999e969232431ba04678e7437e.zip
Adding upstream version 4:24.2.0.upstream/4%24.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/inc/controls')
-rw-r--r--toolkit/inc/controls/accessiblecontrolcontext.hxx116
-rw-r--r--toolkit/inc/controls/animatedimages.hxx89
-rw-r--r--toolkit/inc/controls/controlmodelcontainerbase.hxx270
-rw-r--r--toolkit/inc/controls/dialogcontrol.hxx299
-rw-r--r--toolkit/inc/controls/eventcontainer.hxx82
-rw-r--r--toolkit/inc/controls/filectrl.hxx70
-rw-r--r--toolkit/inc/controls/formattedcontrol.hxx124
-rw-r--r--toolkit/inc/controls/geometrycontrolmodel.hxx251
-rw-r--r--toolkit/inc/controls/geometrycontrolmodel_impl.hxx69
-rw-r--r--toolkit/inc/controls/roadmapcontrol.hxx185
-rw-r--r--toolkit/inc/controls/roadmapentry.hxx69
-rw-r--r--toolkit/inc/controls/stdtabcontroller.hxx86
-rw-r--r--toolkit/inc/controls/stdtabcontrollermodel.hxx123
-rw-r--r--toolkit/inc/controls/svmedit.hxx32
-rw-r--r--toolkit/inc/controls/table/defaultinputhandler.hxx57
-rw-r--r--toolkit/inc/controls/table/gridtablerenderer.hxx116
-rw-r--r--toolkit/inc/controls/table/mousefunction.hxx133
-rw-r--r--toolkit/inc/controls/table/tablecontrol.hxx174
-rw-r--r--toolkit/inc/controls/table/tablecontrolinterface.hxx234
-rw-r--r--toolkit/inc/controls/table/tableinputhandler.hxx63
-rw-r--r--toolkit/inc/controls/table/tablemodel.hxx454
-rw-r--r--toolkit/inc/controls/table/tablerenderer.hxx249
-rw-r--r--toolkit/inc/controls/table/tablesort.hxx79
-rw-r--r--toolkit/inc/controls/table/tabletypes.hxx52
-rw-r--r--toolkit/inc/controls/tabpagecontainer.hxx127
-rw-r--r--toolkit/inc/controls/tabpagemodel.hxx79
-rw-r--r--toolkit/inc/controls/tkscrollbar.hxx112
-rw-r--r--toolkit/inc/controls/treecontrolpeer.hxx166
-rw-r--r--toolkit/inc/controls/unocontrolcontainer.hxx151
-rw-r--r--toolkit/inc/controls/unocontrolcontainermodel.hxx51
30 files changed, 4162 insertions, 0 deletions
diff --git a/toolkit/inc/controls/accessiblecontrolcontext.hxx b/toolkit/inc/controls/accessiblecontrolcontext.hxx
new file mode 100644
index 0000000000..416984c334
--- /dev/null
+++ b/toolkit/inc/controls/accessiblecontrolcontext.hxx
@@ -0,0 +1,116 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <comphelper/accessiblecomponenthelper.hxx>
+#include <com/sun/star/lang/XEventListener.hpp>
+#include <cppuhelper/implbase.hxx>
+#include <rtl/ref.hxx>
+
+namespace vcl { class Window; }
+namespace com::sun::star::awt { class XWindow; }
+namespace com::sun::star::beans { class XPropertySet; }
+namespace com::sun::star::beans { class XPropertySetInfo; }
+
+namespace toolkit
+{
+
+
+ //= OAccessibleControlContext
+
+
+ typedef ::comphelper::OAccessibleComponentHelper OAccessibleControlContext_Base;
+
+ /** class implementing the AccessibleContext for a 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 (a 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 being disposed.</p>
+ */
+ class OAccessibleControlContext final
+ :public cppu::ImplInheritanceHelper<
+ OAccessibleControlContext_Base, css::lang::XEventListener>
+ {
+ public:
+ /** creates an accessible context for a uno control
+ @param _rxCreator
+ the uno control's XAccessible interface. This must be an XControl, from which an XControlModel
+ can be retrieved.
+ */
+ static rtl::Reference<OAccessibleControlContext> create(
+ const css::uno::Reference< css::accessibility::XAccessible >& _rxCreator
+ );
+
+ private:
+
+ // XAccessibleContext
+ virtual sal_Int64 SAL_CALL getAccessibleChildCount( ) override;
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int64 i ) override;
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) override;
+ virtual sal_Int16 SAL_CALL getAccessibleRole( ) override;
+ virtual OUString SAL_CALL getAccessibleDescription( ) override;
+ virtual OUString SAL_CALL getAccessibleName( ) override;
+ virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet( ) override;
+ virtual sal_Int64 SAL_CALL getAccessibleStateSet( ) override;
+
+ // XAccessibleComponent
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const css::awt::Point& aPoint ) override;
+ virtual void SAL_CALL grabFocus( ) override;
+ virtual sal_Int32 SAL_CALL getForeground( ) override;
+ virtual sal_Int32 SAL_CALL getBackground( ) override;
+
+ // XEventListener
+ using comphelper::OCommonAccessibleComponent::disposing;
+ virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
+
+ // retrieves the value of a string property from the model, if the property is present
+ OUString getModelStringProperty( const char* _pPropertyName );
+
+ // starts listening at the control model (currently for disposal only)
+ void startModelListening( );
+ // stops listening at the control model
+ void stopModelListening( );
+
+ vcl::Window* implGetWindow( css::uno::Reference< css::awt::XWindow >* _pxUNOWindow = nullptr ) const;
+
+ /// ctor. @see Init
+ OAccessibleControlContext();
+ virtual ~OAccessibleControlContext() override;
+
+ /** late ctor
+ */
+ void Init(
+ const css::uno::Reference< css::accessibility::XAccessible >& _rxCreator
+ );
+
+ // OCommonAccessibleComponent overridables
+ virtual css::awt::Rectangle implGetBounds( ) override;
+
+ css::uno::Reference< css::beans::XPropertySet >
+ m_xControlModel; // the model of the control which's context we implement
+ css::uno::Reference< css::beans::XPropertySetInfo >
+ m_xModelPropsInfo; // the cached property set info of the model
+ };
+
+
+} // namespace toolkit
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/animatedimages.hxx b/toolkit/inc/controls/animatedimages.hxx
new file mode 100644
index 0000000000..fca49bfa39
--- /dev/null
+++ b/toolkit/inc/controls/animatedimages.hxx
@@ -0,0 +1,89 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <com/sun/star/awt/XAnimatedImages.hpp>
+#include <cppuhelper/implbase1.hxx>
+
+namespace com::sun::star::container { class XContainerListener; }
+namespace com::sun::star::uno { class XComponentContext; }
+
+namespace toolkit
+{
+
+
+ typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel
+ , css::awt::XAnimatedImages
+ > AnimatedImagesControlModel_Base;
+ class AnimatedImagesControlModel : public AnimatedImagesControlModel_Base
+ {
+ public:
+ AnimatedImagesControlModel( css::uno::Reference< css::uno::XComponentContext > const & i_factory );
+ AnimatedImagesControlModel( const AnimatedImagesControlModel& i_copySource );
+
+ virtual rtl::Reference<UnoControlModel> Clone() const override;
+
+ // XPropertySet
+ css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
+
+ // XPersistObject
+ OUString SAL_CALL getServiceName() override;
+
+ // XServiceInfo
+ OUString SAL_CALL getImplementationName( ) override;
+ css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
+
+ // XAnimatedImages
+ virtual ::sal_Int32 SAL_CALL getStepTime() override;
+ virtual void SAL_CALL setStepTime( ::sal_Int32 _steptime ) override;
+ virtual sal_Bool SAL_CALL getAutoRepeat() override;
+ virtual void SAL_CALL setAutoRepeat( sal_Bool _autorepeat ) override;
+ virtual ::sal_Int16 SAL_CALL getScaleMode() override;
+ virtual void SAL_CALL setScaleMode( ::sal_Int16 _scalemode ) override;
+ virtual ::sal_Int32 SAL_CALL getImageSetCount( ) override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getImageSet( ::sal_Int32 i_index ) override;
+ virtual void SAL_CALL insertImageSet( ::sal_Int32 i_index, const css::uno::Sequence< OUString >& i_imageURLs ) override;
+ virtual void SAL_CALL replaceImageSet( ::sal_Int32 i_index, const css::uno::Sequence< OUString >& i_imageURLs ) override;
+ virtual void SAL_CALL removeImageSet( ::sal_Int32 i_index ) override;
+
+ // XAnimatedImages::XContainer
+ virtual void SAL_CALL addContainerListener( const css::uno::Reference< css::container::XContainerListener >& i_listener ) override;
+ virtual void SAL_CALL removeContainerListener( const css::uno::Reference< css::container::XContainerListener >& i_listener ) override;
+
+ protected:
+ virtual ~AnimatedImagesControlModel() override;
+
+ css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
+ ::cppu::IPropertyArrayHelper& getInfoHelper() override;
+ void setFastPropertyValue_NoBroadcast(
+ std::unique_lock<std::mutex>& rGuard,
+ sal_Int32 nHandle, const css::uno::Any& rValue ) override;
+
+ private:
+ comphelper::OInterfaceContainerHelper4<css::container::XContainerListener> maContainerListeners;
+ std::vector< css::uno::Sequence< OUString > > maImageSets;
+ };
+
+
+} // namespace toolkit
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/controlmodelcontainerbase.hxx b/toolkit/inc/controls/controlmodelcontainerbase.hxx
new file mode 100644
index 0000000000..ae414346c7
--- /dev/null
+++ b/toolkit/inc/controls/controlmodelcontainerbase.hxx
@@ -0,0 +1,270 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/container/XContainer.hpp>
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/awt/XTabControllerModel.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 <cppuhelper/implbase8.hxx>
+#include <cppuhelper/implbase3.hxx>
+#include <cppuhelper/weak.hxx>
+#include <toolkit/helper/listenermultiplexer.hxx>
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <controls/unocontrolcontainer.hxx>
+#include <cppuhelper/propshlp.hxx>
+#include <com/sun/star/awt/tab/XTabPageModel.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <comphelper/interfacecontainer4.hxx>
+#include <mutex>
+#include <vector>
+
+namespace com::sun::star::resource { class XStringResourceResolver; }
+namespace com::sun::star::uno { class XComponentContext; }
+
+
+typedef UnoControlModel ControlModel_Base;
+typedef ::cppu::AggImplInheritanceHelper8 < ControlModel_Base
+ , css::lang::XMultiServiceFactory
+ , css::container::XContainer
+ , css::container::XNameContainer
+ , css::awt::XTabControllerModel
+ , css::util::XChangesNotifier
+ , css::beans::XPropertyChangeListener
+ , css::awt::tab::XTabPageModel
+ , css::lang::XInitialization
+ > ControlModelContainer_IBase;
+
+class ControlModelContainerBase : public ControlModelContainer_IBase
+{
+public:
+ enum ChildOperation { Insert = 0, Remove };
+ // would like to make this typedef private, too, but the Forte 7 compiler does have
+ // problems with this...
+ typedef ::std::pair< css::uno::Reference< css::awt::XControlModel >, OUString >
+ UnoControlModelHolder;
+private:
+ typedef ::std::vector< UnoControlModelHolder > UnoControlModelHolderVector;
+
+public:
+ // for grouping control models (XTabControllerModel::getGroupXXX)
+ typedef ::std::vector< css::uno::Reference< css::awt::XControlModel > >
+ ModelGroup;
+ typedef ::std::vector< ModelGroup > AllGroups;
+
+ friend struct CloneControlModel;
+ friend struct CompareControlModel;
+
+protected:
+ ContainerListenerMultiplexer maContainerListeners;
+ ::comphelper::OInterfaceContainerHelper4<css::util::XChangesListener> maChangeListeners;
+ UnoControlModelHolderVector maModels;
+
+ AllGroups maGroups;
+ bool mbGroupsUpToDate;
+
+ OUString m_sImageURL;
+ OUString m_sTooltip;
+ sal_Int16 m_nTabPageId;
+
+ void Clone_Impl(ControlModelContainerBase& _rClone) const;
+protected:
+ css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
+ ::cppu::IPropertyArrayHelper& getInfoHelper() override;
+
+ UnoControlModelHolderVector::iterator ImplFindElement( std::u16string_view rName );
+
+ /// @throws css::lang::IllegalArgumentException
+ /// @throws css::container::ElementExistException
+ /// @throws css::lang::WrappedTargetException
+ /// @throws css::uno::RuntimeException
+ void updateUserFormChildren( const css::uno::Reference< css::container::XNameContainer >& xAllChildren, const OUString& aName, ChildOperation Operation, const css::uno::Reference< css::awt::XControlModel >& xTarget );
+public:
+ ControlModelContainerBase( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
+ ControlModelContainerBase( const ControlModelContainerBase& rModel );
+ virtual ~ControlModelContainerBase() override;
+
+ rtl::Reference<UnoControlModel> Clone() const override;
+
+ // css::container::XContainer
+ void SAL_CALL addContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
+ void SAL_CALL removeContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
+
+ // css::container::XElementAccess
+ css::uno::Type SAL_CALL getElementType( ) override;
+ sal_Bool SAL_CALL hasElements( ) override;
+
+ // css::container::XNameContainer, XNameReplace, XNameAccess
+ void SAL_CALL replaceByName( const OUString& aName, const css::uno::Any& aElement ) override;
+ css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
+ css::uno::Sequence< OUString > SAL_CALL getElementNames( ) override;
+ sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
+ void SAL_CALL insertByName( const OUString& aName, const css::uno::Any& aElement ) override;
+ void SAL_CALL removeByName( const OUString& Name ) override;
+
+ // css::beans::XMultiPropertySet
+ css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
+
+ // css::lang::XMultiServiceFactory
+ css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance( const OUString& aServiceSpecifier ) override;
+ css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments( const OUString& ServiceSpecifier, const css::uno::Sequence< css::uno::Any >& Arguments ) override;
+ css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames( ) override;
+
+ // XComponent
+ void SAL_CALL dispose( ) override;
+
+ // XTabControllerModel
+ virtual sal_Bool SAL_CALL getGroupControl( ) override;
+ virtual void SAL_CALL setGroupControl( sal_Bool GroupControl ) override;
+ virtual void SAL_CALL setControlModels( const css::uno::Sequence< css::uno::Reference< css::awt::XControlModel > >& Controls ) override;
+ virtual css::uno::Sequence< css::uno::Reference< css::awt::XControlModel > > SAL_CALL getControlModels( ) override;
+ virtual void SAL_CALL setGroup( const css::uno::Sequence< css::uno::Reference< css::awt::XControlModel > >& Group, const OUString& GroupName ) override;
+ virtual sal_Int32 SAL_CALL getGroupCount( ) override;
+ virtual void SAL_CALL getGroup( sal_Int32 nGroup, css::uno::Sequence< css::uno::Reference< css::awt::XControlModel > >& Group, OUString& Name ) override;
+ virtual void SAL_CALL getGroupByName( const OUString& Name, css::uno::Sequence< css::uno::Reference< css::awt::XControlModel > >& Group ) override;
+
+ // XChangesNotifier
+ virtual void SAL_CALL addChangesListener( const css::uno::Reference< css::util::XChangesListener >& aListener ) override;
+ virtual void SAL_CALL removeChangesListener( const css::uno::Reference< css::util::XChangesListener >& aListener ) override;
+
+ // XPropertyChangeListener
+ virtual void SAL_CALL propertyChange( const css::beans::PropertyChangeEvent& evt ) override;
+
+ // XEventListener
+ using comphelper::OPropertySetHelper::disposing;
+ virtual void SAL_CALL disposing( const css::lang::EventObject& evt ) override;
+
+ // XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED(ControlModelContainerBase, ControlModel_Base, "toolkit.ControlModelContainerBase" )
+
+ // XInitialization
+ virtual void SAL_CALL initialize (const css::uno::Sequence<css::uno::Any>& rArguments) override;
+
+ // css::awt::tab::XTabPageModel
+ virtual ::sal_Int16 SAL_CALL getTabPageID() override;
+ virtual sal_Bool SAL_CALL getEnabled() override;
+ virtual void SAL_CALL setEnabled( sal_Bool _enabled ) override;
+ virtual OUString SAL_CALL getTitle() override;
+ virtual void SAL_CALL setTitle( const OUString& _title ) override;
+ virtual OUString SAL_CALL getImageURL() override;
+ virtual void SAL_CALL setImageURL( const OUString& _imageurl ) override;
+ virtual OUString SAL_CALL getToolTip() override;
+ virtual void SAL_CALL setToolTip( const OUString& _tooltip ) override;
+
+protected:
+ void startControlListening( const css::uno::Reference< css::awt::XControlModel >& _rxChildModel );
+ void stopControlListening( const css::uno::Reference< css::awt::XControlModel >& _rxChildModel );
+
+ void implNotifyTabModelChange( const OUString& _rAccessor );
+
+ void implUpdateGroupStructure();
+};
+
+class ResourceListener final : public css::util::XModifyListener,
+ public ::cppu::OWeakObject
+{
+ public:
+ ResourceListener( const css::uno::Reference< css::util::XModifyListener >& xListener );
+ virtual ~ResourceListener() override;
+
+ void startListening( const css::uno::Reference< css::resource::XStringResourceResolver >& rResource );
+ void stopListening();
+
+ // XInterface
+ virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
+ virtual void SAL_CALL acquire() noexcept override;
+ virtual void SAL_CALL release() noexcept override;
+
+ // XModifyListener
+ virtual void SAL_CALL modified( const css::lang::EventObject& aEvent ) override;
+
+ // XEventListener
+ virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
+
+ private:
+ std::mutex m_aMutex;
+ css::uno::Reference< css::resource::XStringResourceResolver > m_xResource;
+ css::uno::Reference< css::util::XModifyListener > m_xListener;
+ bool m_bListening;
+};
+
+typedef ::cppu::AggImplInheritanceHelper3 < UnoControlContainer
+ , css::container::XContainerListener
+ , css::util::XChangesListener
+ , css::util::XModifyListener
+ > ControlContainer_IBase;
+
+class ControlContainerBase : public ControlContainer_IBase
+{
+protected:
+ css::uno::Reference< css::uno::XComponentContext > m_xContext;
+ bool mbSizeModified;
+ bool mbPosModified;
+ css::uno::Reference< css::awt::XTabController > mxTabController;
+ css::uno::Reference< css::util::XModifyListener > mxListener;
+
+ void ImplInsertControl( css::uno::Reference< css::awt::XControlModel > const & rxModel, const OUString& rName );
+ void ImplRemoveControl( css::uno::Reference< css::awt::XControlModel > const & rxModel );
+ virtual void ImplSetPosSize( css::uno::Reference< css::awt::XControl >& rxCtrl );
+ void ImplUpdateResourceResolver();
+ void ImplStartListingForResourceEvents();
+
+#ifdef _MSC_VER
+ // just implemented to let the various FooImplInheritanceHelper compile
+ ControlContainerBase();
+#endif
+
+public:
+ ControlContainerBase( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
+ virtual ~ControlContainerBase() override;
+
+ DECLIMPL_SERVICEINFO_DERIVED( ControlContainerBase, UnoControlBase, "toolkit.ControlContainerBase" )
+
+ void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
+ void SAL_CALL dispose() override;
+
+ void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override;
+
+ // css::container::XContainerListener
+ void SAL_CALL elementInserted( const css::container::ContainerEvent& Event ) override;
+ void SAL_CALL elementRemoved( const css::container::ContainerEvent& Event ) override;
+ void SAL_CALL elementReplaced( const css::container::ContainerEvent& Event ) override;
+
+ // XChangesListener
+ virtual void SAL_CALL changesOccurred( const css::util::ChangesEvent& Event ) override;
+
+ // css::awt::XControl
+ sal_Bool SAL_CALL setModel( const css::uno::Reference< css::awt::XControlModel >& Model ) override;
+ void SAL_CALL setDesignMode( sal_Bool bOn ) override;
+ // XModifyListener
+ // Using a dummy/no-op implementation here, not sure if every container control needs
+ // to implement this, certainly Dialog does, lets see about others
+ virtual void SAL_CALL modified( const css::lang::EventObject& ) override {}
+protected:
+ virtual void ImplModelPropertiesChanged( const css::uno::Sequence< css::beans::PropertyChangeEvent >& rEvents ) override;
+ virtual void removingControl( const css::uno::Reference< css::awt::XControl >& _rxControl ) override;
+ virtual void addingControl( const css::uno::Reference< css::awt::XControl >& _rxControl ) override;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/dialogcontrol.hxx b/toolkit/inc/controls/dialogcontrol.hxx
new file mode 100644
index 0000000000..3aaf3e50b1
--- /dev/null
+++ b/toolkit/inc/controls/dialogcontrol.hxx
@@ -0,0 +1,299 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <controls/controlmodelcontainerbase.hxx>
+#include <com/sun/star/awt/UnoControlDialog.hpp>
+#include <com/sun/star/awt/XSimpleTabController.hpp>
+#include <toolkit/helper/macros.hxx>
+#include <cppuhelper/implbase2.hxx>
+
+namespace com::sun::star::awt { class XTopWindowListener; }
+
+typedef ::cppu::AggImplInheritanceHelper2 < ControlContainerBase
+ , css::awt::XUnoControlDialog
+ , css::awt::XWindowListener
+ > UnoDialogControl_Base;
+class UnoDialogControl final : public UnoDialogControl_Base
+{
+private:
+ css::uno::Reference< css::awt::XMenuBar > mxMenuBar;
+ TopWindowListenerMultiplexer maTopWindowListeners;
+ bool mbWindowListener;
+
+public:
+
+ UnoDialogControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
+ virtual ~UnoDialogControl() override;
+ OUString GetComponentServiceName() const override;
+
+ void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override;
+ void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
+ void SAL_CALL dispose() override;
+
+ // css::awt::XTopWindow
+ void SAL_CALL addTopWindowListener( const css::uno::Reference< css::awt::XTopWindowListener >& xListener ) override;
+ void SAL_CALL removeTopWindowListener( const css::uno::Reference< css::awt::XTopWindowListener >& xListener ) override;
+ void SAL_CALL toFront( ) override;
+ void SAL_CALL toBack( ) override;
+ void SAL_CALL setMenuBar( const css::uno::Reference< css::awt::XMenuBar >& xMenu ) override;
+
+ // css::awt::XWindowListener
+ virtual void SAL_CALL windowResized( const css::awt::WindowEvent& e ) override;
+ virtual void SAL_CALL windowMoved( const css::awt::WindowEvent& e ) override;
+ virtual void SAL_CALL windowShown( const css::lang::EventObject& e ) override;
+ virtual void SAL_CALL windowHidden( const css::lang::EventObject& e ) override;
+
+ // css::awt::XDialog2
+ virtual void SAL_CALL endDialog( ::sal_Int32 Result ) override;
+ virtual void SAL_CALL setHelpId( const OUString& Id ) override;
+
+ // css::awt::XDialog
+ void SAL_CALL setTitle( const OUString& Title ) override;
+ OUString SAL_CALL getTitle() override;
+ sal_Int16 SAL_CALL execute() override;
+ void SAL_CALL endExecute() override;
+
+ // css::awt::XControl
+ sal_Bool SAL_CALL setModel( const css::uno::Reference< css::awt::XControlModel >& Model ) override;
+
+ // XModifyListener
+ virtual void SAL_CALL modified( const css::lang::EventObject& aEvent ) override;
+
+ // resolve some ambiguous methods
+ virtual css::uno::Reference<css::awt::XWindowPeer> SAL_CALL getPeer() override
+ { return UnoDialogControl_Base::ControlContainerBase::getPeer(); }
+ virtual void SAL_CALL addWindowListener(const css::uno::Reference<css::awt::XWindowListener>& p1) override
+ { UnoDialogControl_Base::ControlContainerBase::addWindowListener(p1); }
+ virtual css::uno::Reference<css::awt::XControlModel> SAL_CALL getModel() override
+ { return UnoDialogControl_Base::ControlContainerBase::getModel(); }
+ virtual void SAL_CALL addEventListener(const css::uno::Reference<css::lang::XEventListener>& p1) override
+ { UnoDialogControl_Base::ControlContainerBase::addEventListener(p1); }
+ virtual void SAL_CALL removeEventListener(const css::uno::Reference<css::lang::XEventListener>& p1) override
+ { UnoDialogControl_Base::ControlContainerBase::removeEventListener(p1); }
+ virtual void SAL_CALL setContext(const css::uno::Reference<css::uno::XInterface>& p1) override
+ { UnoDialogControl_Base::ControlContainerBase::setContext(p1); }
+ virtual css::uno::Reference<css::uno::XInterface> SAL_CALL getContext() override
+ { return UnoDialogControl_Base::ControlContainerBase::getContext(); }
+ virtual css::uno::Reference<css::awt::XView> SAL_CALL getView() override
+ { return UnoDialogControl_Base::ControlContainerBase::getView(); }
+ virtual void SAL_CALL setDesignMode(sal_Bool p1) override
+ { UnoDialogControl_Base::ControlContainerBase::setDesignMode(p1); }
+ virtual sal_Bool SAL_CALL isDesignMode() override
+ { return UnoDialogControl_Base::ControlContainerBase::isDesignMode(); }
+ virtual sal_Bool SAL_CALL isTransparent() override
+ { return UnoDialogControl_Base::ControlContainerBase::isTransparent(); }
+ virtual void SAL_CALL setPosSize(sal_Int32 p1, sal_Int32 p2, sal_Int32 p3, sal_Int32 p4, sal_Int16 p5) override
+ { UnoDialogControl_Base::ControlContainerBase::setPosSize(p1, p2, p3, p4, p5); }
+ virtual css::awt::Rectangle SAL_CALL getPosSize() override
+ { return UnoDialogControl_Base::ControlContainerBase::getPosSize(); }
+ virtual void SAL_CALL setVisible(sal_Bool p1) override
+ { UnoDialogControl_Base::ControlContainerBase::setVisible(p1); }
+ virtual void SAL_CALL setEnable(sal_Bool p1) override
+ { UnoDialogControl_Base::ControlContainerBase::setEnable(p1); }
+ virtual void SAL_CALL setFocus() override
+ { UnoDialogControl_Base::ControlContainerBase::setFocus(); }
+ virtual void SAL_CALL removeWindowListener(const css::uno::Reference<css::awt::XWindowListener>& p1) override
+ { UnoDialogControl_Base::ControlContainerBase::removeWindowListener(p1); }
+ virtual void SAL_CALL addFocusListener(const css::uno::Reference<css::awt::XFocusListener>& p1) override
+ { UnoDialogControl_Base::ControlContainerBase::addFocusListener(p1); }
+ virtual void SAL_CALL removeFocusListener(const css::uno::Reference<css::awt::XFocusListener>& p1) override
+ { UnoDialogControl_Base::ControlContainerBase::removeFocusListener(p1); }
+ virtual void SAL_CALL addKeyListener(const css::uno::Reference<css::awt::XKeyListener>& p1) override
+ { UnoDialogControl_Base::ControlContainerBase::addKeyListener(p1); }
+ virtual void SAL_CALL removeKeyListener(const css::uno::Reference<css::awt::XKeyListener>& p1) override
+ { UnoDialogControl_Base::ControlContainerBase::removeKeyListener(p1); }
+ virtual void SAL_CALL addMouseListener(const css::uno::Reference<css::awt::XMouseListener>& p1) override
+ { UnoDialogControl_Base::ControlContainerBase::addMouseListener(p1); }
+ virtual void SAL_CALL removeMouseListener(const css::uno::Reference<css::awt::XMouseListener>& p1) override
+ { UnoDialogControl_Base::ControlContainerBase::removeMouseListener(p1); }
+ virtual void SAL_CALL addMouseMotionListener(const css::uno::Reference<css::awt::XMouseMotionListener>& p1) override
+ { UnoDialogControl_Base::ControlContainerBase::addMouseMotionListener(p1); }
+ virtual void SAL_CALL removeMouseMotionListener(const css::uno::Reference<css::awt::XMouseMotionListener>& p1) override
+ { UnoDialogControl_Base::ControlContainerBase::removeMouseMotionListener(p1); }
+ virtual void SAL_CALL addPaintListener(const css::uno::Reference<css::awt::XPaintListener>& p1) override
+ { UnoDialogControl_Base::ControlContainerBase::addPaintListener(p1); }
+ virtual void SAL_CALL removePaintListener(const css::uno::Reference<css::awt::XPaintListener>& p1) override
+ { UnoDialogControl_Base::ControlContainerBase::removePaintListener(p1); }
+ virtual void SAL_CALL setStatusText(const OUString& p1) override
+ { UnoDialogControl_Base::ControlContainerBase::setStatusText(p1); }
+ virtual css::uno::Sequence<css::uno::Reference<css::awt::XControl> > SAL_CALL getControls() override
+ { return UnoDialogControl_Base::ControlContainerBase::getControls(); }
+ virtual css::uno::Reference<css::awt::XControl> SAL_CALL getControl(const OUString& p1) override
+ { return UnoDialogControl_Base::ControlContainerBase::getControl(p1); }
+ virtual void SAL_CALL addControl(const OUString& p1, const css::uno::Reference<css::awt::XControl>& p2) override
+ { UnoDialogControl_Base::ControlContainerBase::addControl(p1, p2); }
+ virtual void SAL_CALL removeControl(const css::uno::Reference<css::awt::XControl>& p1) override
+ { UnoDialogControl_Base::ControlContainerBase::removeControl(p1); }
+
+
+ // css::lang::XServiceInfo
+ OUString SAL_CALL getImplementationName() override;
+
+ sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override;
+
+ css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+
+private:
+ virtual void PrepareWindowDescriptor( css::awt::WindowDescriptor& rDesc ) override;
+ virtual void ImplModelPropertiesChanged( const css::uno::Sequence< css::beans::PropertyChangeEvent >& rEvents ) override;
+};
+
+class UnoMultiPageModel final : public ControlModelContainerBase
+{
+public:
+ UnoMultiPageModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
+ UnoMultiPageModel(const UnoMultiPageModel& rOther) : ControlModelContainerBase(rOther) {}
+ virtual ~UnoMultiPageModel() override;
+
+ rtl::Reference<UnoControlModel> Clone() const override;
+
+ DECLIMPL_SERVICEINFO_DERIVED( UnoMultiPageModel, ControlModelContainerBase, "com.sun.star.awt.UnoMultiPageModel" )
+
+ virtual OUString SAL_CALL getServiceName() override;
+ virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
+ // XNamedContainer
+ void SAL_CALL insertByName( const OUString& aName, const css::uno::Any& aElement ) override;
+
+ // Override the method of parent class
+ virtual sal_Bool SAL_CALL getGroupControl( ) override;
+private:
+ virtual css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
+ ::cppu::IPropertyArrayHelper& getInfoHelper() override;
+
+};
+
+class UnoMultiPageControl final : public ControlContainerBase
+ ,public css::awt::XSimpleTabController
+ ,public css::awt::XTabListener
+{
+ TabListenerMultiplexer maTabListeners;
+ void bindPage( const css::uno::Reference< css::awt::XControl >& _rxControl );
+public:
+ UnoMultiPageControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
+ virtual ~UnoMultiPageControl() override;
+ OUString GetComponentServiceName() const override;
+
+ // css::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoMultiPageControl, ControlContainerBase, "com.sun.star.awt.UnoControlMultiPage" )
+ css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override { return ControlContainerBase::queryInterface(rType); }
+ css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
+ void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); }
+ void SAL_CALL release() noexcept override { OWeakAggObject::release(); }
+ // css::lang::XTypeProvider
+ css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
+ css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
+ void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override;
+ // css::awt::XSimpleTabController
+ virtual ::sal_Int32 SAL_CALL insertTab() override;
+ virtual void SAL_CALL removeTab( ::sal_Int32 ID ) override;
+
+ virtual void SAL_CALL setTabProps( ::sal_Int32 ID, const css::uno::Sequence< css::beans::NamedValue >& Properties ) override;
+ virtual css::uno::Sequence< css::beans::NamedValue > SAL_CALL getTabProps( ::sal_Int32 ID ) override;
+
+ virtual void SAL_CALL activateTab( ::sal_Int32 ID ) override;
+ virtual ::sal_Int32 SAL_CALL getActiveTabID() override;
+
+ virtual void SAL_CALL addTabListener( const css::uno::Reference< css::awt::XTabListener >& Listener ) override;
+ virtual void SAL_CALL removeTabListener( const css::uno::Reference< css::awt::XTabListener >& Listener ) override;
+ // XTabListener
+ virtual void SAL_CALL inserted( ::sal_Int32 ID ) override;
+ virtual void SAL_CALL removed( ::sal_Int32 ID ) override;
+ virtual void SAL_CALL changed( ::sal_Int32 ID, const css::uno::Sequence< css::beans::NamedValue >& Properties ) override;
+ virtual void SAL_CALL activated( ::sal_Int32 ID ) override;
+ virtual void SAL_CALL deactivated( ::sal_Int32 ID ) override;
+ virtual void SAL_CALL disposing( const css::lang::EventObject& evt ) override;
+ // XComponent
+ void SAL_CALL dispose( ) override;
+
+private:
+ virtual void impl_createControlPeerIfNecessary(
+ const css::uno::Reference< css::awt::XControl >& _rxControl
+ ) override;
+
+};
+
+
+class UnoPageModel final : public ControlModelContainerBase
+{
+public:
+ UnoPageModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
+ UnoPageModel(const UnoPageModel& rOther) : ControlModelContainerBase(rOther) {}
+ virtual ~UnoPageModel() override;
+
+ rtl::Reference<UnoControlModel> Clone() const override;
+
+ DECLIMPL_SERVICEINFO_DERIVED( UnoPageModel, ControlModelContainerBase, "com.sun.star.awt.UnoPageModel" )
+
+ virtual OUString SAL_CALL getServiceName() override;
+ virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
+
+ // Override the method of parent class
+ virtual sal_Bool SAL_CALL getGroupControl( ) override;
+private:
+ virtual css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
+ ::cppu::IPropertyArrayHelper& getInfoHelper() override;
+
+};
+
+class UnoPageControl final : public ControlContainerBase
+{
+public:
+ UnoPageControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
+ virtual ~UnoPageControl() override;
+ OUString GetComponentServiceName() const override;
+
+
+ // css::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoPageControl, ControlContainerBase, "com.sun.star.awt.UnoControlPage" )
+};
+
+class UnoFrameModel final : public ControlModelContainerBase
+{
+public:
+ UnoFrameModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
+ UnoFrameModel(const UnoFrameModel& rOther) : ControlModelContainerBase(rOther) {}
+ virtual ~UnoFrameModel() override;
+
+ rtl::Reference<UnoControlModel> Clone() const override;
+
+ DECLIMPL_SERVICEINFO_DERIVED( UnoFrameModel, ControlModelContainerBase, "com.sun.star.awt.UnoFrameModel" )
+
+ virtual OUString SAL_CALL getServiceName() override;
+ virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
+
+private:
+ virtual css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
+ ::cppu::IPropertyArrayHelper& getInfoHelper() override;
+};
+
+class UnoFrameControl final : public ControlContainerBase
+{
+ virtual void ImplSetPosSize( css::uno::Reference< css::awt::XControl >& rxCtrl ) override;
+public:
+ UnoFrameControl( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
+ virtual ~UnoFrameControl() override;
+ OUString GetComponentServiceName() const override;
+
+// css::lang::XServiceInfo
+DECLIMPL_SERVICEINFO_DERIVED( UnoFrameControl, ControlContainerBase, "com.sun.star.awt.UnoControlFrame" )
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/eventcontainer.hxx b/toolkit/inc/controls/eventcontainer.hxx
new file mode 100644
index 0000000000..79a434a398
--- /dev/null
+++ b/toolkit/inc/controls/eventcontainer.hxx
@@ -0,0 +1,82 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <com/sun/star/container/XNameContainer.hpp>
+#include <com/sun/star/container/XContainer.hpp>
+
+#include <toolkit/helper/listenermultiplexer.hxx>
+
+#include <cppuhelper/implbase.hxx>
+#include <unordered_map>
+
+namespace toolkit
+{
+
+// Hashtable to optimize
+typedef std::unordered_map
+<
+ OUString,
+ sal_Int32,
+ OUStringHash
+>
+NameContainerNameMap;
+
+class ScriptEventContainer final : public ::cppu::WeakImplHelper<
+ css::container::XNameContainer,
+ css::container::XContainer >
+{
+ // The map needs to keep the insertion order, otherwise Macro signatures would get broken
+ // if the order changes here (Dialog xml files are digitally signed too).
+ // Thus a std::map or std::unordered_map can't be used.
+ NameContainerNameMap mHashMap;
+ css::uno::Sequence< OUString > mNames;
+ std::vector< css::uno::Any > mValues;
+ css::uno::Type mType;
+
+ ContainerListenerMultiplexer maContainerListeners;
+
+public:
+ ScriptEventContainer();
+
+ // Methods XElementAccess
+ virtual css::uno::Type SAL_CALL getElementType( ) override;
+ virtual sal_Bool SAL_CALL hasElements( ) override;
+
+ // Methods XNameAccess
+ virtual css::uno::Any SAL_CALL getByName( const OUString& aName ) override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getElementNames( ) override;
+ virtual sal_Bool SAL_CALL hasByName( const OUString& aName ) override;
+
+ // Methods XNameReplace
+ virtual void SAL_CALL replaceByName( const OUString& aName, const css::uno::Any& aElement ) override;
+
+ // Methods XNameContainer
+ virtual void SAL_CALL insertByName( const OUString& aName, const css::uno::Any& aElement ) override;
+ virtual void SAL_CALL removeByName( const OUString& Name ) override;
+
+ // Methods XContainer
+ void SAL_CALL addContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
+ void SAL_CALL removeContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
+};
+
+} // namespace toolkit_namecontainer
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/filectrl.hxx b/toolkit/inc/controls/filectrl.hxx
new file mode 100644
index 0000000000..1330d0ce7c
--- /dev/null
+++ b/toolkit/inc/controls/filectrl.hxx
@@ -0,0 +1,70 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <vcl/window.hxx>
+#include <vcl/toolkit/button.hxx>
+
+class Edit;
+
+// Flags for internal use of FileControl
+enum class FileControlMode_Internal
+{
+ INRESIZE = 0x0001,
+ ORIGINALBUTTONTEXT = 0x0002,
+};
+
+namespace o3tl
+{
+ template<> struct typed_flags<FileControlMode_Internal> : is_typed_flags<FileControlMode_Internal, 0x03> {};
+}
+
+
+class FileControl final : public vcl::Window
+{
+ VclPtr<Edit> maEdit;
+ VclPtr<PushButton> maButton;
+ OUString maButtonText;
+ FileControlMode_Internal mnInternalFlags;
+
+ void Resize() override;
+ void GetFocus() override;
+ void StateChanged( StateChangedType nType ) override;
+ WinBits ImplInitStyle( WinBits nStyle );
+ DECL_LINK( ButtonHdl, Button*, void );
+
+public:
+ FileControl( vcl::Window* pParent, WinBits nStyle );
+ virtual ~FileControl() override;
+ virtual void dispose() override;
+
+ Edit& GetEdit() { return *maEdit; }
+ PushButton& GetButton() { return *maButton; }
+
+ void Draw( OutputDevice* pDev, const Point& rPos, SystemTextColorFlags nFlags ) override;
+
+ void SetText( const OUString& rStr ) override;
+ OUString GetText() const override;
+
+ void SetEditModifyHdl( const Link<Edit&,void>& rLink );
+};
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/formattedcontrol.hxx b/toolkit/inc/controls/formattedcontrol.hxx
new file mode 100644
index 0000000000..c614b42c74
--- /dev/null
+++ b/toolkit/inc/controls/formattedcontrol.hxx
@@ -0,0 +1,124 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <toolkit/controls/unocontrols.hxx>
+#include <toolkit/controls/unocontrolmodel.hxx>
+
+namespace com::sun::star::util { class XNumberFormatter; }
+
+
+namespace toolkit
+{
+
+
+ // = UnoControlFormattedFieldModel
+
+ class UnoControlFormattedFieldModel final : public UnoControlModel
+ {
+ public:
+ UnoControlFormattedFieldModel( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
+ UnoControlFormattedFieldModel( const UnoControlFormattedFieldModel& rModel )
+ : UnoControlModel(rModel)
+ , m_bRevokedAsClient(false)
+ , m_bSettingValueAndText(false)
+ {
+ }
+
+ rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlFormattedFieldModel( *this ); }
+
+ // css::io::XPersistObject
+ OUString SAL_CALL getServiceName() override;
+
+ // css::beans::XMultiPropertySet
+ css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
+
+
+ // css::lang::XServiceInfo
+ OUString SAL_CALL getImplementationName() override;
+
+ css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+
+ private:
+ virtual ~UnoControlFormattedFieldModel() override;
+
+ // XComponent
+ void SAL_CALL dispose() override;
+
+ // XPropertySet
+ void SAL_CALL setPropertyValues( const css::uno::Sequence< OUString >& PropertyNames, const css::uno::Sequence< css::uno::Any >& Values ) override;
+
+ // 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
+ css::uno::Any* _pValues, /// the values of the properties to set
+ sal_Int32* _pValidHandles /// pointer to the valid handles, allowed to be adjusted
+ ) const override;
+ void impl_updateTextFromValue_nothrow(std::unique_lock<std::mutex>& rGuard);
+ void impl_updateCachedFormatter_nothrow(std::unique_lock<std::mutex>& rGuard);
+ void impl_updateCachedFormatKey_nothrow(std::unique_lock<std::mutex>& rGuard);
+
+ css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
+ ::cppu::IPropertyArrayHelper& getInfoHelper() override;
+ bool convertFastPropertyValue(
+ std::unique_lock<std::mutex>& rGuard,
+ css::uno::Any& rConvertedValue,
+ css::uno::Any& rOldValue,
+ sal_Int32 nPropId,
+ const css::uno::Any& rValue
+ ) override;
+
+ void setFastPropertyValue_NoBroadcast(
+ std::unique_lock<std::mutex>& rGuard,
+ sal_Int32 nHandle,
+ const css::uno::Any& rValue
+ ) override;
+
+ css::uno::Any m_aCachedFormat;
+ bool m_bRevokedAsClient;
+ bool m_bSettingValueAndText;
+ css::uno::Reference< css::util::XNumberFormatter >
+ m_xCachedFormatter;
+ };
+
+
+ // = UnoFormattedFieldControl
+
+ class UnoFormattedFieldControl final : public UnoSpinFieldControl
+ {
+ public:
+ UnoFormattedFieldControl();
+ OUString GetComponentServiceName() const override;
+
+ // css::awt::XTextListener
+ void SAL_CALL textChanged( const css::awt::TextEvent& rEvent ) override;
+
+ // css::lang::XServiceInfo
+ OUString SAL_CALL getImplementationName() override;
+
+ css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+ };
+
+
+} // namespace toolkit
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/geometrycontrolmodel.hxx b/toolkit/inc/controls/geometrycontrolmodel.hxx
new file mode 100644
index 0000000000..c2dc13b49f
--- /dev/null
+++ b/toolkit/inc/controls/geometrycontrolmodel.hxx
@@ -0,0 +1,251 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <comphelper/broadcasthelper.hxx>
+#include <comphelper/propagg.hxx>
+#include <comphelper/proparrhlp.hxx>
+#include <comphelper/propertycontainer.hxx>
+#include <cppuhelper/compbase2.hxx>
+#include <com/sun/star/util/XCloneable.hpp>
+#include <com/sun/star/script/XScriptEventsSupplier.hpp>
+#include <comphelper/IdPropArrayHelper.hxx>
+#include <rtl/ref.hxx>
+
+namespace com::sun::star::resource { class XStringResourceResolver; }
+
+namespace com::sun::star {
+ namespace uno {
+ class XComponentContext;
+ }
+}
+
+
+// namespace toolkit
+// {
+
+
+ //= OGeometryControlModel_Base
+
+ typedef ::cppu::WeakAggComponentImplHelper2 < css::util::XCloneable
+ , css::script::XScriptEventsSupplier
+ > OGCM_Base;
+ class OGeometryControlModel_Base
+ :public ::comphelper::OMutexAndBroadcastHelper
+ ,public ::comphelper::OPropertySetAggregationHelper
+ ,public ::comphelper::OPropertyContainer
+ ,public OGCM_Base
+ {
+ protected:
+ css::uno::Reference< css::uno::XAggregation >
+ m_xAggregate;
+ css::uno::Reference< css::container::XNameContainer >
+ mxEventContainer;
+
+ // <properties>
+ sal_Int32 m_nPosX;
+ sal_Int32 m_nPosY;
+ sal_Int32 m_nWidth;
+ sal_Int32 m_nHeight;
+ OUString m_aName;
+ sal_Int16 m_nTabIndex;
+ sal_Int32 m_nStep;
+ OUString m_aTag;
+ css::uno::Reference< css::resource::XStringResourceResolver > m_xStrResolver;
+ // </properties>
+
+ bool m_bCloneable;
+
+ protected:
+ static css::uno::Any ImplGetDefaultValueByHandle(sal_Int32 nHandle);
+ css::uno::Any ImplGetPropertyValueByHandle(sal_Int32 nHandle) const;
+ void ImplSetPropertyValueByHandle(sal_Int32 nHandle, const css::uno::Any& aValue);
+
+ protected:
+ /**
+ @param _pAggregateInstance
+ the object to be aggregated. The refcount of the instance given MUST be 0!
+ */
+ OGeometryControlModel_Base(css::uno::XAggregation* _pAggregateInstance);
+
+ /**
+ @param _rxAggregateInstance
+ is the object to be aggregated. Must be acquired exactly once (by the reference object given).<br/>
+ Will be reset to NULL upon leaving
+ */
+ OGeometryControlModel_Base(css::uno::Reference< css::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:
+ virtual ~OGeometryControlModel_Base() override;
+
+ // XAggregation
+ css::uno::Any SAL_CALL queryAggregation( const css::uno::Type& _aType ) override;
+
+ public:
+ // XInterface
+ virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
+ virtual void SAL_CALL acquire( ) noexcept override;
+ virtual void SAL_CALL release( ) noexcept override;
+
+ protected:
+ // XTypeProvider
+ virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( ) override;
+
+ // OPropertySetHelper overridables
+ virtual sal_Bool SAL_CALL convertFastPropertyValue(
+ css::uno::Any& _rConvertedValue, css::uno::Any& _rOldValue,
+ sal_Int32 _nHandle, const css::uno::Any& _rValue ) override;
+
+ virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
+ sal_Int32 _nHandle, const css::uno::Any& _rValue) override;
+
+ using comphelper::OPropertySetAggregationHelper::getFastPropertyValue;
+ virtual void SAL_CALL getFastPropertyValue(
+ css::uno::Any& _rValue, sal_Int32 _nHandle) const override;
+
+ // OPropertyStateHelper overridables
+ virtual css::beans::PropertyState getPropertyStateByHandle(sal_Int32 nHandle) override;
+ virtual void setPropertyToDefaultByHandle(sal_Int32 nHandle) override;
+ virtual css::uno::Any getPropertyDefaultByHandle(sal_Int32 nHandle) const override;
+
+ // XPropertySet
+ virtual css::uno::Reference< css::beans::XPropertySetInfo> SAL_CALL getPropertySetInfo() override;
+
+ // OPropertySetAggregationHelper overridables
+ using OPropertySetAggregationHelper::getInfoHelper;
+
+ // XCloneable
+ virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone( ) override;
+
+ //XScriptEventsSupplier
+ virtual css::uno::Reference< css::container::XNameContainer >
+ SAL_CALL getEvents( ) override;
+
+ // XCloneable implementation - to be overwritten
+ virtual rtl::Reference<OGeometryControlModel_Base> createClone_Impl(
+ css::uno::Reference< css::util::XCloneable >& _rxAggregateInstance) = 0;
+
+ // XComponent
+ using comphelper::OPropertySetAggregationHelper::disposing;
+ virtual void SAL_CALL disposing() override;
+
+ 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 final
+ :public OGeometryControlModel_Base
+ ,public ::comphelper::OAggregationArrayUsageHelper< OTemplateInstanceDisambiguation< CONTROLMODEL > >
+ {
+ public:
+ OGeometryControlModel( const css::uno::Reference< css::uno::XComponentContext >& i_factory );
+
+ private:
+ OGeometryControlModel(css::uno::Reference< css::util::XCloneable >& _rxAggregateInstance);
+
+ // OAggregationArrayUsageHelper overridables
+ virtual void fillProperties(
+ css::uno::Sequence< css::beans::Property >& _rProps,
+ css::uno::Sequence< css::beans::Property >& _rAggregateProps
+ ) const override;
+
+ // OPropertySetAggregationHelper overridables
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
+
+ // OGeometryControlModel_Base
+ virtual rtl::Reference<OGeometryControlModel_Base> createClone_Impl(
+ css::uno::Reference< css::util::XCloneable >& _rxAggregateInstance) override;
+
+ // XTypeProvider
+ virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
+ };
+
+
+ //= OCommonGeometryControlModel
+
+ /** allows to extend an arbitrary com.sun.star.awt::UnoControlModel with geometry
+ information.
+ */
+ class OCommonGeometryControlModel final
+ :public OGeometryControlModel_Base
+ ,public ::comphelper::OIdPropertyArrayUsageHelper< OCommonGeometryControlModel >
+ {
+ private:
+ 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 com.sun.star.awt::UnoControlModel
+ (this is not checked here)
+ */
+ OCommonGeometryControlModel(
+ css::uno::Reference< css::util::XCloneable >& _rxAgg,
+ OUString _aServiceSpecifier
+ );
+
+ // OIdPropertyArrayUsageHelper overridables
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 nId) const override;
+
+ // OPropertySetAggregationHelper overridables
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
+
+ // OGeometryControlModel_Base
+ virtual rtl::Reference<OGeometryControlModel_Base> createClone_Impl(
+ css::uno::Reference< css::util::XCloneable >& _rxAggregateInstance) override;
+
+ // XTypeProvider
+ virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( ) override;
+
+ private:
+ virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
+ sal_Int32 _nHandle, const css::uno::Any& _rValue) override;
+ };
+
+#include <controls/geometrycontrolmodel_impl.hxx>
+
+
+// } // namespace toolkit
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/geometrycontrolmodel_impl.hxx b/toolkit/inc/controls/geometrycontrolmodel_impl.hxx
new file mode 100644
index 0000000000..2ec8595ddd
--- /dev/null
+++ b/toolkit/inc/controls/geometrycontrolmodel_impl.hxx
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+// no include protection. This is included from within geometrycontrolmodel.hxx only
+
+//= OGeometryControlModel
+
+template <class CONTROLMODEL>
+OGeometryControlModel<CONTROLMODEL>::OGeometryControlModel(
+ const css::uno::Reference<css::uno::XComponentContext>& i_factory)
+ : OGeometryControlModel_Base(new CONTROLMODEL(i_factory))
+{
+}
+
+template <class CONTROLMODEL>
+OGeometryControlModel<CONTROLMODEL>::OGeometryControlModel(
+ css::uno::Reference<css::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(
+ css::uno::Sequence<css::beans::Property>& _rProps,
+ css::uno::Sequence<css::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>
+css::uno::Sequence<sal_Int8> SAL_CALL OGeometryControlModel<CONTROLMODEL>::getImplementationId()
+{
+ return css::uno::Sequence<sal_Int8>();
+}
+
+template <class CONTROLMODEL>
+rtl::Reference<OGeometryControlModel_Base> OGeometryControlModel<CONTROLMODEL>::createClone_Impl(
+ css::uno::Reference<css::util::XCloneable>& _rxAggregateInstance)
+{
+ return new OGeometryControlModel<CONTROLMODEL>(_rxAggregateInstance);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/roadmapcontrol.hxx b/toolkit/inc/controls/roadmapcontrol.hxx
new file mode 100644
index 0000000000..cb6e2cec45
--- /dev/null
+++ b/toolkit/inc/controls/roadmapcontrol.hxx
@@ -0,0 +1,185 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+
+#include <toolkit/controls/unocontrols.hxx>
+#include <toolkit/controls/unocontrolmodel.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>
+
+
+namespace toolkit
+{
+
+
+ typedef GraphicControlModel UnoControlRoadmapModel_Base;
+
+
+ typedef ::cppu::ImplHelper3 < css::lang::XSingleServiceFactory
+ , css::container::XContainer
+ , css::container::XIndexContainer
+ > UnoControlRoadmapModel_IBase;
+
+
+ typedef UnoControlBase UnoControlRoadmap_Base;
+ typedef ::cppu::ImplHelper4 < css::awt::XItemEventBroadcaster
+ , css::container::XContainerListener
+ , css::awt::XItemListener
+ , css::beans::XPropertyChangeListener
+ > UnoControlRoadmap_IBase;
+
+
+ typedef ::cppu::ImplHelper2< css::container::XContainerListener,
+ css::awt::XItemEventBroadcaster> SVTXRoadmap_Base;
+
+
+ // = UnoControlRoadmapModel
+
+ class UnoControlRoadmapModel final : public UnoControlRoadmapModel_Base,
+ public UnoControlRoadmapModel_IBase
+
+ {
+ private:
+// PropertyChangeListenerMultiplexer maPropertyListeners;
+
+ typedef ::std::vector< css::uno::Reference< XInterface > > RoadmapItemHolderList;
+
+ ContainerListenerMultiplexer maContainerListeners;
+ RoadmapItemHolderList maRoadmapItems;
+
+ void MakeRMItemValidation( sal_Int32 Index, const css::uno::Reference< XInterface >& xRoadmapItem );
+ css::container::ContainerEvent GetContainerEvent(sal_Int32 Index, const css::uno::Reference< XInterface >& );
+ void SetRMItemDefaultProperties( const css::uno::Reference< XInterface >& );
+ static sal_Int16 GetCurrentItemID( const css::uno::Reference< css::beans::XPropertySet >& xPropertySet );
+ sal_Int32 GetUniqueID();
+
+ css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
+ ::cppu::IPropertyArrayHelper& getInfoHelper() override;
+
+ public:
+ UnoControlRoadmapModel( const css::uno::Reference< css::uno::XComponentContext >& i_factory );
+ UnoControlRoadmapModel( const UnoControlRoadmapModel& rModel ) :
+ UnoControlRoadmapModel_Base( rModel ),
+ UnoControlRoadmapModel_IBase( rModel ),
+ maContainerListeners( *this ) {}
+ rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlRoadmapModel( *this ); }
+
+
+ // XTypeProvider
+ DECLARE_XTYPEPROVIDER( )
+
+
+ // css::io::XPersistObject
+ OUString SAL_CALL getServiceName() override;
+
+ // css::lang::XServiceInfo
+ OUString SAL_CALL getImplementationName() override;
+
+ css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+
+ sal_Int32 SAL_CALL getCount() override;
+ virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
+
+ virtual void SAL_CALL insertByIndex( sal_Int32 Index, const css::uno::Any & Element) override;
+ virtual void SAL_CALL removeByIndex( sal_Int32 Index ) override;
+ virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const css::uno::Any & Element) override;
+
+ virtual void SAL_CALL addContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
+ virtual void SAL_CALL removeContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
+
+ css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override { return UnoControlRoadmapModel_Base::queryInterface(rType); }
+ css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
+ void SAL_CALL acquire() noexcept override { UnoControlRoadmapModel_Base::acquire(); }
+ void SAL_CALL release() noexcept override { UnoControlRoadmapModel_Base::release(); }
+
+
+ // css::beans::XPropertySet
+ virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
+
+
+ virtual css::uno::Reference< XInterface > SAL_CALL createInstance( ) override;
+ virtual css::uno::Reference< XInterface > SAL_CALL createInstanceWithArguments( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
+
+ virtual css::uno::Type SAL_CALL getElementType() override;
+
+ virtual sal_Bool SAL_CALL hasElements() override;
+
+ };
+
+
+ // = UnoRoadmapControl
+
+ class UnoRoadmapControl final : public UnoControlRoadmap_Base,
+ public UnoControlRoadmap_IBase
+ {
+ private:
+ ItemListenerMultiplexer maItemListeners;
+ public:
+ UnoRoadmapControl();
+ OUString GetComponentServiceName() const override;
+
+ void SAL_CALL disposing( const css::lang::EventObject& Source ) override { UnoControlBase::disposing( Source ); }
+
+ void SAL_CALL dispose( ) override;
+
+
+ sal_Bool SAL_CALL setModel(const css::uno::Reference< css::awt::XControlModel >& Model) override;
+
+ void SAL_CALL elementInserted( const css::container::ContainerEvent& rEvent ) override;
+ void SAL_CALL elementRemoved( const css::container::ContainerEvent& rEvent ) override;
+ void SAL_CALL elementReplaced( const css::container::ContainerEvent& rEvent ) override;
+
+ virtual void SAL_CALL addItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override;
+ virtual void SAL_CALL removeItemListener( const css::uno::Reference< css::awt::XItemListener >& l ) override;
+
+
+ virtual void SAL_CALL itemStateChanged( const css::awt::ItemEvent& rEvent ) override;
+
+ virtual void SAL_CALL propertyChange( const css::beans::PropertyChangeEvent& evt ) override;
+
+ // XTypeProvider
+ DECLARE_XTYPEPROVIDER( )
+ DECLARE_UNO3_AGG_DEFAULTS(UnoRoadmapControl, UnoControlRoadmap_Base)
+
+ css::uno::Any SAL_CALL queryAggregation(css::uno::Type const & aType) override;
+
+ // css::lang::XServiceInfo
+ OUString SAL_CALL getImplementationName() override;
+
+ css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+ };
+
+
+} // toolkit
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/roadmapentry.hxx b/toolkit/inc/controls/roadmapentry.hxx
new file mode 100644
index 0000000000..b8490439c9
--- /dev/null
+++ b/toolkit/inc/controls/roadmapentry.hxx
@@ -0,0 +1,69 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#pragma once
+
+#include <comphelper/uno3.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <comphelper/propertycontainer.hxx>
+#include <comphelper/proparrhlp.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <cppuhelper/implbase.hxx>
+
+
+#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::WeakImplHelper< css::lang::XServiceInfo > ORoadmapEntry_Base;
+
+class ORoadmapEntry final : public ORoadmapEntry_Base
+ ,public ::comphelper::OMutexAndBroadcastHelper
+ ,public ::comphelper::OPropertyContainer
+ ,public ::comphelper::OPropertyArrayUsageHelper< ORoadmapEntry >
+{
+
+public:
+ ORoadmapEntry();
+
+ DECLARE_XINTERFACE() // merge XInterface implementations
+ DECLARE_XTYPEPROVIDER() // merge XTypeProvider implementations
+
+private:
+ /// @see css::beans::XPropertySet
+ virtual css::uno::Reference< css::beans::XPropertySetInfo >
+ SAL_CALL getPropertySetInfo() override;
+
+ // OPropertySetHelper
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
+
+ // OPropertyArrayUsageHelper
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
+
+ virtual OUString SAL_CALL getImplementationName( ) override;
+ virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
+ virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
+
+ OUString m_sLabel;
+ sal_Int32 m_nID;
+ bool m_bEnabled;
+ bool m_bInteractive;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/stdtabcontroller.hxx b/toolkit/inc/controls/stdtabcontroller.hxx
new file mode 100644
index 0000000000..37de42d7da
--- /dev/null
+++ b/toolkit/inc/controls/stdtabcontroller.hxx
@@ -0,0 +1,86 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/awt/XTabController.hpp>
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#include <cppuhelper/weakagg.hxx>
+#include <osl/mutex.hxx>
+
+
+namespace com::sun::star::awt { class XWindow; }
+namespace com::sun::star::awt { class XControl; }
+namespace com::sun::star::awt { class XControlContainer; }
+
+class StdTabController final : public css::awt::XTabController,
+ public css::lang::XServiceInfo,
+ public css::lang::XTypeProvider,
+ public ::cppu::OWeakAggObject
+{
+private:
+ ::osl::Mutex maMutex;
+ css::uno::Reference< css::awt::XTabControllerModel > mxModel;
+ css::uno::Reference< css::awt::XControlContainer > mxControlContainer;
+
+ ::osl::Mutex& GetMutex() { return maMutex; }
+ static bool ImplCreateComponentSequence( css::uno::Sequence< css::uno::Reference< css::awt::XControl > >& rControls, const css::uno::Sequence< css::uno::Reference< css::awt::XControlModel > >& rModels, css::uno::Sequence< css::uno::Reference< css::awt::XWindow > >& rComponents, css::uno::Sequence< css::uno::Any>* pTabStops, bool bPeerComponent );
+ // if sequence length of rModels is less than rControls, return only the matching elements in rModels sequence and remove corresponding elements from rControls
+ void ImplActivateControl( bool bFirst ) const;
+
+public:
+ StdTabController();
+ virtual ~StdTabController() override;
+
+ static css::uno::Reference< css::awt::XControl > FindControl( css::uno::Sequence< css::uno::Reference< css::awt::XControl > >& rCtrls, const css::uno::Reference< css::awt::XControlModel > & rxCtrlModel );
+
+ // css::uno::XInterface
+ css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override { return OWeakAggObject::queryInterface(rType); }
+ void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); }
+ void SAL_CALL release() noexcept override { OWeakAggObject::release(); }
+
+ css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
+
+ // css::lang::XTypeProvider
+ css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
+ css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
+
+ // XTabController
+ void SAL_CALL setModel( const css::uno::Reference< css::awt::XTabControllerModel >& Model ) override;
+ css::uno::Reference< css::awt::XTabControllerModel > SAL_CALL getModel( ) override;
+ void SAL_CALL setContainer( const css::uno::Reference< css::awt::XControlContainer >& Container ) override;
+ css::uno::Reference< css::awt::XControlContainer > SAL_CALL getContainer( ) override;
+ css::uno::Sequence< css::uno::Reference< css::awt::XControl > > SAL_CALL getControls( ) override;
+ void SAL_CALL autoTabOrder( ) override;
+ void SAL_CALL activateTabOrder( ) override;
+ void SAL_CALL activateFirst( ) override;
+ void SAL_CALL activateLast( ) override;
+
+ // XServiceInfo
+ OUString SAL_CALL getImplementationName() override;
+
+ sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override;
+
+ css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+};
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/stdtabcontrollermodel.hxx b/toolkit/inc/controls/stdtabcontrollermodel.hxx
new file mode 100644
index 0000000000..4fa12d252e
--- /dev/null
+++ b/toolkit/inc/controls/stdtabcontrollermodel.hxx
@@ -0,0 +1,123 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+
+#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/lang/XTypeProvider.hpp>
+#include <cppuhelper/weakagg.hxx>
+#include <osl/mutex.hxx>
+
+#include <vector>
+
+struct UnoControlModelEntry;
+typedef ::std::vector< UnoControlModelEntry* > UnoControlModelEntryListBase;
+
+class UnoControlModelEntryList
+{
+private:
+ UnoControlModelEntryListBase maList;
+ OUString maGroupName;
+
+public:
+ UnoControlModelEntryList();
+ ~UnoControlModelEntryList();
+
+ const OUString& GetName() const { return maGroupName; }
+ void SetName( const OUString& rName ) { maGroupName = rName; }
+
+ void Reset();
+ void DestroyEntry( size_t nEntry );
+ size_t size() const;
+ UnoControlModelEntry* operator[]( size_t i ) const;
+ void push_back( UnoControlModelEntry* item );
+ void insert( size_t i, UnoControlModelEntry* item );
+};
+
+struct UnoControlModelEntry
+{
+ bool bGroup;
+ union
+ {
+ css::uno::Reference< css::awt::XControlModel >* pxControl;
+ UnoControlModelEntryList* pGroup;
+ };
+};
+
+#define CONTROLPOS_NOTFOUND 0xFFFFFFFF
+
+class StdTabControllerModel final : public css::awt::XTabControllerModel,
+ public css::lang::XServiceInfo,
+ public css::io::XPersistObject,
+ public css::lang::XTypeProvider,
+ public ::cppu::OWeakAggObject
+{
+ ::osl::Mutex maMutex;
+ UnoControlModelEntryList maControls;
+ bool mbGroupControl;
+
+ ::osl::Mutex& GetMutex() { return maMutex; }
+ sal_uInt32 ImplGetControlCount( const UnoControlModelEntryList& rList ) const;
+ void ImplGetControlModels( css::uno::Reference< css::awt::XControlModel > ** pRefs, const UnoControlModelEntryList& rList ) const;
+ static void ImplSetControlModels( UnoControlModelEntryList& rList, const css::uno::Sequence< css::uno::Reference< css::awt::XControlModel > >& Controls );
+ static sal_uInt32 ImplGetControlPos( const css::uno::Reference< css::awt::XControlModel >& rCtrl, const UnoControlModelEntryList& rList );
+
+public:
+ StdTabControllerModel();
+ virtual ~StdTabControllerModel() override;
+
+ // css::uno::XInterface
+ css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override { return OWeakAggObject::queryInterface(rType); }
+ void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); }
+ void SAL_CALL release() noexcept override { OWeakAggObject::release(); }
+
+ css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
+
+ // css::lang::XTypeProvider
+ css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
+ css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
+
+ // css::awt::XTabControllerModel
+ sal_Bool SAL_CALL getGroupControl( ) override;
+ void SAL_CALL setGroupControl( sal_Bool GroupControl ) override;
+ void SAL_CALL setControlModels( const css::uno::Sequence< css::uno::Reference< css::awt::XControlModel > >& Controls ) override;
+ css::uno::Sequence< css::uno::Reference< css::awt::XControlModel > > SAL_CALL getControlModels( ) override;
+ void SAL_CALL setGroup( const css::uno::Sequence< css::uno::Reference< css::awt::XControlModel > >& Group, const OUString& GroupName ) override;
+ sal_Int32 SAL_CALL getGroupCount( ) override;
+ void SAL_CALL getGroup( sal_Int32 nGroup, css::uno::Sequence< css::uno::Reference< css::awt::XControlModel > >& Group, OUString& Name ) override;
+ void SAL_CALL getGroupByName( const OUString& Name, css::uno::Sequence< css::uno::Reference< css::awt::XControlModel > >& Group ) override;
+
+ // css::io::XPersistObject
+ OUString SAL_CALL getServiceName( ) override;
+ void SAL_CALL write( const css::uno::Reference< css::io::XObjectOutputStream >& OutStream ) override;
+ void SAL_CALL read( const css::uno::Reference< css::io::XObjectInputStream >& InStream ) override;
+
+ // XServiceInfo
+ OUString SAL_CALL getImplementationName() override;
+
+ sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override;
+
+ css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+};
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/svmedit.hxx b/toolkit/inc/controls/svmedit.hxx
new file mode 100644
index 0000000000..61befc9815
--- /dev/null
+++ b/toolkit/inc/controls/svmedit.hxx
@@ -0,0 +1,32 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <vcl/toolkit/vclmedit.hxx>
+
+class MultiLineEdit final : public VclMultiLineEdit
+{
+public:
+ MultiLineEdit( vcl::Window* pParent, WinBits nWinStyle );
+
+ virtual css::uno::Reference< css::awt::XVclWindowPeer > GetComponentInterface(bool bCreate = true) override;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/table/defaultinputhandler.hxx b/toolkit/inc/controls/table/defaultinputhandler.hxx
new file mode 100644
index 0000000000..3f3d425a69
--- /dev/null
+++ b/toolkit/inc/controls/table/defaultinputhandler.hxx
@@ -0,0 +1,57 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <controls/table/mousefunction.hxx>
+#include <controls/table/tableinputhandler.hxx>
+#include <rtl/ref.hxx>
+
+#include <vector>
+
+namespace svt::table
+{
+
+ class DefaultInputHandler final : public ITableInputHandler
+ {
+ public:
+ DefaultInputHandler();
+ virtual ~DefaultInputHandler() override;
+
+ virtual bool MouseMove ( ITableControl& _rControl, const MouseEvent& rMEvt ) override;
+ virtual bool MouseButtonDown ( ITableControl& _rControl, const MouseEvent& rMEvt ) override;
+ virtual bool MouseButtonUp ( ITableControl& _rControl, const MouseEvent& rMEvt ) override;
+ virtual bool KeyInput ( ITableControl& _rControl, const KeyEvent& rKEvt ) override;
+ virtual bool GetFocus ( ITableControl& _rControl ) override;
+ virtual bool LoseFocus ( ITableControl& _rControl ) override;
+
+ private:
+ bool delegateMouseEvent( ITableControl& i_control, const MouseEvent& i_event,
+ FunctionResult ( MouseFunction::*i_handlerMethod )( ITableControl&, const MouseEvent& ) );
+
+ rtl::Reference< MouseFunction > pActiveFunction;
+ std::vector< rtl::Reference< MouseFunction > > aMouseFunctions;
+ };
+
+
+} // namespace svt::table
+
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/table/gridtablerenderer.hxx b/toolkit/inc/controls/table/gridtablerenderer.hxx
new file mode 100644
index 0000000000..e2634b2d26
--- /dev/null
+++ b/toolkit/inc/controls/table/gridtablerenderer.hxx
@@ -0,0 +1,116 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <controls/table/tablemodel.hxx>
+#include <vcl/image.hxx>
+
+#include <memory>
+
+
+namespace svt::table
+{
+
+
+ struct GridTableRenderer_Impl;
+
+
+ //= GridTableRenderer
+
+ /** a default implementation for the ->ITableRenderer interface
+
+ This class is able to paint a table grid, table headers, and cell
+ backgrounds according to the selected/active state of cells.
+ */
+ class GridTableRenderer final : public ITableRenderer
+ {
+ private:
+ ::std::unique_ptr< GridTableRenderer_Impl > m_pImpl;
+
+ public:
+ /** creates a table renderer associated with the given model
+
+ @param _rModel
+ the model which should be rendered. The caller is responsible
+ for lifetime control, that is, the model instance must live
+ at least as long as the renderer instance lives
+ */
+ GridTableRenderer( ITableModel& _rModel );
+ virtual ~GridTableRenderer() override;
+
+ /** determines whether or not to paint grid lines
+ */
+ bool useGridLines() const;
+
+ /** controls whether or not to paint grid lines
+ */
+ void useGridLines( bool const i_use );
+
+ public:
+ // ITableRenderer overridables
+ virtual void PaintHeaderArea(
+ vcl::RenderContext& _rDevice, const tools::Rectangle& _rArea,
+ bool _bIsColHeaderArea, bool _bIsRowHeaderArea,
+ const StyleSettings& _rStyle ) override;
+ virtual void PaintColumnHeader( ColPos _nCol,
+ vcl::RenderContext& _rDevice, const tools::Rectangle& _rArea,
+ const StyleSettings& _rStyle ) override;
+ virtual void PrepareRow( RowPos _nRow, bool i_hasControlFocus, bool _bSelected,
+ vcl::RenderContext& _rDevice, const tools::Rectangle& _rRowArea,
+ const StyleSettings& _rStyle ) override;
+ virtual void PaintRowHeader(
+ vcl::RenderContext& _rDevice, const tools::Rectangle& _rArea,
+ const StyleSettings& _rStyle ) override;
+ virtual void PaintCell( ColPos const i_col,
+ bool i_hasControlFocus, bool _bSelected,
+ vcl::RenderContext& _rDevice, const tools::Rectangle& _rArea,
+ const StyleSettings& _rStyle ) override;
+ virtual void ShowCellCursor( vcl::Window& _rView, const tools::Rectangle& _rCursorRect) override;
+ virtual void HideCellCursor( vcl::Window& _rView ) override;
+ virtual bool FitsIntoCell(
+ css::uno::Any const & i_cellContent,
+ OutputDevice& i_targetDevice, tools::Rectangle const & i_targetArea
+ ) const override;
+ virtual bool GetFormattedCellString(
+ css::uno::Any const & i_cellValue,
+ OUString & o_cellString
+ ) const override;
+
+ private:
+ struct CellRenderContext;
+
+ void impl_paintCellContent(
+ CellRenderContext const & i_context
+ );
+ void impl_paintCellImage(
+ CellRenderContext const & i_context,
+ Image const & i_image
+ );
+ void impl_paintCellText(
+ CellRenderContext const & i_context,
+ OUString const & i_text
+ );
+ };
+
+} // namespace svt::table
+
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/table/mousefunction.hxx b/toolkit/inc/controls/table/mousefunction.hxx
new file mode 100644
index 0000000000..ef68dc89ce
--- /dev/null
+++ b/toolkit/inc/controls/table/mousefunction.hxx
@@ -0,0 +1,133 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include "tabletypes.hxx"
+
+#include <salhelper/simplereferenceobject.hxx>
+
+class MouseEvent;
+
+namespace svt::table
+{
+class ITableControl;
+
+//= FunctionResult
+
+enum FunctionResult
+{
+ ActivateFunction,
+ ContinueFunction,
+ DeactivateFunction,
+
+ SkipFunction
+};
+
+//= MouseFunction
+
+class MouseFunction : public ::salhelper::SimpleReferenceObject
+{
+public:
+ MouseFunction() {}
+ MouseFunction(const MouseFunction&) = delete;
+ MouseFunction& operator=(const MouseFunction&) = delete;
+ virtual FunctionResult handleMouseMove(ITableControl& i_tableControl, MouseEvent const& i_event)
+ = 0;
+ virtual FunctionResult handleMouseDown(ITableControl& i_tableControl, MouseEvent const& i_event)
+ = 0;
+ virtual FunctionResult handleMouseUp(ITableControl& i_tableControl, MouseEvent const& i_event)
+ = 0;
+
+protected:
+ virtual ~MouseFunction() override {}
+};
+
+//= ColumnResize
+
+class ColumnResize final : public MouseFunction
+{
+public:
+ ColumnResize()
+ : m_nResizingColumn(COL_INVALID)
+ {
+ }
+
+public:
+ // MouseFunction
+ virtual FunctionResult handleMouseMove(ITableControl& i_tableControl,
+ MouseEvent const& i_event) override;
+ virtual FunctionResult handleMouseDown(ITableControl& i_tableControl,
+ MouseEvent const& i_event) override;
+ virtual FunctionResult handleMouseUp(ITableControl& i_tableControl,
+ MouseEvent const& i_event) override;
+
+private:
+ ColPos m_nResizingColumn;
+};
+
+//= RowSelection
+
+class RowSelection final : public MouseFunction
+{
+public:
+ RowSelection()
+ : m_bActive(false)
+ {
+ }
+
+public:
+ // MouseFunction
+ virtual FunctionResult handleMouseMove(ITableControl& i_tableControl,
+ MouseEvent const& i_event) override;
+ virtual FunctionResult handleMouseDown(ITableControl& i_tableControl,
+ MouseEvent const& i_event) override;
+ virtual FunctionResult handleMouseUp(ITableControl& i_tableControl,
+ MouseEvent const& i_event) override;
+
+private:
+ bool m_bActive;
+};
+
+//= ColumnSortHandler
+
+class ColumnSortHandler final : public MouseFunction
+{
+public:
+ ColumnSortHandler()
+ : m_nActiveColumn(COL_INVALID)
+ {
+ }
+
+public:
+ // MouseFunction
+ virtual FunctionResult handleMouseMove(ITableControl& i_tableControl,
+ MouseEvent const& i_event) override;
+ virtual FunctionResult handleMouseDown(ITableControl& i_tableControl,
+ MouseEvent const& i_event) override;
+ virtual FunctionResult handleMouseUp(ITableControl& i_tableControl,
+ MouseEvent const& i_event) override;
+
+private:
+ ColPos m_nActiveColumn;
+};
+
+} // namespace svt::table
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/table/tablecontrol.hxx b/toolkit/inc/controls/table/tablecontrol.hxx
new file mode 100644
index 0000000000..9d9f98ff11
--- /dev/null
+++ b/toolkit/inc/controls/table/tablecontrol.hxx
@@ -0,0 +1,174 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <controls/table/tablemodel.hxx>
+#include <vcl/accessibletable.hxx>
+
+#include <vcl/ctrl.hxx>
+#include <vcl/seleng.hxx>
+
+#include <memory>
+
+namespace svt::table
+{
+ class TableControl_Impl;
+
+
+ //= TableControl
+
+ /** a basic control which manages table-like data, i.e. a number of cells
+ organized in <code>m</code> rows and <code>n</code> columns.
+
+ The control itself does not do any assumptions about the concrete data
+ it displays, this is encapsulated in an instance supporting the
+ ->ITableModel interface.
+
+ Also, the control does not do any assumptions about how the model's
+ content is rendered. This is the responsibility of a component
+ supporting the ->ITableRenderer interface (the renderer is obtained from
+ the model).
+
+ The control supports the concept of a <em>current</em> (or <em>active</em>
+ cell).
+ The control supports accessibility, this is encapsulated in IAccessibleTable
+ */
+ class TableControl final : public Control, public vcl::table::IAccessibleTable
+ {
+ private:
+ std::shared_ptr<TableControl_Impl> m_pImpl;
+
+
+ public:
+ TableControl( vcl::Window* _pParent, WinBits _nStyle );
+ virtual ~TableControl() override;
+ virtual void dispose() override;
+
+ /// sets a new table model
+ void SetModel( const PTableModel& _pModel );
+ /// retrieves the current table model
+ PTableModel GetModel() const;
+
+ /** retrieves the current row
+
+ The current row is the one which contains the active cell.
+
+ @return
+ the row index of the active cell, or ->ROW_INVALID
+ if there is no active cell, e.g. because the table does
+ not contain any rows or columns.
+ */
+ sal_Int32 GetCurrentRow() const override;
+
+ ITableControl&
+ getTableControlInterface();
+
+ /** retrieves the current column
+
+ The current col is the one which contains the active cell.
+
+ @return
+ the column index of the active cell, or ->COL_INVALID
+ if there is no active cell, e.g. because the table does
+ not contain any rows or columns.
+ */
+ sal_Int32 GetCurrentColumn() const override;
+
+ /** activates the cell at the given position
+ */
+ void GoTo( ColPos _nColumnPos, RowPos _nRow);
+
+ virtual void Resize() override;
+ void Select();
+
+ /**after removing a row, updates the vector which contains the selected rows
+ if the row, which should be removed, is selected, it will be erased from the vector
+ */
+ SelectionEngine* getSelEngine();
+ vcl::Window& getDataWindow();
+
+ // Window overridables
+ virtual void GetFocus() override;
+ virtual void LoseFocus() override;
+ virtual void KeyInput( const KeyEvent& rKEvt ) override;
+ virtual void StateChanged( StateChangedType i_nStateChange ) override;
+
+ /** Creates and returns the accessible object of the whole GridControl. */
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override;
+ virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessibleControl( sal_Int32 _nIndex ) override;
+ virtual OUString GetAccessibleObjectName(vcl::table::AccessibleTableControlObjType eObjType, sal_Int32 _nRow, sal_Int32 _nCol) const override;
+ virtual void GoToCell( sal_Int32 _nColumnPos, sal_Int32 _nRow ) override;
+ virtual OUString GetAccessibleObjectDescription(vcl::table::AccessibleTableControlObjType eObjType) const override;
+ virtual void FillAccessibleStateSet( sal_Int64& rStateSet, vcl::table::AccessibleTableControlObjType eObjType ) const override;
+
+ // temporary methods
+ // Those do not really belong into the public API - they're intended for firing A11Y-related events. However,
+ // firing those events should be an implementation internal to the TableControl resp. TableControl_Impl,
+ // instead of something triggered externally.
+ void commitCellEventIfAccessibleAlive( sal_Int16 const i_eventID, const css::uno::Any& i_newValue, const css::uno::Any& i_oldValue );
+ void commitTableEventIfAccessibleAlive( sal_Int16 const i_eventID, const css::uno::Any& i_newValue, const css::uno::Any& i_oldValue );
+
+
+ // IAccessibleTable
+ virtual AbsoluteScreenPixelRectangle GetWindowExtentsAbsolute() const override;
+ virtual tools::Rectangle GetWindowExtentsRelative(const vcl::Window& rRelativeWindow) const override;
+ virtual void GrabFocus() override;
+ virtual css::uno::Reference< css::accessibility::XAccessible > GetAccessible() override;
+ virtual vcl::Window* GetAccessibleParentWindow() const override;
+ virtual vcl::Window* GetWindowInstance() override;
+ virtual sal_Int32 GetAccessibleControlCount() const override;
+ virtual bool ConvertPointToControlIndex( sal_Int32& _rnIndex, const Point& _rPoint ) override;
+ virtual sal_Int32 GetRowCount() const override;
+ virtual sal_Int32 GetColumnCount() const override;
+ virtual bool ConvertPointToCellAddress( sal_Int32& _rnRow, sal_Int32& _rnColPos, const Point& _rPoint ) override;
+ virtual tools::Rectangle calcHeaderRect( bool _bIsColumnBar ) override;
+ virtual tools::Rectangle calcHeaderCellRect( bool _bIsColumnBar, sal_Int32 nPos) override;
+ virtual tools::Rectangle calcTableRect() override;
+ virtual tools::Rectangle calcCellRect( sal_Int32 _nRowPos, sal_Int32 _nColPos ) override;
+ virtual tools::Rectangle GetFieldCharacterBounds(sal_Int32 _nRow,sal_Int32 _nColumnPos,sal_Int32 nIndex) override;
+ virtual sal_Int32 GetFieldIndexAtPoint(sal_Int32 _nRow,sal_Int32 _nColumnPos,const Point& _rPoint) override;
+ virtual void FillAccessibleStateSetForCell( sal_Int64& _rStateSet, sal_Int32 _nRow, sal_uInt16 _nColumnPos ) const override;
+ virtual OUString GetRowName(sal_Int32 _nIndex) const override;
+ virtual OUString GetColumnName( sal_Int32 _nIndex ) const override;
+ virtual bool HasRowHeader() override;
+ virtual bool HasColHeader() override;
+ virtual OUString GetAccessibleCellText(sal_Int32 _nRowPos, sal_Int32 _nColPos) const override;
+
+ virtual sal_Int32 GetSelectedRowCount() const override;
+ virtual sal_Int32 GetSelectedRowIndex( sal_Int32 const i_selectionIndex ) const override;
+ virtual bool IsRowSelected( sal_Int32 const i_rowIndex ) const override;
+ virtual void SelectRow( sal_Int32 const i_rowIndex, bool const i_select ) override;
+ virtual void SelectAllRows( bool const i_select ) override;
+
+
+ private:
+ DECL_LINK( ImplSelectHdl, LinkParamNone*, void );
+
+ private:
+ TableControl( const TableControl& ) = delete;
+ TableControl& operator=( const TableControl& ) = delete;
+ };
+
+
+} // namespace svt::table
+
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/table/tablecontrolinterface.hxx b/toolkit/inc/controls/table/tablecontrolinterface.hxx
new file mode 100644
index 0000000000..8f5dca6763
--- /dev/null
+++ b/toolkit/inc/controls/table/tablecontrolinterface.hxx
@@ -0,0 +1,234 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <sal/types.h>
+#include <vcl/seleng.hxx>
+#include <vcl/window.hxx>
+
+#include <controls/table/tabletypes.hxx>
+#include <controls/table/tablemodel.hxx>
+
+namespace svt::table
+{
+ //= TableControlAction
+ enum TableControlAction
+ {
+ /// moves the cursor in the table control one row up, if possible, by keeping the current column
+ cursorUp,
+ /// moves the cursor in the table control one row down, if possible, by keeping the current column
+ cursorDown,
+ /// moves the cursor in the table control one column to the left, if possible, by keeping the current row
+ cursorLeft,
+ /// moves the cursor in the table control one column to the right, if possible, by keeping the current row
+ cursorRight,
+ /// moves the cursor to the beginning of the current line
+ cursorToLineStart,
+ /// moves the cursor to the end of the current line
+ cursorToLineEnd,
+ /// moves the cursor to the first row, keeping the current column
+ cursorToFirstLine,
+ /// moves the cursor to the last row, keeping the current column
+ cursorToLastLine,
+ /// moves the cursor one page up, keeping the current column
+ cursorPageUp,
+ /// moves the cursor one page down, keeping the current column
+ cursorPageDown,
+ /// moves the cursor to the top-most, left-most cell
+ cursorTopLeft,
+ /// moves the cursor to the bottom-most, right-most cell
+ cursorBottomRight,
+ /// selects the row, where the actual cursor is
+ cursorSelectRow,
+ /// selects the rows, above the actual cursor is
+ cursorSelectRowUp,
+ /// selects the row, beneath the actual cursor is
+ cursorSelectRowDown,
+ /// selects the row, from the actual cursor till top
+ cursorSelectRowAreaTop,
+ /// selects the row, from the actual cursor till bottom
+ cursorSelectRowAreaBottom
+ };
+
+
+ //= TableCellArea
+
+ enum TableCellArea
+ {
+ CellContent,
+ ColumnDivider
+ };
+
+
+ //= TableCell
+
+ struct TableCell
+ {
+ ColPos nColumn;
+ RowPos nRow;
+ TableCellArea eArea;
+
+ TableCell( ColPos const i_column, RowPos const i_row )
+ :nColumn( i_column )
+ ,nRow( i_row )
+ ,eArea( CellContent )
+ {
+ }
+ };
+
+
+ //= ColumnMetrics
+
+ struct ColumnMetrics
+ {
+ /** the start of the column, in pixels. Might be negative, in case the column is scrolled out of the visible
+ area. Note: see below.
+ */
+ tools::Long nStartPixel;
+
+ /** the end of the column, in pixels, plus 1. Effectively, this is the accumulated width of all columns
+ up to the current one.
+
+ Huh? Earlier you said that the nStartPixel of columns
+ scrolled out (to the left) of the visible area is
+ negative. Also, where is the promise that there is no gap
+ between columns? The above claim would be true only if the
+ first column always started at zero, and there is never a
+ gap. So these doc comments are inconsistent. How
+ surprising.
+ */
+ tools::Long nEndPixel;
+
+ ColumnMetrics()
+ :nStartPixel(0)
+ ,nEndPixel(0)
+ {
+ }
+
+ ColumnMetrics( tools::Long const i_start, tools::Long const i_end )
+ :nStartPixel( i_start )
+ ,nEndPixel( i_end )
+ {
+ }
+ };
+
+
+ //= TableArea
+
+ enum class TableArea
+ {
+ ColumnHeaders,
+ RowHeaders,
+ All
+ };
+
+
+ //= ITableControl
+
+ /** defines a callback interface to be implemented by a concrete table control
+ */
+ class SAL_NO_VTABLE ITableControl
+ {
+ public:
+ /** hides the cell cursor
+
+ The method cares for successive calls, that is, for every call to
+ ->hideCursor(), you need one call to ->showCursor. Only if the number
+ of both calls matches, the cursor is really shown.
+
+ @see showCursor
+ */
+ virtual void hideCursor() = 0;
+
+ /** shows the cell cursor
+
+ @see hideCursor
+ */
+ virtual void showCursor() = 0;
+
+ /** dispatches an action to the table control
+
+ @return
+ <TRUE/> if the action could be dispatched successfully, <FALSE/> otherwise. Usual
+ failure conditions include some other instance vetoing the action, or impossibility
+ to execute the action at all (for instance moving up one row when already positioned
+ on the very first row).
+
+ @see TableControlAction
+ */
+ virtual bool dispatchAction( TableControlAction _eAction ) = 0;
+
+ /** returns selection engine*/
+ virtual SelectionEngine* getSelEngine() = 0;
+
+ /** returns the table model
+
+ The returned model is guaranteed to not be <NULL/>.
+ */
+ virtual PTableModel getModel() const = 0;
+
+ /// returns the index of the currently active column
+ virtual ColPos getCurrentColumn() const = 0;
+
+ /// returns the index of the currently active row
+ virtual RowPos getCurrentRow() const = 0;
+
+ /// activates the given cell
+ virtual void activateCell( ColPos const i_col, RowPos const i_row ) = 0;
+
+ /// retrieves the size of the table window, in pixels
+ virtual ::Size getTableSizePixel() const = 0;
+
+ /// sets a new mouse pointer for the table window
+ virtual void setPointer( PointerStyle i_pointer ) = 0;
+
+ /// captures the mouse to the table window
+ virtual void captureMouse() = 0;
+
+ /// releases the mouse, after it had previously been captured
+ virtual void releaseMouse() = 0;
+
+ /// invalidates the table window
+ virtual void invalidate( TableArea const i_what ) = 0;
+
+ /// calculates a width, given in pixels, into an AppFont-based width
+ virtual tools::Long pixelWidthToAppFont( tools::Long const i_pixels ) const = 0;
+
+ /// shows a tracking rectangle
+ virtual void showTracking( tools::Rectangle const & i_location, ShowTrackFlags const i_flags ) = 0;
+
+ /// hides a previously shown tracking rectangle
+ virtual void hideTracking() = 0;
+
+ /// does a hit test for the given pixel coordinates
+ virtual TableCell hitTest( const Point& rPoint ) const = 0;
+
+ /// retrieves the metrics for a given column
+ virtual ColumnMetrics getColumnMetrics( ColPos const i_column ) const = 0;
+
+ /// determines whether a given row is selected
+ virtual bool isRowSelected( RowPos _nRow ) const = 0;
+
+ virtual ~ITableControl() {};
+ };
+
+} // namespace svt::table
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/table/tableinputhandler.hxx b/toolkit/inc/controls/table/tableinputhandler.hxx
new file mode 100644
index 0000000000..9d11df38db
--- /dev/null
+++ b/toolkit/inc/controls/table/tableinputhandler.hxx
@@ -0,0 +1,63 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <memory>
+
+class MouseEvent;
+class KeyEvent;
+
+
+namespace svt::table
+{
+
+
+ class ITableControl;
+
+
+ //= ITableInputHandler
+
+ /** interface for components handling input in a ->TableControl
+ */
+ class ITableInputHandler
+ {
+ public:
+ // all those methods have the same semantics as the equal-named methods of ->Window,
+ // with the additional option to return a boolean value indicating whether
+ // the event should be further processed by the ->Window implementations (<FALSE/>),
+ // or whether it has been sufficiently handled by the ->ITableInputHandler instance
+ // (<FALSE/>).
+
+ virtual bool MouseMove ( ITableControl& _rControl, const MouseEvent& rMEvt ) = 0;
+ virtual bool MouseButtonDown ( ITableControl& _rControl, const MouseEvent& rMEvt ) = 0;
+ virtual bool MouseButtonUp ( ITableControl& _rControl, const MouseEvent& rMEvt ) = 0;
+ virtual bool KeyInput ( ITableControl& _rControl, const KeyEvent& rKEvt ) = 0;
+ virtual bool GetFocus ( ITableControl& _rControl ) = 0;
+ virtual bool LoseFocus ( ITableControl& _rControl ) = 0;
+
+ virtual ~ITableInputHandler() { }
+ };
+ typedef std::shared_ptr< ITableInputHandler > PTableInputHandler;
+
+
+} // namespace svt::table
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/table/tablemodel.hxx b/toolkit/inc/controls/table/tablemodel.hxx
new file mode 100644
index 0000000000..7add49629a
--- /dev/null
+++ b/toolkit/inc/controls/table/tablemodel.hxx
@@ -0,0 +1,454 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <toolkit/dllapi.h>
+#include <controls/table/tabletypes.hxx>
+#include <controls/table/tablerenderer.hxx>
+#include <controls/table/tableinputhandler.hxx>
+
+#include <com/sun/star/style/VerticalAlignment.hpp>
+#include <com/sun/star/style/HorizontalAlignment.hpp>
+
+#include <sal/types.h>
+
+#include <optional>
+#include <memory>
+#include <vector>
+#include <o3tl/typed_flags_set.hxx>
+
+namespace svt::table { class ITableDataSort; }
+
+class Color;
+
+enum class ColumnAttributeGroup
+{
+ NONE = 0x00,
+ /// denotes column attributes related to the width of the column
+ WIDTH = 0x01,
+ /// denotes column attributes related to the appearance of the column, i.e. those relevant for rendering
+ APPEARANCE = 0x02,
+ /// denotes the entirety of column attributes
+ ALL = 0x03,
+};
+namespace o3tl
+{
+ template<> struct typed_flags<ColumnAttributeGroup> : is_typed_flags<ColumnAttributeGroup, 0x03> {};
+}
+
+
+namespace svt::table
+{
+ //= ScrollbarVisibility
+ enum ScrollbarVisibility
+ {
+ /** enumeration value denoting that a scrollbar should never be visible, even
+ if needed normally
+ */
+ ScrollbarShowNever,
+ /** enumeration value denoting that a scrollbar should be visible when needed only
+ */
+ ScrollbarShowSmart,
+ /** enumeration value denoting that a scrollbar should always be visible, even
+ if not needed normally
+ */
+ ScrollbarShowAlways
+ };
+
+
+ //= ITableModelListener
+
+ /** declares an interface to be implemented by components interested in
+ changes in an ->ITableModel
+ */
+ class SAL_NO_VTABLE ITableModelListener : public std::enable_shared_from_this< ITableModelListener >
+ {
+ public:
+ /** notifies the listener that one or more rows have been inserted into
+ the table
+
+ @param first
+ the index of the first newly inserted row
+ @param last
+ the index of the last newly inserted row. Must not be smaller
+ than ->first
+ */
+ virtual void rowsInserted( RowPos first, RowPos last ) = 0;
+
+ /** notifies the listener that one or more rows have been removed from
+ the table
+
+ @param first
+ the old index of the first removed row. If this is <code>-1</code>, then all
+ rows have been removed from the model.
+ @param last
+ the old index of the last removed row. Must not be smaller
+ than ->first
+ */
+ virtual void rowsRemoved( RowPos first, RowPos last ) = 0;
+
+ /** notifies the listener that one or more columns have been inserted into
+ the table
+ */
+ virtual void columnInserted() = 0;
+
+ /** notifies the listener that one or more columns have been removed from
+ the table
+ */
+ virtual void columnRemoved() = 0;
+
+ /** notifies the listener that all columns have been removed from the model
+ */
+ virtual void allColumnsRemoved() = 0;
+
+ /** notifies the listener that a rectangular cell range in the table
+ has been updated
+
+ Listeners are required to discard any possibly cached information
+ they have about the cells in question, in particular any possibly
+ cached cell values.
+ */
+ virtual void cellsUpdated( RowPos const i_firstRow, RowPos const i_lastRow ) = 0;
+
+ /** notifies the listener that attributes of a given column changed
+
+ @param i_column
+ the position of the column whose attributes changed
+ @param i_attributeGroup
+ a combination of one or more <code>COL_ATTRS_*</code> flags, denoting the attribute group(s)
+ in which changes occurred.
+ */
+ virtual void columnChanged( ColPos const i_column, ColumnAttributeGroup const i_attributeGroup ) = 0;
+
+ /** notifies the listener that the metrics of the table changed.
+
+ Metrics here include the column header height, the row header width, the row height, and the presence
+ of both the row and column header.
+ */
+ virtual void tableMetricsChanged() = 0;
+
+ /// deletes the listener instance
+ virtual ~ITableModelListener(){};
+ };
+ typedef std::shared_ptr< ITableModelListener > PTableModelListener;
+
+
+ //= IColumnModel
+
+ /** interface to be implemented by table column models
+ */
+ class SAL_NO_VTABLE IColumnModel
+ {
+ public:
+ /** returns the name of the column
+
+ Column names should be human-readable, but not necessarily unique
+ within a given table.
+
+ @see setName
+ */
+ virtual OUString getName() const = 0;
+
+ /** retrieves the help text to be displayed for the column.
+ */
+ virtual OUString getHelpText() const = 0;
+
+ /** determines whether the column can be interactively resized
+
+ @see getMinWidth
+ @see getMaxWidth
+ @see getWidth
+ */
+ virtual bool isResizable() const = 0;
+
+ /** denotes the relative flexibility of the column
+
+ This flexibility is taken into account when a table control auto-resizes its columns, because the available
+ space changed. In this case, the columns grow or shrink according to their flexibility.
+
+ A value of 0 means the column is not auto-resized at all.
+ */
+ virtual sal_Int32 getFlexibility() const = 0;
+
+ /** returns the width of the column, in app-font units
+
+ The returned value must be a positive ->TableMetrics value.
+
+ @see setWidth
+ @see getMinWidth
+ @see getMaxWidth
+ */
+ virtual TableMetrics getWidth() const = 0;
+
+ /** sets a new width for the column
+
+ @param _nWidth
+ the new width, app-font units
+
+ @see getWidth
+ */
+ virtual void setWidth( TableMetrics _nWidth ) = 0;
+
+ /** returns the minimum width of the column, in app-font units, or 0 if the column
+ does not have a minimal width
+
+ @see setMinWidth
+ @see getMaxWidth
+ @see getWidth
+ */
+ virtual TableMetrics getMinWidth() const = 0;
+
+ /** returns the maximum width of the column, in app-font units, or 0 if the column
+ does not have a minimal width
+
+ @see setMaxWidth
+ @see getMinWidth
+ @see getWidth
+ */
+ virtual TableMetrics getMaxWidth() const = 0;
+
+ /** retrieves the horizontal alignment to be used for content in this cell
+ */
+ virtual css::style::HorizontalAlignment getHorizontalAlign() = 0;
+
+ /// deletes the column model instance
+ virtual ~IColumnModel() { }
+ };
+ typedef std::shared_ptr< IColumnModel > PColumnModel;
+
+
+ //= ITableModel
+
+ /** declares the interface to implement by an abstract table model
+ */
+ class SAL_NO_VTABLE TOOLKIT_DLLPUBLIC ITableModel
+ {
+ public:
+ /** returns the number of columns in the table
+ */
+ virtual TableSize getColumnCount() const = 0;
+
+ /** returns the number of rows in the table
+ */
+ virtual TableSize getRowCount() const = 0;
+
+ /** determines whether the table has column headers
+
+ If this method returns <TRUE/>, the renderer returned by
+ ->getRenderer must be able to render column headers.
+
+ @see IColumnRenderer
+ */
+ virtual bool hasColumnHeaders() const = 0;
+
+ /** determines whether the table has row headers
+
+ If this method returns <TRUE/>, the renderer returned by
+ ->getRenderer must be able to render row headers.
+
+ @see IColumnRenderer
+ */
+ virtual bool hasRowHeaders() const = 0;
+
+ /** returns a model for a certain column
+
+ @param column
+ the index of the column in question. Must be greater than or
+ equal 0, and smaller than the return value of ->getColumnCount()
+
+ @return
+ the model of the column in question. Must not be <NULL/>
+ */
+ virtual PColumnModel getColumnModel( ColPos column ) = 0;
+
+ /** returns a renderer which is able to paint the table represented
+ by this table model
+
+ @return the renderer to use. Must not be <NULL/>
+ */
+ virtual PTableRenderer getRenderer() const = 0;
+
+ /** returns the component handling input in a view associated with the model
+ */
+ virtual PTableInputHandler getInputHandler() const = 0;
+
+ /** determines the height of rows in the table.
+
+ @return
+ the logical height of rows in the table, in app-font units. The height must be
+ greater 0.
+ */
+ virtual TableMetrics getRowHeight() const = 0;
+
+ /** determines the height of the column header row
+
+ This method is not to be called if ->hasColumnHeaders()
+ returned <FALSE/>.
+
+ @return
+ the logical height of the column header row, in app-font units.
+ Must be greater than 0.
+ */
+ virtual TableMetrics getColumnHeaderHeight() const = 0;
+
+ /** determines the width of the row header column
+
+ This method is not to be called if ->hasRowHeaders()
+ returned <FALSE/>.
+
+ @return
+ the logical width of the row header column, in app-font units.
+ Must be greater than 0.
+ */
+ virtual TableMetrics getRowHeaderWidth() const = 0;
+
+ /** returns the visibility mode of the vertical scrollbar
+ */
+ virtual ScrollbarVisibility getVerticalScrollbarVisibility() const = 0;
+
+ /** returns the visibility mode of the horizontal scrollbar
+ */
+ virtual ScrollbarVisibility getHorizontalScrollbarVisibility() const = 0;
+
+ /** adds a listener to be notified of changes in the table model
+ */
+ virtual void addTableModelListener( const PTableModelListener& i_listener ) = 0;
+
+ /** remove a listener to be notified of changes in the table model
+ */
+ virtual void removeTableModelListener( const PTableModelListener& i_listener ) = 0;
+
+ /** retrieves the content of the given cell
+ */
+ virtual void getCellContent( ColPos const i_col, RowPos const i_row, css::uno::Any& o_cellContent ) = 0;
+
+ /** returns an object which should be displayed as tooltip for the given cell
+
+ At the moment, only string-convertible values are supported here. In the future, one might imagine displaying
+ scaled-down versions of a graphic in a cell, and a larger version of that very graphic as tooltip.
+
+ If no tooltip object is provided, then the cell content is used, and displayed as tooltip for the cell
+ if and only if it doesn't fit into the cell's space itself.
+
+ @param i_col
+ The column index of the cell in question. COL_ROW_HEADERS is a valid argument here.
+ @param i_row
+ The row index of the cell in question.
+ @param o_cellToolTip
+ takes the tooltip object upon return.
+ */
+ virtual void getCellToolTip( ColPos const i_col, RowPos const i_row, css::uno::Any & o_cellToolTip ) = 0;
+
+ /** retrieves title of a given row
+ */
+ virtual css::uno::Any getRowHeading( RowPos const i_rowPos ) const = 0;
+
+ /** returns the color to be used for rendering the grid lines.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::std::optional< ::Color > getLineColor() const = 0;
+
+ /** returns the color to be used for rendering the header background.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::std::optional< ::Color > getHeaderBackgroundColor() const = 0;
+
+ /** returns the color to be used for rendering the header text.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::std::optional< ::Color > getHeaderTextColor() const = 0;
+
+ /** returns the color to be used for the background of selected cells, when the control has the focus
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::std::optional< ::Color > getActiveSelectionBackColor() const = 0;
+
+ /** returns the color to be used for the background of selected cells, when the control does not have the focus
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::std::optional< ::Color > getInactiveSelectionBackColor() const = 0;
+
+ /** returns the color to be used for the text of selected cells, when the control has the focus
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::std::optional< ::Color > getActiveSelectionTextColor() const = 0;
+
+ /** returns the color to be used for the text of selected cells, when the control does not have the focus
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::std::optional< ::Color > getInactiveSelectionTextColor() const = 0;
+
+ /** returns the color to be used for rendering cell texts.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::std::optional< ::Color > getTextColor() const = 0;
+
+ /** returns the color to be used for text lines (underline, strikethrough) when rendering cell text.
+
+ If this value is not set, a default color from the style settings will be used.
+ */
+ virtual ::std::optional< ::Color > getTextLineColor() const = 0;
+
+ /** returns the colors to be used for the row backgrounds.
+
+ If this value is not set, every second row will have a background color derived from the style settings's
+ selection color, the other rows will not have a special background at all.
+
+ If this value is an empty sequence, the rows will not have a special background at all, instead the
+ normal background of the complete control will be used.
+
+ If value is a non-empty sequence, then rows will have the background colors as specified in the sequence,
+ in alternating order.
+ */
+ virtual ::std::optional< ::std::vector< ::Color > >
+ getRowBackgroundColors() const = 0;
+
+ /** determines the vertical alignment of content within a cell
+ */
+ virtual css::style::VerticalAlignment getVerticalAlign() const = 0;
+
+ /** returns an adapter to the sorting functionality of the model
+
+ It is legitimate to return <NULL/> here, in this case, the table model does not support sorting.
+ */
+ virtual ITableDataSort* getSortAdapter() = 0;
+
+ /** returns enabled state.
+ */
+ virtual bool isEnabled() const = 0;
+
+ /// destroys the table model instance
+ virtual ~ITableModel() { }
+ };
+ typedef std::shared_ptr< ITableModel > PTableModel;
+
+
+} // namespace svt::table
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/table/tablerenderer.hxx b/toolkit/inc/controls/table/tablerenderer.hxx
new file mode 100644
index 0000000000..a4d7a48a62
--- /dev/null
+++ b/toolkit/inc/controls/table/tablerenderer.hxx
@@ -0,0 +1,249 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <controls/table/tabletypes.hxx>
+
+#include <rtl/ustring.hxx>
+
+#include <memory>
+
+namespace com :: sun :: star :: uno { class Any; }
+namespace tools { class Rectangle; }
+namespace vcl { class Window; }
+
+class OutputDevice;
+class StyleSettings;
+namespace vcl {
+ typedef OutputDevice RenderContext;
+};
+
+
+namespace svt::table
+{
+
+
+ //= ITableRenderer
+
+ /** interface to implement by components rendering a ->TableControl
+ */
+ class SAL_NO_VTABLE ITableRenderer
+ {
+ public:
+
+ /** paints a (part of) header area
+
+ There are two header areas in a table control:
+ <ul><li>The row containing all column headers, i.e. <em>above</em> all rows containing the data</li>
+ <li>The column containing all row headers. i.e. <em>left of</em> all columns containing the data</li>
+ </ul>
+
+ A header area is more than the union of the single column/row headers.
+
+ First, there might be less columns than fit into the view - in this case, right
+ beside the right-most column, there's still room which belongs to the column header
+ area, but is not occupied by any particular column header.<br/>
+ An equivalent statement holds for the row header area, if there are fewer rows than
+ fit into the view.
+
+ Second, if the table control has both a row header and a column header,
+ the intersection between those both belongs to both the column header area and the
+ row header area, but not to any particular column or row header.
+
+ There are two flags specifying whether the to-be-painted area is part of the column
+ and/or row header area.
+ <ul><li>If both are <TRUE/>, the intersection of both areas is to be painted.</li>
+ <li>If ->_bIsColHeaderArea is <TRUE/> and ->_bIsRowHeaderArea is <FALSE/>,
+ then ->_rArea denotes the column header area <em>excluding</em> the
+ intersection between row and column header area.</li>
+ <li>Equivalently for ->_bIsColHeaderArea being <FALSE/> and ->_bIsRowHeaderArea
+ being <TRUE/></li>
+ </ul>
+ Note that it's not possible for both ->_bIsColHeaderArea and ->_bIsRowHeaderArea
+ to be <FALSE/> at the same time.
+
+ @param _rDevice
+ the device to paint onto
+ @param _rArea
+ the area to paint into
+ @param _bIsColHeaderArea
+ <TRUE/> if and only if ->_rArea is part of the column header area.
+ @param _bIsRowHeaderArea
+ <TRUE/> if and only if ->_rArea is part of the row header area.
+ @param _rStyle
+ the style to be used for drawing
+ */
+ virtual void PaintHeaderArea(
+ vcl::RenderContext& _rDevice, const tools::Rectangle& _rArea,
+ bool _bIsColHeaderArea, bool _bIsRowHeaderArea,
+ const StyleSettings& _rStyle ) = 0;
+
+ /** paints the header for a given column
+
+ @param _nCol
+ the index of the column to paint
+ @param _rDevice
+ denotes the device to paint onto
+ @param _rArea
+ the are into which the column header should be painted
+ @param _rStyle
+ the style to be used for drawing
+ */
+ virtual void PaintColumnHeader( ColPos _nCol,
+ vcl::RenderContext& _rDevice, const tools::Rectangle& _rArea,
+ const StyleSettings& _rStyle ) = 0;
+
+ /** prepares a row for painting
+
+ Painting a table means painting rows as necessary, in an increasing
+ order. The assumption is that retrieving data for two different rows
+ is (potentially) more expensive than retrieving data for two different
+ columns. Thus, the renderer will get the chance to "seek" to a certain
+ row, and then has to render all cells in this row, before another
+ row is going to be painted.
+
+ @param _nRow
+ the row which is going to be painted. The renderer should
+ at least remember this row, since subsequent calls to
+ ->PaintRowHeader(), ->PaintCell(), and ->FinishRow() will
+ not pass this parameter again.
+
+ However, the renderer is also allowed to render any
+ cell-independent content of this row.
+
+ @param i_hasControlFocus
+ <TRUE/> if and only if the table control currently has the focus
+ @param _bSelected
+ <TRUE/> if and only if the row to be prepared is
+ selected currently.
+ @param _rDevice
+ denotes the device to paint onto
+ @param _rRowArea
+ the are into which the row should be painted. This excludes
+ the row header area, if applicable.
+ @param _rStyle
+ the style to be used for drawing
+ */
+ virtual void PrepareRow( RowPos _nRow, bool i_hasControlFocus, bool _bSelected,
+ vcl::RenderContext& _rDevice, const tools::Rectangle& _rRowArea,
+ const StyleSettings& _rStyle ) = 0;
+
+ /** paints the header of a row
+
+ The row to be painted is denoted by the most recent call to
+ ->PrepareRow.
+
+ @param _rDevice
+ denotes the device to paint onto
+ @param _rArea
+ the are into which the row header should be painted
+ @param _rStyle
+ the style to be used for drawing
+ */
+ virtual void PaintRowHeader(
+ vcl::RenderContext& _rDevice, tools::Rectangle const & _rArea,
+ StyleSettings const & _rStyle ) = 0;
+
+ /** paints a certain cell
+
+ The row to be painted is denoted by the most recent call to
+ ->PrepareRow.
+
+ @param _bSelected
+ <TRUE/> if and only if the cell to be painted is
+ selected currently. This is the case if either
+ the row or the column of the cell is currently selected.
+ <br/>
+ Note that this flag is equal to the respective flag in the
+ previous ->PrepareRow call, it's passed here for convenience
+ only.
+ @param i_hasControlFocus
+ <TRUE/> if and only if the table control currently has the focus
+ <br/>
+ Note that this flag is equal to the respective flag in the
+ previous ->PrepareRow call, it's passed here for convenience
+ only.
+ @param _rDevice
+ denotes the device to paint onto
+ @param _rArea
+ the are into which the cell should be painted
+ @param _rStyle
+ the style to be used for drawing
+ */
+ virtual void PaintCell( ColPos const i_col,
+ bool i_hasControlFocus, bool _bSelected,
+ vcl::RenderContext& _rDevice, const tools::Rectangle& _rArea,
+ const StyleSettings& _rStyle ) = 0;
+
+ /** draws a cell cursor in the given rectangle
+
+ The cell cursor is used to indicate the active/current cell
+ of a table control.
+ */
+ virtual void ShowCellCursor( vcl::Window& _rView, const tools::Rectangle& _rCursorRect) = 0;
+
+ /** hides the cell cursor previously drawn into the given rectangle
+
+ The cell cursor is used to indicate the active/current cell
+ of a table control.
+ */
+ virtual void HideCellCursor( vcl::Window& _rView ) = 0;
+
+ /** checks whether a given cell content fits into a given target area on a given device.
+
+ @param i_targetDevice
+ denotes the target device for the assumed rendering operation
+
+ @param i_targetArea
+ denotes the area within the target device for the assumed rendering operation.
+
+ @return
+ <TRUE/> if and only if the given cell content could be rendered into the given device and the
+ given area.
+ */
+ virtual bool FitsIntoCell(
+ css::uno::Any const & i_cellContent,
+ OutputDevice& i_targetDevice, tools::Rectangle const & i_targetArea
+ ) const = 0;
+
+ /** attempts to format the content of the given cell as string
+
+ @param i_cellValue
+ the value for which an attempt for a string conversion should be made
+ @param o_cellString
+ the cell content, formatted as string
+ @return
+ <TRUE/> if and only if the content could be formatted as string
+ */
+ virtual bool GetFormattedCellString(
+ css::uno::Any const & i_cellValue,
+ OUString & o_cellString
+ ) const = 0;
+
+ /// deletes the renderer instance
+ virtual ~ITableRenderer() { }
+ };
+ typedef std::shared_ptr< ITableRenderer > PTableRenderer;
+
+
+} // namespace svt::table
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/table/tablesort.hxx b/toolkit/inc/controls/table/tablesort.hxx
new file mode 100644
index 0000000000..691beea4ed
--- /dev/null
+++ b/toolkit/inc/controls/table/tablesort.hxx
@@ -0,0 +1,79 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <controls/table/tabletypes.hxx>
+
+namespace svt::table
+{
+
+
+ //= ColumnSortDirection
+
+ enum ColumnSortDirection
+ {
+ ColumnSortAscending,
+ ColumnSortDescending
+ };
+
+
+ //= ColumnSort
+
+ struct ColumnSort
+ {
+ ColPos nColumnPos;
+ ColumnSortDirection eSortDirection;
+
+ ColumnSort()
+ :nColumnPos( COL_INVALID )
+ ,eSortDirection( ColumnSortAscending )
+ {
+ }
+
+ };
+
+
+ //= ITableDataSort
+
+ /** provides sorting functionality for the data underlying an ITableModel
+ */
+ class SAL_NO_VTABLE ITableDataSort
+ {
+ public:
+ /** sorts the rows in the model by the given column's data, in the given direction.
+ */
+ virtual void sortByColumn( ColPos const i_column, ColumnSortDirection const i_sortDirection ) = 0;
+
+ /** retrieves the current sort order of the data
+
+ If the <code>nColumnIndex</code> member of the returned structure is <code>COL_INVALID</code>, then
+ the data is currently not sorted.
+ */
+ virtual ColumnSort getCurrentSortOrder() const = 0;
+
+ protected:
+ ~ITableDataSort() {}
+ };
+
+
+} // namespace svt::table
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/table/tabletypes.hxx b/toolkit/inc/controls/table/tabletypes.hxx
new file mode 100644
index 0000000000..8fdb18a830
--- /dev/null
+++ b/toolkit/inc/controls/table/tabletypes.hxx
@@ -0,0 +1,52 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <sal/types.h>
+
+
+namespace svt::table
+{
+
+ /// a value denoting the size of a table
+ typedef sal_Int32 TableSize;
+
+ /// a value denoting a column position within a table
+ typedef sal_Int32 ColPos;
+ /// a value denoting a row position within a table
+ typedef sal_Int32 RowPos;
+
+ typedef sal_Int32 TableMetrics;
+
+/// denotes the column containing the row headers
+#define COL_ROW_HEADERS (::svt::table::ColPos(-1))
+/// denotes the row containing the column headers
+#define ROW_COL_HEADERS (::svt::table::RowPos(-1))
+
+/// denotes an invalid column index
+#define COL_INVALID (::svt::table::ColPos(-2))
+/// denotes an invalid row index
+#define ROW_INVALID (::svt::table::RowPos(-2))
+
+
+} // namespace svt::table
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/tabpagecontainer.hxx b/toolkit/inc/controls/tabpagecontainer.hxx
new file mode 100644
index 0000000000..f9fe2df02d
--- /dev/null
+++ b/toolkit/inc/controls/tabpagecontainer.hxx
@@ -0,0 +1,127 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <com/sun/star/awt/tab/XTabPageContainer.hpp>
+#include <com/sun/star/awt/tab/XTabPageContainerModel.hpp>
+#include <toolkit/controls/unocontrolbase.hxx>
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <controls/controlmodelcontainerbase.hxx>
+#include <toolkit/helper/listenermultiplexer.hxx>
+
+
+namespace com::sun::star::awt::tab { class XTabPage; }
+namespace com::sun::star::awt::tab { class XTabPageContainerListener; }
+namespace com::sun::star::awt::tab { class XTabPageModel; }
+
+
+typedef ::cppu::AggImplInheritanceHelper1 < UnoControlModel
+ , css::awt::tab::XTabPageContainerModel
+ > UnoControlTabPageContainerModel_Base;
+class UnoControlTabPageContainerModel final : public UnoControlTabPageContainerModel_Base
+{
+private:
+ std::vector< css::uno::Reference< css::awt::tab::XTabPageModel > > m_aTabPageVector;
+ ContainerListenerMultiplexer maContainerListeners;
+
+ css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
+ ::cppu::IPropertyArrayHelper& getInfoHelper() override;
+ // css::beans::XMultiPropertySet
+ css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
+
+public:
+ UnoControlTabPageContainerModel( const css::uno::Reference< css::uno::XComponentContext >& i_factory );
+ UnoControlTabPageContainerModel( const UnoControlTabPageContainerModel& rModel ) : UnoControlTabPageContainerModel_Base( rModel ),maContainerListeners( *this ) {}
+
+ rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlTabPageContainerModel( *this ); }
+
+ // css::io::XPersistObject
+ OUString SAL_CALL getServiceName() override;
+
+ // css::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlTabPageContainerModel, UnoControlModel, "com.sun.star.awt.tab.UnoControlTabPageContainerModel" )
+
+ // XTabPageContainerModel
+ virtual css::uno::Reference< css::awt::tab::XTabPageModel > SAL_CALL createTabPage( ::sal_Int16 TabPageID ) override;
+ virtual css::uno::Reference< css::awt::tab::XTabPageModel > SAL_CALL loadTabPage( ::sal_Int16 TabPageID, const OUString& ResourceURL ) override;
+
+ // XIndexContainer
+ virtual void SAL_CALL insertByIndex( sal_Int32 Index, const css::uno::Any& Element ) override;
+ virtual void SAL_CALL removeByIndex( sal_Int32 Index ) override;
+
+ // XIndexReplace
+ virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const css::uno::Any& Element ) override;
+
+ // XIndexAccess
+ virtual sal_Int32 SAL_CALL getCount() override;
+
+ virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) override;
+
+ // XElementAccess
+ virtual css::uno::Type SAL_CALL getElementType() override;
+ virtual sal_Bool SAL_CALL hasElements() override;
+
+ // css::container::XContainer
+ void SAL_CALL addContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
+ void SAL_CALL removeContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
+};
+
+// = UnoControlTabPageContainer
+
+typedef ::cppu::AggImplInheritanceHelper1 < ControlContainerBase
+ , css::awt::tab::XTabPageContainer
+ > UnoControlTabPageContainer_Base;
+class UnoControlTabPageContainer final : public UnoControlTabPageContainer_Base
+{
+public:
+ UnoControlTabPageContainer( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
+ OUString GetComponentServiceName() const override;
+
+ // css::lang::XComponent
+ void SAL_CALL dispose( ) override;
+
+ // css::awt::XControl
+ void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override;
+
+ // css::awt::tab::XTabPageContainer
+ virtual ::sal_Int16 SAL_CALL getActiveTabPageID() override;
+ virtual void SAL_CALL setActiveTabPageID( ::sal_Int16 _activetabpageid ) override;
+ virtual ::sal_Int16 SAL_CALL getTabPageCount( ) override;
+ virtual sal_Bool SAL_CALL isTabPageActive( ::sal_Int16 tabPageIndex ) override;
+ virtual css::uno::Reference< css::awt::tab::XTabPage > SAL_CALL getTabPage( ::sal_Int16 tabPageIndex ) override;
+ virtual css::uno::Reference< css::awt::tab::XTabPage > SAL_CALL getTabPageByID( ::sal_Int16 tabPageID ) override;
+ virtual void SAL_CALL addTabPageContainerListener( const css::uno::Reference< css::awt::tab::XTabPageContainerListener >& listener ) override;
+ virtual void SAL_CALL removeTabPageContainerListener( const css::uno::Reference< css::awt::tab::XTabPageContainerListener >& listener ) override;
+
+ // css::beans::XPropertiesChangeListener
+ virtual void SAL_CALL propertiesChange( const ::css::uno::Sequence< ::css::beans::PropertyChangeEvent >& aEvent ) override;
+
+ virtual void SAL_CALL addControl( const OUString& Name, const css::uno::Reference< css::awt::XControl >& Control ) override;
+ // css::lang::XServiceInfo
+ DECLIMPL_SERVICEINFO_DERIVED( UnoControlTabPageContainer, UnoControlBase, "com.sun.star.awt.tab.UnoControlTabPageContainer" )
+
+// using UnoControl::getPeer;
+private:
+ virtual void updateFromModel() override;
+ TabPageListenerMultiplexer m_aTabPageListeners;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/tabpagemodel.hxx b/toolkit/inc/controls/tabpagemodel.hxx
new file mode 100644
index 0000000000..a1668e2d5d
--- /dev/null
+++ b/toolkit/inc/controls/tabpagemodel.hxx
@@ -0,0 +1,79 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <controls/controlmodelcontainerbase.hxx>
+#include <com/sun/star/awt/tab/XTabPage.hpp>
+#include <cppuhelper/implbase2.hxx>
+
+class UnoControlTabPageModel final : public ControlModelContainerBase
+{
+ css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
+ ::cppu::IPropertyArrayHelper& getInfoHelper() override;
+public:
+ UnoControlTabPageModel( css::uno::Reference< css::uno::XComponentContext > const & i_factory);
+
+ // css::io::XPersistObject
+ OUString SAL_CALL getServiceName() override;
+
+ // css::beans::XMultiPropertySet
+ css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
+ // XInitialization
+ virtual void SAL_CALL initialize (const css::uno::Sequence<css::uno::Any>& rArguments) override;
+
+ // XServiceInfo
+ OUString SAL_CALL getImplementationName() override;
+
+ css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
+};
+
+
+
+typedef ::cppu::AggImplInheritanceHelper2 < ControlContainerBase
+ , css::awt::tab::XTabPage
+ , css::awt::XWindowListener
+ > UnoControlTabPage_Base;
+class UnoControlTabPage final : public UnoControlTabPage_Base
+{
+private:
+ bool m_bWindowListener;
+public:
+
+ UnoControlTabPage( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
+ virtual ~UnoControlTabPage() override;
+ OUString GetComponentServiceName() const override;
+
+ void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override;
+ void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
+
+ // css::awt::XWindowListener
+ virtual void SAL_CALL windowResized( const css::awt::WindowEvent& e ) override;
+ virtual void SAL_CALL windowMoved( const css::awt::WindowEvent& e ) override;
+ virtual void SAL_CALL windowShown( const css::lang::EventObject& e ) override;
+ virtual void SAL_CALL windowHidden( const css::lang::EventObject& e ) override;
+ // css::lang::XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() override;
+
+ virtual sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override;
+
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/tkscrollbar.hxx b/toolkit/inc/controls/tkscrollbar.hxx
new file mode 100644
index 0000000000..c7948de072
--- /dev/null
+++ b/toolkit/inc/controls/tkscrollbar.hxx
@@ -0,0 +1,112 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#pragma once
+
+#include <toolkit/controls/unocontrolmodel.hxx>
+#include <toolkit/controls/unocontrolbase.hxx>
+#include <com/sun/star/awt/XScrollBar.hpp>
+#include <com/sun/star/awt/XAdjustmentListener.hpp>
+
+
+namespace toolkit
+{
+
+
+ //= UnoControlScrollBarModel
+
+ class UnoControlScrollBarModel final : public UnoControlModel
+ {
+ css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
+ ::cppu::IPropertyArrayHelper& getInfoHelper() override;
+
+ public:
+ UnoControlScrollBarModel( const css::uno::Reference< css::uno::XComponentContext >& i_factory );
+ UnoControlScrollBarModel( const UnoControlScrollBarModel& rModel ) : UnoControlModel( rModel ) {}
+
+ rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlScrollBarModel( *this ); }
+
+ // css::beans::XMultiPropertySet
+ css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
+
+ // css::io::XPersistObject
+ OUString SAL_CALL getServiceName() override;
+
+ // XServiceInfo
+ OUString SAL_CALL getImplementationName() override;
+
+ css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+ };
+
+
+ //= UnoControlScrollBarModel
+
+ class UnoScrollBarControl final : public UnoControlBase,
+ public css::awt::XAdjustmentListener,
+ public css::awt::XScrollBar
+ {
+ private:
+ AdjustmentListenerMultiplexer maAdjustmentListeners;
+
+ public:
+ UnoScrollBarControl();
+ OUString GetComponentServiceName() const override;
+
+ css::uno::Any SAL_CALL queryInterface( const css::uno::Type & rType ) override { return UnoControlBase::queryInterface(rType); }
+ css::uno::Any SAL_CALL queryAggregation( const css::uno::Type & rType ) override;
+ void SAL_CALL acquire() noexcept override { OWeakAggObject::acquire(); }
+ void SAL_CALL release() noexcept override { OWeakAggObject::release(); }
+ void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override;
+ void SAL_CALL disposing( const css::lang::EventObject& Source ) override { UnoControlBase::disposing( Source ); }
+ void SAL_CALL dispose( ) override;
+
+ // css::lang::XTypeProvider
+ css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override;
+ css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override;
+
+ // css::awt::XAdjustmentListener
+ void SAL_CALL adjustmentValueChanged( const css::awt::AdjustmentEvent& rEvent ) override;
+
+ // css::awt::XScrollBar
+ void SAL_CALL addAdjustmentListener( const css::uno::Reference< css::awt::XAdjustmentListener >& l ) override;
+ void SAL_CALL removeAdjustmentListener( const css::uno::Reference< css::awt::XAdjustmentListener >& l ) override;
+ void SAL_CALL setValue( sal_Int32 n ) override;
+ void SAL_CALL setValues( sal_Int32 nValue, sal_Int32 nVisible, sal_Int32 nMax ) override;
+ sal_Int32 SAL_CALL getValue( ) override;
+ void SAL_CALL setMaximum( sal_Int32 n ) override;
+ sal_Int32 SAL_CALL getMaximum( ) override;
+ void SAL_CALL setLineIncrement( sal_Int32 n ) override;
+ sal_Int32 SAL_CALL getLineIncrement( ) override;
+ void SAL_CALL setBlockIncrement( sal_Int32 n ) override;
+ sal_Int32 SAL_CALL getBlockIncrement( ) override;
+ void SAL_CALL setVisibleSize( sal_Int32 n ) override;
+ sal_Int32 SAL_CALL getVisibleSize( ) override;
+ void SAL_CALL setOrientation( sal_Int32 n ) override;
+ sal_Int32 SAL_CALL getOrientation( ) override;
+
+ // css::lang::XServiceInfo
+ OUString SAL_CALL getImplementationName() override;
+
+ css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+ };
+
+
+} // namespacetoolkit
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/treecontrolpeer.hxx b/toolkit/inc/controls/treecontrolpeer.hxx
new file mode 100644
index 0000000000..d584516ae3
--- /dev/null
+++ b/toolkit/inc/controls/treecontrolpeer.hxx
@@ -0,0 +1,166 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <com/sun/star/awt/tree/XTreeControl.hpp>
+#include <com/sun/star/awt/tree/XTreeDataModel.hpp>
+#include <com/sun/star/graphic/XGraphicProvider.hpp>
+
+#include <toolkit/awt/vclxwindow.hxx>
+#include <toolkit/helper/listenermultiplexer.hxx>
+
+#include <vcl/image.hxx>
+
+#include <cppuhelper/implbase.hxx>
+
+#include <map>
+
+namespace com::sun::star::awt::tree { class XTreeNode; }
+
+class UnoTreeListEntry;
+class TreeControlPeer;
+class UnoTreeListBoxImpl;
+
+class TreeControlPeer final : public ::cppu::ImplInheritanceHelper< VCLXWindow, css::awt::tree::XTreeControl, css::awt::tree::XTreeDataModelListener >
+{
+ typedef std::map<css::uno::Reference<css::awt::tree::XTreeNode>, UnoTreeListEntry*> TreeNodeMap;
+
+ friend class UnoTreeListBoxImpl;
+ friend class UnoTreeListEntry;
+public:
+ TreeControlPeer();
+ virtual ~TreeControlPeer() override;
+
+ vcl::Window* createVclControl( vcl::Window* pParent, sal_Int64 nWinStyle );
+
+ // css::view::XSelectionSupplier
+ virtual sal_Bool SAL_CALL select( const css::uno::Any& xSelection ) override;
+ virtual css::uno::Any SAL_CALL getSelection( ) override;
+ virtual void SAL_CALL addSelectionChangeListener( const css::uno::Reference< css::view::XSelectionChangeListener >& xListener ) override;
+ virtual void SAL_CALL removeSelectionChangeListener( const css::uno::Reference< css::view::XSelectionChangeListener >& xListener ) override;
+
+ // css::view::XMultiSelectionSupplier
+ virtual sal_Bool SAL_CALL addSelection( const css::uno::Any& Selection ) override;
+ virtual void SAL_CALL removeSelection( const css::uno::Any& Selection ) override;
+ virtual void SAL_CALL clearSelection( ) override;
+ virtual ::sal_Int32 SAL_CALL getSelectionCount( ) override;
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createSelectionEnumeration( ) override;
+ virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createReverseSelectionEnumeration( ) override;
+
+ // css::awt::XTreeControl
+ virtual OUString SAL_CALL getDefaultExpandedGraphicURL() override;
+ virtual void SAL_CALL setDefaultExpandedGraphicURL( const OUString& _defaultexpandedgraphicurl ) override;
+ virtual OUString SAL_CALL getDefaultCollapsedGraphicURL() override;
+ virtual void SAL_CALL setDefaultCollapsedGraphicURL( const OUString& _defaultcollapsedgraphicurl ) override;
+ virtual sal_Bool SAL_CALL isNodeExpanded( const css::uno::Reference< css::awt::tree::XTreeNode >& Node ) override;
+ virtual sal_Bool SAL_CALL isNodeCollapsed( const css::uno::Reference< css::awt::tree::XTreeNode >& Node ) override;
+ virtual void SAL_CALL makeNodeVisible( const css::uno::Reference< css::awt::tree::XTreeNode >& Node ) override;
+ virtual sal_Bool SAL_CALL isNodeVisible( const css::uno::Reference< css::awt::tree::XTreeNode >& Node ) override;
+ virtual void SAL_CALL expandNode( const css::uno::Reference< css::awt::tree::XTreeNode >& Node ) override;
+ virtual void SAL_CALL collapseNode( const css::uno::Reference< css::awt::tree::XTreeNode >& Node ) override;
+ virtual void SAL_CALL addTreeExpansionListener( const css::uno::Reference< css::awt::tree::XTreeExpansionListener >& Listener ) override;
+ virtual void SAL_CALL removeTreeExpansionListener( const css::uno::Reference< css::awt::tree::XTreeExpansionListener >& Listener ) override;
+ virtual css::uno::Reference< css::awt::tree::XTreeNode > SAL_CALL getNodeForLocation( ::sal_Int32 x, ::sal_Int32 y ) override;
+ virtual css::uno::Reference< css::awt::tree::XTreeNode > SAL_CALL getClosestNodeForLocation( ::sal_Int32 x, ::sal_Int32 y ) override;
+ virtual css::awt::Rectangle SAL_CALL getNodeRect( const css::uno::Reference< css::awt::tree::XTreeNode >& Node ) override;
+ virtual sal_Bool SAL_CALL isEditing( ) override;
+ virtual sal_Bool SAL_CALL stopEditing( ) override;
+ virtual void SAL_CALL cancelEditing( ) override;
+ virtual void SAL_CALL startEditingAtNode( const css::uno::Reference< css::awt::tree::XTreeNode >& Node ) override;
+ virtual void SAL_CALL addTreeEditListener( const css::uno::Reference< css::awt::tree::XTreeEditListener >& Listener ) override;
+ virtual void SAL_CALL removeTreeEditListener( const css::uno::Reference< css::awt::tree::XTreeEditListener >& Listener ) override;
+
+ // css::awt::tree::TreeDataModelListener
+ virtual void SAL_CALL treeNodesChanged( const css::awt::tree::TreeDataModelEvent& aEvent ) override;
+ virtual void SAL_CALL treeNodesInserted( const css::awt::tree::TreeDataModelEvent& aEvent ) override;
+ virtual void SAL_CALL treeNodesRemoved( const css::awt::tree::TreeDataModelEvent& aEvent ) override;
+ virtual void SAL_CALL treeStructureChanged( const css::awt::tree::TreeDataModelEvent& aEvent ) override;
+
+ // XEventListener
+ void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
+
+ // css::awt::XLayoutConstrains
+ css::awt::Size SAL_CALL getMinimumSize() override;
+ css::awt::Size SAL_CALL getPreferredSize() override;
+ css::awt::Size SAL_CALL calcAdjustedSize( const css::awt::Size& aNewSize ) override;
+
+ // css::awt::XVclWindowPeer
+ void SAL_CALL setProperty( const OUString& PropertyName, const css::uno::Any& Value ) override;
+ css::uno::Any SAL_CALL getProperty( const OUString& PropertyName ) override;
+
+private:
+ /// @throws css::lang::IllegalArgumentException
+ UnoTreeListEntry* getEntry( const css::uno::Reference< css::awt::tree::XTreeNode >& xNode, bool bThrow = true );
+
+ void disposeControl();
+
+ bool onEditingEntry( UnoTreeListEntry const * pEntry );
+ bool onEditedEntry( UnoTreeListEntry const * pEntry, const OUString& rNewText );
+
+ void fillTree( UnoTreeListBoxImpl& rTree, const css::uno::Reference< css::awt::tree::XTreeDataModel >& xDataModel );
+ void addNode( UnoTreeListBoxImpl& rTree, const css::uno::Reference< css::awt::tree::XTreeNode >& xNode, UnoTreeListEntry* pParentEntry );
+
+ UnoTreeListEntry* createEntry( const css::uno::Reference< css::awt::tree::XTreeNode >& xNode, UnoTreeListEntry* pParent, sal_uLong nPos );
+ void updateEntry( UnoTreeListEntry* pEntry );
+
+ void updateTree( const css::awt::tree::TreeDataModelEvent& rEvent );
+ void updateNode( UnoTreeListBoxImpl const & rTree, const css::uno::Reference< css::awt::tree::XTreeNode >& xNode );
+ void updateChildNodes( UnoTreeListBoxImpl const & rTree, const css::uno::Reference< css::awt::tree::XTreeNode >& xParentNode, UnoTreeListEntry* pParentEntry );
+
+ static OUString getEntryString( const css::uno::Any& rValue );
+
+ /// @throws css::uno::RuntimeException
+ UnoTreeListBoxImpl& getTreeListBoxOrThrow() const;
+ /// @throws css::uno::RuntimeException
+ /// @throws css::lang::IllegalArgumentException
+ void ChangeNodesSelection( const css::uno::Any& rSelection, bool bSelect, bool bSetSelection );
+
+ void onChangeDataModel( UnoTreeListBoxImpl& rTree, const css::uno::Reference< css::awt::tree::XTreeDataModel >& xDataModel );
+
+ void onSelectionChanged();
+ void onRequestChildNodes( const css::uno::Reference< css::awt::tree::XTreeNode >& xNode );
+ bool onExpanding( const css::uno::Reference< css::awt::tree::XTreeNode >& xNode, bool bExpanding );
+ void onExpanded( const css::uno::Reference< css::awt::tree::XTreeNode >& xNode, bool bExpanding );
+
+ void onChangeRootDisplayed( bool bIsRootDisplayed );
+
+ void addEntry( UnoTreeListEntry* pEntry );
+ void removeEntry( UnoTreeListEntry const * pEntry );
+
+ bool loadImage( const OUString& rURL, Image& rImage );
+
+private:
+ css::uno::Reference< css::awt::tree::XTreeDataModel >mxDataModel;
+ TreeSelectionListenerMultiplexer maSelectionListeners;
+ TreeExpansionListenerMultiplexer maTreeExpansionListeners;
+ TreeEditListenerMultiplexer maTreeEditListeners;
+ bool mbIsRootDisplayed;
+ VclPtr<UnoTreeListBoxImpl> mpTreeImpl;
+ sal_Int32 mnEditLock;
+ OUString msDefaultCollapsedGraphicURL;
+ OUString msDefaultExpandedGraphicURL;
+ Image maDefaultExpandedImage;
+ Image maDefaultCollapsedImage;
+ std::unique_ptr<TreeNodeMap> mpTreeNodeMap;
+ css::uno::Reference< css::graphic::XGraphicProvider > mxGraphicProvider;
+};
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/unocontrolcontainer.hxx b/toolkit/inc/controls/unocontrolcontainer.hxx
new file mode 100644
index 0000000000..ac4e018160
--- /dev/null
+++ b/toolkit/inc/controls/unocontrolcontainer.hxx
@@ -0,0 +1,151 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+
+#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/unocontrolbase.hxx>
+
+#include <cppuhelper/implbase4.hxx>
+#include <memory>
+
+class UnoControlHolderList;
+
+
+
+typedef ::cppu::AggImplInheritanceHelper4 < UnoControlBase
+ , css::awt::XUnoControlContainer
+ , css::awt::XControlContainer
+ , css::container::XContainer
+ , css::container::XIdentifierContainer
+ > UnoControlContainer_Base;
+
+class UnoControlContainer : public UnoControlContainer_Base
+{
+private:
+ std::unique_ptr<UnoControlHolderList> mpControls;
+ css::uno::Sequence< css::uno::Reference< css::awt::XTabController > > maTabControllers;
+ ContainerListenerMultiplexer maCListeners;
+
+protected:
+ void ImplActivateTabControllers();
+
+public:
+ UnoControlContainer();
+ UnoControlContainer( const css::uno::Reference< css::awt::XVclWindowPeer >& xPeer );
+ virtual ~UnoControlContainer() override;
+
+
+ // css::lang::XComponent
+ void SAL_CALL dispose() override;
+
+ // css::lang::XEventListener
+ void SAL_CALL disposing( const css::lang::EventObject& Source ) override;
+
+ // css::container::XContainer
+ void SAL_CALL addContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
+ void SAL_CALL removeContainerListener( const css::uno::Reference< css::container::XContainerListener >& xListener ) override;
+
+ // css::container::XIdentifierContainer
+ virtual ::sal_Int32 SAL_CALL insert( const css::uno::Any& aElement ) override;
+
+ // css::container::XIdentifierReplace
+ virtual void SAL_CALL removeByIdentifier( ::sal_Int32 Identifier ) override;
+ virtual void SAL_CALL replaceByIdentifer( ::sal_Int32 Identifier, const css::uno::Any& aElement ) override;
+
+ // css::container::XIdentifierAccess
+ virtual css::uno::Any SAL_CALL getByIdentifier( ::sal_Int32 Identifierr ) override;
+ virtual css::uno::Sequence< ::sal_Int32 > SAL_CALL getIdentifiers( ) override;
+
+ // css::container::XElementAccess
+ virtual css::uno::Type SAL_CALL getElementType( ) override;
+ virtual sal_Bool SAL_CALL hasElements( ) override;
+
+ // css::awt::XControlContainer
+ void SAL_CALL setStatusText( const OUString& StatusText ) override;
+ css::uno::Sequence< css::uno::Reference< css::awt::XControl > > SAL_CALL getControls( ) override;
+ css::uno::Reference< css::awt::XControl > SAL_CALL getControl( const OUString& aName ) override;
+ void SAL_CALL addControl( const OUString& Name, const css::uno::Reference< css::awt::XControl >& Control ) override;
+ void SAL_CALL removeControl( const css::uno::Reference< css::awt::XControl >& Control ) override;
+
+ // css::awt::XUnoControlContainer
+ void SAL_CALL setTabControllers( const css::uno::Sequence< css::uno::Reference< css::awt::XTabController > >& TabControllers ) override;
+ css::uno::Sequence< css::uno::Reference< css::awt::XTabController > > SAL_CALL getTabControllers( ) override;
+ void SAL_CALL addTabController( const css::uno::Reference< css::awt::XTabController >& TabController ) override;
+ void SAL_CALL removeTabController( const css::uno::Reference< css::awt::XTabController >& TabController ) override;
+
+ // css::awt::XControl
+ void SAL_CALL createPeer( const css::uno::Reference< css::awt::XToolkit >& Toolkit, const css::uno::Reference< css::awt::XWindowPeer >& Parent ) override;
+
+ // css::awt::XWindow
+ void SAL_CALL setVisible( sal_Bool Visible ) override;
+
+ OUString SAL_CALL getImplementationName() override;
+
+ css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+
+protected:
+ virtual void PrepareWindowDescriptor( css::awt::WindowDescriptor& rDesc ) override;
+ virtual void removingControl( const css::uno::Reference< css::awt::XControl >& _rxControl );
+ virtual void addingControl( const css::uno::Reference< css::awt::XControl >& _rxControl );
+
+ /** 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
+ */
+ virtual void impl_createControlPeerIfNecessary(
+ const css::uno::Reference< css::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 automatic name is generated
+ @return
+ the ID of the newly added control
+ */
+ sal_Int32 impl_addControl(
+ const css::uno::Reference< css::awt::XControl >& _rxControl,
+ const OUString* _pName = nullptr
+ );
+
+ /** 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.
+ */
+ void impl_removeControl(
+ sal_Int32 _nId,
+ const css::uno::Reference< css::awt::XControl >& _rxControl
+ );
+
+};
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/toolkit/inc/controls/unocontrolcontainermodel.hxx b/toolkit/inc/controls/unocontrolcontainermodel.hxx
new file mode 100644
index 0000000000..83db8af31b
--- /dev/null
+++ b/toolkit/inc/controls/unocontrolcontainermodel.hxx
@@ -0,0 +1,51 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+
+#include <toolkit/controls/unocontrolmodel.hxx>
+
+
+
+class UnoControlContainerModel final : public UnoControlModel
+{
+ css::uno::Any ImplGetDefaultValue( sal_uInt16 nPropId ) const override;
+ ::cppu::IPropertyArrayHelper& getInfoHelper() override;
+
+public:
+ UnoControlContainerModel( const css::uno::Reference< css::uno::XComponentContext >& i_factory );
+ UnoControlContainerModel( const UnoControlContainerModel& rModel ) : UnoControlModel( rModel ) {}
+
+ rtl::Reference<UnoControlModel> Clone() const override { return new UnoControlContainerModel( *this ); }
+
+ // css::beans::XMultiPropertySet
+ css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
+
+ // css::io::XPersistObject
+ OUString SAL_CALL getServiceName() override;
+
+ // css::lang::XServiceInfo
+ OUString SAL_CALL getImplementationName() override;
+
+ css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+};
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */