summaryrefslogtreecommitdiffstats
path: root/cui/source/inc/FontFeaturesDialog.hxx
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:51:28 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 16:51:28 +0000
commit940b4d1848e8c70ab7642901a68594e8016caffc (patch)
treeeb72f344ee6c3d9b80a7ecc079ea79e9fba8676d /cui/source/inc/FontFeaturesDialog.hxx
parentInitial commit. (diff)
downloadlibreoffice-1ad18e38974bb28c3d98d0be8f7d8c18fc56de29.tar.xz
libreoffice-1ad18e38974bb28c3d98d0be8f7d8c18fc56de29.zip
Adding upstream version 1:7.0.4.upstream/1%7.0.4upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'cui/source/inc/FontFeaturesDialog.hxx')
-rw-r--r--cui/source/inc/FontFeaturesDialog.hxx78
1 files changed, 78 insertions, 0 deletions
diff --git a/cui/source/inc/FontFeaturesDialog.hxx b/cui/source/inc/FontFeaturesDialog.hxx
new file mode 100644
index 000000000..93e5f7c4a
--- /dev/null
+++ b/cui/source/inc/FontFeaturesDialog.hxx
@@ -0,0 +1,78 @@
+/* -*- 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/.
+ *
+ */
+
+#ifndef INCLUDED_CUI_SOURCE_INC_FONTFEATURESDIALOG_HXX
+#define INCLUDED_CUI_SOURCE_INC_FONTFEATURESDIALOG_HXX
+
+#include <vcl/svapp.hxx>
+#include <vcl/weld.hxx>
+#include <vcl/font/Feature.hxx>
+#include <svx/fntctrl.hxx>
+#include <memory>
+
+namespace cui
+{
+struct FontFeatureItem
+{
+ FontFeatureItem(weld::Widget* pParent)
+ : m_aFeatureCode(0)
+ , m_nDefault(0)
+ , 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"))
+ {
+ }
+
+ sal_uInt32 m_aFeatureCode;
+ sal_uInt32 m_nDefault;
+ std::unique_ptr<weld::Builder> m_xBuilder;
+ std::unique_ptr<weld::Widget> m_xContainer;
+ std::unique_ptr<weld::Label> m_xText;
+ std::unique_ptr<weld::ComboBox> m_xCombo;
+ std::unique_ptr<weld::CheckButton> m_xCheck;
+};
+
+class FontFeaturesDialog : public weld::GenericDialogController
+{
+private:
+ std::vector<FontFeatureItem> m_aFeatureItems;
+ OUString m_sFontName;
+ OUString m_sResultFontName;
+
+ SvxFontPrevWindow m_aPreviewWindow;
+ std::unique_ptr<weld::ScrolledWindow> m_xContentWindow;
+ std::unique_ptr<weld::Container> m_xContentGrid;
+ std::unique_ptr<weld::CustomWeld> m_xPreviewWindow;
+
+ void initialize();
+ OUString createFontNameWithFeatures();
+
+ void fillGrid(std::vector<vcl::font::Feature> const& rFontFeatures);
+
+ DECL_LINK(ComboBoxSelectedHdl, weld::ComboBox&, void);
+ DECL_LINK(CheckBoxToggledHdl, weld::ToggleButton&, void);
+
+public:
+ FontFeaturesDialog(weld::Window* pParent, OUString const& rFontName);
+ ~FontFeaturesDialog() override;
+ virtual short run() override;
+
+ OUString const& getResultFontName() const { return m_sResultFontName; }
+
+ void updateFontPreview();
+};
+
+} // end svx namespaces
+
+#endif // INCLUDED_CUI_SOURCE_INC_FONTFEATURESDIALOG_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */