diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-09-16 09:30:41 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-09-21 07:30:20 +0200 |
commit | 46588c42a546d4517b773853856b9c8f8c2e5ece (patch) | |
tree | ee35d297a358b2f28a388003e48920d7929535b9 /include | |
parent | 855e1bac1d5155352706c7d849942f5dc453c67d (diff) |
lok::Document: add get/setView()
Change-Id: Ic3bce8f01d7e048e853c063c4bce1255845c60d0
Diffstat (limited to 'include')
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.h | 4 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.hxx | 20 | ||||
-rw-r--r-- | include/sfx2/lokhelper.hxx | 4 |
3 files changed, 27 insertions, 1 deletions
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(); |