21#include <com/sun/star/lang/XComponent.hpp>
22#include <com/sun/star/container/XIndexAccess.hpp>
23#include <com/sun/star/container/XNameAccess.hpp>
30 :m_aNames(_xAccess->getElementNames())
40 std::vector<OUString> _aNames )
41 :m_aNames(
std::move(_aNames))
42 ,m_xAccess(
std::move(_xAccess))
89 throw css::container::NoSuchElementException();
109 css::uno::Reference< css::lang::XComponent > xDisposable(
m_xAccess, css::uno::UNO_QUERY);
110 if (xDisposable.is())
112 xDisposable->addEventListener(
this);
125 css::uno::Reference< css::lang::XComponent > xDisposable(
m_xAccess, css::uno::UNO_QUERY);
126 if (xDisposable.is())
128 xDisposable->removeEventListener(
this);
139 return std::get<std::vector<OUString>>(
m_aNames).
size();
145 return std::get<css::uno::Sequence<OUString>>(
m_aNames).getConstArray()[
nIndex];
152 :m_xAccess(
std::move(_xAccess))
162 std::lock_guard aLock(
m_aLock);
170 std::lock_guard aLock(
m_aLock);
187 std::lock_guard aLock(
m_aLock);
190 if (
m_xAccess.is() && m_nPos < m_xAccess->getCount())
199 if (!aRes.hasValue())
200 throw css::container::NoSuchElementException();
207 std::lock_guard aLock(
m_aLock);
220 css::uno::Reference< css::lang::XComponent > xDisposable(
m_xAccess, css::uno::UNO_QUERY);
221 if (xDisposable.is())
223 xDisposable->addEventListener(
this);
236 css::uno::Reference< css::lang::XComponent > xDisposable(
m_xAccess, css::uno::UNO_QUERY);
237 if (xDisposable.is())
239 xDisposable->removeEventListener(
this);
259 std::lock_guard aLock(
m_aLock);
268 throw css::container::NoSuchElementException();
270 std::lock_guard aLock(
m_aLock);
OAnyEnumeration(const css::uno::Sequence< css::uno::Any > &lItems)
virtual ~OAnyEnumeration() override
virtual css::uno::Any SAL_CALL nextElement() override
virtual sal_Bool SAL_CALL hasMoreElements() override
css::uno::Sequence< css::uno::Any > m_lItems
virtual ~OEnumerationByIndex() override
css::uno::Reference< css::container::XIndexAccess > m_xAccess
virtual void SAL_CALL disposing(const css::lang::EventObject &aEvent) override
COMPHELPER_DLLPRIVATE void impl_startDisposeListening()
virtual sal_Bool SAL_CALL hasMoreElements() override
OEnumerationByIndex(css::uno::Reference< css::container::XIndexAccess > _xAccess)
virtual css::uno::Any SAL_CALL nextElement() override
COMPHELPER_DLLPRIVATE void impl_stopDisposeListening()
COMPHELPER_DLLPRIVATE void impl_stopDisposeListening()
virtual void SAL_CALL disposing(const css::lang::EventObject &aEvent) override
virtual ~OEnumerationByName() override
virtual sal_Bool SAL_CALL hasMoreElements() override
sal_Int32 getLength() const
std::variant< css::uno::Sequence< OUString >, std::vector< OUString > > m_aNames
virtual css::uno::Any SAL_CALL nextElement() override
css::uno::Reference< css::container::XNameAccess > m_xAccess
COMPHELPER_DLLPRIVATE void impl_startDisposeListening()
OEnumerationByName(css::uno::Reference< css::container::XNameAccess > _xAccess)
const OUString & getElement(sal_Int32 nIndex) const