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
26class SwWrtShell;
27class SwView;
28class EditEngine;
29class EditView;
30class OutlinerView;
31class SfxItemSet;
32class SfxRequest;
33struct ESelection;
34enum class SvtScriptType : sal_uInt8;
35
36namespace 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, 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 );
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: */
Definition: view.hxx:146
Used by the UI to modify the document model.
Definition: wrtsh.hxx:97
SvtScriptType
LanguageType GetCurrentLanguage(SfxItemSet const &aSet, SvtScriptType nScriptType)
Definition: langhelper.cxx:444
void SelectPara(EditView &rEditView, const ESelection &rCurSel)
Definition: langhelper.cxx:530
void SetLanguage_None(SwWrtShell &rWrtSh, bool bIsForSelection, SfxItemSet &rCoreSet)
Definition: langhelper.cxx:258
void ResetLanguages(SwWrtShell &rWrtSh, OutlinerView const *pOLV=nullptr)
Definition: langhelper.cxx:319
void SelectCurrentPara(SwWrtShell &rWrtSh)
Definition: langhelper.cxx:536
void GetLanguageStatus(OutlinerView *pOLV, SfxItemSet &rSet)
Definition: langhelper.cxx:57
bool SetLanguageStatus(OutlinerView *pOLV, SfxRequest &rReq, SwView const &rView, SwWrtShell &rSh)
Definition: langhelper.cxx:93
void SetLanguage(SwWrtShell &rWrtSh, std::u16string_view rLangText, bool bIsForSelection, SfxItemSet &rCoreSet)
Definition: langhelper.cxx:192
OUString GetTextForLanguageGuessing(EditEngine const *rEditEngine, const ESelection &rDocSelection)
Definition: langhelper.cxx:510
LanguageType GetLanguage(SfxItemSet const &aSet, sal_uInt16 nLangWhichId)
Definition: langhelper.cxx:365
static SfxItemSet & rSet
unsigned char sal_uInt8