Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / source / uibase / inc / langhelper.hxx
blob9e4e467546d9f0609e02666caeccb9bdbe8d66a2
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_LANGHELPER_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_LANGHELPER_HXX
22 #include <sal/types.h>
23 #include <rtl/ustring.hxx>
24 #include <i18nlangtag/lang.h>
26 class SwWrtShell;
27 class SwView;
28 class EditEngine;
29 class EditView;
30 class OutlinerView;
31 class SfxItemSet;
32 class SfxRequest;
33 struct ESelection;
34 enum class SvtScriptType : sal_uInt8;
36 namespace SwLangHelper
38 extern void GetLanguageStatus( OutlinerView* pOLV, SfxItemSet& rSet );
39 extern bool SetLanguageStatus( OutlinerView* pOLV, SfxRequest &rReq, SwView const &rView, SwWrtShell &rSh );
41 extern void SetLanguage( SwWrtShell &rWrtSh, std::u16string_view rLangText, bool bIsForSelection, SfxItemSet &rCoreSet );
42 extern void SetLanguage( SwWrtShell &rWrtSh, OutlinerView const * pOLV, const ESelection& rSelection, std::u16string_view rLangText, bool bIsForSelection, SfxItemSet &rCoreSet );
43 extern void SetLanguage_None( SwWrtShell &rWrtSh, bool bIsForSelection, SfxItemSet &rCoreSet );
44 extern void SetLanguage_None( SwWrtShell &rWrtSh, OutlinerView const * pOLV, const ESelection& rSelection, bool bIsForSelection, SfxItemSet &rCoreSet );
45 extern void ResetLanguages( SwWrtShell &rWrtSh, OutlinerView const * pOLV = nullptr );
47 // document
48 extern void SelectCurrentPara( SwWrtShell &rWrtSh );
49 // EditView
50 extern void SelectPara( EditView &rEditView, const ESelection &rCurSel );
52 extern OUString GetTextForLanguageGuessing(EditEngine const * rEditEngine, const ESelection& rDocSelection);
53 extern OUString GetTextForLanguageGuessing(SwWrtShell const &rSh);
55 extern LanguageType GetLanguage( SfxItemSet const & aSet, sal_uInt16 nLangWhichId );
56 extern LanguageType GetLanguage( SwWrtShell &rSh, sal_uInt16 nLangWhichId );
58 extern LanguageType GetCurrentLanguage( SfxItemSet const & aSet, SvtScriptType nScriptType );
59 extern LanguageType GetCurrentLanguage( SwWrtShell &rSh );
62 #endif
64 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */