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 2595a18594SAndre Fischer #include <vcl/ctrl.hxx> 26b9e67834SAndre Fischer #include <sfx2/sidebar/SidebarPanelBase.hxx> 27b9e67834SAndre Fischer #include <sfx2/sidebar/ControllerItem.hxx> 28f120fe41SAndre Fischer #include <sfx2/sidebar/IContextChangeReceiver.hxx> 29b9e67834SAndre Fischer 30b9e67834SAndre Fischer #include <svtools/ctrlbox.hxx> 31b9e67834SAndre Fischer #include <svx/tbxcolorupdate.hxx> 32b9e67834SAndre Fischer #include <editeng/svxenum.hxx> 33b9e67834SAndre Fischer #include <editeng/fhgtitem.hxx> 34b9e67834SAndre Fischer 35b9e67834SAndre Fischer #include <com/sun/star/ui/XUIElement.hpp> 36b9e67834SAndre Fischer 37b9e67834SAndre Fischer #include <boost/scoped_ptr.hpp> 38*da72173fSAndre Fischer 39b9e67834SAndre Fischer 4095a18594SAndre Fischer class FloatingWindow; 4195a18594SAndre Fischer class ToolBox; 4295a18594SAndre Fischer 43b9e67834SAndre Fischer namespace svx { namespace sidebar { 44b9e67834SAndre Fischer 45b9e67834SAndre Fischer class SvxSBFontNameBox; 46b9e67834SAndre Fischer 47b9e67834SAndre Fischer class TextPropertyPanel 4895a18594SAndre Fischer : public Control, 49*da72173fSAndre Fischer public ::sfx2::sidebar::IContextChangeReceiver, 50b9e67834SAndre Fischer public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface 51b9e67834SAndre Fischer { 52b9e67834SAndre Fischer public: 5395a18594SAndre 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); 59*da72173fSAndre Fischer 60*da72173fSAndre Fischer // void SetDefaultUnderline(FontUnderline eUnderline); 61b9e67834SAndre Fischer // USHORT GetCurrColorType(); 62b9e67834SAndre Fischer 63b9e67834SAndre Fischer // void SetBackColor(Color aCol); 64b9e67834SAndre Fischer // void SetColor(Color aCol); 65*da72173fSAndre 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 81*da72173fSAndre 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; 1027a32b0c8SAndre Fischer ::boost::scoped_ptr<Window> mpToolBoxIncDecBackground; 1037a32b0c8SAndre Fischer ::boost::scoped_ptr<ToolBox> mpToolBoxIncDec; 1047a32b0c8SAndre Fischer ::boost::scoped_ptr<Window> mpToolBoxFontBackground; 105b9e67834SAndre Fischer ::boost::scoped_ptr<ToolBox> mpToolBoxFont; 1067a32b0c8SAndre Fischer ::boost::scoped_ptr<Window> mpToolBoxFontColorBackground; 107b9e67834SAndre Fischer ::boost::scoped_ptr<ToolBox> mpToolBoxFontColor; 1087a32b0c8SAndre Fischer ::boost::scoped_ptr<Window> mpToolBoxScriptBackground; 109b9e67834SAndre Fischer ::boost::scoped_ptr<ToolBox> mpToolBoxScript; 1107a32b0c8SAndre Fischer ::boost::scoped_ptr<Window> mpToolBoxScriptSwBackground; 111b9e67834SAndre Fischer ::boost::scoped_ptr<ToolBox> mpToolBoxScriptSw; 1127a32b0c8SAndre Fischer ::boost::scoped_ptr<Window> mpToolBoxSpacingBackground; 113b9e67834SAndre Fischer ::boost::scoped_ptr<ToolBox> mpToolBoxSpacing; 1147a32b0c8SAndre Fischer ::boost::scoped_ptr<Window> mpToolBoxHighlightBackground; 115b9e67834SAndre Fischer ::boost::scoped_ptr<ToolBox> mpToolBoxHighlight; 116b9e67834SAndre Fischer ::boost::scoped_ptr<ToolboxButtonColorUpdater> mpFontColorUpdater; 117b9e67834SAndre Fischer ::boost::scoped_ptr<ToolboxButtonColorUpdater> mpHighlightUpdater; 118b9e67834SAndre Fischer 119b9e67834SAndre Fischer //control items 120b9e67834SAndre Fischer ::sfx2::sidebar::ControllerItem maFontNameControl; 121b9e67834SAndre Fischer ::sfx2::sidebar::ControllerItem maFontSizeControl; 122b9e67834SAndre Fischer ::sfx2::sidebar::ControllerItem maWeightControl; 123b9e67834SAndre Fischer ::sfx2::sidebar::ControllerItem maItalicControl; 124b9e67834SAndre Fischer ::sfx2::sidebar::ControllerItem maUnderlineControl; 125b9e67834SAndre Fischer ::sfx2::sidebar::ControllerItem maStrikeControl; 126b9e67834SAndre Fischer ::sfx2::sidebar::ControllerItem maShadowControl; 127b9e67834SAndre Fischer ::sfx2::sidebar::ControllerItem maFontColorControl; 128b9e67834SAndre Fischer ::sfx2::sidebar::ControllerItem maScriptControlSw; 129b9e67834SAndre Fischer ::sfx2::sidebar::ControllerItem maSuperScriptControl; 130b9e67834SAndre Fischer ::sfx2::sidebar::ControllerItem maSubScriptControl; 131b9e67834SAndre Fischer ::sfx2::sidebar::ControllerItem maSpacingControl; 132b9e67834SAndre Fischer ::sfx2::sidebar::ControllerItem maHighlightControl; 133b9e67834SAndre Fischer ::sfx2::sidebar::ControllerItem maSDFontGrow; 134b9e67834SAndre Fischer ::sfx2::sidebar::ControllerItem maSDFontShrink; 135b9e67834SAndre Fischer 136b9e67834SAndre Fischer //Images 137b9e67834SAndre Fischer Image maImgIncrease; 138b9e67834SAndre Fischer Image maImgDecrease; 139b9e67834SAndre Fischer Image maImgBold; 140b9e67834SAndre Fischer Image maImgItalic; 141b9e67834SAndre Fischer Image maImgUnderline; 142b9e67834SAndre Fischer Image maImgStrike; 143b9e67834SAndre Fischer Image maImgShadow; 144b9e67834SAndre Fischer Image maImgFontColor; 145b9e67834SAndre Fischer Image maImgSupScript; 146b9e67834SAndre Fischer Image maImgSubScript; 147b9e67834SAndre Fischer Image maImgHighlight; 148b9e67834SAndre Fischer 149b9e67834SAndre Fischer Image maImgNormalIcon; 150b9e67834SAndre Fischer 151b9e67834SAndre Fischer Image maImgIncreaseHigh; 152b9e67834SAndre Fischer Image maImgDecreaseHigh; 153b9e67834SAndre Fischer Image maImgBoldHigh; 154b9e67834SAndre Fischer Image maImgItalicHigh; 155b9e67834SAndre Fischer Image maImgUnderlineHigh; 156b9e67834SAndre Fischer Image maImgStrikeHigh; 157b9e67834SAndre Fischer Image maImgShadowHigh; 158b9e67834SAndre Fischer Image maImgFontColorHigh; 159b9e67834SAndre Fischer Image maImgSupScriptHigh; 160b9e67834SAndre Fischer Image maImgSubScriptHigh; 161b9e67834SAndre Fischer // Image maImgSpacingHigh; // 162b9e67834SAndre Fischer Image maImgHighlightHigh; 163b9e67834SAndre Fischer 164b9e67834SAndre Fischer FontWeight meWeight; 165b9e67834SAndre Fischer FontItalic meItalic; 166b9e67834SAndre Fischer FontUnderline meUnderline; 167b9e67834SAndre Fischer Color meUnderlineColor; // 168b9e67834SAndre Fischer bool mbShadow; 169b9e67834SAndre Fischer FontStrikeout meStrike; 170b9e67834SAndre Fischer bool mbWeightAvailable; 171b9e67834SAndre Fischer bool mbPostureAvailable; 172b9e67834SAndre Fischer Color maColor; 173b9e67834SAndre Fischer bool mbColorAvailable; 174b9e67834SAndre Fischer Color maBackColor; 175b9e67834SAndre Fischer bool mbBackColorAvailable; 176b9e67834SAndre Fischer ColorType meColorType; 177b9e67834SAndre Fischer SvxEscapement meEscape; //for sw 178b9e67834SAndre Fischer bool mbSuper; 179b9e67834SAndre Fischer bool mbSub; 180b9e67834SAndre Fischer bool mbKernAvailable; 181b9e67834SAndre Fischer bool mbKernLBAvailable; 182b9e67834SAndre Fischer long mlKerning; 183b9e67834SAndre Fischer SvxFontHeightItem* mpHeightItem; 184b9e67834SAndre Fischer 185b9e67834SAndre Fischer const FontList* mpFontList; 186b9e67834SAndre Fischer bool mbMustDelete; 187b9e67834SAndre Fischer bool mbFocusOnFontSizeCtrl; 188b9e67834SAndre Fischer 18995a18594SAndre Fischer cssu::Reference<css::frame::XFrame> mxFrame; 190b9e67834SAndre Fischer ::sfx2::sidebar::EnumContext maContext; 191b9e67834SAndre Fischer SfxBindings* mpBindings; 192b9e67834SAndre Fischer 193b9e67834SAndre Fischer TextPropertyPanel ( 194b9e67834SAndre Fischer Window* pParent, 195b9e67834SAndre Fischer const cssu::Reference<css::frame::XFrame>& rxFrame, 196b9e67834SAndre Fischer SfxBindings* pBindings); 197*da72173fSAndre Fischer virtual ~TextPropertyPanel (void); 198b9e67834SAndre Fischer 199b9e67834SAndre Fischer void Initialize (void); 200b9e67834SAndre Fischer void SetupIcons (void); 201b9e67834SAndre Fischer void InitToolBoxFont(); 202b9e67834SAndre Fischer void InitToolBoxIncDec(); 203b9e67834SAndre Fischer void InitToolBoxFontColor(); 204b9e67834SAndre Fischer void InitToolBoxScript(); 205b9e67834SAndre Fischer void InitToolBoxHighlight(); 206b9e67834SAndre Fischer void InitToolBoxSpacing(); 207b9e67834SAndre Fischer 208b9e67834SAndre Fischer void UpdateFontBold(); 209b9e67834SAndre Fischer void UpdateFontItalic(); 210b9e67834SAndre Fischer void UpdateFontUnderline(); 211b9e67834SAndre Fischer void UpdateFontStrikeOut(); 212b9e67834SAndre Fischer void UpdateFontShadowed(); 213b9e67834SAndre Fischer void UpdateFontScript(); 214b9e67834SAndre Fischer 215b9e67834SAndre Fischer /* 216b9e67834SAndre Fischer SfxPopupPanelWin* mpFloatWinUnderline; 217b9e67834SAndre Fischer class SvxTextUnderlinePage; 218b9e67834SAndre Fischer SvxTextUnderlinePage* mpPageUnderline; 219b9e67834SAndre Fischer 220b9e67834SAndre Fischer SfxPopupPanelWin* mpFloatWinFontColor; 221b9e67834SAndre Fischer class SvxTextFontColorPage; 222b9e67834SAndre Fischer SvxTextFontColorPage* mpPageFontColor; 223b9e67834SAndre Fischer 224b9e67834SAndre Fischer SfxPopupPanelWin* mpFloatWinSpacing; 225b9e67834SAndre Fischer class SvxTextSpacingPage; 226b9e67834SAndre Fischer SvxTextSpacingPage* mpPageSpacing; 227b9e67834SAndre Fischer */ 228b9e67834SAndre Fischer DECL_LINK(FontSelHdl, FontNameBox *); 229b9e67834SAndre Fischer DECL_LINK(FontSizeModifyHdl, FontSizeBox *); 230b9e67834SAndre Fischer DECL_LINK(FontSizeSelHdl, FontSizeBox *); 231b9e67834SAndre Fischer DECL_LINK(FontSizeLoseFocus, FontSizeBox *); 232b9e67834SAndre Fischer DECL_LINK(ToolboxFontSelectHandler, ToolBox *); 233b9e67834SAndre Fischer DECL_LINK(ToolboxIncDecSelectHdl, ToolBox *); 234*da72173fSAndre Fischer DECL_LINK(ToolBoxUnderlineClickHdl, ToolBox* ); 235b9e67834SAndre Fischer DECL_LINK(ImplPopupModeEndHdl, FloatingWindow* ); 236*da72173fSAndre Fischer DECL_LINK(ImplSpacingPopupModeEndHdl, FloatingWindow* ); // 237*da72173fSAndre Fischer DECL_LINK(ToolBoxFontColorDropHdl, ToolBox *); 238b9e67834SAndre Fischer DECL_LINK(ToolBoxSwScriptSelectHdl, ToolBox *); 239b9e67834SAndre Fischer DECL_LINK(ToolBoxScriptSelectHdl, ToolBox *); 240*da72173fSAndre Fischer DECL_LINK(SpacingClickHdl, ToolBox*); 241*da72173fSAndre Fischer DECL_LINK(ToolBoxHighlightDropHdl, ToolBox *); 242b9e67834SAndre Fischer 243b9e67834SAndre Fischer void TextStyleChanged(); 24495a18594SAndre Fischer 24595a18594SAndre Fischer Image GetIcon (const ::rtl::OUString& rsURL); 246b9e67834SAndre Fischer }; 247b9e67834SAndre Fischer 248b9e67834SAndre Fischer } } // end of namespace ::svx::sidebar 249b9e67834SAndre Fischer 250b9e67834SAndre Fischer #endif 251