tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / basctl / source / inc / managelang.hxx
blob58dd4189057adb0ff58b53b8bfabd46c26ddde22
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 #pragma once
22 #include <utility>
23 #include <vcl/weld.hxx>
25 class SvxLanguageBox;
27 namespace basctl
30 class LocalizationMgr;
32 struct LanguageEntry
34 css::lang::Locale m_aLocale;
35 bool m_bIsDefault;
37 LanguageEntry( css::lang::Locale _aLocale,
38 bool _bIsDefault ) :
39 m_aLocale(std::move( _aLocale )),
40 m_bIsDefault( _bIsDefault ) {}
43 extern bool localesAreEqual( const css::lang::Locale& rLocaleLeft,
44 const css::lang::Locale& rLocaleRight );
46 class ManageLanguageDialog : public weld::GenericDialogController
48 private:
49 std::shared_ptr<LocalizationMgr> m_xLocalizationMgr;
51 OUString m_sDefLangStr;
52 OUString m_sCreateLangStr;
54 std::unique_ptr<weld::TreeView> m_xLanguageLB;
55 std::unique_ptr<weld::Button> m_xAddPB;
56 std::unique_ptr<weld::Button> m_xDeletePB;
57 std::unique_ptr<weld::Button> m_xMakeDefPB;
59 void Init();
60 void FillLanguageBox();
61 void ClearLanguageBox();
63 DECL_LINK(AddHdl, weld::Button&, void);
64 DECL_LINK(DeleteHdl, weld::Button&, void);
65 DECL_LINK(MakeDefHdl, weld::Button&, void);
66 DECL_LINK(SelectHdl, weld::TreeView&, void);
68 public:
69 ManageLanguageDialog(weld::Window* pParent, std::shared_ptr<LocalizationMgr> _pLMgr);
70 virtual ~ManageLanguageDialog() override;
73 class SetDefaultLanguageDialog : public weld::GenericDialogController
75 private:
76 std::shared_ptr<LocalizationMgr> m_xLocalizationMgr;
78 void FillLanguageBox();
80 std::unique_ptr<weld::Label> m_xLanguageFT;
81 std::unique_ptr<weld::TreeView> m_xLanguageLB;
82 std::unique_ptr<weld::Label> m_xCheckLangFT;
83 std::unique_ptr<weld::TreeView> m_xCheckLangLB;
84 std::unique_ptr<weld::Label> m_xDefinedFT;
85 std::unique_ptr<weld::Label> m_xAddedFT;
86 std::unique_ptr<weld::Label> m_xAltTitle;
87 std::unique_ptr<SvxLanguageBox> m_xLanguageCB;
89 public:
90 SetDefaultLanguageDialog(weld::Window* pParent, std::shared_ptr<LocalizationMgr> xLMgr);
91 virtual ~SetDefaultLanguageDialog() override;
93 css::uno::Sequence< css::lang::Locale > GetLocales() const;
96 } // namespace basctl
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */