LibreOffice Module framework (master) 1
|
it represent a job; execute it and control its lifetime More...
#include <job.hxx>
Public Member Functions | |
Job (const css::uno::Reference< css::uno::XComponentContext > &xContext, css::uno::Reference< css::frame::XFrame > xFrame) | |
Job (const css::uno::Reference< css::uno::XComponentContext > &xContext, css::uno::Reference< css::frame::XModel > xModel) | |
virtual | ~Job () override |
void | setDispatchResultFake (const css::uno::Reference< css::frame::XDispatchResultListener > &xListener, const css::uno::Reference< css::uno::XInterface > &xSourceFake) |
void | setJobData (const JobData &aData) |
void | execute (const css::uno::Sequence< css::beans::NamedValue > &lDynamicArgs) |
void | die () |
virtual void SAL_CALL | jobFinished (const css::uno::Reference< css::task::XAsyncJob > &xJob, const css::uno::Any &aResult) override |
virtual void SAL_CALL | queryTermination (const css::lang::EventObject &aEvent) override |
virtual void SAL_CALL | notifyTermination (const css::lang::EventObject &aEvent) override |
virtual void SAL_CALL | queryClosing (const css::lang::EventObject &aEvent, sal_Bool bGetsOwnership) override |
virtual void SAL_CALL | notifyClosing (const css::lang::EventObject &aEvent) override |
virtual void SAL_CALL | disposing (const css::lang::EventObject &aEvent) override |
Private Types | |
enum | ERunState { E_NEW , E_RUNNING , E_STOPPED_OR_FINISHED , E_DISPOSED } |
different possible states for the internal wrapped job. More... | |
Private Member Functions | |
css::uno::Sequence< css::beans::NamedValue > | impl_generateJobArgs (const css::uno::Sequence< css::beans::NamedValue > &lDynamicArgs) |
void | impl_reactForJobResult (const css::uno::Any &aResult) |
void | impl_startListening () |
void | impl_stopListening () |
Private Attributes | |
JobData | m_aJobCfg |
hold all necessary information about this job. More... | |
css::uno::Reference< css::uno::XComponentContext > | m_xContext |
We need it to create own services on demand. More... | |
css::uno::Reference< css::uno::XInterface > | m_xJob |
Hold the (may asynchronous) job alive. More... | |
::osl::Condition | m_aAsyncWait |
Used to wait for finishing of asynchronous started jobs. More... | |
css::uno::Reference< css::frame::XFrame > | m_xFrame |
For some special cases we must know the environment, in which this job runs. More... | |
css::uno::Reference< css::frame::XModel > | m_xModel |
For some special cases we must know the environment, in which this job runs. More... | |
css::uno::Reference< css::frame::XDesktop2 > | m_xDesktop |
We are registered at this instance to listen for office shutdown events. More... | |
css::uno::Reference< css::frame::XDispatchResultListener > | m_xResultListener |
A job can return a dispatch result event after finishing its work. More... | |
css::uno::Reference< css::uno::XInterface > | m_xResultSourceFake |
We can't set ourself as source of a dispatch result event ... nor our job. More... | |
bool | m_bListenOnDesktop |
Holds the state, if we are listen for desktop/frame or model closing events or not. More... | |
bool | m_bListenOnFrame |
bool | m_bListenOnModel |
bool | m_bPendingCloseFrame |
In case we got a close request from our desktop/frame/model (on which we listen) ... and the ownership was delivered there ... we have to close ourself and this object in case the internal wrapped and running job finish his work. More... | |
bool | m_bPendingCloseModel |
ERunState | m_eRunState |
indicates in which state the internal job currently exist. More... | |
it represent a job; execute it and control its lifetime
@descr This implementation can be used to wrap jobs, execute it synchronously or asynchronous, control its lifetime and differe between jobs with and without configuration.
|
private |
different possible states for the internal wrapped job.
It can be started, stopped by a queryClosing() request or disposed() by a notifyClosing() request ...
Enumerator | |
---|---|
E_NEW | |
E_RUNNING | |
E_STOPPED_OR_FINISHED | |
E_DISPOSED |
framework::Job::Job | ( | const css::uno::Reference< css::uno::XComponentContext > & | xContext, |
css::uno::Reference< css::frame::XFrame > | xFrame | ||
) |
framework::Job::Job | ( | const css::uno::Reference< css::uno::XComponentContext > & | xContext, |
css::uno::Reference< css::frame::XModel > | xModel | ||
) |
|
overridevirtual |
void framework::Job::die | ( | ) |
|
overridevirtual |
void framework::Job::execute | ( | const css::uno::Sequence< css::beans::NamedValue > & | lDynamicArgs | ) |
|
private |
|
private |
|
private |
|
private |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
void framework::Job::setDispatchResultFake | ( | const css::uno::Reference< css::frame::XDispatchResultListener > & | xListener, |
const css::uno::Reference< css::uno::XInterface > & | xSourceFake | ||
) |
void framework::Job::setJobData | ( | const JobData & | aData | ) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
For some special cases we must know the environment, in which this job runs.
Means the frame inside which we may was triggered. We use it too, to listen for closing events of this resource.
Please note: If m_xFrame is set - m_xModel should be NULL. Only one environment can be supported really.
|
private |
|
private |
For some special cases we must know the environment, in which this job runs.
Means the document inside which we may was triggered. We use it too, to listen for closing events of this resource.
Please note: If m_xModel is set - m_xFrame should be NULL. Only one environment can be supported really.
|
private |
|
private |
We can't set ourself as source of a dispatch result event ... nor our job.
Because the listener (set as m_xResultListener) expect the original instance, where it was registered. This original instance is the user of this class. It must be set explicitly and will be used to fake the source of the event!