Bump version to 6.4.7.2.M8
[LibreOffice.git] / cui / source / inc / FontFeaturesDialog.hxx
blob93e5f7c4a76ed3e9dbba700fa01048ea9ea1cd0d
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 */
11 #ifndef INCLUDED_CUI_SOURCE_INC_FONTFEATURESDIALOG_HXX
12 #define INCLUDED_CUI_SOURCE_INC_FONTFEATURESDIALOG_HXX
14 #include <vcl/svapp.hxx>
15 #include <vcl/weld.hxx>
16 #include <vcl/font/Feature.hxx>
17 #include <svx/fntctrl.hxx>
18 #include <memory>
20 namespace cui
22 struct FontFeatureItem
24 FontFeatureItem(weld::Widget* pParent)
25 : m_aFeatureCode(0)
26 , m_nDefault(0)
27 , m_xBuilder(Application::CreateBuilder(pParent, "cui/ui/fontfragment.ui"))
28 , m_xContainer(m_xBuilder->weld_widget("fontentry"))
29 , m_xText(m_xBuilder->weld_label("label"))
30 , m_xCombo(m_xBuilder->weld_combo_box("combo"))
31 , m_xCheck(m_xBuilder->weld_check_button("check"))
35 sal_uInt32 m_aFeatureCode;
36 sal_uInt32 m_nDefault;
37 std::unique_ptr<weld::Builder> m_xBuilder;
38 std::unique_ptr<weld::Widget> m_xContainer;
39 std::unique_ptr<weld::Label> m_xText;
40 std::unique_ptr<weld::ComboBox> m_xCombo;
41 std::unique_ptr<weld::CheckButton> m_xCheck;
44 class FontFeaturesDialog : public weld::GenericDialogController
46 private:
47 std::vector<FontFeatureItem> m_aFeatureItems;
48 OUString m_sFontName;
49 OUString m_sResultFontName;
51 SvxFontPrevWindow m_aPreviewWindow;
52 std::unique_ptr<weld::ScrolledWindow> m_xContentWindow;
53 std::unique_ptr<weld::Container> m_xContentGrid;
54 std::unique_ptr<weld::CustomWeld> m_xPreviewWindow;
56 void initialize();
57 OUString createFontNameWithFeatures();
59 void fillGrid(std::vector<vcl::font::Feature> const& rFontFeatures);
61 DECL_LINK(ComboBoxSelectedHdl, weld::ComboBox&, void);
62 DECL_LINK(CheckBoxToggledHdl, weld::ToggleButton&, void);
64 public:
65 FontFeaturesDialog(weld::Window* pParent, OUString const& rFontName);
66 ~FontFeaturesDialog() override;
67 virtual short run() override;
69 OUString const& getResultFontName() const { return m_sResultFontName; }
71 void updateFontPreview();
74 } // end svx namespaces
76 #endif // INCLUDED_CUI_SOURCE_INC_FONTFEATURESDIALOG_HXX
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */