LibreOffice Module sw (master)  1
langhelper.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_LANGHELPER_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_LANGHELPER_HXX
21 
22 #include <sal/types.h>
23 #include <rtl/ustring.hxx>
24 #include <i18nlangtag/lang.h>
25 
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;
35 
36 namespace SwLangHelper
37 {
38  extern void GetLanguageStatus( OutlinerView* pOLV, SfxItemSet& rSet );
39  extern bool SetLanguageStatus( OutlinerView* pOLV, SfxRequest &rReq, SwView const &rView, SwWrtShell &rSh );
40 
41  extern void SetLanguage( SwWrtShell &rWrtSh, const OUString &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet );
42  extern void SetLanguage( SwWrtShell &rWrtSh, OutlinerView const * pOLV, const ESelection& rSelection, const OUString &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 );
46 
47  // document
48  extern void SelectCurrentPara( SwWrtShell &rWrtSh );
49  // EditView
50  extern void SelectPara( EditView &rEditView, const ESelection &rCurSel );
51 
52  extern OUString GetTextForLanguageGuessing(EditEngine const * rEditEngine, const ESelection& rDocSelection);
53  extern OUString GetTextForLanguageGuessing(SwWrtShell const &rSh);
54 
55  extern LanguageType GetLanguage( SfxItemSet const & aSet, sal_uInt16 nLangWhichId );
56  extern LanguageType GetLanguage( SwWrtShell &rSh, sal_uInt16 nLangWhichId );
57 
58  extern LanguageType GetCurrentLanguage( SfxItemSet const & aSet, SvtScriptType nScriptType );
60 }
61 
62 #endif
63 
64 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SelectPara(EditView &rEditView, const ESelection &rCurSel)
Definition: langhelper.cxx:567
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
Definition: langhelper.cxx:402
Used by the UI to modify the document model.
Definition: wrtsh.hxx:88
bool SetLanguageStatus(OutlinerView *pOLV, SfxRequest &rReq, SwView const &rView, SwWrtShell &rSh)
Definition: langhelper.cxx:102
SvtScriptType
void ResetLanguages(SwWrtShell &rWrtSh, OutlinerView const *pOLV=nullptr)
Definition: langhelper.cxx:365
void GetLanguageStatus(OutlinerView *pOLV, SfxItemSet &rSet)
Definition: langhelper.cxx:62
void SetLanguage_None(SwWrtShell &rWrtSh, bool bIsForSelection, SfxItemSet &rCoreSet)
Definition: langhelper.cxx:305
void SelectCurrentPara(SwWrtShell &rWrtSh)
Definition: langhelper.cxx:573
LanguageType GetCurrentLanguage(SfxItemSet const &aSet, SvtScriptType nScriptType)
Definition: langhelper.cxx:481
void SetLanguage(SwWrtShell &rWrtSh, const OUString &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet)
Definition: langhelper.cxx:223
OUString GetTextForLanguageGuessing(EditEngine const *rEditEngine, const ESelection &rDocSelection)
Definition: langhelper.cxx:547
Definition: view.hxx:146