25#include <com/sun/star/configuration/XUpdate.hpp>
26#include <com/sun/star/lang/XServiceInfo.hpp>
27#include <com/sun/star/uno/Reference.hxx>
28#include <com/sun/star/uno/Sequence.hxx>
29#include <com/sun/star/uno/XInterface.hpp>
33#include <osl/mutex.hxx>
35#include <rtl/ustring.hxx>
48std::set< OUString > seqToSet(
49 css::uno::Sequence< OUString >
const & sequence)
51 return std::set< OUString >( sequence.begin(), sequence.end() );
55 public cppu::WeakImplHelper< css::configuration::XUpdate, css::lang::XServiceInfo >
58 explicit Service(
const css::uno::Reference< css::uno::XComponentContext >& context):
69 virtual ~Service()
override {}
71 virtual void SAL_CALL insertExtensionXcsFile(
72 sal_Bool shared, OUString
const & fileUri)
override;
74 virtual void SAL_CALL insertExtensionXcuFile(
75 sal_Bool shared, OUString
const & fileUri)
override;
77 virtual void SAL_CALL removeExtensionXcuFile(OUString
const & fileUri)
override;
79 virtual void SAL_CALL insertModificationXcuFile(
80 OUString
const & fileUri,
82 css::uno::Sequence< OUString >
const &
excludedPaths)
override;
85 return "com.sun.star.comp.configuration.Update";
93 return {
"com.sun.star.configuration.Update_Service"};
96 std::shared_ptr<osl::Mutex>
lock_;
97 css::uno::Reference< css::uno::XComponentContext >
context_;
100void Service::insertExtensionXcsFile(
101 sal_Bool shared, OUString
const & fileUri)
103 osl::MutexGuard g(*
lock_);
107void Service::insertExtensionXcuFile(
108 sal_Bool shared, OUString
const & fileUri)
112 osl::MutexGuard g(*
lock_);
115 components.insertExtensionXcuFile(shared, fileUri, &mods);
116 components.initGlobalBroadcaster(
122void Service::removeExtensionXcuFile(OUString
const & fileUri)
126 osl::MutexGuard g(*
lock_);
129 components.removeExtensionXcuFile(fileUri, &mods);
130 components.initGlobalBroadcaster(
136void Service::insertModificationXcuFile(
137 OUString
const & fileUri,
138 css::uno::Sequence< OUString >
const & includedPaths,
139 css::uno::Sequence< OUString >
const & excludedPaths)
143 osl::MutexGuard g(*
lock_);
146 components.insertModificationXcuFile(
147 fileUri, seqToSet(includedPaths), seqToSet(excludedPaths), &mods);
148 components.initGlobalBroadcaster(
157extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
159 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any>
const& )
161 return cppu::acquire(
new configmgr::update::Service(context));
void insertExtensionXcsFile(bool shared, OUString const &fileUri)
static Components & getSingleton(css::uno::Reference< css::uno::XComponentContext > const &context)
std::set< OUString > includedPaths
std::set< OUString > excludedPaths
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
std::shared_ptr< osl::Mutex > const & lock()
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
css::uno::Reference< css::uno::XComponentContext > context_
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_configuration_Update_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
std::shared_ptr< osl::Mutex > lock_
std::vector< uno::Reference< sheet::XSpreadsheetDocument > > Components