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 rtl::OString &pPayload) override
 
virtual void libreOfficeKitViewCallbackWithViewId (int nType, const rtl::OString &pPayload, int nViewId) override
 
virtual void libreOfficeKitViewInvalidateTilesCallback (const tools::Rectangle *pRect, int nPart, int nMode) override
 
virtual void libreOfficeKitViewUpdatedCallback (int nType) override
 
virtual void libreOfficeKitViewUpdatedCallbackPerViewId (int nType, int nViewId, int nSourceViewId) override
 
virtual void libreOfficeKitViewAddPendingInvalidateTiles () override
 
virtual void dumpState (rtl::OStringBuffer &) override
 
virtual void Invoke () override
 
- Public Member Functions inherited from SfxLokCallbackInterface
virtual ~SfxLokCallbackInterface ()
 
virtual void libreOfficeKitViewCallback (int nType, const rtl::OString &pPayload)=0
 
virtual void libreOfficeKitViewCallbackWithViewId (int nType, const rtl::OString &pPayload, int nViewId)=0
 
virtual void libreOfficeKitViewInvalidateTilesCallback (const tools::Rectangle *pRect, int nPart, int nMode)=0
 
virtual void libreOfficeKitViewUpdatedCallback (int nType)=0
 
virtual void libreOfficeKitViewUpdatedCallbackPerViewId (int nType, int nViewId, int nSourceViewId)=0
 
virtual void libreOfficeKitViewAddPendingInvalidateTiles ()=0
 
virtual void dumpState (rtl::OStringBuffer &rState)=0
 
- 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)
 
virtual void Invoke () override
 
void Invoke (Timer *arg)
 
void SetInvokeHandler (const Link< Timer *, void > &rLink)
 
void ClearInvokeHandler ()
 
void SetTimeout (sal_uInt64 nTimeoutMs)
 
sal_uInt64 GetTimeout () const
 
virtual void Start (bool bStartTimer=true) override
 
- 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
 
virtual void Invoke ()=0
 
virtual void Start (bool bStartTimer=true)
 
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
 
void * m_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
 
virtual sal_uInt64 UpdateMinPeriod (sal_uInt64 nTimeNow) const override
 
 Timer (bool bAuto, const char *pDebugName)
 
- Protected Member Functions inherited from Task
const ImplSchedulerDataGetSchedulerData () const
 
virtual void SetDeletionFlags ()
 
virtual sal_uInt64 UpdateMinPeriod (sal_uInt64 nTimeNow) const=0
 
- 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::TestLokCallbackWrapper ( LibreOfficeKitCallback  callback,
void *  data 
)

Definition at line 18 of file lokcallback.cxx.

References Task::SetPriority().

Member Function Documentation

◆ callCallback()

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

◆ clear()

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.

◆ discardUpdatedTypes()

void TestLokCallbackWrapper::discardUpdatedTypes ( int  nType,
int  nViewId 
)
private

◆ dumpState()

virtual void TestLokCallbackWrapper::dumpState ( rtl::OStringBuffer &  )
inlineoverridevirtual

Implements SfxLokCallbackInterface.

Definition at line 43 of file lokcallback.hxx.

◆ flushLOKData()

void TestLokCallbackWrapper::flushLOKData ( )
private

◆ Invoke()

void TestLokCallbackWrapper::Invoke ( )
overridevirtual

Reimplemented from Timer.

Definition at line 177 of file lokcallback.cxx.

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

◆ libreOfficeKitViewAddPendingInvalidateTiles()

void TestLokCallbackWrapper::libreOfficeKitViewAddPendingInvalidateTiles ( )
overridevirtual

Implements SfxLokCallbackInterface.

Definition at line 110 of file lokcallback.cxx.

References startTimer().

◆ libreOfficeKitViewCallback()

void TestLokCallbackWrapper::libreOfficeKitViewCallback ( int  nType,
const rtl::OString &  pPayload 
)
overridevirtual

Implements SfxLokCallbackInterface.

Definition at line 50 of file lokcallback.cxx.

References callCallback(), NO_VIEWID, and nType.

Referenced by flushLOKData().

◆ libreOfficeKitViewCallbackWithViewId()

void TestLokCallbackWrapper::libreOfficeKitViewCallbackWithViewId ( int  nType,
const rtl::OString &  pPayload,
int  nViewId 
)
overridevirtual

Implements SfxLokCallbackInterface.

Definition at line 55 of file lokcallback.cxx.

References callCallback(), and nType.

Referenced by flushLOKData().

◆ libreOfficeKitViewInvalidateTilesCallback()

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

◆ libreOfficeKitViewUpdatedCallback()

void TestLokCallbackWrapper::libreOfficeKitViewUpdatedCallback ( int  nType)
overridevirtual

Implements SfxLokCallbackInterface.

Definition at line 85 of file lokcallback.cxx.

References m_updatedTypes, nType, and startTimer().

◆ libreOfficeKitViewUpdatedCallbackPerViewId()

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

Implements SfxLokCallbackInterface.

Definition at line 94 of file lokcallback.cxx.

References m_updatedTypesPerViewId, nType, and startTimer().

◆ setLOKViewId()

void TestLokCallbackWrapper::setLOKViewId ( int  viewId)
inline

Set the view id of the associated SfxViewShell.

Definition at line 33 of file lokcallback.hxx.

◆ startTimer()

void TestLokCallbackWrapper::startTimer ( )
inlineprivate

Member Data Documentation

◆ m_callback

LibreOfficeKitCallback TestLokCallbackWrapper::m_callback
private

Definition at line 52 of file lokcallback.hxx.

Referenced by callCallback().

◆ m_data

void* TestLokCallbackWrapper::m_data
private

Definition at line 53 of file lokcallback.hxx.

Referenced by callCallback().

◆ m_updatedTypes

std::vector<int> TestLokCallbackWrapper::m_updatedTypes
private

◆ m_updatedTypesPerViewId

std::vector<PerViewIdData> TestLokCallbackWrapper::m_updatedTypesPerViewId
private

◆ m_viewId

int TestLokCallbackWrapper::m_viewId = -1
private

Definition at line 54 of file lokcallback.hxx.

Referenced by clear(), and flushLOKData().


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