23#include <osl/diagnose.h>
33#include <com/sun/star/task/XJobExecutor.hpp>
34#include <com/sun/star/ui/dialogs/XAsynchronousExecutableDialog.hpp>
55 MyApp(
const MyApp&) =
delete;
56 const MyApp& operator=(
const MyApp&) =
delete;
59 virtual int Main()
override;
60 virtual void DeInit()
override;
77 css::uno::Reference< css::uno::XComponentContext > context(
80 css::uno::Reference< css::lang::XComponent >(
81 context, css::uno::UNO_QUERY_THROW)->dispose();
87 if (rStr.indexOf(
"%PRODUCT" ) == -1)
97 OUString sRet = rStr.replaceAll(
"%PRODUCTNAME", sProductName );
98 sRet = sRet.replaceAll(
"%PRODUCTVERSION", sVersion );
99 sRet = sRet.replaceAll(
"%ABOUTBOXPRODUCTVERSIONSUFFIX", sAboutBoxVersionSuffix );
100 sRet = sRet.replaceAll(
"%ABOUTBOXPRODUCTVERSION", sAboutBoxVersion );
101 sRet = sRet.replaceAll(
"%OOOVENDOR", sOOOVendor );
102 sRet = sRet.replaceAll(
"%PRODUCTEXTENSION", sExtension );
109 :
public ::cppu::WeakImplHelper<ui::dialogs::XAsynchronousExecutableDialog,
110 task::XJobExecutor, css::lang::XServiceInfo>
119 ServiceImpl( Sequence<Any>
const & args,
120 Reference<XComponentContext>
const & xComponentContext );
128 virtual void SAL_CALL setDialogTitle( OUString
const & aTitle )
override;
129 virtual void SAL_CALL startExecuteModal(
130 Reference< ui::dialogs::XDialogClosedListener >
const & xListener )
override;
133 virtual void SAL_CALL trigger( OUString
const & event )
override;
138ServiceImpl::ServiceImpl( Sequence<Any>
const& args,
139 Reference<XComponentContext>
const& xComponentContext)
144 std::optional<OUString> view;
146 std::optional<sal_Bool>
unopkg;
149 }
catch (
const css::lang::IllegalArgumentException & ) {
153 }
catch (
const css::lang::IllegalArgumentException & ) {
162OUString ServiceImpl::getImplementationName()
164 return "com.sun.star.comp.deployment.ui.PackageManagerDialog";
167sal_Bool ServiceImpl::supportsService(
const OUString& ServiceName )
172css::uno::Sequence< OUString > ServiceImpl::getSupportedServiceNames()
174 return {
"com.sun.star.deployment.ui.PackageManagerDialog" };
179void ServiceImpl::setDialogTitle( OUString
const & title )
188 dialog->SetText( title );
195void ServiceImpl::startExecuteModal(
196 Reference< ui::dialogs::XDialogClosedListener >
const & xListener )
198 bool bCloseDialog =
true;
199 std::unique_ptr<Application> app;
203 const bool bAppUp = (
GetpApp() !=
nullptr);
204 bool bOfficePipePresent;
208 catch (
const Exception & exc) {
213 VclMessageType::Warning, VclButtonsType::Ok, exc.Message));
219 if (! bOfficePipePresent) {
220 OSL_ASSERT( ! bAppUp );
221 app.reset(
new MyApp );
224 static_cast<OWeakObject *
>(
this) );
248 myExtMgr->createDialog(
false );
255 myExtMgr->checkUpdates();
275 xListener->dialogClosed(
276 ui::dialogs::DialogClosedEvent(
283void ServiceImpl::trigger( OUString
const &rEvent )
285 if ( rEvent ==
"SHOW_UPDATE_DIALOG" )
290 startExecuteModal( Reference< ui::dialogs::XDialogClosedListener >() );
295extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
297 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any>
const& args)
302extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
304 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any>
const& args)
306 return cppu::acquire(
new dp_gui::ServiceImpl(
args, context));
309extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
311 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any>
const& args)
static void SetDisplayName(const OUString &rDisplayName)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
static vcl::Window * GetActiveTopWindow()
static ::rtl::Reference< TheExtensionManager > get(css::uno::Reference< css::uno::XComponentContext > const &xContext, css::uno::Reference< css::awt::XWindow > const &xParent=nullptr, OUString const &view=OUString())
static ::rtl::Reference< TheExtensionManager > s_ExtMgr
static OUString getProductVersion()
static OUString getAboutBoxProductVersionSuffix()
static OUString getProductExtension()
static OUString getAboutBoxProductVersion()
static OUString getVendor()
static OUString getProductName()
weld::Window * GetFrameWeld() const
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * desktop_LicenseDialog_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &args)
Reference< XComponentContext > const m_xComponentContext
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * desktop_ServiceImpl_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &args)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * desktop_UpdateRequiredDialogService_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &args)
std::optional< Reference< awt::XWindow > > m_parent
std::optional< OUString > m_extensionURL
ResHookProc GetReadStringHook()
void SetReadStringHook(ResHookProc pProc)
void unwrapArgs(const css::uno::Sequence< css::uno::Any > &seq, Args &... args)
void setProcessServiceFactory(const Reference< XMultiServiceFactory > &xSMgr)
Reference< XComponentContext > getProcessComponentContext()
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
static OUString ReplaceProductNameHookProc(const OUString &rStr)
void syncRepositories(bool force, Reference< ucb::XCommandEnvironment > const &xCmdEnv)
void disposeBridges(Reference< css::uno::XComponentContext > const &ctx)
OUString(* ResHookProc)(const OUString &rStr)
VCL_DLLPUBLIC bool InitVCL()
VCL_DLLPUBLIC Application * GetpApp()
VCL_DLLPUBLIC void DeInitVCL()