LibreOffice Module framework (master) 1
|
implement a factory service to create new status indicator objects More...
#include <statusindicatorfactory.hxx>
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< WakeUpThread > | m_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... | |
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.
framework::StatusIndicatorFactory::StatusIndicatorFactory | ( | css::uno::Reference< css::uno::XComponentContext > | xContext | ) |
Definition at line 47 of file statusindicatorfactory.cxx.
|
overrideprivatevirtual |
Definition at line 55 of file statusindicatorfactory.cxx.
References impl_stopWakeUpThread().
|
overridevirtual |
Definition at line 96 of file statusindicatorfactory.cxx.
void framework::StatusIndicatorFactory::end | ( | const css::uno::Reference< css::task::XStatusIndicator > & | xChild | ) |
Definition at line 169 of file statusindicatorfactory.cxx.
References impl_hideProgress(), impl_reschedule(), impl_stopWakeUpThread(), m_aStack, m_mutex, m_xActiveChild, m_xProgress, and nValue.
Referenced by framework::StatusIndicator::end().
|
inlineoverridevirtual |
Definition at line 175 of file statusindicatorfactory.hxx.
|
inlineoverridevirtual |
Definition at line 185 of file statusindicatorfactory.hxx.
|
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().
|
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().
|
private |
try to "share the current thread in an intelligent manner" :-)
Overwrites | our 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().
|
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().
|
private |
Definition at line 540 of file statusindicatorfactory.cxx.
References m_bDisableReschedule, m_mutex, and m_pWakeUp.
Referenced by start().
|
private |
Definition at line 554 of file statusindicatorfactory.cxx.
References m_mutex, and m_pWakeUp.
Referenced by end(), and ~StatusIndicatorFactory().
|
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().
|
overridevirtual |
Definition at line 60 of file statusindicatorfactory.cxx.
References comphelper::SequenceAsHashMap::getUnpackedValueOrDefault(), impl_createProgress(), m_bAllowParentShow, m_bDisableReschedule, m_mutex, m_xFrame, and m_xPluggWindow.
void framework::StatusIndicatorFactory::reset | ( | const css::uno::Reference< css::task::XStatusIndicator > & | xChild | ) |
Definition at line 137 of file statusindicatorfactory.cxx.
References impl_reschedule(), m_aStack, m_mutex, m_xActiveChild, and m_xProgress.
Referenced by framework::StatusIndicator::reset().
void framework::StatusIndicatorFactory::setText | ( | const css::uno::Reference< css::task::XStatusIndicator > & | xChild, |
const OUString & | sText | ||
) |
Definition at line 224 of file statusindicatorfactory.cxx.
References impl_reschedule(), m_aStack, m_mutex, m_xActiveChild, and m_xProgress.
Referenced by framework::StatusIndicator::setText().
void framework::StatusIndicatorFactory::setValue | ( | const css::uno::Reference< css::task::XStatusIndicator > & | xChild, |
sal_Int32 | nValue | ||
) |
Definition at line 255 of file statusindicatorfactory.cxx.
References impl_reschedule(), m_aStack, m_mutex, m_xActiveChild, m_xProgress, and nValue.
Referenced by framework::StatusIndicator::setValue().
void framework::StatusIndicatorFactory::start | ( | const css::uno::Reference< css::task::XStatusIndicator > & | xChild, |
const OUString & | sText, | ||
sal_Int32 | nRange | ||
) |
Definition at line 107 of file statusindicatorfactory.cxx.
References impl_reschedule(), impl_startWakeUpThread(), implts_makeParentVisibleIfAllowed(), m_aStack, m_mutex, m_xActiveChild, and m_xProgress.
Referenced by framework::StatusIndicator::start().
|
inlineoverridevirtual |
Definition at line 180 of file statusindicatorfactory.hxx.
References ServiceName, and cppu::supportsService().
|
overridevirtual |
Definition at line 101 of file statusindicatorfactory.cxx.
References m_bAllowReschedule, and m_mutex.
|
private |
stack with all current indicator children.
Definition at line 131 of file statusindicatorfactory.hxx.
Referenced by end(), reset(), setText(), setValue(), and start().
|
private |
enable/disable automatic showing of our parent window.
Definition at line 162 of file statusindicatorfactory.hxx.
Referenced by implts_makeParentVisibleIfAllowed(), and initialize().
|
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().
|
private |
enable/disable rescheduling.
Default=enabled
Definition at line 165 of file statusindicatorfactory.hxx.
Referenced by impl_reschedule(), impl_startWakeUpThread(), and initialize().
|
private |
Definition at line 128 of file statusindicatorfactory.hxx.
Referenced by end(), impl_createProgress(), impl_hideProgress(), impl_reschedule(), impl_showProgress(), impl_startWakeUpThread(), impl_stopWakeUpThread(), implts_makeParentVisibleIfAllowed(), initialize(), reset(), setText(), setValue(), start(), and update().
|
staticprivate |
prevent recursive calling of Application::Reschedule().
static counter for rescheduling
Definition at line 168 of file statusindicatorfactory.hxx.
Referenced by impl_reschedule().
|
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().
|
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().
|
private |
uno service manager to create own needed uno resources.
Definition at line 134 of file statusindicatorfactory.hxx.
Referenced by implts_makeParentVisibleIfAllowed().
|
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().
|
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().
|
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().