LibreOffice Module desktop (master)  1
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
desktop::CallbackFlushHandler Class Referencefinal

#include <init.hxx>

Inheritance diagram for desktop::CallbackFlushHandler:
[legend]
Collaboration diagram for desktop::CallbackFlushHandler:
[legend]

Classes

struct  CallbackData
 
struct  PerViewIdData
 
class  TimeoutIdle
 

Public Member Functions

 CallbackFlushHandler (LibreOfficeKitDocument *pDocument, LibreOfficeKitCallback pCallback, void *pData)
 
virtual ~CallbackFlushHandler () override
 
virtual void Invoke () override
 
void queue (const int type, const char *data)
 
void disableCallbacks ()
 Disables callbacks on this handler. More...
 
void enableCallbacks ()
 Enables callbacks on this handler. More...
 
bool callbacksDisabled () const
 Returns true iff callbacks are disabled. More...
 
void addViewStates (int viewId)
 
void removeViewStates (int viewId)
 
void setViewId (int viewId)
 
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
 
- 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
 
- Public Member Functions inherited from SfxLokCallbackInterface
virtual ~SfxLokCallbackInterface ()
 

Private Types

typedef std::vector< intqueue_type1
 
typedef std::vector< CallbackDataqueue_type2
 

Private Member Functions

bool removeAll (int type)
 
bool removeAll (int type, const std::function< bool(const CallbackData &)> &rTestFunc)
 
bool processInvalidateTilesEvent (int type, CallbackData &aCallbackData)
 
bool processWindowEvent (int type, CallbackData &aCallbackData)
 
queue_type2::iterator toQueue2 (queue_type1::iterator)
 
queue_type2::reverse_iterator toQueue2 (queue_type1::reverse_iterator)
 
void queue (const int type, CallbackData &data)
 
void enqueueUpdatedTypes ()
 
void enqueueUpdatedType (int type, const SfxViewShell *sourceViewShell, int viewId)
 
void setUpdatedType (int nType, bool value)
 
void setUpdatedTypePerViewId (int nType, int nViewId, int nSourceViewId, bool value)
 
void resetUpdatedType (int nType)
 
void resetUpdatedTypePerViewId (int nType, int nViewId)
 

Private Attributes

queue_type1 m_queue1
 we frequently want to scan the queue, and mostly when we do so, we only care about the element type so we split the queue in 2 to make the scanning cache friendly. More...
 
queue_type2 m_queue2
 
std::map< int, std::string > m_states
 
std::unordered_map< int, std::unordered_map< int, std::string > > m_viewStates
 
std::vector< bool > m_updatedTypes
 
boost::container::flat_map< int, std::vector< PerViewIdData > > m_updatedTypesPerViewId
 
LibreOfficeKitDocument * m_pDocument
 
int m_viewId = -1
 
LibreOfficeKitCallback m_pCallback
 
voidm_pData
 
int m_nDisableCallbacks
 
std::mutex m_mutex
 
TimeoutIdle m_TimeoutIdle
 

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

Definition at line 90 of file init.hxx.

Member Typedef Documentation

typedef std::vector<int> desktop::CallbackFlushHandler::queue_type1
private

Definition at line 176 of file init.hxx.

Definition at line 177 of file init.hxx.

Constructor & Destructor Documentation

CallbackFlushHandler::CallbackFlushHandler ( LibreOfficeKitDocument *  pDocument,
LibreOfficeKitCallback  pCallback,
void pData 
)
explicit

Definition at line 1464 of file init.cxx.

References m_states, and Task::SetPriority().

CallbackFlushHandler::~CallbackFlushHandler ( )
overridevirtual

Definition at line 1489 of file init.cxx.

References Task::Stop().

Member Function Documentation

void CallbackFlushHandler::addViewStates ( int  viewId)

Definition at line 2346 of file init.cxx.

References m_viewStates.

bool desktop::CallbackFlushHandler::callbacksDisabled ( ) const
inline

Returns true iff callbacks are disabled.

Definition at line 106 of file init.hxx.

Referenced by queue().

void desktop::CallbackFlushHandler::disableCallbacks ( )
inline

Disables callbacks on this handler.

Must match with identical count of enableCallbacks. Used during painting and changing views.

Definition at line 101 of file init.hxx.

void desktop::CallbackFlushHandler::enableCallbacks ( )
inline

Enables callbacks on this handler.

Must match with identical count of disableCallbacks. Used during painting and changing views.

Definition at line 104 of file init.hxx.

void CallbackFlushHandler::enqueueUpdatedType ( int  type,
const SfxViewShell sourceViewShell,
int  viewId 
)
private

Definition at line 2213 of file init.cxx.

References SfxViewShell::getLOKPayload(), ignore, m_queue1, m_queue2, and SAL_INFO.

Referenced by enqueueUpdatedTypes().

void CallbackFlushHandler::enqueueUpdatedTypes ( )
private
void CallbackFlushHandler::Invoke ( )
overridevirtual
void CallbackFlushHandler::libreOfficeKitViewCallback ( int  nType,
const char *  pPayload 
)
overridevirtual

Implements SfxLokCallbackInterface.

Definition at line 1548 of file init.cxx.

References queue().

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

Implements SfxLokCallbackInterface.

Definition at line 1554 of file init.cxx.

References queue().

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

Implements SfxLokCallbackInterface.

Definition at line 1560 of file init.cxx.

References queue().

void CallbackFlushHandler::libreOfficeKitViewUpdatedCallback ( int  nType)
overridevirtual

Implements SfxLokCallbackInterface.

Definition at line 1566 of file init.cxx.

References isUpdatedType(), lock(), m_mutex, SAL_INFO, and setUpdatedType().

void CallbackFlushHandler::libreOfficeKitViewUpdatedCallbackPerViewId ( int  nType,
int  nViewId,
int  nSourceViewId 
)
overridevirtual
bool CallbackFlushHandler::processInvalidateTilesEvent ( int  type,
CallbackData aCallbackData 
)
private
bool CallbackFlushHandler::processWindowEvent ( int  type,
CallbackData aCallbackData 
)
private
void CallbackFlushHandler::queue ( const int  type,
const char *  data 
)
void CallbackFlushHandler::queue ( const int  type,
CallbackData data 
)
private
bool CallbackFlushHandler::removeAll ( int  type)
private

Definition at line 2308 of file init.cxx.

References m_queue1, m_queue2, and toQueue2().

Referenced by processInvalidateTilesEvent(), processWindowEvent(), and queue().

bool CallbackFlushHandler::removeAll ( int  type,
const std::function< bool(const CallbackData &)> &  rTestFunc 
)
private

Definition at line 2324 of file init.cxx.

References m_queue1, m_queue2, and toQueue2().

void CallbackFlushHandler::removeViewStates ( int  viewId)

Definition at line 2355 of file init.cxx.

References m_viewStates.

void CallbackFlushHandler::resetUpdatedType ( int  nType)
private

Definition at line 1514 of file init.cxx.

References setUpdatedType().

Referenced by queue().

void CallbackFlushHandler::resetUpdatedTypePerViewId ( int  nType,
int  nViewId 
)
private
void CallbackFlushHandler::setUpdatedType ( int  nType,
bool  value 
)
private
void CallbackFlushHandler::setUpdatedTypePerViewId ( int  nType,
int  nViewId,
int  nSourceViewId,
bool  value 
)
private
void desktop::CallbackFlushHandler::setViewId ( int  viewId)
inline

Definition at line 111 of file init.hxx.

queue_type2::iterator desktop::CallbackFlushHandler::toQueue2 ( queue_type1::iterator  )
private
queue_type2::reverse_iterator desktop::CallbackFlushHandler::toQueue2 ( queue_type1::reverse_iterator  )
private

Member Data Documentation

std::mutex desktop::CallbackFlushHandler::m_mutex
private
int desktop::CallbackFlushHandler::m_nDisableCallbacks
private

Definition at line 219 of file init.hxx.

LibreOfficeKitCallback desktop::CallbackFlushHandler::m_pCallback
private

Definition at line 217 of file init.hxx.

Referenced by Invoke().

void* desktop::CallbackFlushHandler::m_pData
private

Definition at line 218 of file init.hxx.

Referenced by Invoke().

LibreOfficeKitDocument* desktop::CallbackFlushHandler::m_pDocument
private

Definition at line 215 of file init.hxx.

Referenced by processWindowEvent(), and queue().

queue_type1 desktop::CallbackFlushHandler::m_queue1
private

we frequently want to scan the queue, and mostly when we do so, we only care about the element type so we split the queue in 2 to make the scanning cache friendly.

Definition at line 191 of file init.hxx.

Referenced by enqueueUpdatedType(), Invoke(), processInvalidateTilesEvent(), processWindowEvent(), queue(), and removeAll().

queue_type2 desktop::CallbackFlushHandler::m_queue2
private

Definition at line 192 of file init.hxx.

Referenced by enqueueUpdatedType(), Invoke(), processWindowEvent(), queue(), and removeAll().

std::map<int, std::string> desktop::CallbackFlushHandler::m_states
private

Definition at line 193 of file init.hxx.

Referenced by CallbackFlushHandler(), and Invoke().

TimeoutIdle desktop::CallbackFlushHandler::m_TimeoutIdle
private

Definition at line 229 of file init.hxx.

Referenced by Invoke(), and queue().

std::vector<bool> desktop::CallbackFlushHandler::m_updatedTypes
private

Definition at line 206 of file init.hxx.

Referenced by enqueueUpdatedTypes(), and setUpdatedType().

boost::container::flat_map<int, std::vector<PerViewIdData> > desktop::CallbackFlushHandler::m_updatedTypesPerViewId
private
int desktop::CallbackFlushHandler::m_viewId = -1
private

Definition at line 216 of file init.hxx.

Referenced by enqueueUpdatedTypes(), and Invoke().

std::unordered_map<int, std::unordered_map<int, std::string> > desktop::CallbackFlushHandler::m_viewStates
private

Definition at line 194 of file init.hxx.

Referenced by addViewStates(), Invoke(), and removeViewStates().


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