bump product version to 4.1.6.2
[LibreOffice.git] / sc / source / ui / sidebar / CellAppearancePropertyPanel.hxx
blob30efdca2cfc2a02ce3748135f637ffcef7ff6aaf
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 #ifndef SC_PROPERTYPANEL_APPEARANCE_HXX
19 #define SC_PROPERTYPANEL_APPEARANCE_HXX
21 #include <sfx2/sidebar/ControllerItem.hxx>
22 #include <sfx2/sidebar/IContextChangeReceiver.hxx>
23 #include <boost/scoped_ptr.hpp>
24 #include <svx/sidebar/ColorPopup.hxx>
26 class FixedText;
27 namespace svx { class ToolboxButtonColorUpdater; }
28 namespace sc { namespace sidebar {
29 class CellLineStylePopup;
30 class CellBorderStylePopup;
31 class CellLineStyleControl;
32 class CellBorderUpdater;
34 class ToolBox;
35 class CheckBox;
37 namespace sc { namespace sidebar {
39 class CellAppearancePropertyPanel
40 : public Control,
41 public ::sfx2::sidebar::IContextChangeReceiver,
42 public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
44 private:
45 friend class CellLineStyleControl;
46 friend class CellBorderStyleControl;
48 public:
49 static CellAppearancePropertyPanel* Create(
50 Window* pParent,
51 const cssu::Reference<css::frame::XFrame>& rxFrame,
52 SfxBindings* pBindings);
54 virtual void DataChanged(
55 const DataChangedEvent& rEvent);
57 virtual void HandleContextChange(
58 const ::sfx2::sidebar::EnumContext aContext);
60 virtual void NotifyItemUpdate(
61 const sal_uInt16 nSId,
62 const SfxItemState eState,
63 const SfxPoolItem* pState,
64 const bool bIsEnabled);
66 SfxBindings* GetBindings();
68 private:
69 //ui controls
70 ::boost::scoped_ptr< FixedText > mpFTFillColor;
71 ::boost::scoped_ptr< Window > mpTBFillColorBackground;
72 ::boost::scoped_ptr< ToolBox > mpTBFillColor;
73 ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpFillColorUpdater;
75 ::boost::scoped_ptr< FixedText > mpFTCellBorder;
76 ::boost::scoped_ptr< Window > mpTBCellBorderBackground;
77 ::boost::scoped_ptr< ToolBox > mpTBCellBorder;
78 ::boost::scoped_ptr< CellBorderUpdater > mpCellBorderUpdater;
80 ::boost::scoped_ptr< Window > mpTBLineStyleBackground;
81 ::boost::scoped_ptr< ToolBox > mpTBLineStyle;
83 ::boost::scoped_ptr< Window > mpTBLineColorBackground;
84 ::boost::scoped_ptr< ToolBox > mpTBLineColor;
85 ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpLineColorUpdater;
87 ::boost::scoped_ptr< CheckBox > mpCBXShowGrid;
89 ::sfx2::sidebar::ControllerItem maBackColorControl;
90 ::sfx2::sidebar::ControllerItem maLineColorControl;
91 ::sfx2::sidebar::ControllerItem maLineStyleControl;
92 ::sfx2::sidebar::ControllerItem maBorderOuterControl;
93 ::sfx2::sidebar::ControllerItem maBorderInnerControl;
94 ::sfx2::sidebar::ControllerItem maGridShowControl;
95 ::sfx2::sidebar::ControllerItem maBorderTLBRControl;
96 ::sfx2::sidebar::ControllerItem maBorderBLTRControl;
98 // images
99 Image maIMGBKColor;
100 Image maIMGCellBorder;
101 Image maIMGLineColor;
102 Image maIMGLineStyle1;
103 Image maIMGLineStyle2;
104 Image maIMGLineStyle3;
105 Image maIMGLineStyle4;
106 Image maIMGLineStyle5;
107 Image maIMGLineStyle6;
108 Image maIMGLineStyle7;
109 Image maIMGLineStyle8;
110 Image maIMGLineStyle9;
112 // cell background color
113 Color maBackColor;
115 // cell line color(s)
116 Color maLineColor;
117 Color maTLBRColor;
118 Color maBLTRColor;
120 // BorderStyle defines
121 sal_uInt16 mnIn;
122 sal_uInt16 mnOut;
123 sal_uInt16 mnDis;
124 sal_uInt16 mnTLBRIn;
125 sal_uInt16 mnTLBROut;
126 sal_uInt16 mnTLBRDis;
127 sal_uInt16 mnBLTRIn;
128 sal_uInt16 mnBLTROut;
129 sal_uInt16 mnBLTRDis;
131 /// bitfield
132 bool mbBackColorAvailable : 1;
133 bool mbLineColorAvailable : 1;
134 bool mbBorderStyleAvailable : 1;
136 // CellBorder defines
137 bool mbLeft : 1;
138 bool mbRight : 1;
139 bool mbTop : 1;
140 bool mbBottom : 1;
141 bool mbVer : 1;
142 bool mbHor : 1;
144 bool mbOuterBorder : 1; // mbLeft || mbRight || mbTop || mbBottom
145 bool mbInnerBorder : 1; // mbVer || mbHor || bLeft || bRight || bTop || bBottom
147 bool mbTLBR : 1;
148 bool mbBLTR : 1;
150 // popups
151 svx::sidebar::ColorPopup maFillColorPopup;
152 svx::sidebar::ColorPopup maLineColorPopup;
153 ::boost::scoped_ptr< CellLineStylePopup > mpCellLineStylePopup;
154 ::boost::scoped_ptr< CellBorderStylePopup > mpCellBorderStylePopup;
156 cssu::Reference<css::frame::XFrame> mxFrame;
157 ::sfx2::sidebar::EnumContext maContext;
158 SfxBindings* mpBindings;
160 DECL_LINK(TbxBKColorSelectHdl, ToolBox*);
161 DECL_LINK(TbxLineColorSelectHdl, ToolBox*);
162 DECL_LINK(TbxCellBorderSelectHdl, ToolBox*);
163 DECL_LINK(TbxLineStyleSelectHdl, ToolBox*);
164 DECL_LINK(CBOXGridShowClkHdl, void*);
166 // for fill color picker
167 svx::sidebar::PopupControl* CreateFillColorPopupControl(svx::sidebar::PopupContainer* pParent);
168 void SetFillColor(const String& rsColorName, const Color aColor);
170 // for line color picker
171 svx::sidebar::PopupControl* CreateLineColorPopupControl(svx::sidebar::PopupContainer* pParent);
172 void SetLineColor(const String& rsColorName, const Color aColor);
174 // for CellLineStyle popup
175 svx::sidebar::PopupControl* CreateCellLineStylePopupControl(svx::sidebar::PopupContainer* pParent);
176 void EndCellLineStylePopupMode(void);
178 // for CellBorderStyle popup
179 svx::sidebar::PopupControl* CreateCellBorderStylePopupControl(svx::sidebar::PopupContainer* pParent);
180 void EndCellBorderStylePopupMode(void);
182 // constructor/destuctor
183 CellAppearancePropertyPanel(
184 Window* pParent,
185 const cssu::Reference<css::frame::XFrame>& rxFrame,
186 SfxBindings* pBindings);
187 virtual ~CellAppearancePropertyPanel();
189 void Initialize();
190 void SetStyleIcon();
191 void UpdateControlState();
194 } } // end of namespace ::sc::sidebar
196 #endif
197 // eof