tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / include / svx / fontwork.hxx
blobc726382756e6e74102e31d93e04227ba237641fe
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 .
19 #ifndef INCLUDED_SVX_FONTWORK_HXX
20 #define INCLUDED_SVX_FONTWORK_HXX
22 #include <sfx2/dockwin.hxx>
23 #include <sfx2/ctrlitem.hxx>
24 #include <svx/svxdllapi.h>
25 #include <vcl/idle.hxx>
26 #include <vcl/weld.hxx>
28 class ColorListBox;
30 class XFormTextAdjustItem;
31 class XFormTextDistanceItem;
32 class XFormTextStartItem;
33 class XFormTextStyleItem;
34 class XFormTextMirrorItem;
35 class XFormTextHideFormItem;
36 class XFormTextOutlineItem;
37 class XFormTextShadowItem;
38 class XFormTextShadowColorItem;
39 class XFormTextShadowXValItem;
40 class XFormTextShadowYValItem;
42 /** ControllerItem for Fontwork
46 class SvxFontWorkDialog;
48 class SvxFontWorkControllerItem final : public SfxControllerItem
50 SvxFontWorkDialog &rFontWorkDlg;
52 virtual void StateChangedAtToolBoxControl(sal_uInt16 nSID, SfxItemState eState,
53 const SfxPoolItem* pState) override;
55 public:
56 SvxFontWorkControllerItem(sal_uInt16 nId, SvxFontWorkDialog&, SfxBindings&);
59 /** Derived from SfxChildWindow as "container" for fontwork dialog
62 class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxFontWorkChildWindow final : public SfxChildWindow
64 public:
65 SvxFontWorkChildWindow(vcl::Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo*);
66 SFX_DECL_CHILDWINDOW_WITHID(SvxFontWorkChildWindow);
69 /** Floating window for setting attributes of text effects
72 class SAL_WARN_UNUSED SvxFontWorkDialog final : public SfxDockingWindow
74 #define CONTROLLER_COUNT 11
76 SfxBindings& rBindings;
77 Idle aInputIdle;
79 OUString m_sLastStyleTbxId;
80 OUString m_sLastAdjustTbxId;
81 OUString m_sLastShadowTbxId;
83 tools::Long nSaveShadowX;
84 tools::Long nSaveShadowY;
85 tools::Long nSaveShadowAngle;
86 tools::Long nSaveShadowSize;
88 SvxFontWorkControllerItem* pCtrlItems[CONTROLLER_COUNT];
90 std::unique_ptr<weld::Toolbar> m_xTbxStyle;
91 std::unique_ptr<weld::Toolbar> m_xTbxAdjust;
93 std::unique_ptr<weld::MetricSpinButton> m_xMtrFldDistance;
94 std::unique_ptr<weld::MetricSpinButton> m_xMtrFldTextStart;
96 std::unique_ptr<weld::Toolbar> m_xTbxShadow;
98 std::unique_ptr<weld::Image> m_xFbShadowX;
99 std::unique_ptr<weld::MetricSpinButton> m_xMtrFldShadowX;
100 std::unique_ptr<weld::Image> m_xFbShadowY;
101 std::unique_ptr<weld::MetricSpinButton> m_xMtrFldShadowY;
103 std::unique_ptr<ColorListBox> m_xShadowColorLB;
105 friend class SvxFontWorkChildWindow;
106 friend class SvxFontWorkControllerItem;
108 DECL_LINK( SelectStyleHdl_Impl, const OUString&, void );
109 DECL_LINK( SelectAdjustHdl_Impl, const OUString&, void );
110 DECL_LINK( SelectShadowHdl_Impl, const OUString&, void );
112 DECL_LINK( ModifyInputHdl_Impl, weld::MetricSpinButton&, void );
113 DECL_LINK( InputTimeoutHdl_Impl, Timer*, void );
115 DECL_LINK( ColorSelectHdl_Impl, ColorListBox&, void );
117 void SetStyle_Impl(const XFormTextStyleItem*);
118 void SetAdjust_Impl(const XFormTextAdjustItem*);
119 void SetDistance_Impl(const XFormTextDistanceItem*);
120 void SetStart_Impl(const XFormTextStartItem*);
121 void SetMirror_Impl(const XFormTextMirrorItem*);
122 void SetShowForm_Impl(const XFormTextHideFormItem*);
123 void SetOutline_Impl(const XFormTextOutlineItem*);
124 void SetShadow_Impl(const XFormTextShadowItem*, bool bRestoreValues = false);
125 void SetShadowColor_Impl(const XFormTextShadowColorItem*);
126 void SetShadowXVal_Impl(const XFormTextShadowXValItem*);
127 void SetShadowYVal_Impl(const XFormTextShadowYValItem*);
129 void ApplyImageList();
131 virtual SfxChildAlignment CheckAlignment( SfxChildAlignment eActAlign,
132 SfxChildAlignment eAlign ) override;
133 public:
134 SvxFontWorkDialog(SfxBindings *pBinding, SfxChildWindow *pCW,
135 vcl::Window* pParent);
136 virtual ~SvxFontWorkDialog() override;
137 virtual void dispose() override;
140 #endif // INCLUDED_SVX_FONTWORK_HXX
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */