LibreOffice Module desktop (master) 1
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
dp_manager::ExtensionManager Class Reference

#include <dp_extensionmanager.hxx>

Inheritance diagram for dp_manager::ExtensionManager:
[legend]
Collaboration diagram for dp_manager::ExtensionManager:
[legend]

Public Member Functions

 ExtensionManager (css::uno::Reference< css::uno::XComponentContext >const &xContext)
 
virtual ~ExtensionManager () override
 
void check ()
 
void fireModified ()
 
virtual OUString SAL_CALL getImplementationName () override
 
virtual sal_Bool SAL_CALL supportsService (const OUString &ServiceName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 
virtual void SAL_CALL addModifyListener (css::uno::Reference< css::util::XModifyListener > const &xListener) override
 
virtual void SAL_CALL removeModifyListener (css::uno::Reference< css::util::XModifyListener > const &xListener) override
 
virtual css::uno::Sequence< css::uno::Reference< css::deployment::XPackageTypeInfo > > SAL_CALL getSupportedPackageTypes () override
 
virtual css::uno::Reference< css::task::XAbortChannel > SAL_CALL createAbortChannel () override
 
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 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 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 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 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
 
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
 
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< 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 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 reinstallDeployedExtensions (sal_Bool force, 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 synchronize (css::uno::Reference< css::task::XAbortChannel > const &xAbortChannel, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv) override
 
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
 
virtual sal_Bool SAL_CALL isReadOnlyRepository (OUString const &repository) override
 

Private Member Functions

css::uno::Reference< css::deployment::XPackageManager > getUserRepository ()
 
css::uno::Reference< css::deployment::XPackageManager > getSharedRepository ()
 
css::uno::Reference< css::deployment::XPackageManager > getBundledRepository ()
 
css::uno::Reference< css::deployment::XPackageManager > getTmpRepository ()
 
css::uno::Reference< css::deployment::XPackageManager > getBakRepository ()
 
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)
 
std::vector< css::uno::Reference< css::deployment::XPackage > > getExtensionsWithSameId (OUString const &identifier, OUString const &fileName)
 
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)
 
void checkInstall (OUString const &displayName, css::uno::Reference< css::ucb::XCommandEnvironment > const &cmdEnv)
 
void checkUpdate (OUString const &newVersion, OUString const &newDisplayName, css::uno::Reference< css::deployment::XPackage > const &oldExtension, css::uno::Reference< css::ucb::XCommandEnvironment > const &xCmdEnv)
 
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 > getPackageManager (std::u16string_view repository)
 
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)
 

Static Private Member Functions

static OUString StrSyncRepository ()
 
static bool isUserDisabled (css::uno::Sequence< css::uno::Reference< css::deployment::XPackage > > const &seqExtSameId)
 
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)
 

Private Attributes

css::uno::Reference< css::uno::XComponentContext > m_xContext
 
css::uno::Reference< css::deployment::XPackageManagerFactory > m_xPackageManagerFactory
 
std::mutex m_addMutex
 
std::vector< OUString > m_repositoryNames
 
- Private Attributes inherited from cppu::BaseMutex
mutable::osl::Mutex m_aMutex
 

Detailed Description

Definition at line 41 of file dp_extensionmanager.hxx.

Constructor & Destructor Documentation

◆ ExtensionManager()

dp_manager::ExtensionManager::ExtensionManager ( css::uno::Reference< css::uno::XComponentContext >const &  xContext)
explicit

◆ ~ExtensionManager()

dp_manager::ExtensionManager::~ExtensionManager ( )
overridevirtual

Definition at line 172 of file dp_extensionmanager.cxx.

Member Function Documentation

◆ activateExtension() [1/2]

static void dp_manager::ExtensionManager::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 
)
staticprivate

◆ activateExtension() [2/2]

void dp_manager::ExtensionManager::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 
)
private

◆ addExtension()

Reference< css::deployment::XPackage > dp_manager::ExtensionManager::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 
)
overridevirtual

◆ addExtensionsToMap()

void dp_manager::ExtensionManager::addExtensionsToMap ( id2extensions mapExt,
css::uno::Sequence< css::uno::Reference< css::deployment::XPackage > > const &  seqExt,
std::u16string_view  repository 
)
private

Definition at line 247 of file dp_extensionmanager.cxx.

References dp_misc::getIdentifier(), index, and m_repositoryNames.

Referenced by getAllExtensions().

◆ addModifyListener()

void dp_manager::ExtensionManager::addModifyListener ( css::uno::Reference< css::util::XModifyListener > const &  xListener)
overridevirtual

Definition at line 1386 of file dp_extensionmanager.cxx.

References check().

◆ backupExtension()

Reference< css::deployment::XPackage > dp_manager::ExtensionManager::backupExtension ( OUString const &  identifier,
OUString const &  fileName,
css::uno::Reference< css::deployment::XPackageManager > const &  xPackageManager,
css::uno::Reference< css::ucb::XCommandEnvironment > const &  xCmdEnv 
)
private

Definition at line 479 of file dp_extensionmanager.cxx.

References getTmpRepository(), and identifier.

Referenced by removeExtension().

◆ check()

void dp_manager::ExtensionManager::check ( )

Definition at line 1401 of file dp_extensionmanager.cxx.

References cppu::BaseMutex::m_aMutex.

Referenced by addModifyListener(), and removeModifyListener().

◆ checkInstall()

void dp_manager::ExtensionManager::checkInstall ( OUString const &  displayName,
css::uno::Reference< css::ucb::XCommandEnvironment > const &  cmdEnv 
)
private

Definition at line 1308 of file dp_extensionmanager.cxx.

References DpResId(), and dp_misc::interactContinuation().

Referenced by doChecksForAddExtension().

◆ checkPrerequisitesAndEnable()

sal_Int32 dp_manager::ExtensionManager::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 
)
overridevirtual

◆ checkUpdate()

void dp_manager::ExtensionManager::checkUpdate ( OUString const &  newVersion,
OUString const &  newDisplayName,
css::uno::Reference< css::deployment::XPackage > const &  oldExtension,
css::uno::Reference< css::ucb::XCommandEnvironment > const &  xCmdEnv 
)
private

Definition at line 1337 of file dp_extensionmanager.cxx.

References DpResId(), and dp_misc::interactContinuation().

Referenced by doChecksForAddExtension().

◆ createAbortChannel()

Reference< task::XAbortChannel > dp_manager::ExtensionManager::createAbortChannel ( )
overridevirtual

Definition at line 214 of file dp_extensionmanager.cxx.

◆ disableExtension()

void dp_manager::ExtensionManager::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 
)
overridevirtual

◆ doChecksForAddExtension()

bool dp_manager::ExtensionManager::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 
)
private
Exceptions
css::deployment::DeploymentException
css::ucb::CommandFailedException
css::ucb::CommandAbortedException
css::lang::IllegalArgumentException
css::uno::RuntimeException

Definition at line 519 of file dp_extensionmanager.cxx.

References checkInstall(), checkUpdate(), dp_misc::getDescriptionInfoset(), dp_misc::getIdentifier(), dp_misc::DescriptionInfoset::getSimpleLicenseAttributes(), m_xContext, props, and sDisplayName.

Referenced by addExtension().

◆ enableExtension()

void dp_manager::ExtensionManager::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 
)
overridevirtual

◆ fireModified()

void dp_manager::ExtensionManager::fireModified ( )

◆ getAllExtensions()

uno::Sequence< uno::Sequence< Reference< css::deployment::XPackage > > > dp_manager::ExtensionManager::getAllExtensions ( css::uno::Reference< css::task::XAbortChannel > const &  ,
css::uno::Reference< css::ucb::XCommandEnvironment > const &  xCmdEnv 
)
overridevirtual

◆ getBakRepository()

Reference< css::deployment::XPackageManager > dp_manager::ExtensionManager::getBakRepository ( )
private

Definition at line 209 of file dp_extensionmanager.cxx.

References m_xPackageManagerFactory.

Referenced by addExtension(), and getPackageManager().

◆ getBundledRepository()

Reference< css::deployment::XPackageManager > dp_manager::ExtensionManager::getBundledRepository ( )
private

◆ getDeployedExtension()

Reference< css::deployment::XPackage > dp_manager::ExtensionManager::getDeployedExtension ( OUString const &  repository,
OUString const &  identifier,
OUString const &  filename,
css::uno::Reference< css::ucb::XCommandEnvironment > const &  xCmdEnv 
)
overridevirtual

Definition at line 1086 of file dp_extensionmanager.cxx.

References getPackageManager(), and identifier.

◆ getDeployedExtensions()

uno::Sequence< Reference< css::deployment::XPackage > > dp_manager::ExtensionManager::getDeployedExtensions ( OUString const &  repository,
css::uno::Reference< css::task::XAbortChannel > const &  ,
css::uno::Reference< css::ucb::XCommandEnvironment > const &  xCmdEnv 
)
overridevirtual

Definition at line 1076 of file dp_extensionmanager.cxx.

References getPackageManager().

◆ getExtensionsWithSameId()

std::vector< Reference< css::deployment::XPackage > > dp_manager::ExtensionManager::getExtensionsWithSameId ( OUString const &  identifier,
OUString const &  fileName 
)
private

◆ getExtensionsWithSameIdentifier()

uno::Sequence< Reference< css::deployment::XPackage > > dp_manager::ExtensionManager::getExtensionsWithSameIdentifier ( OUString const &  identifier,
OUString const &  filename,
css::uno::Reference< css::ucb::XCommandEnvironment > const &  xCmdEnv 
)
overridevirtual

◆ getExtensionsWithUnacceptedLicenses()

uno::Sequence< Reference< css::deployment::XPackage > > SAL_CALL dp_manager::ExtensionManager::getExtensionsWithUnacceptedLicenses ( OUString const &  repository,
css::uno::Reference< css::ucb::XCommandEnvironment > const &  xCmdEnv 
)
overridevirtual

Definition at line 1368 of file dp_extensionmanager.cxx.

References getPackageManager(), and cppu::BaseMutex::m_aMutex.

◆ getImplementationName()

OUString dp_manager::ExtensionManager::getImplementationName ( )
overridevirtual

Definition at line 177 of file dp_extensionmanager.cxx.

◆ getPackageManager()

css::uno::Reference< css::deployment::XPackageManager > dp_manager::ExtensionManager::getPackageManager ( std::u16string_view  repository)
private

◆ getSharedRepository()

Reference< css::deployment::XPackageManager > dp_manager::ExtensionManager::getSharedRepository ( )
private

◆ getSupportedPackageTypes()

uno::Sequence< Reference< css::deployment::XPackageTypeInfo > > dp_manager::ExtensionManager::getSupportedPackageTypes ( )
overridevirtual

Definition at line 510 of file dp_extensionmanager.cxx.

References getUserRepository().

◆ getSupportedServiceNames()

css::uno::Sequence< OUString > dp_manager::ExtensionManager::getSupportedServiceNames ( )
overridevirtual

Definition at line 187 of file dp_extensionmanager.cxx.

◆ getTmpRepository()

Reference< css::deployment::XPackageManager > dp_manager::ExtensionManager::getTmpRepository ( )
private

◆ getUserRepository()

Reference< css::deployment::XPackageManager > dp_manager::ExtensionManager::getUserRepository ( )
private

◆ isReadOnlyRepository()

sal_Bool dp_manager::ExtensionManager::isReadOnlyRepository ( OUString const &  repository)
overridevirtual

Definition at line 1378 of file dp_extensionmanager.cxx.

References getPackageManager().

◆ isUserDisabled() [1/2]

static bool dp_manager::ExtensionManager::isUserDisabled ( css::uno::Sequence< css::uno::Reference< css::deployment::XPackage > > const &  seqExtSameId)
staticprivate

◆ isUserDisabled() [2/2]

bool dp_manager::ExtensionManager::isUserDisabled ( OUString const &  identifier,
OUString const &  filename 
)
private

◆ reinstallDeployedExtensions()

void dp_manager::ExtensionManager::reinstallDeployedExtensions ( sal_Bool  force,
OUString const &  repository,
css::uno::Reference< css::task::XAbortChannel > const &  xAbortChannel,
css::uno::Reference< css::ucb::XCommandEnvironment > const &  xCmdEnv 
)
overridevirtual

◆ removeExtension()

void dp_manager::ExtensionManager::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 
)
overridevirtual

◆ removeModifyListener()

void dp_manager::ExtensionManager::removeModifyListener ( css::uno::Reference< css::util::XModifyListener > const &  xListener)
overridevirtual

Definition at line 1394 of file dp_extensionmanager.cxx.

References check().

◆ StrSyncRepository()

static OUString dp_manager::ExtensionManager::StrSyncRepository ( )
inlinestaticprivate

Definition at line 143 of file dp_extensionmanager.hxx.

References DpResId().

Referenced by synchronize().

◆ supportsService()

sal_Bool dp_manager::ExtensionManager::supportsService ( const OUString &  ServiceName)
overridevirtual

Definition at line 182 of file dp_extensionmanager.cxx.

References ServiceName, and cppu::supportsService().

◆ synchronize()

sal_Bool dp_manager::ExtensionManager::synchronize ( css::uno::Reference< css::task::XAbortChannel > const &  xAbortChannel,
css::uno::Reference< css::ucb::XCommandEnvironment > const &  xCmdEnv 
)
overridevirtual

Member Data Documentation

◆ m_addMutex

std::mutex dp_manager::ExtensionManager::m_addMutex
private

Definition at line 149 of file dp_extensionmanager.hxx.

Referenced by addExtension().

◆ m_repositoryNames

std::vector< OUString > dp_manager::ExtensionManager::m_repositoryNames
private

Definition at line 154 of file dp_extensionmanager.hxx.

Referenced by addExtensionsToMap(), and ExtensionManager().

◆ m_xContext

css::uno::Reference< css::uno::XComponentContext> dp_manager::ExtensionManager::m_xContext
private

Definition at line 145 of file dp_extensionmanager.hxx.

Referenced by doChecksForAddExtension(), ExtensionManager(), and synchronize().

◆ m_xPackageManagerFactory

css::uno::Reference<css::deployment::XPackageManagerFactory> dp_manager::ExtensionManager::m_xPackageManagerFactory
private

The documentation for this class was generated from the following files: