Version 6.1.4.1, tag libreoffice-6.1.4.1
[LibreOffice.git] / basctl / source / inc / managelang.hxx
bloba965416254a1e23d7aef84ec5447df90f07a4489
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 .
20 #ifndef INCLUDED_BASCTL_SOURCE_INC_MANAGELANG_HXX
21 #define INCLUDED_BASCTL_SOURCE_INC_MANAGELANG_HXX
23 #include <svx/checklbx.hxx>
24 #include <vcl/button.hxx>
25 #include <vcl/dialog.hxx>
26 #include <vcl/fixed.hxx>
28 class SvxLanguageBox;
30 namespace basctl
33 class LocalizationMgr;
35 struct LanguageEntry
37 css::lang::Locale m_aLocale;
38 bool m_bIsDefault;
40 LanguageEntry( const css::lang::Locale& _rLocale,
41 bool _bIsDefault ) :
42 m_aLocale( _rLocale ),
43 m_bIsDefault( _bIsDefault ) {}
46 extern bool localesAreEqual( const css::lang::Locale& rLocaleLeft,
47 const css::lang::Locale& rLocaleRight );
49 class ManageLanguageDialog : public ModalDialog
51 private:
52 VclPtr<ListBox> m_pLanguageLB;
53 VclPtr<PushButton> m_pAddPB;
54 VclPtr<PushButton> m_pDeletePB;
55 VclPtr<PushButton> m_pMakeDefPB;
57 std::shared_ptr<LocalizationMgr> m_xLocalizationMgr;
59 OUString m_sDefLangStr;
60 OUString m_sCreateLangStr;
62 void Init();
63 void FillLanguageBox();
64 void ClearLanguageBox();
66 DECL_LINK(AddHdl, Button*, void);
67 DECL_LINK(DeleteHdl, Button*, void);
68 DECL_LINK(MakeDefHdl, Button*, void);
69 DECL_LINK(SelectHdl, ListBox&, void);
71 public:
72 ManageLanguageDialog( vcl::Window* pParent, std::shared_ptr<LocalizationMgr> const & _pLMgr );
73 virtual ~ManageLanguageDialog() override;
74 virtual void dispose() override;
77 class SetDefaultLanguageDialog : public ModalDialog
79 private:
80 VclPtr<FixedText> m_pLanguageFT;
81 VclPtr<SvxLanguageBox> m_pLanguageLB;
82 VclPtr<FixedText> m_pCheckLangFT;
83 VclPtr<SvxCheckListBox> m_pCheckLangLB;
84 VclPtr<FixedText> m_pDefinedFT;
85 VclPtr<FixedText> m_pAddedFT;
87 std::shared_ptr<LocalizationMgr> m_xLocalizationMgr;
89 void FillLanguageBox();
91 public:
92 SetDefaultLanguageDialog(vcl::Window* pParent, std::shared_ptr<LocalizationMgr> const & xLMgr);
93 virtual ~SetDefaultLanguageDialog() override;
94 virtual void dispose() override;
96 css::uno::Sequence< css::lang::Locale > GetLocales() const;
99 } // namespace basctl
101 #endif // INCLUDED_BASCTL_SOURCE_INC_MANAGELANG_HXX
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */