1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 <vcl/toolbox.hxx>
23 #include <vcl/fixed.hxx>
24 #include <vcl/field.hxx>
25 #include <vcl/idle.hxx>
26 #include <sfx2/dockwin.hxx>
27 #include <sfx2/ctrlitem.hxx>
28 #include <svx/svxdllapi.h>
30 class SvxColorListBox
;
32 class XFormTextAdjustItem
;
33 class XFormTextDistanceItem
;
34 class XFormTextStartItem
;
35 class XFormTextStyleItem
;
36 class XFormTextMirrorItem
;
37 class XFormTextHideFormItem
;
38 class XFormTextOutlineItem
;
39 class XFormTextShadowItem
;
40 class XFormTextShadowColorItem
;
41 class XFormTextShadowXValItem
;
42 class XFormTextShadowYValItem
;
44 /** ControllerItem for Fontwork
48 class SvxFontWorkDialog
;
50 class SvxFontWorkControllerItem
: public SfxControllerItem
52 SvxFontWorkDialog
&rFontWorkDlg
;
55 virtual void StateChanged(sal_uInt16 nSID
, SfxItemState eState
,
56 const SfxPoolItem
* pState
) override
;
59 SvxFontWorkControllerItem(sal_uInt16 nId
, SvxFontWorkDialog
&, SfxBindings
&);
62 /** Derived from SfxChildWindow as "container" for fontwork dialog
65 class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxFontWorkChildWindow
: public SfxChildWindow
68 SvxFontWorkChildWindow(vcl::Window
*, sal_uInt16
, SfxBindings
*, SfxChildWinInfo
*);
69 SFX_DECL_CHILDWINDOW_WITHID(SvxFontWorkChildWindow
);
72 /** Floating window for setting attributes of text effects
75 class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxFontWorkDialog
: public SfxDockingWindow
77 #define CONTROLLER_COUNT 11
79 SvxFontWorkControllerItem
* pCtrlItems
[CONTROLLER_COUNT
];
81 VclPtr
<ToolBox
> m_pTbxStyle
;
82 VclPtr
<ToolBox
> m_pTbxAdjust
;
84 VclPtr
<MetricField
> m_pMtrFldDistance
;
85 VclPtr
<MetricField
> m_pMtrFldTextStart
;
87 VclPtr
<ToolBox
> m_pTbxShadow
;
89 VclPtr
<FixedImage
> m_pFbShadowX
;
90 VclPtr
<MetricField
> m_pMtrFldShadowX
;
91 VclPtr
<FixedImage
> m_pFbShadowY
;
92 VclPtr
<MetricField
> m_pMtrFldShadowY
;
94 VclPtr
<SvxColorListBox
> m_pShadowColorLB
;
96 SfxBindings
& rBindings
;
99 sal_uInt16 nLastStyleTbxId
;
100 sal_uInt16 nStyleOffId
;
101 sal_uInt16 nStyleRotateId
;
102 sal_uInt16 nStyleUprightId
;
103 sal_uInt16 nStyleSlantXId
;
104 sal_uInt16 nStyleSlantYId
;
106 sal_uInt16 nLastAdjustTbxId
;
107 sal_uInt16 nAdjustMirrorId
;
108 sal_uInt16 nAdjustLeftId
;
109 sal_uInt16 nAdjustCenterId
;
110 sal_uInt16 nAdjustRightId
;
111 sal_uInt16 nAdjustAutoSizeId
;
113 sal_uInt16 nLastShadowTbxId
;
114 sal_uInt16 nShowFormId
;
115 sal_uInt16 nOutlineId
;
116 sal_uInt16 nShadowOffId
;
117 sal_uInt16 nShadowNormalId
;
118 sal_uInt16 nShadowSlantId
;
122 long nSaveShadowAngle
;
123 long nSaveShadowSize
;
125 friend class SvxFontWorkChildWindow
;
126 friend class SvxFontWorkControllerItem
;
128 DECL_LINK( SelectStyleHdl_Impl
, ToolBox
*, void );
129 DECL_LINK( SelectAdjustHdl_Impl
, ToolBox
*, void );
130 DECL_LINK( SelectShadowHdl_Impl
, ToolBox
*, void );
132 DECL_LINK( ModifyInputHdl_Impl
, Edit
&, void );
133 DECL_LINK( InputTimoutHdl_Impl
, Timer
*, void );
135 DECL_LINK( ColorSelectHdl_Impl
, SvxColorListBox
&, void );
137 void SetStyle_Impl(const XFormTextStyleItem
*);
138 void SetAdjust_Impl(const XFormTextAdjustItem
*);
139 void SetDistance_Impl(const XFormTextDistanceItem
*);
140 void SetStart_Impl(const XFormTextStartItem
*);
141 void SetMirror_Impl(const XFormTextMirrorItem
*);
142 void SetShowForm_Impl(const XFormTextHideFormItem
*);
143 void SetOutline_Impl(const XFormTextOutlineItem
*);
144 void SetShadow_Impl(const XFormTextShadowItem
*, bool bRestoreValues
= false);
145 void SetShadowColor_Impl(const XFormTextShadowColorItem
*);
146 void SetShadowXVal_Impl(const XFormTextShadowXValItem
*);
147 void SetShadowYVal_Impl(const XFormTextShadowYValItem
*);
149 void ApplyImageList();
152 virtual SfxChildAlignment
CheckAlignment( SfxChildAlignment eActAlign
,
153 SfxChildAlignment eAlign
) override
;
156 SvxFontWorkDialog(SfxBindings
*pBinding
, SfxChildWindow
*pCW
,
157 vcl::Window
* pParent
);
158 virtual ~SvxFontWorkDialog() override
;
159 virtual void dispose() override
;
162 #endif // INCLUDED_SVX_FONTWORK_HXX
164 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */