Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef _SVX_FONTWORK_HXX
20 : #define _SVX_FONTWORK_HXX
21 :
22 : #include <vcl/toolbox.hxx>
23 : #include <vcl/fixed.hxx>
24 : #include <svtools/valueset.hxx>
25 : #include <sfx2/dockwin.hxx>
26 : #include <sfx2/ctrlitem.hxx>
27 : #include <svx/xenum.hxx>
28 : #include <svx/dlgctrl.hxx>
29 : #include "svx/svxdllapi.h"
30 :
31 : // forward ---------------------------------------------------------------
32 :
33 : class SdrView;
34 : class SdrPageView;
35 : class SdrObject;
36 :
37 : class XFormTextAdjustItem;
38 : class XFormTextDistanceItem;
39 : class XFormTextStartItem;
40 : class XFormTextMirrorItem;
41 : class XFormTextStdFormItem;
42 : class XFormTextHideFormItem;
43 : class XFormTextOutlineItem;
44 : class XFormTextShadowItem;
45 : class XFormTextShadowColorItem;
46 : class XFormTextShadowXValItem;
47 : class XFormTextShadowYValItem;
48 :
49 : /*************************************************************************
50 : |*
51 : |* ControllerItem for Fontwork
52 : |*
53 : \************************************************************************/
54 :
55 : class SvxFontWorkDialog;
56 :
57 0 : class SvxFontWorkControllerItem : public SfxControllerItem
58 : {
59 : SvxFontWorkDialog &rFontWorkDlg;
60 :
61 : protected:
62 : virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState,
63 : const SfxPoolItem* pState);
64 :
65 : public:
66 : SvxFontWorkControllerItem(sal_uInt16 nId, SvxFontWorkDialog&, SfxBindings&);
67 : };
68 :
69 : /*************************************************************************
70 : |*
71 : |* Derived from SfxChildWindow as "container" for fontwork dialog
72 : |*
73 : \************************************************************************/
74 :
75 0 : class SVX_DLLPUBLIC SvxFontWorkChildWindow : public SfxChildWindow
76 : {
77 : public:
78 : SvxFontWorkChildWindow(Window*, sal_uInt16, SfxBindings*, SfxChildWinInfo*);
79 : SFX_DECL_CHILDWINDOW_WITHID(SvxFontWorkChildWindow);
80 : };
81 :
82 : /*************************************************************************
83 : |*
84 : |* Floating window for setting attributes of text effects
85 : |*
86 : \************************************************************************/
87 :
88 : class SVX_DLLPUBLIC SvxFontWorkDialog : public SfxDockingWindow
89 : {
90 : #define CONTROLLER_COUNT 12
91 :
92 : SvxFontWorkControllerItem* pCtrlItems[CONTROLLER_COUNT];
93 :
94 : ValueSet aFormSet;
95 :
96 : ToolBox aTbxStyle;
97 : ToolBox aTbxAdjust;
98 :
99 : FixedImage aFbDistance;
100 : MetricField aMtrFldDistance;
101 : FixedImage aFbTextStart;
102 : MetricField aMtrFldTextStart;
103 :
104 : ToolBox aTbxShadow;
105 :
106 : FixedImage aFbShadowX;
107 : MetricField aMtrFldShadowX;
108 : FixedImage aFbShadowY;
109 : MetricField aMtrFldShadowY;
110 :
111 : ColorLB aShadowColorLB;
112 :
113 : SfxBindings& rBindings;
114 : Timer aInputTimer;
115 :
116 : sal_uInt16 nLastStyleTbxId;
117 : sal_uInt16 nLastAdjustTbxId;
118 : sal_uInt16 nLastShadowTbxId;
119 : long nSaveShadowX;
120 : long nSaveShadowY;
121 : long nSaveShadowAngle;
122 : long nSaveShadowSize;
123 :
124 : ImageList maImageList;
125 :
126 : XColorListRef pColorList;
127 :
128 : #ifdef _SVX_FONTWORK_CXX
129 : friend class SvxFontWorkChildWindow;
130 : friend class SvxFontWorkControllerItem;
131 :
132 : DECL_LINK( SelectStyleHdl_Impl, void * );
133 : DECL_LINK( SelectAdjustHdl_Impl, void * );
134 : DECL_LINK( SelectShadowHdl_Impl, void * );
135 :
136 : DECL_LINK( ModifyInputHdl_Impl, void * );
137 : DECL_LINK( InputTimoutHdl_Impl, void * );
138 :
139 : DECL_LINK( FormSelectHdl_Impl, void * );
140 : DECL_LINK( ColorSelectHdl_Impl, void * );
141 :
142 : void SetStyle_Impl(const XFormTextStyleItem*);
143 : void SetAdjust_Impl(const XFormTextAdjustItem*);
144 : void SetDistance_Impl(const XFormTextDistanceItem*);
145 : void SetStart_Impl(const XFormTextStartItem*);
146 : void SetMirror_Impl(const XFormTextMirrorItem*);
147 : void SetStdForm_Impl(const XFormTextStdFormItem*);
148 : void SetShowForm_Impl(const XFormTextHideFormItem*);
149 : void SetOutline_Impl(const XFormTextOutlineItem*);
150 : void SetShadow_Impl(const XFormTextShadowItem*,
151 : sal_Bool bRestoreValues = sal_False);
152 : void SetShadowColor_Impl(const XFormTextShadowColorItem*);
153 : void SetShadowXVal_Impl(const XFormTextShadowXValItem*);
154 : void SetShadowYVal_Impl(const XFormTextShadowYValItem*);
155 : #endif
156 :
157 : virtual void DataChanged( const DataChangedEvent& rDCEvt );
158 : void ApplyImageList();
159 :
160 : protected:
161 : virtual void Zoom();
162 : virtual SfxChildAlignment CheckAlignment( SfxChildAlignment eActAlign,
163 : SfxChildAlignment eAlign );
164 :
165 : public:
166 : SvxFontWorkDialog( SfxBindings *pBindinx,
167 : SfxChildWindow *pCW,
168 : Window* pParent,
169 : const ResId& rResId );
170 : ~SvxFontWorkDialog();
171 :
172 : void SetColorList(const XColorListRef &pTable);
173 : void SetActive(sal_Bool bActivate = sal_True);
174 :
175 : void CreateStdFormObj(SdrView& rView, SdrPageView& rPV,
176 : const SfxItemSet& rAttr, SdrObject& rOldObj,
177 : XFormTextStdForm eForm);
178 : };
179 :
180 : #endif // _SVX_FONTWORK_HXX
181 :
182 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|