LibreOffice Module basctl (master) 1
managelang.hxx
Go to the documentation of this file.
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#pragma once
21
22#include <utility>
23#include <vcl/weld.hxx>
24
25class SvxLanguageBox;
26
27namespace basctl
28{
29
30class LocalizationMgr;
31
33{
34 css::lang::Locale m_aLocale;
36
37 LanguageEntry( css::lang::Locale _aLocale,
38 bool _bIsDefault ) :
39 m_aLocale(std::move( _aLocale )),
40 m_bIsDefault( _bIsDefault ) {}
41};
42
43extern bool localesAreEqual( const css::lang::Locale& rLocaleLeft,
44 const css::lang::Locale& rLocaleRight );
45
47{
48private:
49 std::shared_ptr<LocalizationMgr> m_xLocalizationMgr;
50
51 OUString m_sDefLangStr;
53
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;
58
59 void Init();
60 void FillLanguageBox();
61 void ClearLanguageBox();
62
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);
67
68public:
69 ManageLanguageDialog(weld::Window* pParent, std::shared_ptr<LocalizationMgr> _pLMgr);
70 virtual ~ManageLanguageDialog() override;
71};
72
74{
75private:
76 std::shared_ptr<LocalizationMgr> m_xLocalizationMgr;
77
78 void FillLanguageBox();
79
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;
88
89public:
90 SetDefaultLanguageDialog(weld::Window* pParent, std::shared_ptr<LocalizationMgr> xLMgr);
91 virtual ~SetDefaultLanguageDialog() override;
92
93 css::uno::Sequence< css::lang::Locale > GetLocales() const;
94};
95
96} // namespace basctl
97
98/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::unique_ptr< weld::Button > m_xDeletePB
Definition: managelang.hxx:56
DECL_LINK(SelectHdl, weld::TreeView &, void)
DECL_LINK(DeleteHdl, weld::Button &, void)
std::unique_ptr< weld::Button > m_xMakeDefPB
Definition: managelang.hxx:57
std::unique_ptr< weld::Button > m_xAddPB
Definition: managelang.hxx:55
ManageLanguageDialog(weld::Window *pParent, std::shared_ptr< LocalizationMgr > _pLMgr)
Definition: managelang.cxx:56
std::shared_ptr< LocalizationMgr > m_xLocalizationMgr
Definition: managelang.hxx:49
DECL_LINK(MakeDefHdl, weld::Button &, void)
virtual ~ManageLanguageDialog() override
Definition: managelang.cxx:74
std::unique_ptr< weld::TreeView > m_xLanguageLB
Definition: managelang.hxx:54
DECL_LINK(AddHdl, weld::Button &, void)
SetDefaultLanguageDialog(weld::Window *pParent, std::shared_ptr< LocalizationMgr > xLMgr)
Definition: managelang.cxx:217
std::unique_ptr< weld::Label > m_xAltTitle
Definition: managelang.hxx:86
virtual ~SetDefaultLanguageDialog() override
Definition: managelang.cxx:248
std::unique_ptr< weld::Label > m_xCheckLangFT
Definition: managelang.hxx:82
std::unique_ptr< weld::Label > m_xLanguageFT
Definition: managelang.hxx:80
css::uno::Sequence< css::lang::Locale > GetLocales() const
Definition: managelang.cxx:295
std::unique_ptr< weld::Label > m_xAddedFT
Definition: managelang.hxx:85
std::shared_ptr< LocalizationMgr > m_xLocalizationMgr
Definition: managelang.hxx:76
std::unique_ptr< SvxLanguageBox > m_xLanguageCB
Definition: managelang.hxx:87
std::unique_ptr< weld::Label > m_xDefinedFT
Definition: managelang.hxx:84
std::unique_ptr< weld::TreeView > m_xCheckLangLB
Definition: managelang.hxx:83
std::unique_ptr< weld::TreeView > m_xLanguageLB
Definition: managelang.hxx:81
bool localesAreEqual(const Locale &rLocaleLeft, const Locale &rLocaleRight)
Definition: managelang.cxx:48
LanguageEntry(css::lang::Locale _aLocale, bool _bIsDefault)
Definition: managelang.hxx:37
css::lang::Locale m_aLocale
Definition: managelang.hxx:34