20#include <com/sun/star/beans/XPropertySetInfo.hpp>
21#include <com/sun/star/ucb/UnsupportedCommandException.hpp>
22#include <com/sun/star/ucb/XPersistentPropertySet.hpp>
23#include <com/sun/star/ucb/XCommandInfo.hpp>
38 uno::Reference< css::ucb::XCommandEnvironment > xEnv,
39 ContentImplHelper* pContent )
40: m_xEnv(
std::move( xEnv )),
41 m_pContent( pContent )
47PropertySetInfo::~PropertySetInfo()
56uno::Sequence< beans::Property > SAL_CALL PropertySetInfo::getProperties()
59 return getPropertiesImpl();
62const uno::Sequence< beans::Property > & PropertySetInfo::getPropertiesImpl()
71 m_xProps = m_pContent->getProperties( m_xEnv );
73 catch ( uno::RuntimeException
const & )
77 catch ( uno::Exception
const & )
84 uno::Reference< css::ucb::XPersistentPropertySet >
85 xSet ( m_pContent->getAdditionalPropertySet(
false ) );
90 uno::Reference< beans::XPropertySetInfo > xInfo(
91 xSet->getPropertySetInfo() );
94 const uno::Sequence< beans::Property >& rAddProps
95 = xInfo->getProperties();
96 sal_Int32 nAddProps = rAddProps.getLength();
102 std::copy(rAddProps.begin(), rAddProps.end(),
112beans::Property SAL_CALL PropertySetInfo::getPropertyByName(
113 const OUString& aName )
115 beans::Property aProp;
116 if ( queryProperty(
aName, aProp ) )
119 throw beans::UnknownPropertyException(
aName);
124sal_Bool SAL_CALL PropertySetInfo::hasPropertyByName(
125 const OUString& Name )
127 beans::Property aProp;
128 return queryProperty(
Name, aProp );
135void PropertySetInfo::reset()
137 std::unique_lock aGuard(
m_aMutex );
142bool PropertySetInfo::queryProperty(
143 std::u16string_view rName, beans::Property& rProp )
145 std::unique_lock aGuard(
m_aMutex );
149 const beans::Property* pProps =
m_xProps->getConstArray();
153 const beans::Property& rCurrProp = pProps[
n ];
154 if ( rCurrProp.Name == rName )
168CommandProcessorInfo::CommandProcessorInfo(
169 uno::Reference< css::ucb::XCommandEnvironment > xEnv,
171: m_xEnv(
std::move( xEnv )),
172 m_pContent( pContent )
189 std::unique_lock aGuard(
m_aMutex );
204 catch ( uno::RuntimeException
const & )
208 catch ( uno::Exception
const & )
217css::ucb::CommandInfo SAL_CALL
219 const OUString& Name )
221 css::ucb::CommandInfo aInfo;
225 throw css::ucb::UnsupportedCommandException();
230css::ucb::CommandInfo SAL_CALL
233 css::ucb::CommandInfo aInfo;
237 throw css::ucb::UnsupportedCommandException();
243 const OUString& Name )
245 css::ucb::CommandInfo aInfo;
253 css::ucb::CommandInfo aInfo;
263 std::unique_lock aGuard(
m_aMutex );
269 std::u16string_view rName,
270 css::ucb::CommandInfo& rCommand )
272 std::unique_lock aGuard(
m_aMutex );
276 const css::ucb::CommandInfo* pCommands
281 const css::ucb::CommandInfo& rCurrCommand = pCommands[
n ];
282 if ( rCurrCommand.Name == rName )
284 rCommand = rCurrCommand;
295 css::ucb::CommandInfo& rCommand )
297 std::unique_lock aGuard(
m_aMutex );
301 const css::ucb::CommandInfo* pCommands =
m_xCommands->getConstArray();
305 const css::ucb::CommandInfo& rCurrCommand = pCommands[
n ];
306 if ( rCurrCommand.Handle ==
nHandle )
308 rCommand = rCurrCommand;
std::optional< css::uno::Sequence< css::ucb::CommandInfo > > m_xCommands
virtual css::ucb::CommandInfo SAL_CALL getCommandInfoByName(const OUString &Name) override
virtual ~CommandProcessorInfo() override
virtual sal_Bool SAL_CALL hasCommandByHandle(sal_Int32 Handle) override
virtual css::ucb::CommandInfo SAL_CALL getCommandInfoByHandle(sal_Int32 Handle) override
virtual css::uno::Sequence< css::ucb::CommandInfo > SAL_CALL getCommands() override
bool queryCommand(std::u16string_view rName, css::ucb::CommandInfo &rCommand)
virtual sal_Bool SAL_CALL hasCommandByName(const OUString &Name) override
css::uno::Reference< css::ucb::XCommandEnvironment > m_xEnv
ContentImplHelper * m_pContent
const css::uno::Sequence< css::ucb::CommandInfo > & getCommandsImpl()
This is an abstract base class for implementations of the service com.sun.star.ucb....
virtual UCBHELPER_DLLPRIVATE css::uno::Sequence< css::ucb::CommandInfo > getCommands(const css::uno::Reference< css::ucb::XCommandEnvironment > &xEnv)=0
Your implementation of this method must return a sequence containing the meta data of the commands su...
PropertySetInfo(css::uno::Reference< css::ucb::XCommandEnvironment > xEnv, ContentImplHelper *pContent)