diff options
author | Jan Holesovsky <kendy@collabora.com> | 2017-12-12 18:13:03 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2017-12-19 17:23:01 +0100 |
commit | e16852cd1bc5d9e0646ae4183bc13a7bce19df7f (patch) | |
tree | 07e7ada37599b825459358b5fa89cc5b11b3bf9d /include | |
parent | 193ebf963cf251fd0885b47e59d9db11a97450f2 (diff) |
lokdialog: Allow windows / dialogs in different languages.
Change-Id: I9f32161981aed73e6d97696e5f976af276d1625a
Reviewed-on: https://gerrit.libreoffice.org/46327
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/46775
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.h | 3 | ||||
-rw-r--r-- | include/LibreOfficeKit/LibreOfficeKit.hxx | 11 | ||||
-rw-r--r-- | include/comphelper/lok.hxx | 7 | ||||
-rw-r--r-- | include/sfx2/lokhelper.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/viewsh.hxx | 5 |
5 files changed, 28 insertions, 0 deletions
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h index ed8b295b3f09..d42bd3434689 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.h +++ b/include/LibreOfficeKit/LibreOfficeKit.h @@ -297,6 +297,9 @@ struct _LibreOfficeKitDocumentClass int nButtons, int nModifier); + /// @see lok::Document::setViewLanguage(). + void (*setViewLanguage) (LibreOfficeKitDocument* pThis, int nId, const char* language); + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/include/LibreOfficeKit/LibreOfficeKit.hxx b/include/LibreOfficeKit/LibreOfficeKit.hxx index 835710e07e91..310b9cfcee88 100644 --- a/include/LibreOfficeKit/LibreOfficeKit.hxx +++ b/include/LibreOfficeKit/LibreOfficeKit.hxx @@ -526,6 +526,17 @@ public: return mpDoc->pClass->getViewIds(mpDoc, pArray, nSize); } + /** + * Set the language tag of the window with the specified nId. + * + * @param nId a view ID, returned by createView(). + * @param language Bcp47 languageTag, like en-US or so. + */ + void setViewLanguage(int nId, const char* language) + { + mpDoc->pClass->setViewLanguage(mpDoc, nId, language); + } + #endif // defined LOK_USE_UNSTABLE_API || defined LIBO_INTERNAL_ONLY }; diff --git a/include/comphelper/lok.hxx b/include/comphelper/lok.hxx index c42a740822e0..e9634e77d6f9 100644 --- a/include/comphelper/lok.hxx +++ b/include/comphelper/lok.hxx @@ -12,6 +12,8 @@ #include <comphelper/comphelperdllapi.h> +#include <i18nlangtag/languagetag.hxx> + // Interface between the LibreOfficeKit implementation called by LibreOfficeKit clients and other // LibreOffice code. @@ -65,6 +67,11 @@ COMPHELPER_DLLPUBLIC void setRangeHeaders(bool bTiledAnnotations); /// Check if range based header data is enabled COMPHELPER_DLLPUBLIC bool isRangeHeaders(); +/// Update the current LOK's language. +COMPHELPER_DLLPUBLIC void setLanguageTag(const LanguageTag& languageTag); +/// Get the current LOK's language. +COMPHELPER_DLLPUBLIC const LanguageTag& getLanguageTag(); + // Status indicator handling. Even if in theory there could be several status indicators active at // the same time, in practice there is only one at a time, so we don't handle any identification of // status indicator in this API. diff --git a/include/sfx2/lokhelper.hxx b/include/sfx2/lokhelper.hxx index 52c9b9763eae..b2b6f9f09977 100644 --- a/include/sfx2/lokhelper.hxx +++ b/include/sfx2/lokhelper.hxx @@ -34,6 +34,8 @@ public: static std::size_t getViewsCount(); /// Get viewIds of all existing views. static bool getViewIds(int* pArray, size_t nSize); + /// Set language of the given view. + static void setViewLanguage(int nId, const OUString& rBcp47LanguageTag); /// Iterate over any view shell, except pThisViewShell, passing it to the f function. template<typename ViewShellType, typename FunctionType> static void forEachOtherView(ViewShellType* pThisViewShell, FunctionType f); diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx index 988e1d3490ec..0c83f5faee15 100644 --- a/include/sfx2/viewsh.hxx +++ b/include/sfx2/viewsh.hxx @@ -153,6 +153,7 @@ friend class SfxPrinterController; VclPtr<vcl::Window> pWindow; bool bNoNewWindow; bool mbPrinterSettingsModified; + LanguageTag maLOKLanguageTag; protected: virtual void Activate(bool IsMDIActivate) override; @@ -342,6 +343,10 @@ public: /// See OutlinerViewShell::GetEditWindowForActiveOLEObj(). virtual vcl::Window* GetEditWindowForActiveOLEObj() const override; + /// Set the LibreOfficeKit language of this view. + void SetLOKLanguageTag(const OUString& rBcp47LanguageTag) { maLOKLanguageTag = LanguageTag(rBcp47LanguageTag, true); } + /// Get the LibreOfficeKit language of this view. + const LanguageTag& GetLOKLanguageTag() const { return maLOKLanguageTag; } }; |