From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001
From: Daniel Baumann
Date: Sun, 7 Apr 2024 11:06:44 +0200
Subject: Adding upstream version 4:7.4.7.
Signed-off-by: Daniel Baumann
---
.../comphelper/AccessibleImplementationHelper.hxx | 45 ++
include/comphelper/ChainablePropertySet.hxx | 148 ++++
include/comphelper/ChainablePropertySetInfo.hxx | 64 ++
include/comphelper/DirectoryHelper.hxx | 38 +
include/comphelper/IdPropArrayHelper.hxx | 106 +++
include/comphelper/MasterPropertySet.hxx | 135 ++++
include/comphelper/MasterPropertySetInfo.hxx | 56 ++
include/comphelper/PropertyInfoHash.hxx | 57 ++
include/comphelper/SelectionMultiplex.hxx | 93 +++
include/comphelper/SetFlagContextHelper.hxx | 71 ++
include/comphelper/accessiblecomponenthelper.hxx | 142 ++++
include/comphelper/accessiblecontexthelper.hxx | 219 ++++++
include/comphelper/accessibleeventnotifier.hxx | 116 +++
include/comphelper/accessiblekeybindinghelper.hxx | 70 ++
include/comphelper/accessibleselectionhelper.hxx | 135 ++++
include/comphelper/accessibletexthelper.hxx | 176 +++++
include/comphelper/accessiblewrapper.hxx | 401 +++++++++++
include/comphelper/accimplaccess.hxx | 73 ++
include/comphelper/anycompare.hxx | 219 ++++++
include/comphelper/anytohash.hxx | 48 ++
include/comphelper/anytostring.hxx | 45 ++
include/comphelper/asyncnotification.hxx | 226 ++++++
include/comphelper/asyncquithandler.hxx | 44 ++
include/comphelper/attributelist.hxx | 92 +++
include/comphelper/automationinvokedzone.hxx | 36 +
include/comphelper/backupfilehelper.hxx | 216 ++++++
include/comphelper/base64.hxx | 62 ++
include/comphelper/basicio.hxx | 88 +++
include/comphelper/broadcasthelper.hxx | 51 ++
include/comphelper/bytereader.hxx | 44 ++
include/comphelper/classids.hxx | 334 +++++++++
include/comphelper/compbase.hxx | 118 +++
include/comphelper/comphelperdllapi.h | 33 +
include/comphelper/componentbase.hxx | 139 ++++
include/comphelper/componentguard.hxx | 58 ++
include/comphelper/configuration.hxx | 342 +++++++++
include/comphelper/configurationhelper.hxx | 239 +++++++
include/comphelper/configurationlistener.hxx | 121 ++++
include/comphelper/container.hxx | 76 ++
include/comphelper/containermultiplexer.hxx | 106 +++
include/comphelper/crashzone.hxx | 70 ++
include/comphelper/debuggerinfo.hxx | 38 +
include/comphelper/dispatchcommand.hxx | 43 ++
include/comphelper/docpasswordhelper.hxx | 447 ++++++++++++
include/comphelper/docpasswordrequest.hxx | 110 +++
include/comphelper/documentconstants.hxx | 130 ++++
include/comphelper/documentinfo.hxx | 51 ++
include/comphelper/doublecheckedinit.hxx | 64 ++
include/comphelper/embeddedobjectcontainer.hxx | 193 +++++
include/comphelper/enumhelper.hxx | 122 ++++
include/comphelper/eventattachermgr.hxx | 48 ++
include/comphelper/evtlistenerhlp.hxx | 49 ++
include/comphelper/evtmethodhelper.hxx | 32 +
include/comphelper/extract.hxx | 113 +++
include/comphelper/fileformat.h | 34 +
include/comphelper/fileurl.hxx | 36 +
include/comphelper/flagguard.hxx | 80 +++
include/comphelper/genericpropertyset.hxx | 43 ++
include/comphelper/getexpandeduri.hxx | 42 ++
include/comphelper/graphicmimetype.hxx | 49 ++
include/comphelper/guarding.hxx | 55 ++
include/comphelper/hash.hxx | 121 ++++
include/comphelper/indexedpropertyvalues.hxx | 55 ++
include/comphelper/interaction.hxx | 119 +++
include/comphelper/interfacecontainer2.hxx | 290 ++++++++
include/comphelper/interfacecontainer3.hxx | 379 ++++++++++
include/comphelper/interfacecontainer4.hxx | 401 +++++++++++
include/comphelper/logging.hxx | 460 ++++++++++++
include/comphelper/lok.hxx | 117 +++
include/comphelper/make_shared_from_uno.hxx | 68 ++
include/comphelper/mimeconfighelper.hxx | 142 ++++
include/comphelper/multicontainer2.hxx | 133 ++++
include/comphelper/multiinterfacecontainer3.hxx | 217 ++++++
include/comphelper/multiinterfacecontainer4.hxx | 190 +++++
include/comphelper/namecontainer.hxx | 40 ++
include/comphelper/namedvaluecollection.hxx | 322 +++++++++
include/comphelper/newarray.hxx | 42 ++
include/comphelper/numberedcollection.hxx | 168 +++++
include/comphelper/numbers.hxx | 56 ++
include/comphelper/ofopxmlhelper.hxx | 101 +++
include/comphelper/oslfile2streamwrap.hxx | 78 ++
include/comphelper/parallelsort.hxx | 373 ++++++++++
include/comphelper/processfactory.hxx | 72 ++
include/comphelper/profilezone.hxx | 92 +++
include/comphelper/propagg.hxx | 325 +++++++++
include/comphelper/proparrhlp.hxx | 141 ++++
include/comphelper/property.hxx | 131 ++++
include/comphelper/propertybag.hxx | 226 ++++++
include/comphelper/propertycontainer.hxx | 87 +++
include/comphelper/propertycontainerhelper.hxx | 197 +++++
include/comphelper/propertysequence.hxx | 62 ++
include/comphelper/propertysethelper.hxx | 96 +++
include/comphelper/propertysetinfo.hxx | 123 ++++
include/comphelper/propertystatecontainer.hxx | 110 +++
include/comphelper/propertyvalue.hxx | 45 ++
include/comphelper/propmultiplex.hxx | 115 +++
include/comphelper/propstate.hxx | 102 +++
include/comphelper/proxyaggregation.hxx | 218 ++++++
include/comphelper/random.hxx | 39 +
include/comphelper/refcountedmutex.hxx | 43 ++
include/comphelper/scopeguard.hxx | 92 +++
include/comphelper/seekableinput.hxx | 83 +++
include/comphelper/seqstream.hxx | 135 ++++
include/comphelper/sequence.hxx | 322 +++++++++
include/comphelper/sequenceashashmap.hxx | 426 +++++++++++
include/comphelper/servicedecl.hxx | 155 ++++
include/comphelper/servicehelper.hxx | 152 ++++
include/comphelper/sharedmutex.hxx | 77 ++
include/comphelper/simplefileaccessinteraction.hxx | 52 ++
include/comphelper/solarmutex.hxx | 98 +++
include/comphelper/stillreadwriteinteraction.hxx | 62 ++
include/comphelper/stl_types.hxx | 176 +++++
include/comphelper/storagehelper.hxx | 206 ++++++
include/comphelper/streamsection.hxx | 79 ++
include/comphelper/string.hxx | 386 ++++++++++
include/comphelper/synchronousdispatch.hxx | 64 ++
include/comphelper/syntaxhighlight.hxx | 84 +++
include/comphelper/threadpool.hxx | 114 +++
include/comphelper/traceevent.hxx | 222 ++++++
include/comphelper/types.hxx | 88 +++
include/comphelper/unique_disposing_ptr.hxx | 187 +++++
include/comphelper/uno3.hxx | 169 +++++
include/comphelper/unwrapargs.hxx | 122 ++++
include/comphelper/weak.hxx | 64 ++
include/comphelper/weakbag.hxx | 84 +++
include/comphelper/weakeventlistener.hxx | 183 +++++
include/comphelper/windowsStart.hxx | 27 +
include/comphelper/windowsdebugoutput.hxx | 796 +++++++++++++++++++++
include/comphelper/windowserrorstring.hxx | 68 ++
include/comphelper/xmlsechelper.hxx | 46 ++
include/comphelper/xmltools.hxx | 24 +
131 files changed, 17670 insertions(+)
create mode 100644 include/comphelper/AccessibleImplementationHelper.hxx
create mode 100644 include/comphelper/ChainablePropertySet.hxx
create mode 100644 include/comphelper/ChainablePropertySetInfo.hxx
create mode 100644 include/comphelper/DirectoryHelper.hxx
create mode 100644 include/comphelper/IdPropArrayHelper.hxx
create mode 100644 include/comphelper/MasterPropertySet.hxx
create mode 100644 include/comphelper/MasterPropertySetInfo.hxx
create mode 100644 include/comphelper/PropertyInfoHash.hxx
create mode 100644 include/comphelper/SelectionMultiplex.hxx
create mode 100644 include/comphelper/SetFlagContextHelper.hxx
create mode 100644 include/comphelper/accessiblecomponenthelper.hxx
create mode 100644 include/comphelper/accessiblecontexthelper.hxx
create mode 100644 include/comphelper/accessibleeventnotifier.hxx
create mode 100644 include/comphelper/accessiblekeybindinghelper.hxx
create mode 100644 include/comphelper/accessibleselectionhelper.hxx
create mode 100644 include/comphelper/accessibletexthelper.hxx
create mode 100644 include/comphelper/accessiblewrapper.hxx
create mode 100644 include/comphelper/accimplaccess.hxx
create mode 100644 include/comphelper/anycompare.hxx
create mode 100644 include/comphelper/anytohash.hxx
create mode 100644 include/comphelper/anytostring.hxx
create mode 100644 include/comphelper/asyncnotification.hxx
create mode 100644 include/comphelper/asyncquithandler.hxx
create mode 100644 include/comphelper/attributelist.hxx
create mode 100644 include/comphelper/automationinvokedzone.hxx
create mode 100644 include/comphelper/backupfilehelper.hxx
create mode 100644 include/comphelper/base64.hxx
create mode 100644 include/comphelper/basicio.hxx
create mode 100644 include/comphelper/broadcasthelper.hxx
create mode 100644 include/comphelper/bytereader.hxx
create mode 100644 include/comphelper/classids.hxx
create mode 100644 include/comphelper/compbase.hxx
create mode 100644 include/comphelper/comphelperdllapi.h
create mode 100644 include/comphelper/componentbase.hxx
create mode 100644 include/comphelper/componentguard.hxx
create mode 100644 include/comphelper/configuration.hxx
create mode 100644 include/comphelper/configurationhelper.hxx
create mode 100644 include/comphelper/configurationlistener.hxx
create mode 100644 include/comphelper/container.hxx
create mode 100644 include/comphelper/containermultiplexer.hxx
create mode 100644 include/comphelper/crashzone.hxx
create mode 100644 include/comphelper/debuggerinfo.hxx
create mode 100644 include/comphelper/dispatchcommand.hxx
create mode 100644 include/comphelper/docpasswordhelper.hxx
create mode 100644 include/comphelper/docpasswordrequest.hxx
create mode 100644 include/comphelper/documentconstants.hxx
create mode 100644 include/comphelper/documentinfo.hxx
create mode 100644 include/comphelper/doublecheckedinit.hxx
create mode 100644 include/comphelper/embeddedobjectcontainer.hxx
create mode 100644 include/comphelper/enumhelper.hxx
create mode 100644 include/comphelper/eventattachermgr.hxx
create mode 100644 include/comphelper/evtlistenerhlp.hxx
create mode 100644 include/comphelper/evtmethodhelper.hxx
create mode 100644 include/comphelper/extract.hxx
create mode 100644 include/comphelper/fileformat.h
create mode 100644 include/comphelper/fileurl.hxx
create mode 100644 include/comphelper/flagguard.hxx
create mode 100644 include/comphelper/genericpropertyset.hxx
create mode 100644 include/comphelper/getexpandeduri.hxx
create mode 100644 include/comphelper/graphicmimetype.hxx
create mode 100644 include/comphelper/guarding.hxx
create mode 100644 include/comphelper/hash.hxx
create mode 100644 include/comphelper/indexedpropertyvalues.hxx
create mode 100644 include/comphelper/interaction.hxx
create mode 100644 include/comphelper/interfacecontainer2.hxx
create mode 100644 include/comphelper/interfacecontainer3.hxx
create mode 100644 include/comphelper/interfacecontainer4.hxx
create mode 100644 include/comphelper/logging.hxx
create mode 100644 include/comphelper/lok.hxx
create mode 100644 include/comphelper/make_shared_from_uno.hxx
create mode 100644 include/comphelper/mimeconfighelper.hxx
create mode 100644 include/comphelper/multicontainer2.hxx
create mode 100644 include/comphelper/multiinterfacecontainer3.hxx
create mode 100644 include/comphelper/multiinterfacecontainer4.hxx
create mode 100644 include/comphelper/namecontainer.hxx
create mode 100644 include/comphelper/namedvaluecollection.hxx
create mode 100644 include/comphelper/newarray.hxx
create mode 100644 include/comphelper/numberedcollection.hxx
create mode 100644 include/comphelper/numbers.hxx
create mode 100644 include/comphelper/ofopxmlhelper.hxx
create mode 100644 include/comphelper/oslfile2streamwrap.hxx
create mode 100644 include/comphelper/parallelsort.hxx
create mode 100644 include/comphelper/processfactory.hxx
create mode 100644 include/comphelper/profilezone.hxx
create mode 100644 include/comphelper/propagg.hxx
create mode 100644 include/comphelper/proparrhlp.hxx
create mode 100644 include/comphelper/property.hxx
create mode 100644 include/comphelper/propertybag.hxx
create mode 100644 include/comphelper/propertycontainer.hxx
create mode 100644 include/comphelper/propertycontainerhelper.hxx
create mode 100644 include/comphelper/propertysequence.hxx
create mode 100644 include/comphelper/propertysethelper.hxx
create mode 100644 include/comphelper/propertysetinfo.hxx
create mode 100644 include/comphelper/propertystatecontainer.hxx
create mode 100644 include/comphelper/propertyvalue.hxx
create mode 100644 include/comphelper/propmultiplex.hxx
create mode 100644 include/comphelper/propstate.hxx
create mode 100644 include/comphelper/proxyaggregation.hxx
create mode 100644 include/comphelper/random.hxx
create mode 100644 include/comphelper/refcountedmutex.hxx
create mode 100644 include/comphelper/scopeguard.hxx
create mode 100644 include/comphelper/seekableinput.hxx
create mode 100644 include/comphelper/seqstream.hxx
create mode 100644 include/comphelper/sequence.hxx
create mode 100644 include/comphelper/sequenceashashmap.hxx
create mode 100644 include/comphelper/servicedecl.hxx
create mode 100644 include/comphelper/servicehelper.hxx
create mode 100644 include/comphelper/sharedmutex.hxx
create mode 100644 include/comphelper/simplefileaccessinteraction.hxx
create mode 100644 include/comphelper/solarmutex.hxx
create mode 100644 include/comphelper/stillreadwriteinteraction.hxx
create mode 100644 include/comphelper/stl_types.hxx
create mode 100644 include/comphelper/storagehelper.hxx
create mode 100644 include/comphelper/streamsection.hxx
create mode 100644 include/comphelper/string.hxx
create mode 100644 include/comphelper/synchronousdispatch.hxx
create mode 100644 include/comphelper/syntaxhighlight.hxx
create mode 100644 include/comphelper/threadpool.hxx
create mode 100644 include/comphelper/traceevent.hxx
create mode 100644 include/comphelper/types.hxx
create mode 100644 include/comphelper/unique_disposing_ptr.hxx
create mode 100644 include/comphelper/uno3.hxx
create mode 100644 include/comphelper/unwrapargs.hxx
create mode 100644 include/comphelper/weak.hxx
create mode 100644 include/comphelper/weakbag.hxx
create mode 100644 include/comphelper/weakeventlistener.hxx
create mode 100644 include/comphelper/windowsStart.hxx
create mode 100644 include/comphelper/windowsdebugoutput.hxx
create mode 100644 include/comphelper/windowserrorstring.hxx
create mode 100644 include/comphelper/xmlsechelper.hxx
create mode 100644 include/comphelper/xmltools.hxx
(limited to 'include/comphelper')
diff --git a/include/comphelper/AccessibleImplementationHelper.hxx b/include/comphelper/AccessibleImplementationHelper.hxx
new file mode 100644
index 000000000..b6c8d9ab0
--- /dev/null
+++ b/include/comphelper/AccessibleImplementationHelper.hxx
@@ -0,0 +1,45 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
+/*
+ * 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
+#include
+
+namespace com::sun::star::awt
+{
+struct KeyStroke;
+}
+namespace com::sun::star::uno
+{
+template class Sequence;
+}
+
+namespace comphelper
+{
+/**
+ * Helper function used for converting keybinding to string.
+ *
+ * @param keySet the key stroke sequence.
+ */
+COMPHELPER_DLLPUBLIC OUString
+GetkeyBindingStrByXkeyBinding(const css::uno::Sequence& keySet);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/include/comphelper/ChainablePropertySet.hxx b/include/comphelper/ChainablePropertySet.hxx
new file mode 100644
index 000000000..fb4fbd744
--- /dev/null
+++ b/include/comphelper/ChainablePropertySet.hxx
@@ -0,0 +1,148 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_COMPHELPER_CHAINABLEPROPERTYSET_HXX
+#define INCLUDED_COMPHELPER_CHAINABLEPROPERTYSET_HXX
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+namespace comphelper { class SolarMutex; }
+namespace comphelper { struct PropertyInfo; }
+
+namespace comphelper
+{
+ class ChainablePropertySetInfo;
+}
+
+/*
+ * A ChainablePropertySet has the following features:
+ *
+ * 1. It implements both the PropertySet and MultiPropertySet interfaces.
+ * 2. It can be 'included' in a MasterPropertySet to seamlessly appear as if
+ * if it's properties were in the master.
+ *
+ * To be used as a base class for PropertySets, the subclass must implement
+ * the 6 protected pure virtual functions. If a mutex is passed to the
+ * constructor, this is locked before any call to _getSingleValue or
+ * _setSingleValue and released after all processing has completed
+ * (including _postSetValues or _postGetValues )
+ *
+ * Any MasterPropertySet implementations that can include an
+ * implementation of a given ChainablePropertySet must be
+ * declared as a 'friend' in the implementation of the ChainablePropertySet.
+ *
+ */
+
+namespace comphelper
+{
+ typedef cppu::WeakImplHelper
+ <
+ css::beans::XPropertySet,
+ css::beans::XMultiPropertySet,
+ css::lang::XServiceInfo
+ >
+ ChainablePropertySetBase;
+ class COMPHELPER_DLLPUBLIC ChainablePropertySet : public ChainablePropertySetBase,
+ public css::beans::XPropertyState
+ {
+ friend class MasterPropertySet;
+ protected:
+ SolarMutex* const mpMutex;
+ rtl::Reference < ChainablePropertySetInfo > mxInfo;
+
+ /// @throws css::beans::UnknownPropertyException
+ /// @throws css::beans::PropertyVetoException
+ /// @throws css::lang::IllegalArgumentException
+ /// @throws css::lang::WrappedTargetException
+ /// @throws css::uno::RuntimeException
+ virtual void _preSetValues () = 0;
+ /// @throws css::beans::UnknownPropertyException
+ /// @throws css::beans::PropertyVetoException
+ /// @throws css::lang::IllegalArgumentException
+ /// @throws css::lang::WrappedTargetException
+ /// @throws css::uno::RuntimeException
+ virtual void _setSingleValue(const comphelper::PropertyInfo & rInfo, const css::uno::Any &rValue) = 0;
+ /// @throws css::beans::UnknownPropertyException
+ /// @throws css::beans::PropertyVetoException
+ /// @throws css::lang::IllegalArgumentException
+ /// @throws css::lang::WrappedTargetException
+ /// @throws css::uno::RuntimeException
+ virtual void _postSetValues () = 0;
+
+ /// @throws css::beans::UnknownPropertyException
+ /// @throws css::beans::PropertyVetoException
+ /// @throws css::lang::IllegalArgumentException
+ /// @throws css::lang::WrappedTargetException
+ /// @throws css::uno::RuntimeException
+ virtual void _preGetValues () = 0;
+ /// @throws css::beans::UnknownPropertyException
+ /// @throws css::lang::WrappedTargetException
+ /// @throws css::uno::RuntimeException
+ virtual void _getSingleValue( const comphelper::PropertyInfo & rInfo, css::uno::Any & rValue ) = 0;
+ /// @throws css::beans::UnknownPropertyException
+ /// @throws css::beans::PropertyVetoException
+ /// @throws css::lang::IllegalArgumentException
+ /// @throws css::lang::WrappedTargetException
+ virtual void _postGetValues () = 0;
+
+ public:
+ ChainablePropertySet( comphelper::ChainablePropertySetInfo* pInfo, SolarMutex* pMutex )
+ noexcept;
+ virtual ~ChainablePropertySet()
+ noexcept override;
+
+ css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override
+ { return ChainablePropertySetBase::queryInterface( aType ); }
+ void SAL_CALL acquire( ) noexcept override
+ { ChainablePropertySetBase::acquire( ); }
+ void SAL_CALL release( ) noexcept override
+ { ChainablePropertySetBase::release( ); }
+
+ // XPropertySet
+ virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
+ virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
+ virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
+ virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
+ virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
+ virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
+ virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
+
+ // XMultiPropertySet
+ virtual void SAL_CALL setPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Sequence< css::uno::Any >& aValues ) override;
+ virtual css::uno::Sequence< css::uno::Any > SAL_CALL getPropertyValues( const css::uno::Sequence< OUString >& aPropertyNames ) override;
+ virtual void SAL_CALL addPropertiesChangeListener( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
+ virtual void SAL_CALL removePropertiesChangeListener( const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
+ virtual void SAL_CALL firePropertiesChangeEvent( const css::uno::Sequence< OUString >& aPropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener ) override;
+
+ // XPropertyState
+ virtual css::beans::PropertyState SAL_CALL getPropertyState( const OUString& PropertyName ) override;
+ virtual css::uno::Sequence< css::beans::PropertyState > SAL_CALL getPropertyStates( const css::uno::Sequence< OUString >& aPropertyName ) override;
+ virtual void SAL_CALL setPropertyToDefault( const OUString& PropertyName ) override;
+ virtual css::uno::Any SAL_CALL getPropertyDefault( const OUString& aPropertyName ) override;
+ };
+}
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/ChainablePropertySetInfo.hxx b/include/comphelper/ChainablePropertySetInfo.hxx
new file mode 100644
index 000000000..5ece0701c
--- /dev/null
+++ b/include/comphelper/ChainablePropertySetInfo.hxx
@@ -0,0 +1,64 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_COMPHELPER_CHAINABLEPROPERTYSETINFO_HXX
+#define INCLUDED_COMPHELPER_CHAINABLEPROPERTYSETINFO_HXX
+
+#include
+#include
+#include
+#include
+
+/*
+ * A ChainablePropertySetInfo is usually initialised with a pointer to the first element
+ * of a null-terminated static table of PropertyInfo structs. This is placed in a hash_map
+ * for fast access
+ *
+ */
+namespace comphelper
+{
+ // workaround for incremental linking bugs in MSVC2015
+ class SAL_DLLPUBLIC_TEMPLATE ChainablePropertySetInfo_Base : public cppu::WeakImplHelper< css::beans::XPropertySetInfo > {};
+
+ class COMPHELPER_DLLPUBLIC ChainablePropertySetInfo final : public ChainablePropertySetInfo_Base
+ {
+ public:
+ ChainablePropertySetInfo( PropertyInfo const * pMap );
+
+ void remove( const OUString& aName );
+
+ private:
+ virtual ~ChainablePropertySetInfo()
+ noexcept override;
+
+ // XPropertySetInfo
+ virtual css::uno::Sequence< css::beans::Property > SAL_CALL getProperties() override;
+ virtual css::beans::Property SAL_CALL getPropertyByName( const OUString& aName ) override;
+ virtual sal_Bool SAL_CALL hasPropertyByName( const OUString& Name ) override;
+
+ PropertyInfoHash maMap;
+ css::uno::Sequence < css::beans::Property > maProperties;
+
+ friend class ChainablePropertySet;
+ friend class MasterPropertySet;
+ };
+}
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/DirectoryHelper.hxx b/include/comphelper/DirectoryHelper.hxx
new file mode 100644
index 000000000..321e9f960
--- /dev/null
+++ b/include/comphelper/DirectoryHelper.hxx
@@ -0,0 +1,38 @@
+/* -*- 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/.
+ */
+
+#pragma once
+
+#include
+
+#include
+#include
+#include
+#include
+
+namespace comphelper
+{
+class COMPHELPER_DLLPUBLIC DirectoryHelper
+{
+public:
+ static std::u16string_view splitAtLastToken(std::u16string_view rSrc, sal_Unicode aToken,
+ OUString& rRight);
+ static bool fileExists(const OUString& rBaseURL);
+ static bool dirExists(const OUString& rDirURL);
+
+ // all rDirs and rFiles strings are already URI encoded, so safe for concat
+ static void scanDirsAndFiles(const OUString& rDirURL, std::set& rDirs,
+ std::set>& rFiles);
+ static bool deleteDirRecursively(const OUString& rDirURL);
+ static bool moveDirContent(const OUString& rSourceDirURL, std::u16string_view rTargetDirURL,
+ const std::set& rExcludeList);
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/IdPropArrayHelper.hxx b/include/comphelper/IdPropArrayHelper.hxx
new file mode 100644
index 000000000..8b70db849
--- /dev/null
+++ b/include/comphelper/IdPropArrayHelper.hxx
@@ -0,0 +1,106 @@
+/* -*- 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
+
+#include
+#include
+#include
+#include
+
+namespace comphelper
+{
+
+ typedef std::unordered_map< sal_Int32, ::cppu::IPropertyArrayHelper* > OIdPropertyArrayMap;
+ template
+ class OIdPropertyArrayUsageHelper
+ {
+ public:
+ OIdPropertyArrayUsageHelper();
+ virtual ~OIdPropertyArrayUsageHelper()
+ {
+ std::unique_lock aGuard(theMutex());
+ assert(s_nRefCount > 0 && "OIdPropertyArrayUsageHelper::~OIdPropertyArrayUsageHelper : suspicious call : have a refcount of 0 !");
+ if (!--s_nRefCount)
+ {
+ // delete the element
+ for (auto const& elem : *s_pMap)
+ delete elem.second;
+ delete s_pMap;
+ s_pMap = nullptr;
+ }
+ }
+
+ /** call this in the getInfoHelper method of your derived class. The method returns the array helper of the
+ class, which is created if necessary.
+ */
+ ::cppu::IPropertyArrayHelper* getArrayHelper(sal_Int32 nId);
+
+ protected:
+ /** used to implement the creation of the array helper which is shared amongst all instances of the class.
+ This method needs to be implemented in derived classes.
+
+ The method gets called with Mutex acquired.
+ @return a pointer to the newly created array helper. Must not be NULL.
+ */
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 nId) const = 0;
+ private:
+ static sal_Int32 s_nRefCount;
+ static OIdPropertyArrayMap* s_pMap;
+ static std::mutex& theMutex()
+ {
+ static std::mutex SINGLETON;
+ return SINGLETON;
+ }
+ };
+
+ template
+ sal_Int32 OIdPropertyArrayUsageHelper< TYPE >::s_nRefCount = 0;
+
+ template
+ OIdPropertyArrayMap* OIdPropertyArrayUsageHelper< TYPE >::s_pMap = nullptr;
+
+ template
+ OIdPropertyArrayUsageHelper::OIdPropertyArrayUsageHelper()
+ {
+ std::unique_lock aGuard(theMutex());
+ // create the map if necessary
+ if (!s_pMap)
+ s_pMap = new OIdPropertyArrayMap;
+ ++s_nRefCount;
+ }
+
+ template
+ ::cppu::IPropertyArrayHelper* OIdPropertyArrayUsageHelper::getArrayHelper(sal_Int32 nId)
+ {
+ assert(s_nRefCount && "OIdPropertyArrayUsageHelper::getArrayHelper : suspicious call : have a refcount of 0 !");
+ std::unique_lock aGuard(theMutex());
+ // do we have the array already?
+ auto& rEntry = (*s_pMap)[nId];
+ if (!rEntry)
+ {
+ rEntry = createArrayHelper(nId);
+ assert(rEntry && "OIdPropertyArrayUsageHelper::getArrayHelper : createArrayHelper returned nonsense !");
+ }
+ return (*s_pMap)[nId];
+ }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/MasterPropertySet.hxx b/include/comphelper/MasterPropertySet.hxx
new file mode 100644
index 000000000..acd9ce9c4
--- /dev/null
+++ b/include/comphelper/MasterPropertySet.hxx
@@ -0,0 +1,135 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_COMPHELPER_MASTERPROPERTYSET_HXX
+#define INCLUDED_COMPHELPER_MASTERPROPERTYSET_HXX
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+ */
+ class OContextEntryGuard : public ::osl::ClearableMutexGuard
+ {
+ public:
+ /** constructs the guard
+
+ The given context (it's mutex, respectively) is locked, and an exception is thrown if the context
+ is not alive anymore. In the latter case, of course, the mutex is freed, again.
+
+ @param _pContext
+ the context which shall be guarded
+ @precond _pContext != NULL
+ */
+ inline OContextEntryGuard( OAccessibleContextHelper* _pContext );
+ };
+
+
+ inline OContextEntryGuard::OContextEntryGuard( OAccessibleContextHelper* _pContext )
+ : ::osl::ClearableMutexGuard( _pContext->GetMutex() )
+ {
+ _pContext->ensureAlive();
+ }
+
+
+ //= OExternalLockGuard
+
+ class OExternalLockGuard
+ :public osl::Guard
+ ,public OContextEntryGuard
+ {
+ public:
+ inline OExternalLockGuard( OAccessibleContextHelper* _pContext );
+ };
+
+
+ inline OExternalLockGuard::OExternalLockGuard( OAccessibleContextHelper* _pContext )
+ :osl::Guard( SolarMutex::get() )
+ ,OContextEntryGuard( _pContext )
+ {
+ // Only lock the external mutex,
+ // release the ::osl::Mutex of the OAccessibleContextHelper instance.
+ // If you call into another UNO object with locked ::osl::Mutex,
+ // this may lead to dead locks.
+ clear();
+ }
+
+
+} // namespace comphelper
+
+
+#endif // INCLUDED_COMPHELPER_ACCESSIBLECONTEXTHELPER_HXX
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/accessibleeventnotifier.hxx b/include/comphelper/accessibleeventnotifier.hxx
new file mode 100644
index 000000000..75828cda6
--- /dev/null
+++ b/include/comphelper/accessibleeventnotifier.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 .
+ */
+
+#ifndef INCLUDED_COMPHELPER_ACCESSIBLEEVENTNOTIFIER_HXX
+#define INCLUDED_COMPHELPER_ACCESSIBLEEVENTNOTIFIER_HXX
+
+#include
+
+namespace com::sun::star::uno { class XInterface; }
+namespace com::sun::star::uno { template class Reference; }
+namespace com::sun::star::accessibility { class XAccessibleEventListener; }
+namespace com::sun::star::accessibility { struct AccessibleEventObject; }
+
+namespace comphelper {
+
+class COMPHELPER_DLLPUBLIC AccessibleEventNotifier
+{
+public:
+ typedef sal_uInt32 TClientId;
+
+public:
+ AccessibleEventNotifier() = delete;
+ ~AccessibleEventNotifier() = delete;
+ AccessibleEventNotifier( const AccessibleEventNotifier& ) = delete;
+ AccessibleEventNotifier& operator=( const AccessibleEventNotifier& ) = delete;
+
+ /** registers a client of this class, means a broadcaster of AccessibleEvents
+
+ No precaution is taken to care for disposal of this component. When the component
+ dies, it must call revokeClient or revokeClientNotifyDisposing
+ explicitly itself.
+ */
+ static TClientId registerClient();
+
+ /** revokes a broadcaster of AccessibleEvents
+
+ Note that no disposing event is fired when you use this method, the client is simply revoked.
+ You can for instance revoke a client if the last listener for it is revoked, but the client
+ itself is not disposed.
+ When the client is disposed, you should prefer revokeClientNotifyDisposing
+
+ Any possibly pending events for this client are removed from the queue.
+
+ @seealso revokeClientNotifyDisposing
+ */
+ static void revokeClient( const TClientId _nClient );
+
+ /** revokes a client, with additionally notifying a disposing event to all listeners registered for
+ this client
+
+ Any other possibly pending events for this client are removed from the queue
+
+ @param _nClient
+ the id of the client which should be revoked
+ @param _rxEventSource
+ the source to be notified together with the XComponent::disposing
+ call.
+ */
+ static void revokeClientNotifyDisposing(
+ const TClientId _nClient,
+ const css::uno::Reference< css::uno::XInterface >& _rxEventSource );
+
+ /** registers a listener for the given client
+
+ @param _nClient
+ the id of the client for which a listener should be registered
+ @return
+ the number of event listeners currently registered for this client
+ */
+ static sal_Int32 addEventListener(
+ const TClientId _nClient,
+ const css::uno::Reference< css::accessibility::XAccessibleEventListener >& _rxListener );
+
+ /** revokes a listener for the given client
+
+ @param _nClient
+ the id of the client for which a listener should be revoked
+ @return
+ the number of event listeners currently registered for this client
+ */
+ static sal_Int32 removeEventListener(
+ const TClientId _nClient,
+ const css::uno::Reference< css::accessibility::XAccessibleEventListener >& _rxListener );
+
+ /** adds an event, which is to be broadcasted, to the queue
+
+ @param _nClient
+ the id of the client which needs to broadcast the event
+ */
+ static void addEvent(
+ const TClientId _nClient,
+ const css::accessibility::AccessibleEventObject& _rEvent );
+
+};
+
+} // namespace comphelper
+
+#endif // INCLUDED_COMPHELPER_ACCESSIBLEEVENTNOTIFIER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/accessiblekeybindinghelper.hxx b/include/comphelper/accessiblekeybindinghelper.hxx
new file mode 100644
index 000000000..fe6b03521
--- /dev/null
+++ b/include/comphelper/accessiblekeybindinghelper.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 .
+ */
+
+#ifndef INCLUDED_COMPHELPER_ACCESSIBLEKEYBINDINGHELPER_HXX
+#define INCLUDED_COMPHELPER_ACCESSIBLEKEYBINDINGHELPER_HXX
+
+#include
+#include
+#include
+#include
+#include
+
+namespace comphelper
+{
+
+
+ // OAccessibleKeyBindingHelper
+
+
+ typedef ::cppu::WeakImplHelper < css::accessibility::XAccessibleKeyBinding
+ > OAccessibleKeyBindingHelper_Base;
+
+ /** a helper class for implementing an accessible keybinding
+ */
+ class COMPHELPER_DLLPUBLIC OAccessibleKeyBindingHelper final : public OAccessibleKeyBindingHelper_Base
+ {
+ private:
+ typedef ::std::vector< css::uno::Sequence< css::awt::KeyStroke > > KeyBindings;
+ KeyBindings m_aKeyBindings;
+ std::mutex m_aMutex;
+
+ virtual ~OAccessibleKeyBindingHelper() override;
+
+ public:
+ OAccessibleKeyBindingHelper();
+ OAccessibleKeyBindingHelper( const OAccessibleKeyBindingHelper& rHelper );
+
+ /// @throws css::uno::RuntimeException
+ void AddKeyBinding( const css::uno::Sequence< css::awt::KeyStroke >& rKeyBinding );
+ /// @throws css::uno::RuntimeException
+ void AddKeyBinding( const css::awt::KeyStroke& rKeyStroke );
+
+ // XAccessibleKeyBinding
+ virtual sal_Int32 SAL_CALL getAccessibleKeyBindingCount() override;
+ virtual css::uno::Sequence< css::awt::KeyStroke > SAL_CALL getAccessibleKeyBinding( sal_Int32 nIndex ) override;
+ };
+
+
+} // namespace comphelper
+
+
+#endif // INCLUDED_COMPHELPER_ACCESSIBLEKEYBINDINGHELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/accessibleselectionhelper.hxx b/include/comphelper/accessibleselectionhelper.hxx
new file mode 100644
index 000000000..3a49c1ffd
--- /dev/null
+++ b/include/comphelper/accessibleselectionhelper.hxx
@@ -0,0 +1,135 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_COMPHELPER_ACCESSIBLESELECTIONHELPER_HXX
+#define INCLUDED_COMPHELPER_ACCESSIBLESELECTIONHELPER_HXX
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#define ACCESSIBLE_SELECTION_CHILD_ALL (sal_Int32(-1))
+#define ACCESSIBLE_SELECTION_CHILD_SELF ((sal_Int32)-2)
+
+
+namespace comphelper
+{
+
+
+ //= OCommonAccessibleSelection
+
+ /** base class encapsulating common functionality for the helper classes implementing
+ the XAccessibleSelection
+ */
+ class COMPHELPER_DLLPUBLIC OCommonAccessibleSelection
+ {
+ protected:
+
+ OCommonAccessibleSelection();
+
+ ~OCommonAccessibleSelection();
+
+ protected:
+
+ // access to context - still waiting to be overwritten
+ /// @throws css::uno::RuntimeException
+ virtual css::uno::Reference< css::accessibility::XAccessibleContext >
+ implGetAccessibleContext() = 0;
+
+ // return if the specified child is visible => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx)
+ /// @throws css::uno::RuntimeException
+ virtual bool
+ implIsSelected( sal_Int32 nAccessibleChildIndex ) = 0;
+
+ // select the specified child => watch for special ChildIndexes (ACCESSIBLE_SELECTION_CHILD_xxx)
+ /// @throws css::uno::RuntimeException
+ virtual void
+ implSelect( sal_Int32 nAccessibleChildIndex, bool bSelect ) = 0;
+
+ protected:
+
+ /** non-virtual versions of the methods which can be implemented using implIsSelected and implSelect
+
+ @throws css::lang::IndexOutOfBoundsException
+ @throws css::uno::RuntimeException
+ */
+ void selectAccessibleChild( sal_Int32 nChildIndex );
+ /// @throws css::lang::IndexOutOfBoundsException
+ /// @throws css::uno::RuntimeException
+ bool isAccessibleChildSelected( sal_Int32 nChildIndex );
+ /// @throws css::uno::RuntimeException
+ void clearAccessibleSelection( );
+ /// @throws css::uno::RuntimeException
+ void selectAllAccessibleChildren( );
+ /// @throws css::uno::RuntimeException
+ sal_Int32 getSelectedAccessibleChildCount( );
+ /// @throws css::lang::IndexOutOfBoundsException
+ /// @throws css::uno::RuntimeException
+ css::uno::Reference< css::accessibility::XAccessible > getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex );
+ /// @throws css::lang::IndexOutOfBoundsException
+ /// @throws css::uno::RuntimeException
+ void deselectAccessibleChild( sal_Int32 nSelectedChildIndex );
+ };
+
+
+ //= OAccessibleSelectionHelper
+
+
+ typedef ::cppu::ImplHelper1< css::accessibility::XAccessibleSelection > OAccessibleSelectionHelper_Base;
+
+ /** a helper class for implementing an AccessibleSelection which at the same time
+ supports an XAccessibleSelection interface.
+ */
+ class UNLESS_MERGELIBS(COMPHELPER_DLLPUBLIC) OAccessibleSelectionHelper : public OAccessibleComponentHelper,
+ public OCommonAccessibleSelection,
+ public OAccessibleSelectionHelper_Base
+ {
+ protected:
+
+ OAccessibleSelectionHelper();
+
+ // return ourself here by default
+ virtual css::uno::Reference< css::accessibility::XAccessibleContext > implGetAccessibleContext() override;
+
+ public:
+
+ // XInterface
+ DECLARE_XINTERFACE( )
+ DECLARE_XTYPEPROVIDER( )
+
+ // XAccessibleSelection - default implementations
+ virtual void SAL_CALL selectAccessibleChild( sal_Int32 nChildIndex ) override;
+ virtual sal_Bool SAL_CALL isAccessibleChildSelected( sal_Int32 nChildIndex ) override;
+ virtual void SAL_CALL clearAccessibleSelection( ) override;
+ virtual void SAL_CALL selectAllAccessibleChildren( ) override;
+ virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) override;
+ virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) override;
+ virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) override;
+ };
+
+
+} // namespace comphelper
+
+
+#endif // INCLUDED_COMPHELPER_ACCESSIBLESELECTIONHELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/accessibletexthelper.hxx b/include/comphelper/accessibletexthelper.hxx
new file mode 100644
index 000000000..607004aee
--- /dev/null
+++ b/include/comphelper/accessibletexthelper.hxx
@@ -0,0 +1,176 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_COMPHELPER_ACCESSIBLETEXTHELPER_HXX
+#define INCLUDED_COMPHELPER_ACCESSIBLETEXTHELPER_HXX
+
+#include
+#include
+#include
+#include
+#include
+
+namespace com::sun::star::i18n { class XBreakIterator; }
+namespace com::sun::star::i18n { class XCharacterClassification; }
+namespace com::sun::star::i18n { struct Boundary; }
+
+namespace comphelper
+{
+
+
+ // OCommonAccessibleText
+
+ /** base class encapsulating common functionality for the helper classes implementing
+ the XAccessibleText
+ */
+ class COMPHELPER_DLLPUBLIC OCommonAccessibleText
+ {
+ private:
+ css::uno::Reference < css::i18n::XBreakIterator > m_xBreakIter;
+ css::uno::Reference < css::i18n::XCharacterClassification > m_xCharClass;
+
+ protected:
+ OCommonAccessibleText();
+ virtual ~OCommonAccessibleText();
+
+ css::uno::Reference < css::i18n::XBreakIterator > const & implGetBreakIterator();
+ css::uno::Reference < css::i18n::XCharacterClassification > const & implGetCharacterClassification();
+ static bool implIsValidBoundary( css::i18n::Boundary const & rBoundary, sal_Int32 nLength );
+ static bool implIsValidIndex( sal_Int32 nIndex, sal_Int32 nLength );
+ static bool implIsValidRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex, sal_Int32 nLength );
+ static sal_Unicode implGetCharacter( std::u16string_view rText, sal_Int32 nIndex );
+ static OUString implGetTextRange( std::u16string_view rText, sal_Int32 nStartIndex, sal_Int32 nEndIndex );
+ virtual OUString implGetText() = 0;
+ virtual css::lang::Locale implGetLocale() = 0;
+ virtual void implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) = 0;
+ void implGetGlyphBoundary( const OUString& rText, css::i18n::Boundary& rBoundary, sal_Int32 nIndex );
+ bool implGetWordBoundary( const OUString& rText, css::i18n::Boundary& rBoundary, sal_Int32 nIndex );
+ void implGetSentenceBoundary( const OUString& rText, css::i18n::Boundary& rBoundary, sal_Int32 nIndex );
+ virtual void implGetParagraphBoundary( const OUString& rText, css::i18n::Boundary& rBoundary, sal_Int32 nIndex );
+ virtual void implGetLineBoundary( const OUString& rText, css::i18n::Boundary& rBoundary, sal_Int32 nIndex );
+
+ /** non-virtual versions of the methods
+
+ @throws css::lang::IndexOutOfBoundsException
+ @throws css::uno::RuntimeException
+ */
+ OUString getSelectedText();
+ /// @throws css::uno::RuntimeException
+ sal_Int32 getSelectionStart();
+ /// @throws css::uno::RuntimeException
+ sal_Int32 getSelectionEnd();
+ /// @throws css::lang::IndexOutOfBoundsException
+ /// @throws css::lang::IllegalArgumentException
+ /// @throws css::uno::RuntimeException
+ css::accessibility::TextSegment getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType );
+ /// @throws css::lang::IndexOutOfBoundsException
+ /// @throws css::lang::IllegalArgumentException
+ /// @throws css::uno::RuntimeException
+ css::accessibility::TextSegment getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType );
+ /// @throws css::lang::IndexOutOfBoundsException
+ /// @throws css::lang::IllegalArgumentException
+ /// @throws css::uno::RuntimeException
+ css::accessibility::TextSegment getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType );
+
+ public:
+
+ /** Helper method, that detects the difference between
+ two strings and returns the deleted selection and
+ the inserted selection if available.
+
+ @returns true if there are differences between the
+ two strings and false if both are equal
+
+ @see css::accessibility::AccessibleEventId
+ css::accessibility::TextSegment
+ */
+ static bool implInitTextChangedEvent(
+ std::u16string_view rOldString,
+ std::u16string_view rNewString,
+ /*out*/ css::uno::Any& rDeleted,
+ /*out*/ css::uno::Any& rInserted); // throw()
+ };
+
+
+ // OAccessibleTextHelper
+
+
+ typedef ::cppu::ImplHelper1 < css::accessibility::XAccessibleText
+ > OAccessibleTextHelper_Base;
+
+ /** a helper class for implementing an AccessibleExtendedComponent which at the same time
+ supports an XAccessibleText interface
+ */
+ class COMPHELPER_DLLPUBLIC OAccessibleTextHelper : public OAccessibleExtendedComponentHelper,
+ public OCommonAccessibleText,
+ public OAccessibleTextHelper_Base
+ {
+ protected:
+ OAccessibleTextHelper();
+
+ public:
+ // XInterface
+ DECLARE_XINTERFACE( )
+
+ // XTypeProvider
+ DECLARE_XTYPEPROVIDER( )
+
+ // XAccessibleText
+ virtual OUString SAL_CALL getSelectedText() override;
+ virtual sal_Int32 SAL_CALL getSelectionStart() override;
+ virtual sal_Int32 SAL_CALL getSelectionEnd() override;
+ virtual css::accessibility::TextSegment SAL_CALL getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
+ virtual css::accessibility::TextSegment SAL_CALL getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
+ virtual css::accessibility::TextSegment SAL_CALL getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) override;
+ };
+
+
+} // namespace comphelper
+
+
+// OAccessibleTextHelper is a helper class for implementing the
+// XAccessibleText interface.
+
+// The following methods have a default implementation:
+
+// getCharacter
+// getSelectedText
+// getSelectionStart
+// getSelectionEnd
+// getTextRange
+// getTextAtIndex
+// getTextBeforeIndex
+// getTextBehindIndex
+
+// The following methods must be overridden by derived classes:
+
+// implGetText
+// implGetLocale
+// implGetSelection
+// getCaretPosition
+// setCaretPosition
+// getCharacterAttributes
+// getCharacterBounds
+// getIndexAtPoint
+// setSelection
+// copyText
+
+#endif // INCLUDED_COMPHELPER_ACCESSIBLETEXTHELPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/comphelper/accessiblewrapper.hxx b/include/comphelper/accessiblewrapper.hxx
new file mode 100644
index 000000000..13fb29bff
--- /dev/null
+++ b/include/comphelper/accessiblewrapper.hxx
@@ -0,0 +1,401 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_COMPHELPER_ACCESSIBLEWRAPPER_HXX
+#define INCLUDED_COMPHELPER_ACCESSIBLEWRAPPER_HXX
+
+#include
+#include
+
+#include