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