12#include <LibreOfficeKit/LibreOfficeKitEnums.h>
13#include <rtl/strbuf.hxx>
19 :
Idle(
"TestLokCallbackWrapper flush timer")
20 , m_callback(callback)
64 OStringBuffer buf(64);
72 buf.append(
static_cast<sal_Int32
>(nPart));
74 buf.append(
static_cast<sal_Int32
>(nMode));
101 auto it = std::find_if(l.begin(), l.end(), [data](
const PerViewIdData& other) {
102 return data.type == other.type && data.viewId == other.viewId;
129 bool allViewIds =
false;
132 if (
nType == LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR
137 if (it->type ==
nType && (allViewIds || it->viewId == nViewId))
153 assert(viewShell !=
nullptr);
155 std::vector<int> updatedTypes;
157 std::vector<PerViewIdData> updatedTypesPerViewId;
160 for (
int type : updatedTypes)
169 return shell->GetViewShellId().
get() == data.sourceViewId;
171 assert(viewShell !=
nullptr);
172 std::optional<OString> payload = viewShell->
getLOKPayload(data.type, data.viewId);
184 viewShell->flushPendingLOKInvalidateTiles();
virtual void Start(bool bStartTimer=true) override
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetNext(const SfxViewShell &rPrev, bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
static SAL_WARN_UNUSED_RESULT SfxViewShell * GetFirst(bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
virtual std::optional< OString > getLOKPayload(int nType, int nViewId) const
void SetPriority(TaskPriority ePriority)
virtual void libreOfficeKitViewUpdatedCallback(int nType) override
virtual void libreOfficeKitViewUpdatedCallbackPerViewId(int nType, int nViewId, int nSourceViewId) override
void discardUpdatedTypes(int nType, int nViewId)
virtual void libreOfficeKitViewCallbackWithViewId(int nType, const char *pPayload, int nViewId) override
virtual void Invoke() override
virtual void libreOfficeKitViewInvalidateTilesCallback(const tools::Rectangle *pRect, int nPart, int nMode) override
std::vector< int > m_updatedTypes
virtual void libreOfficeKitViewCallback(int nType, const char *pPayload) override
TestLokCallbackWrapper(LibreOfficeKitCallback callback, void *data)
void callCallback(int nType, const char *pPayload, int nViewId)
LibreOfficeKitCallback m_callback
void clear()
Discard all possibly still held events.
virtual void libreOfficeKitViewAddPendingInvalidateTiles() override
std::vector< PerViewIdData > m_updatedTypesPerViewId
bool isPartInInvalidation()
bool isViewIdForVisCursorInvalidation()
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)