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 INCLUDED_BASCTL_SOURCE_INC_MANAGELANG_HXX
21 : #define INCLUDED_BASCTL_SOURCE_INC_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 : VclPtr<ListBox> m_pLanguageLB;
56 : VclPtr<PushButton> m_pAddPB;
57 : VclPtr<PushButton> m_pDeletePB;
58 : VclPtr<PushButton> m_pMakeDefPB;
59 :
60 : boost::shared_ptr<LocalizationMgr> m_xLocalizationMgr;
61 :
62 : OUString m_sDefLangStr;
63 : OUString m_sCreateLangStr;
64 :
65 : void Init();
66 : void FillLanguageBox();
67 : void ClearLanguageBox();
68 :
69 : DECL_LINK(AddHdl, void *);
70 : DECL_LINK(DeleteHdl, void *);
71 : DECL_LINK(MakeDefHdl, void *);
72 : DECL_LINK(SelectHdl, void *);
73 :
74 : public:
75 : ManageLanguageDialog( vcl::Window* pParent, boost::shared_ptr<LocalizationMgr> _pLMgr );
76 : virtual ~ManageLanguageDialog();
77 : virtual void dispose() SAL_OVERRIDE;
78 : };
79 :
80 : class SetDefaultLanguageDialog : public ModalDialog
81 : {
82 : private:
83 : VclPtr<FixedText> m_pLanguageFT;
84 : VclPtr<SvxLanguageBox> m_pLanguageLB;
85 : VclPtr<FixedText> m_pCheckLangFT;
86 : VclPtr<SvxCheckListBox> m_pCheckLangLB;
87 : VclPtr<FixedText> m_pDefinedFT;
88 : VclPtr<FixedText> m_pAddedFT;
89 :
90 : boost::shared_ptr<LocalizationMgr> m_xLocalizationMgr;
91 :
92 : void FillLanguageBox();
93 :
94 : public:
95 : SetDefaultLanguageDialog(vcl::Window* pParent, boost::shared_ptr<LocalizationMgr> xLMgr);
96 : virtual ~SetDefaultLanguageDialog();
97 : virtual void dispose() SAL_OVERRIDE;
98 :
99 : ::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > GetLocales() const;
100 : };
101 :
102 : } // namespace basctl
103 :
104 : #endif // INCLUDED_BASCTL_SOURCE_INC_MANAGELANG_HXX
105 :
106 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|