12#include <LibreOfficeKit/LibreOfficeKitEnums.h>
13#include <rtl/strbuf.hxx>
19 :
Idle(
"TestLokCallbackWrapper flush timer")
20 , m_callback(callback)
56 const rtl::OString& pPayload,
65 OStringBuffer buf(64);
72 buf.append(
", " + OString::number(
static_cast<sal_Int32
>(nPart)) +
", "
73 + OString::number(
static_cast<sal_Int32
>(nMode)));
100 auto it = std::find_if(l.begin(), l.end(), [data](
const PerViewIdData& other) {
101 return data.type == other.type && data.viewId == other.viewId;
128 bool allViewIds =
false;
131 if (
nType == LOK_CALLBACK_INVALIDATE_VISIBLE_CURSOR
136 if (it->type ==
nType && (allViewIds || it->viewId == nViewId))
152 assert(viewShell !=
nullptr);
154 std::vector<int> updatedTypes;
156 std::vector<PerViewIdData> updatedTypesPerViewId;
159 for (
int type : updatedTypes)
168 return shell->GetViewShellId().
get() == data.sourceViewId;
170 assert(viewShell !=
nullptr);
171 std::optional<OString> payload = viewShell->
getLOKPayload(data.type, data.viewId);
183 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 libreOfficeKitViewCallback(int nType, const rtl::OString &pPayload) override
virtual void libreOfficeKitViewUpdatedCallback(int nType) override
virtual void libreOfficeKitViewUpdatedCallbackPerViewId(int nType, int nViewId, int nSourceViewId) override
void discardUpdatedTypes(int nType, int nViewId)
virtual void Invoke() override
virtual void libreOfficeKitViewInvalidateTilesCallback(const tools::Rectangle *pRect, int nPart, int nMode) override
std::vector< int > m_updatedTypes
TestLokCallbackWrapper(LibreOfficeKitCallback callback, void *data)
void callCallback(int nType, const char *pPayload, int nViewId)
virtual void libreOfficeKitViewCallbackWithViewId(int nType, const rtl::OString &pPayload, int nViewId) override
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)