Branch data Line data Source code
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 : :
20 : : #ifndef _BASCTL_MANAGELANG_HXX
21 : : #define _BASCTL_MANAGELANG_HXX
22 : :
23 : : #include <svx/checklbx.hxx>
24 : : #include <vcl/button.hxx>
25 : : #include <vcl/dialog.hxx>
26 : : #include <vcl/fixed.hxx>
27 : :
28 : : class LocalizationMgr;
29 : : class SvxLanguageBox;
30 : :
31 : 0 : struct LanguageEntry
32 : : {
33 : : ::rtl::OUString m_sLanguage;
34 : : ::com::sun::star::lang::Locale m_aLocale;
35 : : bool m_bIsDefault;
36 : :
37 : 0 : LanguageEntry( const ::rtl::OUString& _rLanguage,
38 : : const ::com::sun::star::lang::Locale& _rLocale,
39 : : bool _bIsDefault ) :
40 : : m_sLanguage( _rLanguage ),
41 : : m_aLocale( _rLocale ),
42 : 0 : m_bIsDefault( _bIsDefault ) {}
43 : : };
44 : :
45 : : extern bool localesAreEqual( const ::com::sun::star::lang::Locale& rLocaleLeft,
46 : : const ::com::sun::star::lang::Locale& rLocaleRight );
47 : :
48 : : class ManageLanguageDialog : public ModalDialog
49 : : {
50 : : private:
51 : : FixedText m_aLanguageFT;
52 : : ListBox m_aLanguageLB;
53 : : PushButton m_aAddPB;
54 : : PushButton m_aDeletePB;
55 : : PushButton m_aMakeDefPB;
56 : : FixedText m_aInfoFT;
57 : :
58 : : FixedLine m_aBtnLine;
59 : : HelpButton m_aHelpBtn;
60 : : OKButton m_aCloseBtn;
61 : :
62 : : boost::shared_ptr<LocalizationMgr> m_pLocalizationMgr;
63 : :
64 : : ::rtl::OUString m_sDefLangStr;
65 : : ::rtl::OUString m_sDeleteStr;
66 : : ::rtl::OUString m_sCreateLangStr;
67 : :
68 : : void Init();
69 : : void CalcInfoSize();
70 : : void FillLanguageBox();
71 : : void ClearLanguageBox();
72 : :
73 : : DECL_LINK(AddHdl, void *);
74 : : DECL_LINK(DeleteHdl, void *);
75 : : DECL_LINK(MakeDefHdl, void *);
76 : : DECL_LINK(SelectHdl, void *);
77 : :
78 : : public:
79 : : ManageLanguageDialog( Window* pParent, boost::shared_ptr<LocalizationMgr> _pLMgr );
80 : : ~ManageLanguageDialog();
81 : : };
82 : :
83 : : class SetDefaultLanguageDialog : public ModalDialog
84 : : {
85 : : private:
86 : : FixedText m_aLanguageFT;
87 : : SvxLanguageBox* m_pLanguageLB;
88 : : SvxCheckListBox* m_pCheckLangLB;
89 : : FixedText m_aInfoFT;
90 : :
91 : : FixedLine m_aBtnLine;
92 : : OKButton m_aOKBtn;
93 : : CancelButton m_aCancelBtn;
94 : : HelpButton m_aHelpBtn;
95 : :
96 : : bool m_bIsDefaultMode;
97 : : boost::shared_ptr<LocalizationMgr> m_pLocalizationMgr;
98 : :
99 : : void FillLanguageBox();
100 : : void CalcInfoSize();
101 : :
102 : : public:
103 : : SetDefaultLanguageDialog( Window* pParent, boost::shared_ptr<LocalizationMgr> _pLMgr );
104 : : ~SetDefaultLanguageDialog();
105 : :
106 : : ::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > GetLocales() const;
107 : : };
108 : :
109 : : #endif //_BASCTL_MANAGELANG_HXX
110 : :
111 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|