21#include <com/sun/star/ucb/XCommandEnvironment.hpp>
22#include <com/sun/star/lang/IllegalArgumentException.hpp>
34using ::com::sun::star::uno::Reference;
43 std::u16string_view urlExtension,
44 Reference<ucb::XCommandEnvironment>
const & xCmdEnv,
45 Reference<uno::XComponentContext>
const &
xContext) :
48 m_propFileUrl = OUString::Concat(urlExtension) +
"properties";
50 std::vector< std::pair< OUString, OUString> >
props;
57 for (
auto const& prop :
props)
60 m_prop_suppress_license = prop.second;
66 std::u16string_view urlExtension,
68 Reference<ucb::XCommandEnvironment>
const & xCmdEnv,
69 Reference<uno::XComponentContext>
const &
xContext) :
72 m_propFileUrl = OUString::Concat(urlExtension) +
"properties";
86 throw lang::IllegalArgumentException(
87 "Extension Manager: unknown property",
nullptr, -1);
95 if (! (
v.Value >>=
value) )
97 throw lang::IllegalArgumentException(
98 "Extension Manager: wrong property value",
nullptr, -1);
113 Reference<css::io::XInputStream> xData(
114 ::xmlscript::createInputStream(
115 reinterpret_cast<sal_Int8 const *
>(stamp.getStr()),
116 stamp.getLength() ) );
bool isSuppressedLicense() const
const css::uno::Reference< css::uno::XComponentContext > m_xContext
::std::optional< OUString > m_prop_extension_update
const css::uno::Reference< css::ucb::XCommandEnvironment > m_xCmdEnv
::std::optional< OUString > m_prop_suppress_license
static OUString getPropertyValue(css::beans::NamedValue const &v)
ExtensionProperties(std::u16string_view urlExtension, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv, css::uno::Reference< css::uno::XComponentContext > const &xContext)
bool isExtensionUpdate() const
void writeStream(const css::uno::Reference< css::io::XInputStream > &rStream, bool bReplaceExisting)
uno::Reference< uno::XComponentContext > m_xContext
constexpr OUStringLiteral PROP_EXTENSION_UPDATE
constexpr OUStringLiteral PROP_SUPPRESS_LICENSE
static uno::Reference< css::uno::XComponentContext > xContext
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool readProperties(std::vector< std::pair< OUString, OUString > > &out_result, ::ucbhelper::Content &ucb_content)
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC bool create_ucb_content(::ucbhelper::Content *ucb_content, OUString const &url, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv, bool throw_exc=true)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
bool getPropertyValue(ValueType &rValue, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, OUString const &propName)