From 24f8446c9e7d1a0ea01cc11ca87abf85ba43342d Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Fri, 18 Oct 2013 15:15:29 +0300 Subject: Work in progress: Text selection handling for iOS Change-Id: I31c6bcb9a4b26653d439601f78d71fd94d938eeb --- include/touch/touch.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'include') diff --git a/include/touch/touch.h b/include/touch/touch.h index c8af48edabc8..11440f16062b 100644 --- a/include/touch/touch.h +++ b/include/touch/touch.h @@ -18,8 +18,24 @@ #if !HAVE_FEATURE_DESKTOP +// Let's try this way: Use Quartz 2D types for iOS, and LO's basegfx +// types for others, when/if this API is used for others. But of +// course, it is quite likely that some degree of redesign is needed +// at such a stage anyway... + +#ifdef IOS +#include +#include +#include +#else +#include +#endif + #ifdef __cplusplus extern "C" { +#if 0 +} // To avoid an editor indenting all inside the extern "C" +#endif #endif // These functions are the interface between the upper GUI layers of a @@ -41,6 +57,31 @@ void touch_ui_show_keyboard(); void touch_ui_hide_keyboard(); bool touch_ui_keyboard_visible(); +typedef enum { + MLOSelectionNone, + MLOSelectionText, + MLOSelectionGraphic +} MLOSelectionKind; + +#ifdef IOS +typedef CGRect MLORect; +#else +typedef basegfx::B2IBox MLORect; +#endif + +void touch_ui_selection_start(MLOSelectionKind kind, + const void *documentHandle, + MLORect *rectangles, + int rectangleCount, + void *preview); + +void touch_ui_selection_resize_done(bool success, + const void *documentHandle, + MLORect *rectangles, + int rectangleCount); + +void touch_ui_selection_none(); + // 2) Those implmented in the lower layers to be called by the upper // layer, in cases where we don't want to include a bunch of the // "normal" LibreOffice C++ headers in an otherwise purely Objective-C @@ -69,6 +110,10 @@ typedef enum { DOWN, MOVE, UP} MLOMouseButtonState; void touch_lo_mouse_drag(int x, int y, MLOMouseButtonState state); +void touch_lo_selection_attempt_resize(const void *documentHandle, + MLORect *selectedRectangles, + int numberOfRectangles); + #ifdef __cplusplus } #endif -- cgit v1.2.3