bump product version to 4.1.6.2
[LibreOffice.git] / include / svx / langbox.hxx
blob106af28ee913a3271df5c95d92a647f33d929792
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 _SVX_LANGBOX_HXX
20 #define _SVX_LANGBOX_HXX
22 #include <com/sun/star/uno/Sequence.hxx>
23 #include <vcl/lstbox.hxx>
24 #include "svx/svxdllapi.h"
25 #include <vcl/image.hxx>
26 #include <tools/solar.h>
28 class SvtLanguageTable;
30 #define LANG_LIST_EMPTY 0x0000
31 #define LANG_LIST_ALL 0x0001
32 #define LANG_LIST_WESTERN 0x0002
33 #define LANG_LIST_CTL 0x0004
34 #define LANG_LIST_CJK 0x0008
35 #define LANG_LIST_FBD_CHARS 0x0010
36 #define LANG_LIST_SPELL_AVAIL 0x0020
37 #define LANG_LIST_HYPH_AVAIL 0x0040
38 #define LANG_LIST_THES_AVAIL 0x0080
39 #define LANG_LIST_ONLY_KNOWN 0x0100 // list only locales provided by I18N
40 #define LANG_LIST_SPELL_USED 0x0200
41 #define LANG_LIST_HYPH_USED 0x0400
42 #define LANG_LIST_THES_USED 0x0800
43 #define LANG_LIST_ALSO_PRIMARY_ONLY 0x1000 // Do not exclude primary-only
44 // languages that do not form a
45 // locale, such as Arabic as
46 // opposed to Arabic-Egypt.
49 // load language strings from resource
50 SVX_DLLPUBLIC String GetDicInfoStr( const String& rName, const sal_uInt16 nLang, bool bNeg );
52 class SVX_DLLPUBLIC SvxLanguageBox : public ListBox
54 public:
56 private:
57 Image m_aNotCheckedImage;
58 Image m_aCheckedImage;
59 String m_aAllString;
60 com::sun::star::uno::Sequence< sal_Int16 > *m_pSpellUsedLang;
61 SvtLanguageTable* m_pLangTable;
62 sal_Int16 m_nLangList;
63 sal_Bool m_bHasLangNone;
64 sal_Bool m_bLangNoneIsLangAll;
65 sal_Bool m_bWithCheckmark;
67 SVX_DLLPRIVATE void Init();
68 SVX_DLLPRIVATE sal_uInt16 ImplInsertImgEntry( const String& rEntry, sal_uInt16 nPos, bool bChecked );
69 SVX_DLLPRIVATE sal_uInt16 ImplInsertLanguage(LanguageType, sal_uInt16, sal_Int16 );
71 public:
72 SvxLanguageBox(Window* pParent, const ResId& rResId, sal_Bool bCheck = sal_False);
73 SvxLanguageBox(Window* pParent, WinBits nBits, sal_Bool bCheck = sal_False);
74 ~SvxLanguageBox();
76 void SetLanguageList( sal_Int16 nLangList,
77 sal_Bool bHasLangNone, sal_Bool bLangNoneIsLangAll = sal_False,
78 sal_Bool bCheckSpellAvail = sal_False );
80 sal_uInt16 InsertLanguage( const LanguageType eLangType, sal_uInt16 nPos = LISTBOX_APPEND );
81 sal_uInt16 InsertDefaultLanguage( sal_Int16 nType, sal_uInt16 nPos = LISTBOX_APPEND );
82 sal_uInt16 InsertSystemLanguage( sal_uInt16 nPos = LISTBOX_APPEND );
83 sal_uInt16 InsertLanguage( const LanguageType eLangType,
84 sal_Bool bCheckEntry, sal_uInt16 nPos = LISTBOX_APPEND );
85 void RemoveLanguage( const LanguageType eLangType );
86 void SelectLanguage( const LanguageType eLangType, sal_Bool bSelect = sal_True );
87 LanguageType GetSelectLanguage() const;
88 sal_Bool IsLanguageSelected( const LanguageType eLangType ) const;
91 #endif
93 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */