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