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