From 46588c42a546d4517b773853856b9c8f8c2e5ece Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 16 Sep 2015 09:30:41 +0200 Subject: lok::Document: add get/setView() Change-Id: Ic3bce8f01d7e048e853c063c4bce1255845c60d0 --- include/LibreOfficeKit/LibreOfficeKit.h | 4 ++++ include/LibreOfficeKit/LibreOfficeKit.hxx | 20 +++++++++++++++++++- include/sfx2/lokhelper.hxx | 4 ++++ 3 files changed, 27 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index 7f41d13ff393..18f4b3edc624 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -170,6 +170,10 @@ struct _LibreOfficeKitDocumentClass int (*createView) (LibreOfficeKitDocument* pThis); /// @see lok::Document::destroyView(). void (*destroyView) (LibreOfficeKitDocument* pThis, int nId); + /// @see lok::Document::setView(). + void (*setView) (LibreOfficeKitDocument* pThis, int nId); + /// @see lok::Document::getView(). + int (*getView) (LibreOfficeKitDocument* pThis); #endif // LOK_USE_UNSTABLE_API }; diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index 3e1a0ac20b07..f5821b71191a 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -269,13 +269,31 @@ public: } /** - * Destroy a view of an existring document. + * Destroy a view of an existing document. * @param nId a view ID, returned by createView(). */ void destroyView(int nId) { mpDoc->pClass->destroyView(mpDoc, nId); } + + /** + * Set an existing view of an existing document as current. + * @param nId a view ID, returned by createView(). + */ + void setView(int nId) + { + mpDoc->pClass->setView(mpDoc, nId); + } + + /** + * Get the current view. + * @return a view ID, previously returned by createView(). + */ + int getView() + { + return mpDoc->pClass->getView(mpDoc); + } #endif // LOK_USE_UNSTABLE_API }; diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx index b57cb7d75b23..a05cd5d4b210 100644 --- a/include/sfx2/lokhelper.hxx +++ b/include/sfx2/lokhelper.hxx @@ -21,6 +21,10 @@ public: static int createView(SfxViewShell* pViewShell); /// Destroy a view shell from the global shell list. static void destroyView(size_t nId); + /// Set a view shell as current one. + static void setView(size_t nId); + /// Get the currently active view. + static size_t getView(); /// Total number of view shells. static int getViews(); -- cgit