xref: /aoo42x/main/sw/source/ui/inc/langhelper.hxx (revision 67e470da)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _SWLANGHELPER_HXX
24 #define _SWLANGHELPER_HXX
25 
26 class SwWrtShell;
27 class SwView;
28 class EditEngine;
29 class EditView;
30 class OutlinerView;
31 class SfxItemSet;
32 struct ESelection;
33 
34 namespace SwLangHelper
35 {
36 	extern sal_uInt16 GetLanguageStatus( OutlinerView* pOLV, SfxItemSet& rSet );
37 	extern bool SetLanguageStatus( OutlinerView* pOLV, SfxRequest &rReq, SwView &rView, SwWrtShell &rSh );
38 
39 	extern void SetLanguage( SwWrtShell &rWrtSh, const String &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet );
40 //	extern void SetLanguage( SwWrtShell &rWrtSh, EditEngine* pEditEngine, ESelection aSelection, const String &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet );
41 	extern void SetLanguage( SwWrtShell &rWrtSh, OutlinerView* pOLV, ESelection aSelection, const String &rLangText, bool bIsForSelection, SfxItemSet &rCoreSet );
42 	extern void SetLanguage_None( SwWrtShell &rWrtSh, bool bIsForSelection, SfxItemSet &rCoreSet );
43 //	extern void SetLanguage_None( SwWrtShell &rWrtSh, EditEngine* pEditEngine, ESelection aSelection, bool bIsForSelection, SfxItemSet &rCoreSet  );
44 	extern void SetLanguage_None( SwWrtShell &rWrtSh, OutlinerView* pOLV, ESelection aSelection, bool bIsForSelection, SfxItemSet &rCoreSet  );
45 	extern void ResetLanguages( SwWrtShell &rWrtSh, bool bIsForSelection );
46 //	extern void ResetLanguages( SwWrtShell &rWrtSh, EditEngine* pEditEngine, ESelection aSelection, bool bIsForSelection );
47 	extern void ResetLanguages( SwWrtShell &rWrtSh, OutlinerView* pOLV, ESelection aSelection, bool bIsForSelection );
48 
49 	// document
50 	extern void SelectCurrentPara( SwWrtShell &rWrtSh );
51 	// EditView
52 	extern void SelectPara( EditView &rEditView, const ESelection &rCurSel );
53 
54 	extern String GetTextForLanguageGuessing( EditEngine* rEditEngine, ESelection aDocSelection );
55 	extern String GetTextForLanguageGuessing( SwWrtShell &rSh );
56 
57 	extern LanguageType GetLanguage( SfxItemSet aSet, sal_uInt16 nLangWhichId );
58 	extern LanguageType GetLanguage( SwWrtShell &rSh, sal_uInt16 nLangWhichId );
59 
60 	extern LanguageType GetCurrentLanguage( SfxItemSet aSet, sal_uInt16 nScriptType );
61 	extern LanguageType GetCurrentLanguage( SwWrtShell &rSh );
62 }
63 
64 #endif
65