26#include <com/sun/star/deployment/XExtensionManager.hpp>
27#include <com/sun/star/deployment/XPackageManager.hpp>
28#include <com/sun/star/deployment/XPackageManagerFactory.hpp>
29#include <com/sun/star/lang/XServiceInfo.hpp>
30#include <com/sun/star/uno/XComponentContext.hpp>
33#include <unordered_map>
37typedef std::unordered_map<
39 std::vector<css::uno::Reference<css::deployment::XPackage> > >
id2extensions;
42 public ::cppu::WeakComponentImplHelper< css::deployment::XExtensionManager, css::lang::XServiceInfo >
60 css::uno::Reference<css::util::XModifyListener>
const & xListener )
override;
62 css::uno::Reference<css::util::XModifyListener>
const & xListener )
override;
65 virtual css::uno::Sequence<
66 css::uno::Reference<css::deployment::XPackageTypeInfo> > SAL_CALL
69 virtual css::uno::Reference<css::task::XAbortChannel> SAL_CALL
72 virtual css::uno::Reference<css::deployment::XPackage> SAL_CALL
addExtension(
74 css::uno::Sequence<css::beans::NamedValue>
const &
properties,
75 OUString
const & repository,
76 css::uno::Reference<css::task::XAbortChannel>
const & xAbortChannel,
77 css::uno::Reference<css::ucb::XCommandEnvironment>
const & xCmdEnv )
override;
81 OUString
const & filename,
82 OUString
const & repository,
83 css::uno::Reference<css::task::XAbortChannel>
const & xAbortChannel,
84 css::uno::Reference<css::ucb::XCommandEnvironment>
const & xCmdEnv )
override;
87 css::uno::Reference<css::deployment::XPackage>
const & extension,
88 css::uno::Reference<css::task::XAbortChannel>
const & xAbortChannel,
89 css::uno::Reference<css::ucb::XCommandEnvironment>
const & xCmdEnv )
override;
92 css::uno::Reference<css::deployment::XPackage>
const & extension,
93 css::uno::Reference<css::task::XAbortChannel>
const & xAbortChannel,
94 css::uno::Reference<css::ucb::XCommandEnvironment>
const & xCmdEnv )
override;
97 css::uno::Reference<css::deployment::XPackage>
const & extension,
98 css::uno::Reference<css::task::XAbortChannel>
const & xAbortChannel,
99 css::uno::Reference<css::ucb::XCommandEnvironment>
const & xCmdEnv )
override;
101 virtual css::uno::Sequence< css::uno::Reference<css::deployment::XPackage> >
103 OUString
const & repository,
104 css::uno::Reference<css::task::XAbortChannel>
const &,
105 css::uno::Reference<css::ucb::XCommandEnvironment>
const & xCmdEnv )
override;
107 virtual css::uno::Reference< css::deployment::XPackage>
109 OUString
const & repository,
111 OUString
const & filename,
112 css::uno::Reference< css::ucb::XCommandEnvironment>
const & xCmdEnv )
override;
114 virtual css::uno::Sequence<css::uno::Reference<css::deployment::XPackage> >
117 OUString
const & filename,
118 css::uno::Reference< css::ucb::XCommandEnvironment>
const & xCmdEnv )
override;
120 virtual css::uno::Sequence< css::uno::Sequence<css::uno::Reference<css::deployment::XPackage> > >
122 css::uno::Reference<css::task::XAbortChannel>
const &,
123 css::uno::Reference<css::ucb::XCommandEnvironment>
const & xCmdEnv )
override;
126 sal_Bool force, OUString
const & repository,
127 css::uno::Reference< css::task::XAbortChannel>
const & xAbortChannel,
128 css::uno::Reference< css::ucb::XCommandEnvironment>
const & xCmdEnv )
override;
131 css::uno::Reference<css::task::XAbortChannel>
const & xAbortChannel,
132 css::uno::Reference<css::ucb::XCommandEnvironment>
const & xCmdEnv )
override;
134 virtual css::uno::Sequence<css::uno::Reference<css::deployment::XPackage> > SAL_CALL
136 OUString
const & repository,
137 css::uno::Reference<css::ucb::XCommandEnvironment>
const & xCmdEnv)
override;
145 css::uno::Reference< css::uno::XComponentContext>
m_xContext;
163 OUString
const & filename);
166 css::uno::Sequence<css::uno::Reference<css::deployment::XPackage> >
const & seqExtSameId);
169 OUString
const & identifier,
170 OUString
const & fileName,
171 bool bUserDisabled,
bool bStartup,
172 css::uno::Reference<css::task::XAbortChannel>
const & xAbortChannel,
173 css::uno::Reference<css::ucb::XCommandEnvironment>
const & xCmdEnv);
176 css::uno::Sequence<css::uno::Reference<css::deployment::XPackage> >
const & seqExt,
177 bool bUserDisabled,
bool bStartup,
178 css::uno::Reference<css::task::XAbortChannel>
const & xAbortChannel,
179 css::uno::Reference<css::ucb::XCommandEnvironment>
const & xCmdEnv );
181 std::vector<css::uno::Reference<css::deployment::XPackage> >
183 OUString
const & fileName);
186 OUString
const & identifier, OUString
const & fileName,
187 css::uno::Reference<css::deployment::XPackageManager>
const & xPackageManager,
188 css::uno::Reference<css::ucb::XCommandEnvironment>
const & xCmdEnv);
191 OUString
const & displayName,
192 css::uno::Reference<css::ucb::XCommandEnvironment>
const & cmdEnv);
195 OUString
const & newVersion,
196 OUString
const & newDisplayName,
197 css::uno::Reference<css::deployment::XPackage>
const & oldExtension,
198 css::uno::Reference<css::ucb::XCommandEnvironment>
const & xCmdEnv);
202 css::uno::Sequence<css::uno::Reference<css::deployment::XPackage> >
const & seqExt,
203 std::u16string_view repository);
207 css::uno::Reference<css::deployment::XPackageManager>
216 css::uno::Reference<css::deployment::XPackageManager>
const & xPackageMgr,
217 css::uno::Sequence<css::beans::NamedValue>
const &
properties,
218 css::uno::Reference<css::deployment::XPackage>
const & xTmpExtension,
219 css::uno::Reference<css::task::XAbortChannel>
const & xAbortChannel,
220 css::uno::Reference<css::ucb::XCommandEnvironment>
const & xCmdEnv,
221 css::uno::Reference<css::deployment::XPackage> & out_existingExtension );
virtual css::uno::Sequence< css::uno::Sequence< css::uno::Reference< css::deployment::XPackage > > > SAL_CALL getAllExtensions(css::uno::Reference< css::task::XAbortChannel > const &, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv) override
virtual void SAL_CALL removeExtension(OUString const &identifier, OUString const &filename, OUString const &repository, css::uno::Reference< css::task::XAbortChannel > const &xAbortChannel, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv) override
virtual css::uno::Reference< css::task::XAbortChannel > SAL_CALL createAbortChannel() override
virtual css::uno::Sequence< css::uno::Reference< css::deployment::XPackage > > SAL_CALL getExtensionsWithSameIdentifier(OUString const &identifier, OUString const &filename, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv) override
virtual sal_Bool SAL_CALL synchronize(css::uno::Reference< css::task::XAbortChannel > const &xAbortChannel, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv) override
virtual css::uno::Reference< css::deployment::XPackage > SAL_CALL getDeployedExtension(OUString const &repository, OUString const &identifier, OUString const &filename, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
css::uno::Reference< css::uno::XComponentContext > m_xContext
css::uno::Reference< css::deployment::XPackageManager > getTmpRepository()
virtual sal_Bool SAL_CALL isReadOnlyRepository(OUString const &repository) override
css::uno::Reference< css::deployment::XPackageManagerFactory > m_xPackageManagerFactory
css::uno::Reference< css::deployment::XPackageManager > getSharedRepository()
void checkUpdate(OUString const &newVersion, OUString const &newDisplayName, css::uno::Reference< css::deployment::XPackage > const &oldExtension, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv)
virtual void SAL_CALL disableExtension(css::uno::Reference< css::deployment::XPackage > const &extension, css::uno::Reference< css::task::XAbortChannel > const &xAbortChannel, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv) override
virtual OUString SAL_CALL getImplementationName() override
css::uno::Reference< css::deployment::XPackageManager > getBundledRepository()
void addExtensionsToMap(id2extensions &mapExt, css::uno::Sequence< css::uno::Reference< css::deployment::XPackage > > const &seqExt, std::u16string_view repository)
css::uno::Reference< css::deployment::XPackageManager > getUserRepository()
static void activateExtension(css::uno::Sequence< css::uno::Reference< css::deployment::XPackage > > const &seqExt, bool bUserDisabled, bool bStartup, css::uno::Reference< css::task::XAbortChannel > const &xAbortChannel, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv)
static bool isUserDisabled(css::uno::Sequence< css::uno::Reference< css::deployment::XPackage > > const &seqExtSameId)
bool doChecksForAddExtension(css::uno::Reference< css::deployment::XPackageManager > const &xPackageMgr, css::uno::Sequence< css::beans::NamedValue > const &properties, css::uno::Reference< css::deployment::XPackage > const &xTmpExtension, css::uno::Reference< css::task::XAbortChannel > const &xAbortChannel, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv, css::uno::Reference< css::deployment::XPackage > &out_existingExtension)
virtual css::uno::Sequence< css::uno::Reference< css::deployment::XPackage > > SAL_CALL getExtensionsWithUnacceptedLicenses(OUString const &repository, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv) override
css::uno::Reference< css::deployment::XPackageManager > getBakRepository()
css::uno::Reference< css::deployment::XPackage > backupExtension(OUString const &identifier, OUString const &fileName, css::uno::Reference< css::deployment::XPackageManager > const &xPackageManager, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv)
std::vector< css::uno::Reference< css::deployment::XPackage > > getExtensionsWithSameId(OUString const &identifier, OUString const &fileName)
bool isUserDisabled(OUString const &identifier, OUString const &filename)
void activateExtension(OUString const &identifier, OUString const &fileName, bool bUserDisabled, bool bStartup, css::uno::Reference< css::task::XAbortChannel > const &xAbortChannel, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv)
virtual void SAL_CALL addModifyListener(css::uno::Reference< css::util::XModifyListener > const &xListener) override
css::uno::Reference< css::deployment::XPackageManager > getPackageManager(std::u16string_view repository)
virtual void SAL_CALL enableExtension(css::uno::Reference< css::deployment::XPackage > const &extension, css::uno::Reference< css::task::XAbortChannel > const &xAbortChannel, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv) override
virtual ~ExtensionManager() override
virtual css::uno::Sequence< css::uno::Reference< css::deployment::XPackageTypeInfo > > SAL_CALL getSupportedPackageTypes() override
virtual void SAL_CALL removeModifyListener(css::uno::Reference< css::util::XModifyListener > const &xListener) override
virtual css::uno::Sequence< css::uno::Reference< css::deployment::XPackage > > SAL_CALL getDeployedExtensions(OUString const &repository, css::uno::Reference< css::task::XAbortChannel > const &, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv) override
ExtensionManager(css::uno::Reference< css::uno::XComponentContext >const &xContext)
std::vector< OUString > m_repositoryNames
virtual sal_Int32 SAL_CALL checkPrerequisitesAndEnable(css::uno::Reference< css::deployment::XPackage > const &extension, css::uno::Reference< css::task::XAbortChannel > const &xAbortChannel, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv) override
void checkInstall(OUString const &displayName, css::uno::Reference< css::ucb::XCommandEnvironment > const &cmdEnv)
virtual css::uno::Reference< css::deployment::XPackage > SAL_CALL addExtension(OUString const &url, css::uno::Sequence< css::beans::NamedValue > const &properties, OUString const &repository, css::uno::Reference< css::task::XAbortChannel > const &xAbortChannel, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv) override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
static OUString StrSyncRepository()
virtual void SAL_CALL reinstallDeployedExtensions(sal_Bool force, OUString const &repository, css::uno::Reference< css::task::XAbortChannel > const &xAbortChannel, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv) override
OUString DpResId(TranslateId aId)
static uno::Reference< css::uno::XComponentContext > xContext
std::unordered_map< OUString, std::vector< css::uno::Reference< css::deployment::XPackage > > > id2extensions
::boost::spirit::classic::rule< ScannerT > identifier