LibreOffice Module framework (master) 1
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
framework::StatusIndicatorFactory Class Referencefinal

implement a factory service to create new status indicator objects More...

#include <statusindicatorfactory.hxx>

Inheritance diagram for framework::StatusIndicatorFactory:
[legend]
Collaboration diagram for framework::StatusIndicatorFactory:
[legend]

Public Member Functions

 StatusIndicatorFactory (css::uno::Reference< css::uno::XComponentContext > xContext)
 
virtual OUString SAL_CALL getImplementationName () override
 
virtual sal_Bool SAL_CALL supportsService (OUString const &ServiceName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
 
virtual void SAL_CALL initialize (const css::uno::Sequence< css::uno::Any > &lArguments) override
 
virtual css::uno::Reference< css::task::XStatusIndicator > SAL_CALL createStatusIndicator () override
 
virtual void SAL_CALL update () override
 
void start (const css::uno::Reference< css::task::XStatusIndicator > &xChild, const OUString &sText, sal_Int32 nRange)
 
void reset (const css::uno::Reference< css::task::XStatusIndicator > &xChild)
 
void end (const css::uno::Reference< css::task::XStatusIndicator > &xChild)
 
void setText (const css::uno::Reference< css::task::XStatusIndicator > &xChild, const OUString &sText)
 
void setValue (const css::uno::Reference< css::task::XStatusIndicator > &xChild, sal_Int32 nValue)
 

Private Member Functions

virtual ~StatusIndicatorFactory () override
 
void implts_makeParentVisibleIfAllowed ()
 show the parent window of this progress ... if it's allowed to do so. More...
 
void impl_createProgress ()
 creates a new internal used progress. More...
 
void impl_showProgress ()
 shows the internal used progress. More...
 
void impl_hideProgress ()
 hides the internal used progress. More...
 
void impl_reschedule (bool bForceUpdate)
 try to "share the current thread in an intelligent manner" :-) More...
 
void impl_startWakeUpThread ()
 
void impl_stopWakeUpThread ()
 

Private Attributes

std::mutex m_mutex
 
IndicatorStack m_aStack
 stack with all current indicator children. More...
 
css::uno::Reference< css::uno::XComponentContext > m_xContext
 uno service manager to create own needed uno resources. More...
 
css::uno::Reference< css::task::XStatusIndicator > m_xActiveChild
 most active indicator child, which could work with our shared indicator window only. More...
 
css::uno::Reference< css::task::XStatusIndicator > m_xProgress
 used to show the progress on the frame (layouted!) or as a plugged vcl window. More...
 
css::uno::WeakReference< css::frame::XFrame > m_xFrame
 points to the frame, where we show the progress (in case m_xProgress points to a frame progress. More...
 
css::uno::WeakReference< css::awt::XWindow > m_xPluggWindow
 points to an outside window, where we show the progress (in case we are plugged into such window). More...
 
rtl::Reference< WakeUpThreadm_pWakeUp
 Notify us if a fix time is over. More...
 
bool m_bAllowReschedule
 Our WakeUpThread calls us in our interface method "XUpdatable::update(). More...
 
bool m_bAllowParentShow
 enable/disable automatic showing of our parent window. More...
 
bool m_bDisableReschedule
 enable/disable rescheduling. More...
 

Static Private Attributes

static sal_Int32 m_nInReschedule = 0
 prevent recursive calling of Application::Reschedule(). More...
 

Detailed Description

implement a factory service to create new status indicator objects

@descr Internally it uses:

This factory create different indicators and control his access to a shared output device! Only the last activated component can write its state to this device. All other requests will be cached only.

@devstatus ready to use @threadsafe yes

Definition at line 119 of file statusindicatorfactory.hxx.

Constructor & Destructor Documentation

◆ StatusIndicatorFactory()

framework::StatusIndicatorFactory::StatusIndicatorFactory ( css::uno::Reference< css::uno::XComponentContext >  xContext)

Definition at line 47 of file statusindicatorfactory.cxx.

◆ ~StatusIndicatorFactory()

framework::StatusIndicatorFactory::~StatusIndicatorFactory ( )
overrideprivatevirtual

Definition at line 55 of file statusindicatorfactory.cxx.

References impl_stopWakeUpThread().

Member Function Documentation

◆ createStatusIndicator()

css::uno::Reference< css::task::XStatusIndicator > SAL_CALL framework::StatusIndicatorFactory::createStatusIndicator ( )
overridevirtual

Definition at line 96 of file statusindicatorfactory.cxx.

◆ end()

void framework::StatusIndicatorFactory::end ( const css::uno::Reference< css::task::XStatusIndicator > &  xChild)

◆ getImplementationName()

virtual OUString SAL_CALL framework::StatusIndicatorFactory::getImplementationName ( )
inlineoverridevirtual

Definition at line 175 of file statusindicatorfactory.hxx.

◆ getSupportedServiceNames()

virtual css::uno::Sequence< OUString > SAL_CALL framework::StatusIndicatorFactory::getSupportedServiceNames ( )
inlineoverridevirtual

Definition at line 185 of file statusindicatorfactory.hxx.

◆ impl_createProgress()

void framework::StatusIndicatorFactory::impl_createProgress ( )
private

creates a new internal used progress.

@descr This factory does not paint the progress itself. It uses helper for that. They can be vcl based or layouted by the frame and provided as a uno interface.

Definition at line 384 of file statusindicatorfactory.cxx.

References framework::FRAME_PROPNAME_ASCII_LAYOUTMANAGER, m_mutex, m_xFrame, m_xPluggWindow, m_xProgress, framework::PROGRESS_RESOURCE, and xFrame.

Referenced by initialize().

◆ impl_hideProgress()

void framework::StatusIndicatorFactory::impl_hideProgress ( )
private

hides the internal used progress.

@descr This factory does not paint the progress itself. It uses helper for that. They can be vcl based or layouted by the frame and provided as a uno interface.

Definition at line 472 of file statusindicatorfactory.cxx.

References framework::FRAME_PROPNAME_ASCII_LAYOUTMANAGER, m_mutex, m_xFrame, framework::PROGRESS_RESOURCE, and xFrame.

Referenced by end().

◆ impl_reschedule()

void framework::StatusIndicatorFactory::impl_reschedule ( bool  bForceUpdate)
private

try to "share the current thread in an intelligent manner" :-)

Parameters
Overwritesour algorithm for Reschedule and force it to be sure that our progress was painted right.

Definition at line 497 of file statusindicatorfactory.cxx.

References m_bAllowReschedule, m_bDisableReschedule, m_mutex, m_nInReschedule, and Application::Reschedule().

Referenced by end(), reset(), setText(), setValue(), and start().

◆ impl_showProgress()

void framework::StatusIndicatorFactory::impl_showProgress ( )
private

shows the internal used progress.

@descr This factory does not paint the progress itself. It uses helper for that. They can be vcl based or layouted by the frame and provided as a uno interface.

Definition at line 431 of file statusindicatorfactory.cxx.

References framework::FRAME_PROPNAME_ASCII_LAYOUTMANAGER, m_mutex, m_xFrame, m_xProgress, framework::PROGRESS_RESOURCE, and xFrame.

Referenced by implts_makeParentVisibleIfAllowed().

◆ impl_startWakeUpThread()

void framework::StatusIndicatorFactory::impl_startWakeUpThread ( )
private

Definition at line 540 of file statusindicatorfactory.cxx.

References m_bDisableReschedule, m_mutex, and m_pWakeUp.

Referenced by start().

◆ impl_stopWakeUpThread()

void framework::StatusIndicatorFactory::impl_stopWakeUpThread ( )
private

Definition at line 554 of file statusindicatorfactory.cxx.

References m_mutex, and m_pWakeUp.

Referenced by end(), and ~StatusIndicatorFactory().

◆ implts_makeParentVisibleIfAllowed()

void framework::StatusIndicatorFactory::implts_makeParentVisibleIfAllowed ( )
private

show the parent window of this progress ... if it's allowed to do so.

@descr By default we show the parent window automatically if this progress is used. If that isn't a valid operation, the user of this progress can suppress this feature by initializing us with a special parameter.

@seealso initialize()

Definition at line 289 of file statusindicatorfactory.cxx.

References framework::FRAME_PROPNAME_ASCII_LAYOUTMANAGER, VCLUnoHelper::GetWindow(), impl_showProgress(), m_bAllowParentShow, m_mutex, m_xContext, m_xFrame, m_xPluggWindow, utl::MediaDescriptor::PROP_HIDDEN, xController, xFrame, and xModel.

Referenced by start().

◆ initialize()

void SAL_CALL framework::StatusIndicatorFactory::initialize ( const css::uno::Sequence< css::uno::Any > &  lArguments)
overridevirtual

◆ reset()

void framework::StatusIndicatorFactory::reset ( const css::uno::Reference< css::task::XStatusIndicator > &  xChild)

◆ setText()

void framework::StatusIndicatorFactory::setText ( const css::uno::Reference< css::task::XStatusIndicator > &  xChild,
const OUString &  sText 
)

◆ setValue()

void framework::StatusIndicatorFactory::setValue ( const css::uno::Reference< css::task::XStatusIndicator > &  xChild,
sal_Int32  nValue 
)

◆ start()

void framework::StatusIndicatorFactory::start ( const css::uno::Reference< css::task::XStatusIndicator > &  xChild,
const OUString &  sText,
sal_Int32  nRange 
)

◆ supportsService()

virtual sal_Bool SAL_CALL framework::StatusIndicatorFactory::supportsService ( OUString const &  ServiceName)
inlineoverridevirtual

Definition at line 180 of file statusindicatorfactory.hxx.

References ServiceName, and cppu::supportsService().

◆ update()

void SAL_CALL framework::StatusIndicatorFactory::update ( )
overridevirtual

Definition at line 101 of file statusindicatorfactory.cxx.

References m_bAllowReschedule, and m_mutex.

Member Data Documentation

◆ m_aStack

IndicatorStack framework::StatusIndicatorFactory::m_aStack
private

stack with all current indicator children.

Definition at line 131 of file statusindicatorfactory.hxx.

Referenced by end(), reset(), setText(), setValue(), and start().

◆ m_bAllowParentShow

bool framework::StatusIndicatorFactory::m_bAllowParentShow
private

enable/disable automatic showing of our parent window.

Definition at line 162 of file statusindicatorfactory.hxx.

Referenced by implts_makeParentVisibleIfAllowed(), and initialize().

◆ m_bAllowReschedule

bool framework::StatusIndicatorFactory::m_bAllowReschedule
private

Our WakeUpThread calls us in our interface method "XUpdatable::update().

There we set this member m_bAllowReschedule to sal_True. Next time if our impl_reschedule() method is called, we know, that an Application::Reschedule() should be made. Because the last made Reschedule can be was taken long time ago ... may be.

Definition at line 159 of file statusindicatorfactory.hxx.

Referenced by impl_reschedule(), and update().

◆ m_bDisableReschedule

bool framework::StatusIndicatorFactory::m_bDisableReschedule
private

enable/disable rescheduling.

Default=enabled

Definition at line 165 of file statusindicatorfactory.hxx.

Referenced by impl_reschedule(), impl_startWakeUpThread(), and initialize().

◆ m_mutex

std::mutex framework::StatusIndicatorFactory::m_mutex
private

◆ m_nInReschedule

sal_Int32 framework::StatusIndicatorFactory::m_nInReschedule = 0
staticprivate

prevent recursive calling of Application::Reschedule().

static counter for rescheduling

Definition at line 168 of file statusindicatorfactory.hxx.

Referenced by impl_reschedule().

◆ m_pWakeUp

rtl::Reference<WakeUpThread> framework::StatusIndicatorFactory::m_pWakeUp
private

Notify us if a fix time is over.

We use it to implement an intelligent "Reschedule" ...

Definition at line 153 of file statusindicatorfactory.hxx.

Referenced by impl_startWakeUpThread(), and impl_stopWakeUpThread().

◆ m_xActiveChild

css::uno::Reference< css::task::XStatusIndicator > framework::StatusIndicatorFactory::m_xActiveChild
private

most active indicator child, which could work with our shared indicator window only.

Definition at line 137 of file statusindicatorfactory.hxx.

Referenced by end(), reset(), setText(), setValue(), and start().

◆ m_xContext

css::uno::Reference< css::uno::XComponentContext > framework::StatusIndicatorFactory::m_xContext
private

uno service manager to create own needed uno resources.

Definition at line 134 of file statusindicatorfactory.hxx.

Referenced by implts_makeParentVisibleIfAllowed().

◆ m_xFrame

css::uno::WeakReference< css::frame::XFrame > framework::StatusIndicatorFactory::m_xFrame
private

points to the frame, where we show the progress (in case m_xProgress points to a frame progress.

Definition at line 145 of file statusindicatorfactory.hxx.

Referenced by impl_createProgress(), impl_hideProgress(), impl_showProgress(), implts_makeParentVisibleIfAllowed(), and initialize().

◆ m_xPluggWindow

css::uno::WeakReference< css::awt::XWindow > framework::StatusIndicatorFactory::m_xPluggWindow
private

points to an outside window, where we show the progress (in case we are plugged into such window).

Definition at line 149 of file statusindicatorfactory.hxx.

Referenced by impl_createProgress(), implts_makeParentVisibleIfAllowed(), and initialize().

◆ m_xProgress

css::uno::Reference< css::task::XStatusIndicator > framework::StatusIndicatorFactory::m_xProgress
private

used to show the progress on the frame (layouted!) or as a plugged vcl window.

Definition at line 141 of file statusindicatorfactory.hxx.

Referenced by end(), impl_createProgress(), impl_showProgress(), reset(), setText(), setValue(), and start().


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