26#include <osl/mutex.hxx>
27#include <com/sun/star/uno/Any.h>
28#include <com/sun/star/uno/Reference.h>
29#include <com/sun/star/uno/XComponentContext.hpp>
30#include <com/sun/star/awt/Rectangle.hpp>
31#include <com/sun/star/awt/XActionListener.hpp>
32#include <com/sun/star/awt/XControlModel.hpp>
33#include <com/sun/star/awt/XDialog.hpp>
34#include <com/sun/star/awt/XTopWindowListener.hpp>
35#include <com/sun/star/beans/NamedValue.hpp>
36#include <com/sun/star/frame/XTerminateListener.hpp>
37#include <com/sun/star/task/XInteractionHandler.hpp>
72class UpdateHandler :
public cppu::WeakImplHelper< css::awt::XActionListener,
73 css::awt::XTopWindowListener,
74 css::task::XInteractionHandler,
75 css::frame::XTerminateListener >
78 css::uno::Reference< css::uno::XComponentContext >
mxContext;
79 css::uno::Reference< css::awt::XDialog >
mxUpdDlg;
133 const OUString &rPropName,
134 const css::uno::Any &rPropValue );
135 void showControl(
const OUString &rCtrlName,
bool bShow =
true );
141 static OUString
loadString(
const std::locale& rLocale,
144 static void insertControlModel( css::uno::Reference< css::awt::XControlModel >
const & rxDialogModel,
145 OUString
const & rServiceName,
146 OUString
const & rControlName,
147 css::awt::Rectangle
const & rPosSize,
148 css::uno::Sequence< css::beans::NamedValue >
const & rProps );
153 UpdateHandler(
const css::uno::Reference< css::uno::XComponentContext > & rxContext,
172 bool showWarning(
const OUString &rWarning )
const;
173 bool showWarning(
const OUString &rWarning,
const OUString& rBtnText_1,
const OUString& rBtnText_2 )
const;
178 operator css::uno::Reference< css::uno::XInterface > ()
const
182 virtual void SAL_CALL
disposing(
const css::lang::EventObject &rObj )
override;
183 virtual void SAL_CALL
actionPerformed( css::awt::ActionEvent
const & rEvent)
override;
186 virtual void SAL_CALL
windowOpened(
const css::lang::EventObject& e )
override;
187 virtual void SAL_CALL
windowClosing(
const css::lang::EventObject& e )
override;
188 virtual void SAL_CALL
windowClosed(
const css::lang::EventObject& e )
override;
189 virtual void SAL_CALL
windowMinimized(
const css::lang::EventObject& e )
override;
190 virtual void SAL_CALL
windowNormalized(
const css::lang::EventObject& e )
override;
191 virtual void SAL_CALL
windowActivated(
const css::lang::EventObject& e )
override;
192 virtual void SAL_CALL
windowDeactivated(
const css::lang::EventObject& e )
override;
195 virtual void SAL_CALL
handle(
const css::uno::Reference< css::task::XInteractionRequest >& Request )
override;
198 virtual void SAL_CALL
queryTermination(
const css::lang::EventObject& e )
override;
199 virtual void SAL_CALL
notifyTermination(
const css::lang::EventObject& e )
override;
OUString getBubbleTitle(UpdateState eState)
css::uno::Reference< css::task::XInteractionHandler > mxInteractionHdl
void setDownloadPath(const OUString &rPath)
OUString msDownloadNotAvail
virtual ~UpdateHandler() override
virtual void SAL_CALL windowDeactivated(const css::lang::EventObject &e) override
void enableControls(short nCtrlState)
UpdateHandler & operator=(const UpdateHandler &)=delete
OUString substVariables(const OUString &rSource) const
virtual void SAL_CALL windowClosed(const css::lang::EventObject &e) override
void setErrorMessage(const OUString &rErrorMsg)
void setDescription(const OUString &rDescription)
OUString msBubbleTitles[UPDATESTATES_COUNT]
void updateState(UpdateState eNewState)
void setFullVersion(OUString &rString)
void setProgress(sal_Int32 nPercent)
rtl::Reference< IActionListener > mxActionListener
virtual void SAL_CALL notifyTermination(const css::lang::EventObject &e) override
static OUString loadString(const std::locale &rLocale, TranslateId pResourceId)
UpdateHandler(const css::uno::Reference< css::uno::XComponentContext > &rxContext, const rtl::Reference< IActionListener > &rxActionListener)
UpdateHandler(const UpdateHandler &)=delete
void setVisible(bool bVisible=true)
void showControl(const OUString &rCtrlName, bool bShow=true)
void focusControl(DialogControls eID)
void setControlProperty(const OUString &rCtrlName, const OUString &rPropName, const css::uno::Any &rPropValue)
css::uno::Reference< css::awt::XDialog > mxUpdDlg
virtual void SAL_CALL actionPerformed(css::awt::ActionEvent const &rEvent) override
virtual void SAL_CALL windowActivated(const css::lang::EventObject &e) override
void setState(UpdateState eState)
OUString msBubbleTexts[UPDATESTATES_COUNT]
bool showWarning(const OUString &rWarning) const
void showControls(short nControls)
virtual void SAL_CALL queryTermination(const css::lang::EventObject &e) override
static void insertControlModel(css::uno::Reference< css::awt::XControlModel > const &rxDialogModel, OUString const &rServiceName, OUString const &rControlName, css::awt::Rectangle const &rPosSize, css::uno::Sequence< css::beans::NamedValue > const &rProps)
void startThrobber(bool bStart=true)
bool mbDownloadBtnHasDots
OUString msDownloadWarning
OUString msButtonIDs[BUTTON_COUNT]
void setDownloadFile(std::u16string_view rPath)
virtual void SAL_CALL windowOpened(const css::lang::EventObject &e) override
virtual void SAL_CALL windowNormalized(const css::lang::EventObject &e) override
OUString msOverwriteWarning
OUString getBubbleText(UpdateState eState)
virtual void SAL_CALL windowClosing(const css::lang::EventObject &e) override
OUString msReloadContinue
virtual void SAL_CALL handle(const css::uno::Reference< css::task::XInteractionRequest > &Request) override
void setDownloadBtnLabel(bool bAppendDots)
virtual void SAL_CALL disposing(const css::lang::EventObject &rObj) override
css::uno::Reference< css::uno::XComponentContext > mxContext
void setNextVersion(const OUString &rNextVersion)
virtual void SAL_CALL windowMinimized(const css::lang::EventObject &e) override
bool showOverwriteWarning() const
OUString msDescriptionMsg
@ UPDATESTATE_UPDATE_NO_DOWNLOAD
@ UPDATESTATE_ERROR_DOWNLOADING
@ UPDATESTATE_EXT_UPD_AVAIL
@ UPDATESTATE_DOWNLOAD_PAUSED
@ UPDATESTATE_ERROR_CHECKING
@ UPDATESTATE_DOWNLOAD_AVAIL
@ UPDATESTATE_NO_UPDATE_AVAIL
@ UPDATESTATE_UPDATE_AVAIL
@ UPDATESTATE_DOWNLOADING