/************************************************************** * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. * *************************************************************/ #ifndef SVX_SIDEBAR_TEXT_PROPERTY_PAGE_HXX #define SVX_SIDEBAR_TEXT_PROPERTY_PAGE_HXX #include #include #include #include #include #include #include #include #include namespace svx { namespace sidebar { class SvxSBFontNameBox; class TextPropertyPanel : public ::sfx2::sidebar::SidebarPanelBase, public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface { public: static cssu::Reference Create ( const ::rtl::OUString& rsResourceURL, Window* pParent, const cssu::Reference& rxFrame, SfxBindings* pBindings); // SVX_DLLPUBLIC static SfxSectionPage* createSectionPage(Window* pParent, SfxPropertyPanel* pPanel, PropertySectionType nPageId); virtual void Paint (const Rectangle &rRect); virtual void DataChanged (const DataChangedEvent& rEvent); // void SetDefaultUnderline(FontUnderline eUnderline); // USHORT GetCurrColorType(); // void SetBackColor(Color aCol); // void SetColor(Color aCol); // void SetUnderline(FontUnderline eUnderline); // void SetSpacing(long nKern); /* SvxTextUnderlinePage* GetUnderlinePage(); SfxPopupPanelWin* GetUnderlineFloatWin(); SvxTextFontColorPage* GetFontColorPage(); SfxPopupPanelWin* GetFontColorFloatWin(); SvxTextSpacingPage* GetSpacingPage(); SfxPopupPanelWin* GetSpacingFloatWin(); */ // long GetSelFontSize(); // SfxPropertyPageController GetSpaceController(); // ToolBox* GetSpacingTB(); //removed // Color& GetUnderlineColor(); // // void FontListChanged(); enum ColorType { FONT_COLOR = 1, BACK_COLOR = 2 }; protected: virtual void HandleContextChange ( const ::sfx2::sidebar::EnumContext aContext); virtual void NotifyItemUpdate( const sal_uInt16 nSId, const SfxItemState eState, const SfxPoolItem* pState); private: //ui controls ::boost::scoped_ptr mpFontNameBox; FontSizeBox maFontSizeBox; ::boost::scoped_ptr mpToolBoxIncDec; ::boost::scoped_ptr mpToolBoxFont; ::boost::scoped_ptr mpToolBoxFontColor; ::boost::scoped_ptr mpToolBoxScript; ::boost::scoped_ptr mpToolBoxScriptSw; ::boost::scoped_ptr mpToolBoxSpacing; ::boost::scoped_ptr mpToolBoxHighlight; ::boost::scoped_ptr mpFontColorUpdater; ::boost::scoped_ptr mpHighlightUpdater; //control items ::sfx2::sidebar::ControllerItem maFontNameControl; ::sfx2::sidebar::ControllerItem maFontSizeControl; ::sfx2::sidebar::ControllerItem maWeightControl; ::sfx2::sidebar::ControllerItem maItalicControl; ::sfx2::sidebar::ControllerItem maUnderlineControl; ::sfx2::sidebar::ControllerItem maStrikeControl; ::sfx2::sidebar::ControllerItem maShadowControl; ::sfx2::sidebar::ControllerItem maFontColorControl; ::sfx2::sidebar::ControllerItem maScriptControlSw; ::sfx2::sidebar::ControllerItem maSuperScriptControl; ::sfx2::sidebar::ControllerItem maSubScriptControl; ::sfx2::sidebar::ControllerItem maSpacingControl; ::sfx2::sidebar::ControllerItem maHighlightControl; ::sfx2::sidebar::ControllerItem maSDFontGrow; ::sfx2::sidebar::ControllerItem maSDFontShrink; //Images Image maImgIncrease; Image maImgDecrease; Image maImgBold; Image maImgItalic; Image maImgUnderline; Image maImgStrike; Image maImgShadow; Image maImgFontColor; Image maImgSupScript; Image maImgSubScript; Image maImgHighlight; Image maImgNormalIcon; Image maImgIncreaseHigh; Image maImgDecreaseHigh; Image maImgBoldHigh; Image maImgItalicHigh; Image maImgUnderlineHigh; Image maImgStrikeHigh; Image maImgShadowHigh; Image maImgFontColorHigh; Image maImgSupScriptHigh; Image maImgSubScriptHigh; // Image maImgSpacingHigh; // Image maImgHighlightHigh; FontWeight meWeight; FontItalic meItalic; FontUnderline meUnderline; Color meUnderlineColor; // bool mbShadow; FontStrikeout meStrike; bool mbWeightAvailable; bool mbPostureAvailable; Color maColor; bool mbColorAvailable; Color maBackColor; bool mbBackColorAvailable; ColorType meColorType; SvxEscapement meEscape; //for sw bool mbSuper; bool mbSub; bool mbKernAvailable; bool mbKernLBAvailable; long mlKerning; SvxFontHeightItem* mpHeightItem; const FontList* mpFontList; bool mbMustDelete; bool mbFocusOnFontSizeCtrl; ::sfx2::sidebar::EnumContext maContext; SfxBindings* mpBindings; TextPropertyPanel ( const ::rtl::OUString& rsResourceURL, Window* pParent, const cssu::Reference& rxFrame, SfxBindings* pBindings); virtual ~TextPropertyPanel (void); void PaintRect(const ToolBox &rTB); void Initialize (void); void SetupIcons (void); void InitToolBoxFont(); void InitToolBoxIncDec(); void InitToolBoxFontColor(); void InitToolBoxScript(); void InitToolBoxHighlight(); void InitToolBoxSpacing(); void UpdateFontBold(); void UpdateFontItalic(); void UpdateFontUnderline(); void UpdateFontStrikeOut(); void UpdateFontShadowed(); void UpdateFontScript(); /* SfxPopupPanelWin* mpFloatWinUnderline; class SvxTextUnderlinePage; SvxTextUnderlinePage* mpPageUnderline; SfxPopupPanelWin* mpFloatWinFontColor; class SvxTextFontColorPage; SvxTextFontColorPage* mpPageFontColor; SfxPopupPanelWin* mpFloatWinSpacing; class SvxTextSpacingPage; SvxTextSpacingPage* mpPageSpacing; */ DECL_LINK(FontSelHdl, FontNameBox *); DECL_LINK(FontSizeModifyHdl, FontSizeBox *); DECL_LINK(FontSizeSelHdl, FontSizeBox *); DECL_LINK(FontSizeLoseFocus, FontSizeBox *); DECL_LINK(ToolboxFontSelectHandler, ToolBox *); DECL_LINK(ToolboxIncDecSelectHdl, ToolBox *); DECL_LINK(ToolBoxUnderlineClickHdl, ToolBox* ); DECL_LINK(ImplPopupModeEndHdl, FloatingWindow* ); DECL_LINK(ImplSpacingPopupModeEndHdl, FloatingWindow* ); // DECL_LINK(ToolBoxFontColorDropHdl, ToolBox *); DECL_LINK(ToolBoxSwScriptSelectHdl, ToolBox *); DECL_LINK(ToolBoxScriptSelectHdl, ToolBox *); DECL_LINK(SpacingClickHdl, ToolBox*); DECL_LINK(ToolBoxHighlightDropHdl, ToolBox *); void TextStyleChanged(); }; } } // end of namespace ::svx::sidebar #endif