27#include <com/sun/star/registry/XSimpleRegistry.hpp>
28#include <com/sun/star/lang/XInitialization.hpp>
29#include <com/sun/star/lang/XMultiServiceFactory.hpp>
30#include <com/sun/star/uno/Exception.hpp>
31#include <com/sun/star/ucb/UniversalContentBroker.hpp>
33#include <officecfg/Setup.hxx>
34#include <osl/file.hxx>
35#include <rtl/bootstrap.hxx>
65 Reference<XMultiServiceFactory>
sm;
67 OUString aUnoRc(
"file:///assets/program/unorc" );
72 OUString uri(
"$APP_DATA_DIR" );
73 rtl_bootstrap_expandMacros( &uri.pData );
74 OUString aUnoRc(
"file://" + uri +
"/unorc");
100 officecfg::Setup::Office::ooSetupConnectionURL::get());
101 if (!conDcpCfg.isEmpty()) {
105 std::vector< OUString >
const & conDcp = rCmdLine.
GetAccept();
106 for (
auto const& elem : conDcp)
117typedef std::map< OUString, css::uno::Reference<css::lang::XInitialization> >
AcceptorMap;
126 OUString& CurrentTempURL()
128 static OUString SINGLETON;
139 AcceptorMap::const_iterator pIter = rMap.find(aAcceptString);
140 if (pIter != rMap.end() )
144 Reference< XComponentContext >
xContext = ::comphelper::getProcessComponentContext();
145 Reference<XInitialization> rAcceptor(
146 xContext->getServiceManager()->createInstanceWithContext(
"com.sun.star.office.Acceptor",
xContext),
148 if ( rAcceptor.is() )
152 rAcceptor->initialize(
aSeq );
153 rMap.emplace(aAcceptString, rAcceptor);
155 catch (
const css::uno::Exception&)
165 SAL_WARN(
"desktop.app",
"Acceptor already exists.");
177 void operator() (
const AcceptorMap::value_type& val) {
178 if (val.second.is()) {
179 val.second->initialize(
m_aSeq);
196 std::for_each(rMap.begin(), rMap.end(), enable());
204 if (aAcceptString ==
"all") {
209 AcceptorMap::const_iterator pIter = rMap.find(aAcceptString);
210 if (pIter != rMap.end() ) {
213 rMap.erase(aAcceptString);
215 SAL_WARN(
"desktop.app",
"Found no acceptor to remove");
224 acceptorMap().clear();
229 OUString aTempBaseURL;
239 OUString aMsg =
DpResId(STR_BOOTSTRAP_ERR_NO_PATHSET_SERVICE);
240 e.Message = aMsg + e.Message;
245 OUString aTempPath = ::utl::SetTempNameBaseDirectory( aTempBaseURL );
246 if ( aTempPath.isEmpty()
247 && ::osl::File::getTempDirURL( aTempBaseURL ) == osl::FileBase::E_None )
249 aTempPath = ::utl::SetTempNameBaseDirectory( aTempBaseURL );
254 if (osl::FileBase::getFileURLFromSystemPath( aTempPath, aRet )
255 != osl::FileBase::E_None)
259 CurrentTempURL() = aRet;
265 OUString &rCurrentTempURL = CurrentTempURL();
266 if ( !rCurrentTempURL.isEmpty() )
268 ::utl::UCBContentHelper::Kill( rCurrentTempURL );
static void EnableHeadlessMode(bool dialogsAreFatal)
const OUString & GetTempPath() const
std::vector< OUString > const & GetAccept() const
static void RemoveTemporaryDirectory()
static void DeregisterServices()
static void destroyAcceptor(const OUString &aDescription)
static void InitApplicationServiceManager()
static void createAcceptor(const OUString &aDescription)
bool m_bServicesRegistered
static CommandLineArgs & GetCommandLineArgs()
static void CreateTemporaryDirectory()
#define TOOLS_WARN_EXCEPTION(area, stream)
OUString DpResId(TranslateId aId)
static uno::Reference< css::uno::XComponentContext > xContext
Sequence< sal_Int8 > aSeq
#define SAL_WARN(area, stream)
void setProcessServiceFactory(const Reference< XMultiServiceFactory > &xSMgr)
Reference< XComponentContext > getProcessComponentContext()
CPPUHELPER_DLLPUBLIC css::uno::Reference< css::uno::XComponentContext > SAL_CALL defaultBootstrap_InitialComponentContext()
std::map< OUString, css::uno::Reference< css::lang::XInitialization > > AcceptorMap
IMPL_STATIC_LINK_NOARG(Desktop, AsyncInitFirstRun, Timer *, void)
static void configureUcb()
css::uno::Reference< css::deployment::XPackageRegistry > create(css::uno::Reference< css::deployment::XPackageRegistry > const &xRootRegistry, OUString const &context, OUString const &cachePath, css::uno::Reference< css::uno::XComponentContext > const &xComponentContext)