1facb16e7SArmin Le Grand /************************************************************** 2facb16e7SArmin Le Grand * 3facb16e7SArmin Le Grand * Licensed to the Apache Software Foundation (ASF) under one 4facb16e7SArmin Le Grand * or more contributor license agreements. See the NOTICE file 5facb16e7SArmin Le Grand * distributed with this work for additional information 6facb16e7SArmin Le Grand * regarding copyright ownership. The ASF licenses this file 7facb16e7SArmin Le Grand * to you under the Apache License, Version 2.0 (the 8facb16e7SArmin Le Grand * "License"); you may not use this file except in compliance 9facb16e7SArmin Le Grand * with the License. You may obtain a copy of the License at 10facb16e7SArmin Le Grand * 11facb16e7SArmin Le Grand * http://www.apache.org/licenses/LICENSE-2.0 12facb16e7SArmin Le Grand * 13facb16e7SArmin Le Grand * Unless required by applicable law or agreed to in writing, 14facb16e7SArmin Le Grand * software distributed under the License is distributed on an 15facb16e7SArmin Le Grand * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16facb16e7SArmin Le Grand * KIND, either express or implied. See the License for the 17facb16e7SArmin Le Grand * specific language governing permissions and limitations 18facb16e7SArmin Le Grand * under the License. 19facb16e7SArmin Le Grand * 20facb16e7SArmin Le Grand *************************************************************/ 21facb16e7SArmin Le Grand 22facb16e7SArmin Le Grand #ifndef SC_PROPERTYPANEL_APPEARANCE_HXX 23facb16e7SArmin Le Grand #define SC_PROPERTYPANEL_APPEARANCE_HXX 24facb16e7SArmin Le Grand 25facb16e7SArmin Le Grand #include <sfx2/sidebar/SidebarPanelBase.hxx> 26facb16e7SArmin Le Grand #include <sfx2/sidebar/ControllerItem.hxx> 27facb16e7SArmin Le Grand #include <sfx2/sidebar/IContextChangeReceiver.hxx> 28facb16e7SArmin Le Grand #include <boost/scoped_ptr.hpp> 29facb16e7SArmin Le Grand #include <svx/sidebar/ColorPopup.hxx> 30facb16e7SArmin Le Grand 31facb16e7SArmin Le Grand class FixedText; 32facb16e7SArmin Le Grand namespace svx { class ToolboxButtonColorUpdater; } 33facb16e7SArmin Le Grand namespace sc { namespace sidebar { 34facb16e7SArmin Le Grand class CellLineStylePopup; 35facb16e7SArmin Le Grand class CellBorderStylePopup; 36facb16e7SArmin Le Grand class CellLineStyleControl; 37facb16e7SArmin Le Grand class CellBorderUpdater; 38facb16e7SArmin Le Grand }} 39facb16e7SArmin Le Grand class ToolBox; 40facb16e7SArmin Le Grand class CheckBox; 41facb16e7SArmin Le Grand 42facb16e7SArmin Le Grand namespace sc { namespace sidebar { 43facb16e7SArmin Le Grand 44facb16e7SArmin Le Grand class CellAppearancePropertyPanel 45facb16e7SArmin Le Grand : public Control, 46facb16e7SArmin Le Grand public ::sfx2::sidebar::IContextChangeReceiver, 47facb16e7SArmin Le Grand public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface 48facb16e7SArmin Le Grand { 49facb16e7SArmin Le Grand private: 50facb16e7SArmin Le Grand friend class CellLineStyleControl; 51facb16e7SArmin Le Grand friend class CellBorderStyleControl; 52facb16e7SArmin Le Grand 53facb16e7SArmin Le Grand public: 54facb16e7SArmin Le Grand static CellAppearancePropertyPanel* Create( 55facb16e7SArmin Le Grand Window* pParent, 56facb16e7SArmin Le Grand const cssu::Reference<css::frame::XFrame>& rxFrame, 57facb16e7SArmin Le Grand SfxBindings* pBindings); 58facb16e7SArmin Le Grand 59facb16e7SArmin Le Grand virtual void DataChanged( 60facb16e7SArmin Le Grand const DataChangedEvent& rEvent); 61facb16e7SArmin Le Grand 62facb16e7SArmin Le Grand virtual void HandleContextChange( 63facb16e7SArmin Le Grand const ::sfx2::sidebar::EnumContext aContext); 64facb16e7SArmin Le Grand 65facb16e7SArmin Le Grand virtual void NotifyItemUpdate( 66facb16e7SArmin Le Grand const sal_uInt16 nSId, 67facb16e7SArmin Le Grand const SfxItemState eState, 68*45da7d5eSAndre Fischer const SfxPoolItem* pState, 69*45da7d5eSAndre Fischer const bool bIsEnabled); 70facb16e7SArmin Le Grand 71facb16e7SArmin Le Grand SfxBindings* GetBindings(); 72facb16e7SArmin Le Grand 73facb16e7SArmin Le Grand private: 74facb16e7SArmin Le Grand //ui controls 75facb16e7SArmin Le Grand ::boost::scoped_ptr< FixedText > mpFTFillColor; 76facb16e7SArmin Le Grand ::boost::scoped_ptr< Window > mpTBFillColorBackground; 77facb16e7SArmin Le Grand ::boost::scoped_ptr< ToolBox > mpTBFillColor; 78facb16e7SArmin Le Grand ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpFillColorUpdater; 79facb16e7SArmin Le Grand 80facb16e7SArmin Le Grand ::boost::scoped_ptr< FixedText > mpFTCellBorder; 81facb16e7SArmin Le Grand ::boost::scoped_ptr< Window > mpTBCellBorderBackground; 82facb16e7SArmin Le Grand ::boost::scoped_ptr< ToolBox > mpTBCellBorder; 83facb16e7SArmin Le Grand ::boost::scoped_ptr< CellBorderUpdater > mpCellBorderUpdater; 84facb16e7SArmin Le Grand 85facb16e7SArmin Le Grand ::boost::scoped_ptr< Window > mpTBLineStyleBackground; 86facb16e7SArmin Le Grand ::boost::scoped_ptr< ToolBox > mpTBLineStyle; 87facb16e7SArmin Le Grand 88facb16e7SArmin Le Grand ::boost::scoped_ptr< Window > mpTBLineColorBackground; 89facb16e7SArmin Le Grand ::boost::scoped_ptr< ToolBox > mpTBLineColor; 90facb16e7SArmin Le Grand ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpLineColorUpdater; 91facb16e7SArmin Le Grand 92facb16e7SArmin Le Grand ::boost::scoped_ptr< CheckBox > mpCBXShowGrid; 93facb16e7SArmin Le Grand 94facb16e7SArmin Le Grand ::sfx2::sidebar::ControllerItem maBackColorControl; 95facb16e7SArmin Le Grand ::sfx2::sidebar::ControllerItem maLineColorControl; 96facb16e7SArmin Le Grand ::sfx2::sidebar::ControllerItem maLineStyleControl; 97facb16e7SArmin Le Grand ::sfx2::sidebar::ControllerItem maBorderOuterControl; 98facb16e7SArmin Le Grand ::sfx2::sidebar::ControllerItem maBorderInnerControl; 99facb16e7SArmin Le Grand ::sfx2::sidebar::ControllerItem maGridShowControl; 100facb16e7SArmin Le Grand ::sfx2::sidebar::ControllerItem maBorderTLBRControl; 101facb16e7SArmin Le Grand ::sfx2::sidebar::ControllerItem maBorderBLTRControl; 102facb16e7SArmin Le Grand 103facb16e7SArmin Le Grand // images 104facb16e7SArmin Le Grand Image maIMGBKColor; 105facb16e7SArmin Le Grand Image maIMGCellBorder; 106facb16e7SArmin Le Grand Image maIMGLineColor; 107facb16e7SArmin Le Grand Image maIMGLineStyle1; 108facb16e7SArmin Le Grand Image maIMGLineStyle2; 109facb16e7SArmin Le Grand Image maIMGLineStyle3; 110facb16e7SArmin Le Grand Image maIMGLineStyle4; 111facb16e7SArmin Le Grand Image maIMGLineStyle5; 112facb16e7SArmin Le Grand Image maIMGLineStyle6; 113facb16e7SArmin Le Grand Image maIMGLineStyle7; 114facb16e7SArmin Le Grand Image maIMGLineStyle8; 115facb16e7SArmin Le Grand Image maIMGLineStyle9; 116facb16e7SArmin Le Grand 117facb16e7SArmin Le Grand // high contrast images 118facb16e7SArmin Le Grand Image maIMGBKColorH; 119facb16e7SArmin Le Grand Image maIMGLineStyle0H; 120facb16e7SArmin Le Grand Image maIMGLineStyle1H; 121facb16e7SArmin Le Grand Image maIMGLineStyle2H; 122facb16e7SArmin Le Grand Image maIMGLineStyle3H; 123facb16e7SArmin Le Grand Image maIMGLineStyle4H; 124facb16e7SArmin Le Grand Image maIMGLineStyle5H; 125facb16e7SArmin Le Grand Image maIMGLineStyle6H; 126facb16e7SArmin Le Grand Image maIMGLineStyle7H; 127facb16e7SArmin Le Grand Image maIMGLineStyle8H; 128facb16e7SArmin Le Grand Image maIMGLineStyle9H; 129facb16e7SArmin Le Grand 130facb16e7SArmin Le Grand // cell background color 131facb16e7SArmin Le Grand Color maBackColor; 132facb16e7SArmin Le Grand 133facb16e7SArmin Le Grand // cell line color(s) 134facb16e7SArmin Le Grand Color maLineColor; 135facb16e7SArmin Le Grand Color maTLBRColor; 136facb16e7SArmin Le Grand Color maBLTRColor; 137facb16e7SArmin Le Grand 138facb16e7SArmin Le Grand // BorderStyle defines 139facb16e7SArmin Le Grand sal_uInt16 mnIn; 140facb16e7SArmin Le Grand sal_uInt16 mnOut; 141facb16e7SArmin Le Grand sal_uInt16 mnDis; 142facb16e7SArmin Le Grand sal_uInt16 mnTLBRIn; 143facb16e7SArmin Le Grand sal_uInt16 mnTLBROut; 144facb16e7SArmin Le Grand sal_uInt16 mnTLBRDis; 145facb16e7SArmin Le Grand sal_uInt16 mnBLTRIn; 146facb16e7SArmin Le Grand sal_uInt16 mnBLTROut; 147facb16e7SArmin Le Grand sal_uInt16 mnBLTRDis; 148facb16e7SArmin Le Grand 149facb16e7SArmin Le Grand /// bitfield 150facb16e7SArmin Le Grand bool mbBackColorAvailable : 1; 151facb16e7SArmin Le Grand bool mbLineColorAvailable : 1; 152facb16e7SArmin Le Grand bool mbBorderStyleAvailable : 1; 153facb16e7SArmin Le Grand 154facb16e7SArmin Le Grand // CellBorder defines 155facb16e7SArmin Le Grand bool mbLeft : 1; 156facb16e7SArmin Le Grand bool mbRight : 1; 157facb16e7SArmin Le Grand bool mbTop : 1; 158facb16e7SArmin Le Grand bool mbBottom : 1; 159facb16e7SArmin Le Grand bool mbVer : 1; 160facb16e7SArmin Le Grand bool mbHor : 1; 161facb16e7SArmin Le Grand 162facb16e7SArmin Le Grand bool mbOuterBorder : 1; // mbLeft || mbRight || mbTop || mbBottom 163facb16e7SArmin Le Grand bool mbInnerBorder : 1; // mbVer || mbHor || bLeft || bRight || bTop || bBottom 164facb16e7SArmin Le Grand 165facb16e7SArmin Le Grand bool mbTLBR : 1; 166facb16e7SArmin Le Grand bool mbBLTR : 1; 167facb16e7SArmin Le Grand 168facb16e7SArmin Le Grand // popups 169facb16e7SArmin Le Grand svx::sidebar::ColorPopup maFillColorPopup; 170facb16e7SArmin Le Grand svx::sidebar::ColorPopup maLineColorPopup; 171facb16e7SArmin Le Grand ::boost::scoped_ptr< CellLineStylePopup > mpCellLineStylePopup; 172facb16e7SArmin Le Grand ::boost::scoped_ptr< CellBorderStylePopup > mpCellBorderStylePopup; 173facb16e7SArmin Le Grand 174facb16e7SArmin Le Grand cssu::Reference<css::frame::XFrame> mxFrame; 175facb16e7SArmin Le Grand ::sfx2::sidebar::EnumContext maContext; 176facb16e7SArmin Le Grand SfxBindings* mpBindings; 177facb16e7SArmin Le Grand 178facb16e7SArmin Le Grand DECL_LINK(TbxBKColorSelectHdl, ToolBox*); 179facb16e7SArmin Le Grand DECL_LINK(TbxLineColorSelectHdl, ToolBox*); 180facb16e7SArmin Le Grand DECL_LINK(TbxCellBorderSelectHdl, ToolBox*); 181facb16e7SArmin Le Grand DECL_LINK(TbxLineStyleSelectHdl, ToolBox*); 182facb16e7SArmin Le Grand DECL_LINK(CBOXGridShowClkHdl, void*); 183facb16e7SArmin Le Grand 184facb16e7SArmin Le Grand // for fill color picker 185facb16e7SArmin Le Grand svx::sidebar::PopupControl* CreateFillColorPopupControl(svx::sidebar::PopupContainer* pParent); 186facb16e7SArmin Le Grand void SetFillColor(const String& rsColorName, const Color aColor); 187facb16e7SArmin Le Grand 188facb16e7SArmin Le Grand // for line color picker 189facb16e7SArmin Le Grand svx::sidebar::PopupControl* CreateLineColorPopupControl(svx::sidebar::PopupContainer* pParent); 190facb16e7SArmin Le Grand void SetLineColor(const String& rsColorName, const Color aColor); 191facb16e7SArmin Le Grand 192facb16e7SArmin Le Grand // for CellLineStyle popup 193facb16e7SArmin Le Grand svx::sidebar::PopupControl* CreateCellLineStylePopupControl(svx::sidebar::PopupContainer* pParent); 194facb16e7SArmin Le Grand void EndCellLineStylePopupMode(void); 195facb16e7SArmin Le Grand 196facb16e7SArmin Le Grand // for CellBorderStyle popup 197facb16e7SArmin Le Grand svx::sidebar::PopupControl* CreateCellBorderStylePopupControl(svx::sidebar::PopupContainer* pParent); 198facb16e7SArmin Le Grand void EndCellBorderStylePopupMode(void); 199facb16e7SArmin Le Grand 200facb16e7SArmin Le Grand // constructor/destuctor 201facb16e7SArmin Le Grand CellAppearancePropertyPanel( 202facb16e7SArmin Le Grand Window* pParent, 203facb16e7SArmin Le Grand const cssu::Reference<css::frame::XFrame>& rxFrame, 204facb16e7SArmin Le Grand SfxBindings* pBindings); 205facb16e7SArmin Le Grand virtual ~CellAppearancePropertyPanel(); 206facb16e7SArmin Le Grand 207facb16e7SArmin Le Grand void Initialize(); 208facb16e7SArmin Le Grand void SetStyleIcon(); 209facb16e7SArmin Le Grand void UpdateControlState(); 210facb16e7SArmin Le Grand }; 211facb16e7SArmin Le Grand 212facb16e7SArmin Le Grand } } // end of namespace ::sc::sidebar 213facb16e7SArmin Le Grand 214facb16e7SArmin Le Grand #endif 215facb16e7SArmin Le Grand // eof 216