summaryrefslogtreecommitdiff
path: root/editeng/inc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-04-12 20:01:06 +0200
committerEike Rathke <erack@redhat.com>2013-04-12 20:45:01 +0200
commitf3e70f0f9ced15917bb3d91f0653952031e250ba (patch)
treed0f777279be8fbd31fa606c6d0684df5ff2c7d9a /editeng/inc
parentcabde84509d0644258b3d5ccb8c7022e28f505bf (diff)
make that a proper static method EditView::CheckLanguage()
Change-Id: I08c1af6813314b4881aafdd7f3f98a7629d5cf76
Diffstat (limited to 'editeng/inc')
-rw-r--r--editeng/inc/editeng/editview.hxx27
1 files changed, 26 insertions, 1 deletions
diff --git a/editeng/inc/editeng/editview.hxx b/editeng/inc/editeng/editview.hxx
index f3cad0e4c99f..a2f5ce8a3d65 100644
--- a/editeng/inc/editeng/editview.hxx
+++ b/editeng/inc/editeng/editview.hxx
@@ -60,7 +60,12 @@ namespace sun {
namespace star {
namespace datatransfer {
class XTransferable;
-}}}}
+}
+namespace linguistic2 {
+ class XSpellChecker1;
+ class XLanguageGuessing;
+}
+}}}
class EDITENG_DLLPUBLIC EditView
{
@@ -215,6 +220,26 @@ public:
String GetSurroundingText() const;
Selection GetSurroundingTextSelection() const;
+
+ /** Tries to determine the language of 'rText', returning a matching known
+ locale if possible, or a fallback, or LANGUAGE_NONE if nothing found or
+ matched.
+
+ @param bIsParaText
+ If TRUE, rText is a paragraph and the language is obtained by
+ passing the text to xLangGuess.
+ IF FALSE, a language match is tried for, in order,
+ 1. the default document language (non-CTL, non-CJK, aka LATIN)
+ 2. the UI language (Tools->Options->LanguageSettings->Languages User Interface)
+ 3. the locale (Tools->Options->LanguageSettings->Languages Locale)
+ 4. en-US
+ If nothing matched, LANGUAGE_NONE is returned.
+ */
+ static LanguageType CheckLanguage(
+ const OUString &rText,
+ com::sun::star::uno::Reference< com::sun::star::linguistic2::XSpellChecker1 > xSpell,
+ com::sun::star::uno::Reference< com::sun::star::linguistic2::XLanguageGuessing > xLangGuess,
+ bool bIsParaText );
};
#endif // _MyEDITVIEW_HXX