From 267c6f2ac71f92999e969232431ba04678e7437e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 07:54:39 +0200 Subject: Adding upstream version 4:24.2.0. Signed-off-by: Daniel Baumann --- cui/source/inc/FontFeaturesDialog.hxx | 87 +++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 cui/source/inc/FontFeaturesDialog.hxx (limited to 'cui/source/inc/FontFeaturesDialog.hxx') diff --git a/cui/source/inc/FontFeaturesDialog.hxx b/cui/source/inc/FontFeaturesDialog.hxx new file mode 100644 index 0000000000..93ba0cb9f8 --- /dev/null +++ b/cui/source/inc/FontFeaturesDialog.hxx @@ -0,0 +1,87 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + */ + +#pragma once + +#include +#include +#include +#include +#include + +namespace cui +{ +struct FontFeatureItem +{ + FontFeatureItem(weld::Widget* pParent) + : m_aFeatureCode(0) + , m_nDefault(-1) + , m_xBuilder(Application::CreateBuilder(pParent, "cui/ui/fontfragment.ui")) + , m_xContainer(m_xBuilder->weld_widget("fontentry")) + , m_xText(m_xBuilder->weld_label("label")) + , m_xCombo(m_xBuilder->weld_combo_box("combo")) + , m_xCheck(m_xBuilder->weld_check_button("check")) + { + m_xCheck->connect_toggled(LINK(this, FontFeatureItem, CheckBoxToggledHdl)); + } + + sal_uInt32 m_aFeatureCode; + sal_Int32 m_nDefault; + weld::TriStateEnabled m_aTriStateEnabled; + Link m_aToggleHdl; + std::unique_ptr m_xBuilder; + std::unique_ptr m_xContainer; + std::unique_ptr m_xText; + std::unique_ptr m_xCombo; + std::unique_ptr m_xCheck; + +private: + DECL_LINK(CheckBoxToggledHdl, weld::Toggleable&, void); +}; + +class FontFeaturesDialog : public weld::GenericDialogController +{ +private: + std::vector> m_aFeatureItems; + OUString m_sFontName; + OUString m_sResultFontName; + + SvxFontPrevWindow m_aPreviewWindow; + std::unique_ptr m_xContentWindow; + std::unique_ptr m_xContentBox; + std::unique_ptr m_xContentGrid; + std::unique_ptr m_xStylisticSetsBox; + std::unique_ptr m_xStylisticSetsGrid; + std::unique_ptr m_xCharacterVariantsBox; + std::unique_ptr m_xCharacterVariantsGrid; + std::unique_ptr m_xPreviewWindow; + + void initialize(); + OUString createFontNameWithFeatures(); + + // returns the max height of a row + int fillGrid(std::vector const& rFontFeatures); + + DECL_LINK(ComboBoxSelectedHdl, weld::ComboBox&, void); + DECL_LINK(CheckBoxToggledHdl, weld::Toggleable&, void); + +public: + FontFeaturesDialog(weld::Window* pParent, OUString aFontName); + ~FontFeaturesDialog() override; + virtual short run() override; + + OUString const& getResultFontName() const { return m_sResultFontName; } + + void updateFontPreview(); +}; + +} // end svx namespaces + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3