diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-10 09:40:38 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-03-16 09:38:03 +0100 |
commit | 65726aae458d5af0e438dd8494a9812770c06186 (patch) | |
tree | 0d6e2efebb0bfc676d8f2bd70e6534367f2ab57e /include | |
parent | c08069f2d764c86533c6ea1a17e7437efe6471ac (diff) |
LOK: add lok::Document::setGraphicSelection() API and implement it for Writer
Change-Id: I115cf7e7978622d5108c4c792f7de861beb6efb6
Diffstat (limited to 'include')
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.h | 5 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.hxx | 12 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKitEnums.h | 25 | ||||
-rw-r--r-- | include/vcl/ITiledRenderable.hxx | 7 |
4 files changed, 49 insertions, 0 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index d4b79067640d..29f07b34df1d 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -137,6 +137,11 @@ struct _LibreOfficeKitDocumentClass int nType, int nX, int nY); + /// @see lok::Document::setGraphicSelection + void (*setGraphicSelection)(LibreOfficeKitDocument* pThis, + int nType, + int nX, + int nY); #endif // LOK_USE_UNSTABLE_API }; diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index a44238236699..2993193fb31e 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -141,6 +141,18 @@ public: { mpDoc->pClass->setTextSelection(mpDoc, nType, nX, nY); } + + /** + * Adjusts the graphic selection. + * + * @param nType @see LibreOfficeKitSetGraphicSelectionType + * @param nX horizontal position in document coordinates + * @param nY vertical position in document coordinates + */ + inline void setGraphicSelection(int nType, int nX, int nY) + { + mpDoc->pClass->setGraphicSelection(mpDoc, nType, nX, nY); + } #endif // LOK_USE_UNSTABLE_API }; diff --git a/include/LibreOfficeKit/LibreOfficeKitEnums.h b/include/LibreOfficeKit/LibreOfficeKitEnums.h index b8ab5f627619..671166e079ed 100644 --- a/include/LibreOfficeKit/LibreOfficeKitEnums.h +++ b/include/LibreOfficeKit/LibreOfficeKitEnums.h @@ -135,6 +135,31 @@ typedef enum } LibreOfficeKitSetTextSelectionType; +typedef enum +{ + /** + * A move or a resize action starts. It is assumed that there is a valid + * graphic selection (see LOK_CALLBACK_GRAPHIC_SELECTION) and the supplied + * coordinates are the ones the user tapped on. + * + * The type of the action is move by default, unless the coordinates are + * the position of a handle (see below), in which case it's a resize. + * + * There are 8 handles for a graphic selection: + * - top-left, top-center, top-right + * - middle-left, middle-right + * - bottom-left, bottom-center, bottom-right + */ + LOK_SETGRAPHICSELECTION_START, + /** + * A move or resize action stops. It is assumed that this is always used + * only after a LOK_SETTEXTSELECTION_START. The supplied coordinates are + * the ones where the user released the screen. + */ + LOK_SETGRAPHICSELECTION_END +} +LibreOfficeKitSetGraphicSelectionType; + #endif // LOK_USE_UNSTABLE_API #ifdef __cplusplus diff --git a/include/vcl/ITiledRenderable.hxx b/include/vcl/ITiledRenderable.hxx index ee903ada6584..7f63b1f7d681 100644 --- a/include/vcl/ITiledRenderable.hxx +++ b/include/vcl/ITiledRenderable.hxx @@ -115,6 +115,13 @@ public: * @see lok::Document::setTextSelection(). */ virtual void setTextSelection(int /*nType*/, int /*nX*/, int /*nY*/) { } + + /** + * Adjusts the graphic selection. + * + * @see lok::Document::setGraphicSelection(). + */ + virtual void setGraphicSelection(int /*nType*/, int /*nX*/, int /*nY*/) { } }; } // namespace vcl |