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/idle.hxx>
25 #include <svtools/valueset.hxx>
26 #include <sfx2/dockwin.hxx>
27 #include <sfx2/ctrlitem.hxx>
28 #include <svx/xenum.hxx>
29 #include <svx/dlgctrl.hxx>
30 #include <svx/svxdllapi.h>
31 #include <svx/xtextit0.hxx>
33 // forward ---------------------------------------------------------------
38 class SvxColorListBox
;
40 class XFormTextAdjustItem
;
41 class XFormTextDistanceItem
;
42 class XFormTextStartItem
;
43 class XFormTextMirrorItem
;
44 class XFormTextHideFormItem
;
45 class XFormTextOutlineItem
;
46 class XFormTextShadowItem
;
47 class XFormTextShadowColorItem
;
48 class XFormTextShadowXValItem
;
49 class XFormTextShadowYValItem
;
51 /*************************************************************************
53 |* ControllerItem for Fontwork
55 \************************************************************************/
57 class SvxFontWorkDialog
;
59 class SvxFontWorkControllerItem
: public SfxControllerItem
61 SvxFontWorkDialog
&rFontWorkDlg
;
64 virtual void StateChanged(sal_uInt16 nSID
, SfxItemState eState
,
65 const SfxPoolItem
* pState
) override
;
68 SvxFontWorkControllerItem(sal_uInt16 nId
, SvxFontWorkDialog
&, SfxBindings
&);
71 /*************************************************************************
73 |* Derived from SfxChildWindow as "container" for fontwork dialog
75 \************************************************************************/
77 class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxFontWorkChildWindow
: public SfxChildWindow
80 SvxFontWorkChildWindow(vcl::Window
*, sal_uInt16
, SfxBindings
*, SfxChildWinInfo
*);
81 SFX_DECL_CHILDWINDOW_WITHID(SvxFontWorkChildWindow
);
84 /*************************************************************************
86 |* Floating window for setting attributes of text effects
88 \************************************************************************/
90 class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxFontWorkDialog
: public SfxDockingWindow
92 #define CONTROLLER_COUNT 11
94 SvxFontWorkControllerItem
* pCtrlItems
[CONTROLLER_COUNT
];
96 VclPtr
<ToolBox
> m_pTbxStyle
;
97 VclPtr
<ToolBox
> m_pTbxAdjust
;
99 VclPtr
<FixedImage
> m_pFbDistance
;
100 VclPtr
<MetricField
> m_pMtrFldDistance
;
101 VclPtr
<FixedImage
> m_pFbTextStart
;
102 VclPtr
<MetricField
> m_pMtrFldTextStart
;
104 VclPtr
<ToolBox
> m_pTbxShadow
;
106 VclPtr
<FixedImage
> m_pFbShadowX
;
107 VclPtr
<MetricField
> m_pMtrFldShadowX
;
108 VclPtr
<FixedImage
> m_pFbShadowY
;
109 VclPtr
<MetricField
> m_pMtrFldShadowY
;
111 VclPtr
<SvxColorListBox
> m_pShadowColorLB
;
113 SfxBindings
& rBindings
;
116 sal_uInt16 nLastStyleTbxId
;
117 sal_uInt16 nStyleOffId
;
118 sal_uInt16 nStyleRotateId
;
119 sal_uInt16 nStyleUprightId
;
120 sal_uInt16 nStyleSlantXId
;
121 sal_uInt16 nStyleSlantYId
;
123 sal_uInt16 nLastAdjustTbxId
;
124 sal_uInt16 nAdjustMirrorId
;
125 sal_uInt16 nAdjustLeftId
;
126 sal_uInt16 nAdjustCenterId
;
127 sal_uInt16 nAdjustRightId
;
128 sal_uInt16 nAdjustAutoSizeId
;
130 sal_uInt16 nLastShadowTbxId
;
131 sal_uInt16 nShowFormId
;
132 sal_uInt16 nOutlineId
;
133 sal_uInt16 nShadowOffId
;
134 sal_uInt16 nShadowNormalId
;
135 sal_uInt16 nShadowSlantId
;
139 long nSaveShadowAngle
;
140 long nSaveShadowSize
;
142 friend class SvxFontWorkChildWindow
;
143 friend class SvxFontWorkControllerItem
;
145 DECL_LINK( SelectStyleHdl_Impl
, ToolBox
*, void );
146 DECL_LINK( SelectAdjustHdl_Impl
, ToolBox
*, void );
147 DECL_LINK( SelectShadowHdl_Impl
, ToolBox
*, void );
149 DECL_LINK( ModifyInputHdl_Impl
, Edit
&, void );
150 DECL_LINK( InputTimoutHdl_Impl
, Timer
*, void );
152 DECL_LINK( ColorSelectHdl_Impl
, SvxColorListBox
&, void );
154 void SetStyle_Impl(const XFormTextStyleItem
*);
155 void SetAdjust_Impl(const XFormTextAdjustItem
*);
156 void SetDistance_Impl(const XFormTextDistanceItem
*);
157 void SetStart_Impl(const XFormTextStartItem
*);
158 void SetMirror_Impl(const XFormTextMirrorItem
*);
159 void SetShowForm_Impl(const XFormTextHideFormItem
*);
160 void SetOutline_Impl(const XFormTextOutlineItem
*);
161 void SetShadow_Impl(const XFormTextShadowItem
*, bool bRestoreValues
= false);
162 void SetShadowColor_Impl(const XFormTextShadowColorItem
*);
163 void SetShadowXVal_Impl(const XFormTextShadowXValItem
*);
164 void SetShadowYVal_Impl(const XFormTextShadowYValItem
*);
166 void ApplyImageList();
169 virtual SfxChildAlignment
CheckAlignment( SfxChildAlignment eActAlign
,
170 SfxChildAlignment eAlign
) override
;
173 SvxFontWorkDialog(SfxBindings
*pBinding
, SfxChildWindow
*pCW
,
174 vcl::Window
* pParent
);
175 virtual ~SvxFontWorkDialog() override
;
176 virtual void dispose() override
;
179 #endif // INCLUDED_SVX_FONTWORK_HXX
181 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */