diff options
author | Jan Holesovsky <kendy@collabora.com> | 2015-02-17 17:12:45 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2015-02-17 17:14:39 +0100 |
commit | 7a17c038a6f4c433a69c6c1ed04aca2e5c929027 (patch) | |
tree | 8ea72ae97962cbbf73fc7108c5ba3c52be5e5667 | |
parent | fc4ba6d31a0d30c4d8bad37c2955cf6609ea5cd6 (diff) |
LOK: Add support for documentLoadWithOptions also to LibreOfficeKit.hxx.
Change-Id: I89f018f524aad84f59372f1be76a8522010345f8
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.h | 2 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.hxx | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index 7cbaad38d5ec..ce1e63698686 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -146,7 +146,9 @@ struct _LibreOfficeKitClass LibreOfficeKitDocument* (*documentLoadWithOptions) (LibreOfficeKit* pThis, const char* pURL, const char* pOptions); +#ifdef LOK_USE_UNSTABLE_API void (*postKeyEvent) (LibreOfficeKit* pThis, int nType, int nCode); +#endif // LOK_USE_UNSTABLE_API }; #define LIBREOFFICEKIT_DOCUMENT_HAS(pDoc,member) LIBREOFFICEKIT_HAS_MEMBER(LibreOfficeKitDocumentClass,member,(pDoc)->pClass->nSize) diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index ef365ce04f4e..74c8533d980d 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -147,11 +147,18 @@ public: mpThis->pClass->destroy(mpThis); } - inline Document* documentLoad(const char* pUrl) + inline Document* documentLoad(const char* pUrl, const char* pFilterOptions = NULL) { - LibreOfficeKitDocument* pDoc = mpThis->pClass->documentLoad(mpThis, pUrl); + LibreOfficeKitDocument* pDoc = NULL; + + if (LIBREOFFICEKIT_HAS(mpThis, documentLoadWithOptions)) + pDoc = mpThis->pClass->documentLoadWithOptions(mpThis, pUrl, pFilterOptions); + else + pDoc = mpThis->pClass->documentLoad(mpThis, pUrl); + if (pDoc == NULL) return NULL; + return new Document(pDoc); } @@ -161,6 +168,7 @@ public: return mpThis->pClass->getError(mpThis); } +#ifdef LOK_USE_UNSTABLE_API /** * Posts a keyboard event to the focused frame. * @@ -171,6 +179,7 @@ public: { mpThis->pClass->postKeyEvent(mpThis, nType, nCode); } +#endif // LOK_USE_UNSTABLE_API }; inline Office* lok_cpp_init(const char* pInstallPath) |