LibreOffice Module extensions (master) 1
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
UpdateCheck Class Reference

#include <updatecheck.hxx>

Inheritance diagram for UpdateCheck:
[legend]
Collaboration diagram for UpdateCheck:
[legend]

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< UpdateHandlergetUpdateHandler ()
 
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
 
WorkerThreadm_pThread
 
osl::Condition m_aCondition
 
UpdateInfo m_aUpdateInfo
 
OUString m_aImageName
 
bool m_bHasExtensionUpdate
 
bool m_bShowExtUpdDlg
 
rtl::Reference< UpdateHandlerm_aUpdateHandler
 
css::uno::Reference< css::beans::XPropertySetm_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
 

Detailed Description

Definition at line 57 of file updatecheck.hxx.

Member Enumeration Documentation

◆ State

enum UpdateCheck::State
private
Enumerator
NOT_INITIALIZED 
DISABLED 
CHECK_SCHEDULED 
DOWNLOADING 
DOWNLOAD_PAUSED 

Definition at line 152 of file updatecheck.hxx.

Constructor & Destructor Documentation

◆ UpdateCheck()

UpdateCheck::UpdateCheck ( )
private

Definition at line 678 of file updatecheck.cxx.

◆ ~UpdateCheck()

UpdateCheck::~UpdateCheck ( )
overrideprivatevirtual

Definition at line 688 of file updatecheck.cxx.

Member Function Documentation

◆ autoCheckIntervalChanged()

void UpdateCheck::autoCheckIntervalChanged ( )
overridevirtual

Implements UpdateCheckConfigListener.

Definition at line 1501 of file updatecheck.cxx.

References m_aCondition.

◆ autoCheckStatusChanged()

void UpdateCheck::autoCheckStatusChanged ( bool  enabled)
overridevirtual

◆ cancel()

void UpdateCheck::cancel ( )
overridevirtual

◆ cancelDownload()

void UpdateCheck::cancelDownload ( )

◆ checkDownloadDestination()

bool UpdateCheck::checkDownloadDestination ( const OUString &  rFile)
overridevirtual

Implements DownloadInteractionHandler.

Definition at line 1019 of file updatecheck.cxx.

References getUpdateHandler(), and m_aMutex.

◆ closeAfterFailure()

void UpdateCheck::closeAfterFailure ( )
overridevirtual

Implements IActionListener.

Definition at line 878 of file updatecheck.cxx.

References CHECK_SCHEDULED, DISABLED, getUIState(), m_aMutex, m_aUpdateInfo, m_eState, and setUIState().

◆ download()

void UpdateCheck::download ( )
overridevirtual

◆ downloadFinished()

void UpdateCheck::downloadFinished ( const OUString &  rLocalFileName)
overridevirtual

◆ downloadProgressAt()

void UpdateCheck::downloadProgressAt ( sal_Int8  nProcent)
overridevirtual

◆ downloadStalled()

void UpdateCheck::downloadStalled ( const OUString &  rErrorMessage)
overridevirtual

◆ downloadStarted()

void UpdateCheck::downloadStarted ( const OUString &  rLocalFileName,
sal_Int64  nFileSize 
)
overridevirtual

◆ downloadTargetExists()

bool UpdateCheck::downloadTargetExists ( const OUString &  rFileName)
overridevirtual

◆ enableAutoCheck()

void UpdateCheck::enableAutoCheck ( bool  enable)
private

◆ enableDownload()

void UpdateCheck::enableDownload ( bool  enable,
bool  paused = false 
)
private

◆ getInteractionHandler()

uno::Reference< task::XInteractionHandler > UpdateCheck::getInteractionHandler ( ) const

Definition at line 1461 of file updatecheck.cxx.

References m_aMutex, and m_aUpdateHandler.

◆ getUIState()

UpdateState UpdateCheck::getUIState ( const UpdateInfo rInfo)
static

◆ getUpdateHandler()

rtl::Reference< UpdateHandler > UpdateCheck::getUpdateHandler ( )
private

◆ handleMenuBarUI()

void UpdateCheck::handleMenuBarUI ( const rtl::Reference< UpdateHandler > &  rUpdateHandler,
UpdateState eState,
bool  suppressBubble 
)
private

◆ hasOfficeUpdate()

bool UpdateCheck::hasOfficeUpdate ( ) const
inline

Definition at line 96 of file updatecheck.hxx.

References UpdateInfo::BuildId, and m_aUpdateInfo.

◆ initialize()

void UpdateCheck::initialize ( const css::uno::Sequence< css::beans::NamedValue > &  rValues,
const css::uno::Reference< css::uno::XComponentContext > &  xContext 
)

◆ isDialogShowing()

bool UpdateCheck::isDialogShowing ( ) const

Definition at line 1475 of file updatecheck.cxx.

References m_aMutex, and m_aUpdateHandler.

◆ notifyUpdateCheckFinished()

void UpdateCheck::notifyUpdateCheckFinished ( )

Definition at line 890 of file updatecheck.cxx.

References m_aMutex, m_updateCheckFinished, and m_updateCheckRunning.

◆ operator rtl::Reference< UpdateCheckConfigListener >()

UpdateCheck::operator rtl::Reference< UpdateCheckConfigListener > ( )
inline

Definition at line 68 of file updatecheck.hxx.

◆ pause()

void UpdateCheck::pause ( )
overridevirtual

◆ resume()

void UpdateCheck::resume ( )
overridevirtual

◆ setCheckFailedState()

void UpdateCheck::setCheckFailedState ( )

Definition at line 1259 of file updatecheck.cxx.

References setUIState(), and UPDATESTATE_ERROR_CHECKING.

◆ setHasExtensionUpdates()

void UpdateCheck::setHasExtensionUpdates ( bool  bHasUpdates)
inline

Definition at line 95 of file updatecheck.hxx.

References m_bHasExtensionUpdate.

◆ setUIState()

void UpdateCheck::setUIState ( UpdateState  eState,
bool  suppressBubble = false 
)

◆ setUpdateInfo()

void UpdateCheck::setUpdateInfo ( const UpdateInfo aInfo)

◆ shouldShowExtUpdDlg()

bool UpdateCheck::shouldShowExtUpdDlg ( ) const
inline

Definition at line 93 of file updatecheck.hxx.

References m_bHasExtensionUpdate, and m_bShowExtUpdDlg.

◆ showDialog()

void UpdateCheck::showDialog ( bool  forceCheck = false)

◆ showExtensionDialog()

void UpdateCheck::showExtensionDialog ( )

Definition at line 1428 of file updatecheck.cxx.

References m_xContext.

◆ showReleaseNote()

void UpdateCheck::showReleaseNote ( const OUString &  rURL) const
private

Definition at line 1372 of file updatecheck.cxx.

References m_xContext.

Referenced by download(), downloadFinished(), downloadStarted(), and initialize().

◆ shutdownThread()

void UpdateCheck::shutdownThread ( bool  join)
private

◆ storeReleaseNote()

bool UpdateCheck::storeReleaseNote ( sal_Int8  nNum,
const OUString &  rURL 
)
staticprivate

Definition at line 1385 of file updatecheck.cxx.

References aURL, UpdateCheckConfig::getAllUsersDirectory(), and OUStringToOString().

Referenced by initialize().

◆ waitForUpdateCheckFinished()

void UpdateCheck::waitForUpdateCheckFinished ( )

Definition at line 896 of file updatecheck.cxx.

References lock(), m_aMutex, m_pThread, m_updateCheckFinished, and m_updateCheckRunning.

Friends And Related Function Documentation

◆ UpdateCheckInitData

friend class UpdateCheckInitData
friend

Definition at line 179 of file updatecheck.hxx.

Member Data Documentation

◆ m_aCondition

osl::Condition UpdateCheck::m_aCondition
private

◆ m_aImageName

OUString UpdateCheck::m_aImageName
private

Definition at line 168 of file updatecheck.hxx.

Referenced by downloadFinished(), downloadTargetExists(), initialize(), and setUIState().

◆ m_aMutex

std::recursive_mutex UpdateCheck::m_aMutex
mutableprivate

◆ m_aUpdateHandler

rtl::Reference<UpdateHandler> UpdateCheck::m_aUpdateHandler
private

◆ m_aUpdateInfo

UpdateInfo UpdateCheck::m_aUpdateInfo
private

◆ m_bHasExtensionUpdate

bool UpdateCheck::m_bHasExtensionUpdate
private

◆ m_bShowExtUpdDlg

bool UpdateCheck::m_bShowExtUpdDlg
private

Definition at line 170 of file updatecheck.hxx.

Referenced by handleMenuBarUI(), initialize(), and shouldShowExtUpdDlg().

◆ m_eState

State UpdateCheck::m_eState
private

◆ m_eUpdateState

UpdateState UpdateCheck::m_eUpdateState
private

Definition at line 161 of file updatecheck.hxx.

Referenced by setUIState().

◆ m_pThread

WorkerThread* UpdateCheck::m_pThread
private

◆ m_updateCheckFinished

std::condition_variable_any UpdateCheck::m_updateCheckFinished
private

Definition at line 177 of file updatecheck.hxx.

Referenced by notifyUpdateCheckFinished(), and waitForUpdateCheckFinished().

◆ m_updateCheckRunning

bool UpdateCheck::m_updateCheckRunning = false
private

◆ m_xContext

css::uno::Reference<css::uno::XComponentContext> UpdateCheck::m_xContext
private

◆ m_xMenuBarUI

css::uno::Reference<css::beans::XPropertySet> UpdateCheck::m_xMenuBarUI
private

Definition at line 173 of file updatecheck.hxx.

Referenced by handleMenuBarUI(), and setUIState().


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