MyScript Interactive Ink SDK 4.3.0
IGestureHandler.h
1// Copyright @ MyScript. All rights reserved.
2
3#pragma once
4
5#include <iink/Engine.h>
6#include <iink/ToolController.h>
7
8#include <memory>
9
10namespace myscript {
11namespace iink {
12
13class Editor;
14class ContentSelection;
15
21enum class GestureAction
22{
26 IGNORE,
29};
30
37{
41 APPLIED,
44};
45
52{
53public:
54 virtual ~IGestureHandler() = default;
55
66 virtual GestureAction onTap(std::shared_ptr<Editor> editor, PointerTool tool, const String& gestureStrokeId, float x, float y) = 0;
67
78 virtual GestureAction onDoubleTap(std::shared_ptr<Editor> editor, PointerTool tool, const std::vector<String>& gestureStrokeIds, float x, float y) = 0;
79
90 virtual GestureAction onLongPress(std::shared_ptr<Editor> editor, PointerTool tool, const String& gestureStrokeId, float x, float y) = 0;
91
104 virtual GestureAction onUnderline(std::shared_ptr<Editor> editor, PointerTool tool, const String& gestureStrokeId, std::shared_ptr<ContentSelection> selection) = 0;
105
118 virtual GestureAction onSurround(std::shared_ptr<Editor> editor, PointerTool tool, const String& gestureStrokeId, std::shared_ptr<ContentSelection> selection) = 0;
119
134 virtual GestureAction onJoin(std::shared_ptr<Editor> editor, PointerTool tool, const String& gestureStrokeId, std::shared_ptr<ContentSelection> before, std::shared_ptr<ContentSelection> after) = 0;
135
150 virtual GestureAction onInsert(std::shared_ptr<Editor> editor, PointerTool tool, const String& gestureStrokeId, std::shared_ptr<ContentSelection> before, std::shared_ptr<ContentSelection> after) = 0;
151
164 virtual GestureAction onStrikethrough(std::shared_ptr<Editor> editor, PointerTool tool, const String& gestureStrokeId, std::shared_ptr<ContentSelection> selection) = 0;
165
178 virtual GestureAction onScratch(std::shared_ptr<Editor> editor, PointerTool tool, const String& gestureStrokeId, std::shared_ptr<ContentSelection> selection) = 0;
179
193 virtual void onShapeOnHold(std::shared_ptr<Editor> editor, PointerTool tool, const String& gestureStrokeId, ShapeOnHoldAction action, const String& shapeJiix) {}
194};
195
196}
197}
Definition: IGestureHandler.h:52
virtual ~IGestureHandler()=default
virtual GestureAction onUnderline(std::shared_ptr< Editor > editor, PointerTool tool, const String &gestureStrokeId, std::shared_ptr< ContentSelection > selection)=0
virtual GestureAction onTap(std::shared_ptr< Editor > editor, PointerTool tool, const String &gestureStrokeId, float x, float y)=0
virtual GestureAction onStrikethrough(std::shared_ptr< Editor > editor, PointerTool tool, const String &gestureStrokeId, std::shared_ptr< ContentSelection > selection)=0
virtual GestureAction onLongPress(std::shared_ptr< Editor > editor, PointerTool tool, const String &gestureStrokeId, float x, float y)=0
virtual void onShapeOnHold(std::shared_ptr< Editor > editor, PointerTool tool, const String &gestureStrokeId, ShapeOnHoldAction action, const String &shapeJiix)
Definition: IGestureHandler.h:193
virtual GestureAction onScratch(std::shared_ptr< Editor > editor, PointerTool tool, const String &gestureStrokeId, std::shared_ptr< ContentSelection > selection)=0
virtual GestureAction onDoubleTap(std::shared_ptr< Editor > editor, PointerTool tool, const std::vector< String > &gestureStrokeIds, float x, float y)=0
virtual GestureAction onJoin(std::shared_ptr< Editor > editor, PointerTool tool, const String &gestureStrokeId, std::shared_ptr< ContentSelection > before, std::shared_ptr< ContentSelection > after)=0
virtual GestureAction onSurround(std::shared_ptr< Editor > editor, PointerTool tool, const String &gestureStrokeId, std::shared_ptr< ContentSelection > selection)=0
virtual GestureAction onInsert(std::shared_ptr< Editor > editor, PointerTool tool, const String &gestureStrokeId, std::shared_ptr< ContentSelection > before, std::shared_ptr< ContentSelection > after)=0
Definition: String.h:17
ShapeOnHoldAction
Definition: IGestureHandler.h:37
GestureAction
Definition: IGestureHandler.h:22
PointerTool
Definition: ToolController.h:15
Definition: Configuration.h:10