LibreOffice Module extensions (master) 1
|
#include <updatecheck.hxx>
Public Member Functions | |
operator rtl::Reference< UpdateCheckConfigListener > () | |
void | initialize (const css::uno::Sequence< css::beans::NamedValue > &rValues, const css::uno::Reference< css::uno::XComponentContext > &xContext) |
void | setUpdateInfo (const UpdateInfo &aInfo) |
void | setUIState (UpdateState eState, bool suppressBubble=false) |
void | setCheckFailedState () |
void | showDialog (bool forceCheck=false) |
bool | isDialogShowing () const |
bool | shouldShowExtUpdDlg () const |
void | showExtensionDialog () |
void | setHasExtensionUpdates (bool bHasUpdates) |
bool | hasOfficeUpdate () const |
virtual bool | downloadTargetExists (const OUString &rFileName) override |
virtual void | downloadStalled (const OUString &rErrorMessage) override |
virtual void | downloadProgressAt (sal_Int8 nProcent) override |
virtual void | downloadStarted (const OUString &rLocalFileName, sal_Int64 nFileSize) override |
virtual void | downloadFinished (const OUString &rLocalFileName) override |
virtual bool | checkDownloadDestination (const OUString &rFile) override |
void | cancelDownload () |
css::uno::Reference< css::task::XInteractionHandler > | getInteractionHandler () const |
virtual void | autoCheckStatusChanged (bool enabled) override |
virtual void | autoCheckIntervalChanged () override |
void | cancel () override |
void | download () override |
void | pause () override |
void | resume () override |
void | closeAfterFailure () override |
void | notifyUpdateCheckFinished () |
void | waitForUpdateCheckFinished () |
virtual void | autoCheckStatusChanged (bool enabled)=0 |
virtual void | autoCheckIntervalChanged ()=0 |
Public Member Functions inherited from salhelper::SimpleReferenceObject | |
SimpleReferenceObject () | |
void | acquire () |
void | release () |
virtual void | cancel ()=0 |
virtual void | download ()=0 |
virtual void | pause ()=0 |
virtual void | resume ()=0 |
virtual void | closeAfterFailure ()=0 |
virtual bool | checkDownloadDestination (const OUString &rFileName)=0 |
virtual bool | downloadTargetExists (const OUString &rFileName)=0 |
virtual void | downloadStalled (const OUString &rErrorMessage)=0 |
virtual void | downloadProgressAt (sal_Int8 nPercent)=0 |
virtual void | downloadStarted (const OUString &rFileName, sal_Int64 nFileSize)=0 |
virtual void | downloadFinished (const OUString &rFileName)=0 |
Static Public Member Functions | |
static UpdateState | getUIState (const UpdateInfo &rInfo) |
Static Public Member Functions inherited from salhelper::SimpleReferenceObject | |
static void * | operator new (std::size_t nSize) |
static void * | operator new (std::size_t nSize, std::nothrow_t const &rNothrow) |
static void | operator delete (void *pPtr) |
static void | operator delete (void *pPtr, std::nothrow_t const &rNothrow) |
Private Types | |
enum | State { NOT_INITIALIZED , DISABLED , CHECK_SCHEDULED , DOWNLOADING , DOWNLOAD_PAUSED } |
Private Member Functions | |
UpdateCheck () | |
virtual | ~UpdateCheck () override |
void | enableAutoCheck (bool enable) |
void | enableDownload (bool enable, bool paused=false) |
void | shutdownThread (bool join) |
rtl::Reference< UpdateHandler > | getUpdateHandler () |
void | showReleaseNote (const OUString &rURL) const |
void | handleMenuBarUI (const rtl::Reference< UpdateHandler > &rUpdateHandler, UpdateState &eState, bool suppressBubble) |
Static Private Member Functions | |
static bool | storeReleaseNote (sal_Int8 nNum, const OUString &rURL) |
Private Attributes | |
State | m_eState |
UpdateState | m_eUpdateState |
std::recursive_mutex | m_aMutex |
WorkerThread * | m_pThread |
osl::Condition | m_aCondition |
UpdateInfo | m_aUpdateInfo |
OUString | m_aImageName |
bool | m_bHasExtensionUpdate |
bool | m_bShowExtUpdDlg |
rtl::Reference< UpdateHandler > | m_aUpdateHandler |
css::uno::Reference< css::beans::XPropertySet > | m_xMenuBarUI |
css::uno::Reference< css::uno::XComponentContext > | m_xContext |
bool | m_updateCheckRunning = false |
std::condition_variable_any | m_updateCheckFinished |
Friends | |
class | UpdateCheckInitData |
Additional Inherited Members | |
Protected Member Functions inherited from UpdateCheckConfigListener | |
virtual | ~UpdateCheckConfigListener () override |
Protected Member Functions inherited from salhelper::SimpleReferenceObject | |
virtual | ~SimpleReferenceObject () COVERITY_NOEXCEPT_FALSE |
Protected Member Functions inherited from IActionListener | |
virtual | ~IActionListener () override |
Protected Member Functions inherited from DownloadInteractionHandler | |
virtual | ~DownloadInteractionHandler () override |
Protected Attributes inherited from salhelper::SimpleReferenceObject | |
oslInterlockedCount | m_nCount |
Definition at line 57 of file updatecheck.hxx.
|
private |
Enumerator | |
---|---|
NOT_INITIALIZED | |
DISABLED | |
CHECK_SCHEDULED | |
DOWNLOADING | |
DOWNLOAD_PAUSED |
Definition at line 152 of file updatecheck.hxx.
|
private |
Definition at line 678 of file updatecheck.cxx.
|
overrideprivatevirtual |
Definition at line 688 of file updatecheck.cxx.
|
overridevirtual |
Implements UpdateCheckConfigListener.
Definition at line 1501 of file updatecheck.cxx.
References m_aCondition.
|
overridevirtual |
Implements UpdateCheckConfigListener.
Definition at line 1483 of file updatecheck.cxx.
References CHECK_SCHEDULED, DISABLED, enableAutoCheck(), getUIState(), m_aMutex, m_aUpdateInfo, m_eState, setUIState(), and shutdownThread().
|
overridevirtual |
Implements IActionListener.
Definition at line 794 of file updatecheck.cxx.
References WorkerThread::cancel(), getUIState(), m_aMutex, m_aUpdateInfo, m_pThread, and setUIState().
void UpdateCheck::cancelDownload | ( | ) |
Definition at line 1101 of file updatecheck.cxx.
References enableDownload(), UpdateCheckConfig::get(), m_aMutex, m_aUpdateInfo, m_xContext, and shutdownThread().
|
overridevirtual |
Implements DownloadInteractionHandler.
Definition at line 1019 of file updatecheck.cxx.
References getUpdateHandler(), and m_aMutex.
|
overridevirtual |
Implements IActionListener.
Definition at line 878 of file updatecheck.cxx.
References CHECK_SCHEDULED, DISABLED, getUIState(), m_aMutex, m_aUpdateInfo, m_eState, and setUIState().
|
overridevirtual |
Implements IActionListener.
Definition at line 811 of file updatecheck.cxx.
References DOWNLOADING, enableDownload(), m_aMutex, m_aUpdateInfo, m_eState, SAL_WARN, setUIState(), showReleaseNote(), shutdownThread(), UpdateInfo::Sources, and UPDATESTATE_DOWNLOADING.
|
overridevirtual |
Implements DownloadInteractionHandler.
Definition at line 1079 of file updatecheck.cxx.
References aURL, UpdateCheckConfig::get(), getReleaseNote(), m_aImageName, m_aMutex, m_aUpdateInfo, m_pThread, m_xContext, setUIState(), showReleaseNote(), and UPDATESTATE_DOWNLOAD_AVAIL.
|
overridevirtual |
Implements DownloadInteractionHandler.
Definition at line 1049 of file updatecheck.cxx.
References getUpdateHandler(), m_aMutex, setUIState(), and UPDATESTATE_DOWNLOADING.
|
overridevirtual |
Implements DownloadInteractionHandler.
Definition at line 1037 of file updatecheck.cxx.
References getUpdateHandler(), m_aMutex, setUIState(), and UPDATESTATE_ERROR_DOWNLOADING.
|
overridevirtual |
Implements DownloadInteractionHandler.
Definition at line 1061 of file updatecheck.cxx.
References aURL, UpdateCheckConfig::get(), getReleaseNote(), m_aMutex, m_aUpdateInfo, m_xContext, and showReleaseNote().
|
overridevirtual |
Implements DownloadInteractionHandler.
Definition at line 977 of file updatecheck.cxx.
References enableDownload(), getUIState(), getUpdateHandler(), m_aImageName, m_aMutex, m_aUpdateInfo, setUIState(), shutdownThread(), UPDATESTATE_DOWNLOAD_AVAIL, and UPDATESTATE_DOWNLOADING.
|
private |
Definition at line 938 of file updatecheck.cxx.
References CHECK_SCHEDULED, DISABLED, m_aCondition, m_eState, m_pThread, m_updateCheckRunning, and m_xContext.
Referenced by autoCheckStatusChanged(), enableDownload(), and initialize().
|
private |
Definition at line 951 of file updatecheck.cxx.
References DISABLED, DOWNLOAD_PAUSED, DOWNLOADING, enableAutoCheck(), UpdateCheckConfig::get(), m_aCondition, m_aUpdateInfo, m_eState, m_pThread, m_xContext, paused, and UpdateInfo::Sources.
Referenced by cancelDownload(), download(), downloadTargetExists(), initialize(), and setUpdateInfo().
uno::Reference< task::XInteractionHandler > UpdateCheck::getInteractionHandler | ( | ) | const |
Definition at line 1461 of file updatecheck.cxx.
References m_aMutex, and m_aUpdateHandler.
|
static |
Definition at line 1355 of file updatecheck.cxx.
References UpdateInfo::BuildId, UpdateInfo::Sources, UPDATESTATE_NO_UPDATE_AVAIL, UPDATESTATE_UPDATE_AVAIL, and UPDATESTATE_UPDATE_NO_DOWNLOAD.
Referenced by autoCheckStatusChanged(), cancel(), closeAfterFailure(), downloadTargetExists(), and initialize().
|
private |
Definition at line 1449 of file updatecheck.cxx.
References m_aMutex, m_aUpdateHandler, and m_xContext.
Referenced by checkDownloadDestination(), downloadProgressAt(), downloadStalled(), downloadTargetExists(), initialize(), setUIState(), and showDialog().
|
private |
Definition at line 1265 of file updatecheck.cxx.
References m_bHasExtensionUpdate, m_bShowExtUpdDlg, m_xMenuBarUI, PROPERTY_SHOW_BUBBLE, PROPERTY_SHOW_MENUICON, PROPERTY_TEXT, PROPERTY_TITLE, UPDATESTATE_CHECKING, UPDATESTATE_EXT_UPD_AVAIL, and UPDATESTATE_NO_UPDATE_AVAIL.
Referenced by setUIState().
|
inline |
Definition at line 96 of file updatecheck.hxx.
References UpdateInfo::BuildId, and m_aUpdateInfo.
void UpdateCheck::initialize | ( | const css::uno::Sequence< css::beans::NamedValue > & | rValues, |
const css::uno::Reference< css::uno::XComponentContext > & | xContext | ||
) |
Definition at line 691 of file updatecheck.cxx.
References aURL, checkForPendingUpdates(), enableAutoCheck(), enableDownload(), UpdateCheckConfig::get(), UpdateCheckROModel::getDownloadSize(), UpdateCheckROModel::getLocalFileName(), getReleaseNote(), getUIState(), UpdateCheckROModel::getUpdateEntry(), UpdateCheckROModel::getUpdateEntryVersion(), getUpdateHandler(), UpdateCheckROModel::isAutoCheckEnabled(), UpdateCheckROModel::isDownloadPaused(), m_aImageName, m_aMutex, m_aUpdateInfo, m_bHasExtensionUpdate, m_bShowExtUpdDlg, m_eState, m_xContext, NOT_INITIALIZED, setUIState(), showReleaseNote(), storeReleaseNote(), UPDATESTATE_DOWNLOAD_AVAIL, UPDATESTATE_DOWNLOAD_PAUSED, and UPDATESTATE_DOWNLOADING.
bool UpdateCheck::isDialogShowing | ( | ) | const |
Definition at line 1475 of file updatecheck.cxx.
References m_aMutex, and m_aUpdateHandler.
void UpdateCheck::notifyUpdateCheckFinished | ( | ) |
Definition at line 890 of file updatecheck.cxx.
References m_aMutex, m_updateCheckFinished, and m_updateCheckRunning.
|
inline |
Definition at line 68 of file updatecheck.hxx.
|
overridevirtual |
Implements IActionListener.
Definition at line 846 of file updatecheck.cxx.
References UpdateCheckConfig::get(), m_aMutex, m_pThread, m_xContext, setUIState(), and UPDATESTATE_DOWNLOAD_PAUSED.
|
overridevirtual |
Implements IActionListener.
Definition at line 862 of file updatecheck.cxx.
References UpdateCheckConfig::get(), m_aMutex, m_pThread, m_xContext, setUIState(), and UPDATESTATE_DOWNLOADING.
void UpdateCheck::setCheckFailedState | ( | ) |
Definition at line 1259 of file updatecheck.cxx.
References setUIState(), and UPDATESTATE_ERROR_CHECKING.
|
inline |
Definition at line 95 of file updatecheck.hxx.
References m_bHasExtensionUpdate.
void UpdateCheck::setUIState | ( | UpdateState | eState, |
bool | suppressBubble = false |
||
) |
Definition at line 1300 of file updatecheck.cxx.
References UpdateInfo::Description, DISABLED, UpdateCheckConfig::get(), getUpdateHandler(), handleMenuBarUI(), m_aImageName, m_aMutex, m_aUpdateInfo, m_bHasExtensionUpdate, m_eState, m_eUpdateState, m_xContext, m_xMenuBarUI, UPDATESTATE_CHECKING, UPDATESTATE_DOWNLOAD_AVAIL, UPDATESTATE_DOWNLOAD_PAUSED, UPDATESTATE_DOWNLOADING, UPDATESTATE_ERROR_CHECKING, UPDATESTATE_NO_UPDATE_AVAIL, UPDATESTATE_UPDATE_AVAIL, and UpdateInfo::Version.
Referenced by autoCheckStatusChanged(), cancel(), closeAfterFailure(), download(), downloadFinished(), downloadProgressAt(), downloadStalled(), downloadTargetExists(), initialize(), pause(), resume(), setCheckFailedState(), setUpdateInfo(), and showDialog().
void UpdateCheck::setUpdateInfo | ( | const UpdateInfo & | aInfo | ) |
Definition at line 1188 of file updatecheck.cxx.
References UpdateInfo::BuildId, CHECK_SCHEDULED, DISABLED, enableDownload(), UpdateCheckConfig::get(), m_aMutex, m_aUpdateInfo, m_eState, m_xContext, UpdateInfo::ReleaseNotes, setUIState(), shutdownThread(), UpdateInfo::Sources, UPDATESTATE_DOWNLOADING, UPDATESTATE_NO_UPDATE_AVAIL, UPDATESTATE_UPDATE_AVAIL, and UPDATESTATE_UPDATE_NO_DOWNLOAD.
|
inline |
Definition at line 93 of file updatecheck.hxx.
References m_bHasExtensionUpdate, and m_bShowExtUpdDlg.
void UpdateCheck::showDialog | ( | bool | forceCheck = false | ) |
Definition at line 1127 of file updatecheck.cxx.
References UpdateInfo::BuildId, CHECK_SCHEDULED, DISABLED, DOWNLOAD_PAUSED, DOWNLOADING, getUpdateHandler(), m_aCondition, m_aMutex, m_aUpdateHandler, m_aUpdateInfo, m_eState, m_xContext, NOT_INITIALIZED, setUIState(), UpdateInfo::Sources, UPDATESTATE_CHECKING, UPDATESTATE_DOWNLOAD_PAUSED, UPDATESTATE_DOWNLOADING, UPDATESTATE_UPDATE_AVAIL, UPDATESTATE_UPDATE_NO_DOWNLOAD, and UPDATESTATES_COUNT.
void UpdateCheck::showExtensionDialog | ( | ) |
Definition at line 1428 of file updatecheck.cxx.
References m_xContext.
|
private |
Definition at line 1372 of file updatecheck.cxx.
References m_xContext.
Referenced by download(), downloadFinished(), downloadStarted(), and initialize().
|
private |
Definition at line 915 of file updatecheck.cxx.
References join(), m_aCondition, m_aMutex, and m_pThread.
Referenced by autoCheckStatusChanged(), cancelDownload(), download(), downloadTargetExists(), and setUpdateInfo().
|
staticprivate |
Definition at line 1385 of file updatecheck.cxx.
References aURL, UpdateCheckConfig::getAllUsersDirectory(), and OUStringToOString().
Referenced by initialize().
void UpdateCheck::waitForUpdateCheckFinished | ( | ) |
Definition at line 896 of file updatecheck.cxx.
References lock(), m_aMutex, m_pThread, m_updateCheckFinished, and m_updateCheckRunning.
|
friend |
Definition at line 179 of file updatecheck.hxx.
|
private |
Definition at line 165 of file updatecheck.hxx.
Referenced by autoCheckIntervalChanged(), enableAutoCheck(), enableDownload(), showDialog(), and shutdownThread().
|
private |
Definition at line 168 of file updatecheck.hxx.
Referenced by downloadFinished(), downloadTargetExists(), initialize(), and setUIState().
|
mutableprivate |
Definition at line 163 of file updatecheck.hxx.
Referenced by autoCheckStatusChanged(), cancel(), cancelDownload(), checkDownloadDestination(), closeAfterFailure(), download(), downloadFinished(), downloadProgressAt(), downloadStalled(), downloadStarted(), downloadTargetExists(), getInteractionHandler(), getUpdateHandler(), initialize(), isDialogShowing(), notifyUpdateCheckFinished(), pause(), resume(), setUIState(), setUpdateInfo(), showDialog(), shutdownThread(), and waitForUpdateCheckFinished().
|
private |
Definition at line 172 of file updatecheck.hxx.
Referenced by getInteractionHandler(), getUpdateHandler(), isDialogShowing(), and showDialog().
|
private |
Definition at line 167 of file updatecheck.hxx.
Referenced by autoCheckStatusChanged(), cancel(), cancelDownload(), closeAfterFailure(), download(), downloadFinished(), downloadStarted(), downloadTargetExists(), enableDownload(), hasOfficeUpdate(), initialize(), setUIState(), setUpdateInfo(), and showDialog().
|
private |
Definition at line 169 of file updatecheck.hxx.
Referenced by handleMenuBarUI(), initialize(), setHasExtensionUpdates(), setUIState(), and shouldShowExtUpdDlg().
|
private |
Definition at line 170 of file updatecheck.hxx.
Referenced by handleMenuBarUI(), initialize(), and shouldShowExtUpdDlg().
|
private |
Definition at line 160 of file updatecheck.hxx.
Referenced by autoCheckStatusChanged(), closeAfterFailure(), download(), enableAutoCheck(), enableDownload(), initialize(), setUIState(), setUpdateInfo(), and showDialog().
|
private |
Definition at line 161 of file updatecheck.hxx.
Referenced by setUIState().
|
private |
Definition at line 164 of file updatecheck.hxx.
Referenced by cancel(), downloadFinished(), enableAutoCheck(), enableDownload(), pause(), resume(), shutdownThread(), and waitForUpdateCheckFinished().
|
private |
Definition at line 177 of file updatecheck.hxx.
Referenced by notifyUpdateCheckFinished(), and waitForUpdateCheckFinished().
|
private |
Definition at line 176 of file updatecheck.hxx.
Referenced by enableAutoCheck(), notifyUpdateCheckFinished(), and waitForUpdateCheckFinished().
|
private |
Definition at line 174 of file updatecheck.hxx.
Referenced by cancelDownload(), downloadFinished(), downloadStarted(), enableAutoCheck(), enableDownload(), getUpdateHandler(), initialize(), pause(), resume(), setUIState(), setUpdateInfo(), showDialog(), showExtensionDialog(), and showReleaseNote().
|
private |
Definition at line 173 of file updatecheck.hxx.
Referenced by handleMenuBarUI(), and setUIState().