LibreOffice Module test (master)  1
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
TestLokCallbackWrapper Class Referencefinal

A helper to convert SfxLokCallbackInterface to a LIbreOfficeKitCallback for tests. More...

#include <lokcallback.hxx>

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

Classes

struct  PerViewIdData
 

Public Member Functions

 TestLokCallbackWrapper (LibreOfficeKitCallback callback, void *data)
 
void clear ()
 Discard all possibly still held events. More...
 
void setLOKViewId (int viewId)
 Set the view id of the associated SfxViewShell. More...
 
virtual void libreOfficeKitViewCallback (int nType, const char *pPayload) override
 
virtual void libreOfficeKitViewCallbackWithViewId (int nType, const char *pPayload, int nViewId) override
 
virtual void libreOfficeKitViewInvalidateTilesCallback (const tools::Rectangle *pRect, int nPart) override
 
virtual void libreOfficeKitViewUpdatedCallback (int nType) override
 
virtual void libreOfficeKitViewUpdatedCallbackPerViewId (int nType, int nViewId, int nSourceViewId) override
 
virtual void Invoke () override
 
- Public Member Functions inherited from SfxLokCallbackInterface
virtual ~SfxLokCallbackInterface ()
 
- Public Member Functions inherited from Idle
 Idle (const char *pDebugName)
 
virtual void Start (bool bStartTimer=true) override
 
- Public Member Functions inherited from Timer
 Timer (const char *pDebugName)
 
 Timer (const Timer &rTimer)
 
virtual ~Timer () override
 
Timeroperator= (const Timer &rTimer)
 
void Invoke (Timer *arg)
 
void SetInvokeHandler (const Link< Timer *, void > &rLink)
 
void ClearInvokeHandler ()
 
void SetTimeout (sal_uInt64 nTimeoutMs)
 
sal_uInt64 GetTimeout () const
 
- Public Member Functions inherited from Task
 Task (const char *pDebugName)
 
 Task (const Task &rTask)
 
virtual ~Task () COVERITY_NOEXCEPT_FALSE
 
Taskoperator= (const Task &rTask)
 
void SetPriority (TaskPriority ePriority)
 
TaskPriority GetPriority () const
 
const char * GetDebugName () const
 
void Stop ()
 
bool IsActive () const
 
void SetStatic ()
 
bool IsStatic () const
 

Private Member Functions

void callCallback (int nType, const char *pPayload, int nViewId)
 
void startTimer ()
 
void flushLOKData ()
 
void discardUpdatedTypes (int nType, int nViewId)
 

Private Attributes

LibreOfficeKitCallback m_callback
 
voidm_data
 
int m_viewId = -1
 
std::vector< intm_updatedTypes
 
std::vector< PerViewIdDatam_updatedTypesPerViewId
 

Additional Inherited Members

- Protected Member Functions inherited from Idle
virtual sal_uInt64 UpdateMinPeriod (sal_uInt64 nTimeNow) const override
 
 Idle (bool bAuto, const char *pDebugName)
 
- Protected Member Functions inherited from Timer
virtual void SetDeletionFlags () override
 
 Timer (bool bAuto, const char *pDebugName)
 
- Protected Member Functions inherited from Task
const ImplSchedulerDataGetSchedulerData () const
 
- Static Protected Member Functions inherited from Task
static void StartTimer (sal_uInt64 nMS)
 

Detailed Description

A helper to convert SfxLokCallbackInterface to a LIbreOfficeKitCallback for tests.

It reimplements the specialized callbacks and converts them to the generic type/payload callback.

Definition at line 26 of file lokcallback.hxx.

Constructor & Destructor Documentation

TestLokCallbackWrapper::TestLokCallbackWrapper ( LibreOfficeKitCallback  callback,
void data 
)

Definition at line 18 of file lokcallback.cxx.

References Task::SetPriority().

Member Function Documentation

void TestLokCallbackWrapper::callCallback ( int  nType,
const char *  pPayload,
int  nViewId 
)
inlineprivate
void TestLokCallbackWrapper::clear ( )

Discard all possibly still held events.

Definition at line 28 of file lokcallback.cxx.

References m_updatedTypes, m_updatedTypesPerViewId, and m_viewId.

void TestLokCallbackWrapper::discardUpdatedTypes ( int  nType,
int  nViewId 
)
private
void TestLokCallbackWrapper::flushLOKData ( )
private
void TestLokCallbackWrapper::Invoke ( )
overridevirtual

Reimplemented from Timer.

Definition at line 172 of file lokcallback.cxx.

References flushLOKData(), SfxViewShell::GetFirst(), and SfxViewShell::GetNext().

void TestLokCallbackWrapper::libreOfficeKitViewCallback ( int  nType,
const char *  pPayload 
)
overridevirtual

Implements SfxLokCallbackInterface.

Definition at line 50 of file lokcallback.cxx.

References callCallback(), and NO_VIEWID.

Referenced by flushLOKData().

void TestLokCallbackWrapper::libreOfficeKitViewCallbackWithViewId ( int  nType,
const char *  pPayload,
int  nViewId 
)
overridevirtual

Implements SfxLokCallbackInterface.

Definition at line 55 of file lokcallback.cxx.

References callCallback().

Referenced by flushLOKData().

void TestLokCallbackWrapper::libreOfficeKitViewInvalidateTilesCallback ( const tools::Rectangle pRect,
int  nPart 
)
overridevirtual
void TestLokCallbackWrapper::libreOfficeKitViewUpdatedCallback ( int  nType)
overridevirtual

Implements SfxLokCallbackInterface.

Definition at line 84 of file lokcallback.cxx.

References m_updatedTypes, and startTimer().

void TestLokCallbackWrapper::libreOfficeKitViewUpdatedCallbackPerViewId ( int  nType,
int  nViewId,
int  nSourceViewId 
)
overridevirtual

Implements SfxLokCallbackInterface.

Definition at line 93 of file lokcallback.cxx.

References data, m_updatedTypesPerViewId, and startTimer().

void TestLokCallbackWrapper::setLOKViewId ( int  viewId)
inline

Set the view id of the associated SfxViewShell.

Definition at line 33 of file lokcallback.hxx.

void TestLokCallbackWrapper::startTimer ( )
inlineprivate

Member Data Documentation

LibreOfficeKitCallback TestLokCallbackWrapper::m_callback
private

Definition at line 49 of file lokcallback.hxx.

Referenced by callCallback().

void* TestLokCallbackWrapper::m_data
private

Definition at line 50 of file lokcallback.hxx.

Referenced by callCallback().

std::vector<int> TestLokCallbackWrapper::m_updatedTypes
private
std::vector<PerViewIdData> TestLokCallbackWrapper::m_updatedTypesPerViewId
private
int TestLokCallbackWrapper::m_viewId = -1
private

Definition at line 51 of file lokcallback.hxx.

Referenced by clear(), and flushLOKData().


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