1b9e67834SAndre Fischer /**************************************************************
2b9e67834SAndre Fischer  *
3b9e67834SAndre Fischer  * Licensed to the Apache Software Foundation (ASF) under one
4b9e67834SAndre Fischer  * or more contributor license agreements.  See the NOTICE file
5b9e67834SAndre Fischer  * distributed with this work for additional information
6b9e67834SAndre Fischer  * regarding copyright ownership.  The ASF licenses this file
7b9e67834SAndre Fischer  * to you under the Apache License, Version 2.0 (the
8b9e67834SAndre Fischer  * "License"); you may not use this file except in compliance
9b9e67834SAndre Fischer  * with the License.  You may obtain a copy of the License at
10b9e67834SAndre Fischer  *
11b9e67834SAndre Fischer  *   http://www.apache.org/licenses/LICENSE-2.0
12b9e67834SAndre Fischer  *
13b9e67834SAndre Fischer  * Unless required by applicable law or agreed to in writing,
14b9e67834SAndre Fischer  * software distributed under the License is distributed on an
15b9e67834SAndre Fischer  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16b9e67834SAndre Fischer  * KIND, either express or implied.  See the License for the
17b9e67834SAndre Fischer  * specific language governing permissions and limitations
18b9e67834SAndre Fischer  * under the License.
19b9e67834SAndre Fischer  *
20b9e67834SAndre Fischer  *************************************************************/
21b9e67834SAndre Fischer 
22b9e67834SAndre Fischer #ifndef SVX_SIDEBAR_TEXT_PROPERTY_PAGE_HXX
23b9e67834SAndre Fischer #define SVX_SIDEBAR_TEXT_PROPERTY_PAGE_HXX
24b9e67834SAndre Fischer 
25*95a18594SAndre Fischer #include <vcl/ctrl.hxx>
26b9e67834SAndre Fischer #include <sfx2/sidebar/SidebarPanelBase.hxx>
27b9e67834SAndre Fischer #include <sfx2/sidebar/ControllerItem.hxx>
28b9e67834SAndre Fischer 
29b9e67834SAndre Fischer #include <svtools/ctrlbox.hxx>
30b9e67834SAndre Fischer #include <svx/tbxcolorupdate.hxx>
31b9e67834SAndre Fischer #include <editeng/svxenum.hxx>
32b9e67834SAndre Fischer #include <editeng/fhgtitem.hxx>
33b9e67834SAndre Fischer 
34b9e67834SAndre Fischer #include <com/sun/star/ui/XUIElement.hpp>
35b9e67834SAndre Fischer 
36b9e67834SAndre Fischer #include <boost/scoped_ptr.hpp>
37b9e67834SAndre Fischer 
38b9e67834SAndre Fischer 
39*95a18594SAndre Fischer class FloatingWindow;
40*95a18594SAndre Fischer class ToolBox;
41*95a18594SAndre Fischer 
42*95a18594SAndre Fischer 
43b9e67834SAndre Fischer namespace svx { namespace sidebar {
44b9e67834SAndre Fischer 
45b9e67834SAndre Fischer class SvxSBFontNameBox;
46b9e67834SAndre Fischer 
47b9e67834SAndre Fischer class TextPropertyPanel
48*95a18594SAndre Fischer     : public Control,
49*95a18594SAndre Fischer       public ::sfx2::sidebar::SidebarPanelBase::ContextChangeReceiverInterface,
50b9e67834SAndre Fischer       public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
51b9e67834SAndre Fischer {
52b9e67834SAndre Fischer public:
53*95a18594SAndre Fischer     static TextPropertyPanel* Create (
54b9e67834SAndre Fischer         Window* pParent,
55b9e67834SAndre Fischer         const cssu::Reference<css::frame::XFrame>& rxFrame,
56b9e67834SAndre Fischer         SfxBindings* pBindings);
57b9e67834SAndre Fischer 
58b9e67834SAndre Fischer     virtual void DataChanged (const DataChangedEvent& rEvent);
59b9e67834SAndre Fischer 
60b9e67834SAndre Fischer     //	void SetDefaultUnderline(FontUnderline eUnderline);
61b9e67834SAndre Fischer     //	USHORT GetCurrColorType();
62b9e67834SAndre Fischer 
63b9e67834SAndre Fischer     //	void SetBackColor(Color aCol);
64b9e67834SAndre Fischer     //	void SetColor(Color aCol);
65b9e67834SAndre Fischer     //	void SetUnderline(FontUnderline	eUnderline);
66b9e67834SAndre Fischer     //	void SetSpacing(long nKern);
67b9e67834SAndre Fischer 
68b9e67834SAndre Fischer     /*
69b9e67834SAndre Fischer 	SvxTextUnderlinePage* GetUnderlinePage();
70b9e67834SAndre Fischer 	SfxPopupPanelWin* GetUnderlineFloatWin();
71b9e67834SAndre Fischer 
72b9e67834SAndre Fischer 	SvxTextFontColorPage* GetFontColorPage();
73b9e67834SAndre Fischer 	SfxPopupPanelWin* GetFontColorFloatWin();
74b9e67834SAndre Fischer 
75b9e67834SAndre Fischer 	SvxTextSpacingPage* GetSpacingPage();
76b9e67834SAndre Fischer 	SfxPopupPanelWin* GetSpacingFloatWin();
77b9e67834SAndre Fischer     */
78b9e67834SAndre Fischer     //	long GetSelFontSize();
79b9e67834SAndre Fischer     //	SfxPropertyPageController GetSpaceController();
80b9e67834SAndre Fischer //	ToolBox* GetSpacingTB();		//removed
81b9e67834SAndre Fischer     //	Color& GetUnderlineColor();  //
82b9e67834SAndre Fischer //	void FontListChanged();
83b9e67834SAndre Fischer 
84b9e67834SAndre Fischer     enum ColorType
85b9e67834SAndre Fischer     {
86b9e67834SAndre Fischer         FONT_COLOR = 1,
87b9e67834SAndre Fischer         BACK_COLOR = 2
88b9e67834SAndre Fischer     };
89b9e67834SAndre Fischer 
90b9e67834SAndre Fischer     virtual void HandleContextChange (
91b9e67834SAndre Fischer         const ::sfx2::sidebar::EnumContext aContext);
92b9e67834SAndre Fischer 
93b9e67834SAndre Fischer     virtual void NotifyItemUpdate(
94b9e67834SAndre Fischer         const sal_uInt16 nSId,
95b9e67834SAndre Fischer         const SfxItemState eState,
96b9e67834SAndre Fischer         const SfxPoolItem* pState);
97b9e67834SAndre Fischer 
98b9e67834SAndre Fischer private:
99b9e67834SAndre Fischer 	//ui controls
100b9e67834SAndre Fischer     ::boost::scoped_ptr<SvxSBFontNameBox> mpFontNameBox;
101b9e67834SAndre Fischer 	FontSizeBox maFontSizeBox;
102b9e67834SAndre Fischer 	::boost::scoped_ptr<ToolBox> mpToolBoxIncDec;
103b9e67834SAndre Fischer 	::boost::scoped_ptr<ToolBox> mpToolBoxFont;
104b9e67834SAndre Fischer 	::boost::scoped_ptr<ToolBox> mpToolBoxFontColor;
105b9e67834SAndre Fischer 	::boost::scoped_ptr<ToolBox> mpToolBoxScript;
106b9e67834SAndre Fischer 	::boost::scoped_ptr<ToolBox> mpToolBoxScriptSw;
107b9e67834SAndre Fischer 	::boost::scoped_ptr<ToolBox> mpToolBoxSpacing;
108b9e67834SAndre Fischer 	::boost::scoped_ptr<ToolBox> mpToolBoxHighlight;
109b9e67834SAndre Fischer 	::boost::scoped_ptr<ToolboxButtonColorUpdater> mpFontColorUpdater;
110b9e67834SAndre Fischer     ::boost::scoped_ptr<ToolboxButtonColorUpdater> mpHighlightUpdater;
111b9e67834SAndre Fischer 
112b9e67834SAndre Fischer 	//control items
113b9e67834SAndre Fischer 	::sfx2::sidebar::ControllerItem maFontNameControl;
114b9e67834SAndre Fischer 	::sfx2::sidebar::ControllerItem maFontSizeControl;
115b9e67834SAndre Fischer 	::sfx2::sidebar::ControllerItem maWeightControl;
116b9e67834SAndre Fischer 	::sfx2::sidebar::ControllerItem maItalicControl;
117b9e67834SAndre Fischer 	::sfx2::sidebar::ControllerItem maUnderlineControl;
118b9e67834SAndre Fischer 	::sfx2::sidebar::ControllerItem maStrikeControl;
119b9e67834SAndre Fischer 	::sfx2::sidebar::ControllerItem maShadowControl;
120b9e67834SAndre Fischer 	::sfx2::sidebar::ControllerItem maFontColorControl;
121b9e67834SAndre Fischer 	::sfx2::sidebar::ControllerItem maScriptControlSw;
122b9e67834SAndre Fischer 	::sfx2::sidebar::ControllerItem maSuperScriptControl;
123b9e67834SAndre Fischer 	::sfx2::sidebar::ControllerItem maSubScriptControl;
124b9e67834SAndre Fischer 	::sfx2::sidebar::ControllerItem maSpacingControl;
125b9e67834SAndre Fischer 	::sfx2::sidebar::ControllerItem maHighlightControl;
126b9e67834SAndre Fischer 	::sfx2::sidebar::ControllerItem maSDFontGrow;
127b9e67834SAndre Fischer 	::sfx2::sidebar::ControllerItem maSDFontShrink;
128b9e67834SAndre Fischer 
129b9e67834SAndre Fischer 	//Images
130b9e67834SAndre Fischer 	Image	maImgIncrease;
131b9e67834SAndre Fischer 	Image	maImgDecrease;
132b9e67834SAndre Fischer 	Image	maImgBold;
133b9e67834SAndre Fischer 	Image	maImgItalic;
134b9e67834SAndre Fischer 	Image	maImgUnderline;
135b9e67834SAndre Fischer 	Image	maImgStrike;
136b9e67834SAndre Fischer 	Image	maImgShadow;
137b9e67834SAndre Fischer 	Image	maImgFontColor;
138b9e67834SAndre Fischer 	Image	maImgSupScript;
139b9e67834SAndre Fischer 	Image	maImgSubScript;
140b9e67834SAndre Fischer 	Image   maImgHighlight;
141b9e67834SAndre Fischer 
142b9e67834SAndre Fischer 	Image				maImgNormalIcon;
143b9e67834SAndre Fischer 
144b9e67834SAndre Fischer 	Image	maImgIncreaseHigh;
145b9e67834SAndre Fischer 	Image	maImgDecreaseHigh;
146b9e67834SAndre Fischer 	Image	maImgBoldHigh;
147b9e67834SAndre Fischer 	Image	maImgItalicHigh;
148b9e67834SAndre Fischer 	Image	maImgUnderlineHigh;
149b9e67834SAndre Fischer 	Image	maImgStrikeHigh;
150b9e67834SAndre Fischer 	Image	maImgShadowHigh;
151b9e67834SAndre Fischer 	Image	maImgFontColorHigh;
152b9e67834SAndre Fischer 	Image	maImgSupScriptHigh;
153b9e67834SAndre Fischer 	Image	maImgSubScriptHigh;
154b9e67834SAndre Fischer //	Image	maImgSpacingHigh;  //
155b9e67834SAndre Fischer 	Image   maImgHighlightHigh;
156b9e67834SAndre Fischer 
157b9e67834SAndre Fischer 	FontWeight					meWeight;
158b9e67834SAndre Fischer 	FontItalic					meItalic;
159b9e67834SAndre Fischer 	FontUnderline				meUnderline;
160b9e67834SAndre Fischer 	Color						meUnderlineColor;  //
161b9e67834SAndre Fischer 	bool						mbShadow;
162b9e67834SAndre Fischer 	FontStrikeout				meStrike;
163b9e67834SAndre Fischer 	bool mbWeightAvailable;
164b9e67834SAndre Fischer 	bool mbPostureAvailable;
165b9e67834SAndre Fischer 	Color						maColor;
166b9e67834SAndre Fischer 	bool mbColorAvailable;
167b9e67834SAndre Fischer 	Color						maBackColor;
168b9e67834SAndre Fischer 	bool mbBackColorAvailable;
169b9e67834SAndre Fischer 	ColorType meColorType;
170b9e67834SAndre Fischer 	SvxEscapement				meEscape;  //for sw
171b9e67834SAndre Fischer 	bool						mbSuper;
172b9e67834SAndre Fischer 	bool						mbSub;
173b9e67834SAndre Fischer 	bool						mbKernAvailable;
174b9e67834SAndre Fischer 	bool						mbKernLBAvailable;
175b9e67834SAndre Fischer 	long						mlKerning;
176b9e67834SAndre Fischer 	SvxFontHeightItem*			mpHeightItem;
177b9e67834SAndre Fischer 
178b9e67834SAndre Fischer 	const FontList* mpFontList;
179b9e67834SAndre Fischer 	bool mbMustDelete;
180b9e67834SAndre Fischer 	bool mbFocusOnFontSizeCtrl;
181b9e67834SAndre Fischer 
182*95a18594SAndre Fischer     cssu::Reference<css::frame::XFrame> mxFrame;
183b9e67834SAndre Fischer     ::sfx2::sidebar::EnumContext maContext;
184b9e67834SAndre Fischer     SfxBindings* mpBindings;
185b9e67834SAndre Fischer 
186b9e67834SAndre Fischer     TextPropertyPanel (
187b9e67834SAndre Fischer         Window* pParent,
188b9e67834SAndre Fischer         const cssu::Reference<css::frame::XFrame>& rxFrame,
189b9e67834SAndre Fischer         SfxBindings* pBindings);
190b9e67834SAndre Fischer     virtual ~TextPropertyPanel (void);
191b9e67834SAndre Fischer 
192b9e67834SAndre Fischer 	void Initialize (void);
193b9e67834SAndre Fischer     void SetupIcons (void);
194b9e67834SAndre Fischer 	void InitToolBoxFont();
195b9e67834SAndre Fischer 	void InitToolBoxIncDec();
196b9e67834SAndre Fischer 	void InitToolBoxFontColor();
197b9e67834SAndre Fischer 	void InitToolBoxScript();
198b9e67834SAndre Fischer 	void InitToolBoxHighlight();
199b9e67834SAndre Fischer 	void InitToolBoxSpacing();
200b9e67834SAndre Fischer 
201b9e67834SAndre Fischer 	void UpdateFontBold();
202b9e67834SAndre Fischer 	void UpdateFontItalic();
203b9e67834SAndre Fischer 	void UpdateFontUnderline();
204b9e67834SAndre Fischer 	void UpdateFontStrikeOut();
205b9e67834SAndre Fischer 	void UpdateFontShadowed();
206b9e67834SAndre Fischer 	void UpdateFontScript();
207b9e67834SAndre Fischer 
208b9e67834SAndre Fischer     /*
209b9e67834SAndre Fischer 	SfxPopupPanelWin*		mpFloatWinUnderline;
210b9e67834SAndre Fischer 	class SvxTextUnderlinePage;
211b9e67834SAndre Fischer 	SvxTextUnderlinePage*	mpPageUnderline;
212b9e67834SAndre Fischer 
213b9e67834SAndre Fischer 	SfxPopupPanelWin*		mpFloatWinFontColor;
214b9e67834SAndre Fischer 	class SvxTextFontColorPage;
215b9e67834SAndre Fischer 	SvxTextFontColorPage*	mpPageFontColor;
216b9e67834SAndre Fischer 
217b9e67834SAndre Fischer 	SfxPopupPanelWin*		mpFloatWinSpacing;
218b9e67834SAndre Fischer 	class SvxTextSpacingPage;
219b9e67834SAndre Fischer 	SvxTextSpacingPage*		mpPageSpacing;
220b9e67834SAndre Fischer     */
221b9e67834SAndre Fischer 	DECL_LINK(FontSelHdl, FontNameBox *);
222b9e67834SAndre Fischer 	DECL_LINK(FontSizeModifyHdl, FontSizeBox *);
223b9e67834SAndre Fischer 	DECL_LINK(FontSizeSelHdl, FontSizeBox *);
224b9e67834SAndre Fischer 	DECL_LINK(FontSizeLoseFocus, FontSizeBox *);
225b9e67834SAndre Fischer 	DECL_LINK(ToolboxFontSelectHandler, ToolBox *);
226b9e67834SAndre Fischer 	DECL_LINK(ToolboxIncDecSelectHdl, ToolBox *);
227b9e67834SAndre Fischer 	DECL_LINK(ToolBoxUnderlineClickHdl, ToolBox* );
228b9e67834SAndre Fischer 	DECL_LINK(ImplPopupModeEndHdl, FloatingWindow* );
229b9e67834SAndre Fischer 	DECL_LINK(ImplSpacingPopupModeEndHdl, FloatingWindow* );  //
230b9e67834SAndre Fischer 	DECL_LINK(ToolBoxFontColorDropHdl, ToolBox *);
231b9e67834SAndre Fischer 	DECL_LINK(ToolBoxSwScriptSelectHdl, ToolBox *);
232b9e67834SAndre Fischer 	DECL_LINK(ToolBoxScriptSelectHdl, ToolBox *);
233b9e67834SAndre Fischer 	DECL_LINK(SpacingClickHdl, ToolBox*);
234b9e67834SAndre Fischer 	DECL_LINK(ToolBoxHighlightDropHdl, ToolBox *);
235b9e67834SAndre Fischer 
236b9e67834SAndre Fischer 	void TextStyleChanged();
237*95a18594SAndre Fischer 
238*95a18594SAndre Fischer     Image GetIcon (const ::rtl::OUString& rsURL);
239b9e67834SAndre Fischer };
240b9e67834SAndre Fischer 
241b9e67834SAndre Fischer } } // end of namespace ::svx::sidebar
242b9e67834SAndre Fischer 
243b9e67834SAndre Fischer #endif
244