Branch libreoffice-5-0-4
[LibreOffice.git] / include / svx / fontwork.hxx
blob4dd6aaeb1236f65858755188992ccd46e5342b30
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 <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 ---------------------------------------------------------------
35 class SdrView;
36 class SdrPageView;
37 class SdrObject;
39 class XFormTextAdjustItem;
40 class XFormTextDistanceItem;
41 class XFormTextStartItem;
42 class XFormTextMirrorItem;
43 class XFormTextHideFormItem;
44 class XFormTextOutlineItem;
45 class XFormTextShadowItem;
46 class XFormTextShadowColorItem;
47 class XFormTextShadowXValItem;
48 class XFormTextShadowYValItem;
50 /*************************************************************************
52 |* ControllerItem for Fontwork
54 \************************************************************************/
56 class SvxFontWorkDialog;
58 class SvxFontWorkControllerItem : public SfxControllerItem
60 SvxFontWorkDialog &rFontWorkDlg;
62 protected:
63 virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState,
64 const SfxPoolItem* pState) SAL_OVERRIDE;
66 public:
67 SvxFontWorkControllerItem(sal_uInt16 nId, SvxFontWorkDialog&, SfxBindings&);
70 /*************************************************************************
72 |* Derived from SfxChildWindow as "container" for fontwork dialog
74 \************************************************************************/
76 class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxFontWorkChildWindow : public SfxChildWindow
78 public:
79 SvxFontWorkChildWindow(vcl::Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo*);
80 SFX_DECL_CHILDWINDOW_WITHID(SvxFontWorkChildWindow);
83 /*************************************************************************
85 |* Floating window for setting attributes of text effects
87 \************************************************************************/
89 class SVX_DLLPUBLIC SAL_WARN_UNUSED SvxFontWorkDialog : public SfxDockingWindow
91 #define CONTROLLER_COUNT 11
93 SvxFontWorkControllerItem* pCtrlItems[CONTROLLER_COUNT];
95 VclPtr<ToolBox> m_pTbxStyle;
96 VclPtr<ToolBox> m_pTbxAdjust;
98 VclPtr<FixedImage> m_pFbDistance;
99 VclPtr<MetricField> m_pMtrFldDistance;
100 VclPtr<FixedImage> m_pFbTextStart;
101 VclPtr<MetricField> m_pMtrFldTextStart;
103 VclPtr<ToolBox> m_pTbxShadow;
105 VclPtr<FixedImage> m_pFbShadowX;
106 VclPtr<MetricField> m_pMtrFldShadowX;
107 VclPtr<FixedImage> m_pFbShadowY;
108 VclPtr<MetricField> m_pMtrFldShadowY;
110 VclPtr<ColorLB> m_pShadowColorLB;
112 SfxBindings& rBindings;
113 Idle aInputIdle;
115 sal_uInt16 nLastStyleTbxId;
116 sal_uInt16 nStyleOffId;
117 sal_uInt16 nStyleRotateId;
118 sal_uInt16 nStyleUprightId;
119 sal_uInt16 nStyleSlantXId;
120 sal_uInt16 nStyleSlantYId;
122 sal_uInt16 nLastAdjustTbxId;
123 sal_uInt16 nAdjustMirrorId;
124 sal_uInt16 nAdjustLeftId;
125 sal_uInt16 nAdjustCenterId;
126 sal_uInt16 nAdjustRightId;
127 sal_uInt16 nAdjustAutoSizeId;
129 sal_uInt16 nLastShadowTbxId;
130 sal_uInt16 nShowFormId;
131 sal_uInt16 nOutlineId;
132 sal_uInt16 nShadowOffId;
133 sal_uInt16 nShadowNormalId;
134 sal_uInt16 nShadowSlantId;
136 long nSaveShadowX;
137 long nSaveShadowY;
138 long nSaveShadowAngle;
139 long nSaveShadowSize;
141 XColorListRef pColorList;
143 friend class SvxFontWorkChildWindow;
144 friend class SvxFontWorkControllerItem;
146 DECL_LINK_TYPED( SelectStyleHdl_Impl, ToolBox *, void );
147 DECL_LINK_TYPED( SelectAdjustHdl_Impl, ToolBox *, void );
148 DECL_LINK_TYPED( SelectShadowHdl_Impl, ToolBox *, void );
150 DECL_LINK( ModifyInputHdl_Impl, void * );
151 DECL_LINK_TYPED( InputTimoutHdl_Impl, Idle *, void );
153 DECL_LINK( ColorSelectHdl_Impl, void * );
155 void SetStyle_Impl(const XFormTextStyleItem*);
156 void SetAdjust_Impl(const XFormTextAdjustItem*);
157 void SetDistance_Impl(const XFormTextDistanceItem*);
158 void SetStart_Impl(const XFormTextStartItem*);
159 void SetMirror_Impl(const XFormTextMirrorItem*);
160 void SetShowForm_Impl(const XFormTextHideFormItem*);
161 void SetOutline_Impl(const XFormTextOutlineItem*);
162 void SetShadow_Impl(const XFormTextShadowItem*, bool bRestoreValues = false);
163 void SetShadowColor_Impl(const XFormTextShadowColorItem*);
164 void SetShadowXVal_Impl(const XFormTextShadowXValItem*);
165 void SetShadowYVal_Impl(const XFormTextShadowYValItem*);
167 void ApplyImageList();
169 protected:
170 virtual SfxChildAlignment CheckAlignment( SfxChildAlignment eActAlign,
171 SfxChildAlignment eAlign ) SAL_OVERRIDE;
173 public:
174 SvxFontWorkDialog(SfxBindings *pBinding, SfxChildWindow *pCW,
175 vcl::Window* pParent);
176 virtual ~SvxFontWorkDialog();
177 virtual void dispose() SAL_OVERRIDE;
179 void SetColorList(const XColorListRef &pTable);
182 #endif // INCLUDED_SVX_FONTWORK_HXX
184 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */