xref: /trunk/main/svx/source/sidebar/area/AreaPropertyPanel.hxx (revision 627628354578bc12b977fd84871d68bc0860b13f)
18dcb2a10SAndre Fischer /**************************************************************
28dcb2a10SAndre Fischer  *
38dcb2a10SAndre Fischer  * Licensed to the Apache Software Foundation (ASF) under one
48dcb2a10SAndre Fischer  * or more contributor license agreements.  See the NOTICE file
58dcb2a10SAndre Fischer  * distributed with this work for additional information
68dcb2a10SAndre Fischer  * regarding copyright ownership.  The ASF licenses this file
78dcb2a10SAndre Fischer  * to you under the Apache License, Version 2.0 (the
88dcb2a10SAndre Fischer  * "License"); you may not use this file except in compliance
98dcb2a10SAndre Fischer  * with the License.  You may obtain a copy of the License at
108dcb2a10SAndre Fischer  *
118dcb2a10SAndre Fischer  *   http://www.apache.org/licenses/LICENSE-2.0
128dcb2a10SAndre Fischer  *
138dcb2a10SAndre Fischer  * Unless required by applicable law or agreed to in writing,
148dcb2a10SAndre Fischer  * software distributed under the License is distributed on an
158dcb2a10SAndre Fischer  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
168dcb2a10SAndre Fischer  * KIND, either express or implied.  See the License for the
178dcb2a10SAndre Fischer  * specific language governing permissions and limitations
188dcb2a10SAndre Fischer  * under the License.
198dcb2a10SAndre Fischer  *
208dcb2a10SAndre Fischer  *************************************************************/
218dcb2a10SAndre Fischer 
22*62762835Smseidel 
23*62762835Smseidel 
248dcb2a10SAndre Fischer #ifndef SVX_PROPERTYPANEL_AREAPAGE_HXX
258dcb2a10SAndre Fischer #define SVX_PROPERTYPANEL_AREAPAGE_HXX
268dcb2a10SAndre Fischer 
27facb16e7SArmin Le Grand #include <svx/sidebar/ColorPopup.hxx>
288dcb2a10SAndre Fischer #include "AreaTransparencyGradientPopup.hxx"
298dcb2a10SAndre Fischer #include <vcl/ctrl.hxx>
308dcb2a10SAndre Fischer #include <sfx2/sidebar/SidebarPanelBase.hxx>
318dcb2a10SAndre Fischer #include <sfx2/sidebar/ControllerItem.hxx>
326a606da0SAndre Fischer #include <sfx2/sidebar/GridLayouter.hxx>
338dcb2a10SAndre Fischer #include <svx/xgrad.hxx>
348dcb2a10SAndre Fischer #include <svx/itemwin.hxx>
358dcb2a10SAndre Fischer #include <svx/xfillit0.hxx>
368dcb2a10SAndre Fischer #include <svx/xflclit.hxx>
378dcb2a10SAndre Fischer #include <svx/xflgrit.hxx>
388dcb2a10SAndre Fischer #include <svx/xflhtit.hxx>
398dcb2a10SAndre Fischer #include <svx/xbtmpit.hxx>
408dcb2a10SAndre Fischer #include <svx/drawitem.hxx>
418dcb2a10SAndre Fischer #include <vcl/lstbox.hxx>
428dcb2a10SAndre Fischer #include <vcl/field.hxx>
438dcb2a10SAndre Fischer #include <vcl/fixed.hxx>
448dcb2a10SAndre Fischer #include <svl/intitem.hxx>
458dcb2a10SAndre Fischer #include <svx/tbxcolorupdate.hxx>
468dcb2a10SAndre Fischer #include <com/sun/star/ui/XUIElement.hpp>
478dcb2a10SAndre Fischer #include <boost/scoped_ptr.hpp>
488dcb2a10SAndre Fischer 
498dcb2a10SAndre Fischer 
508dcb2a10SAndre Fischer class XFillFloatTransparenceItem;
518dcb2a10SAndre Fischer namespace svx { class ToolboxButtonColorUpdater; }
528dcb2a10SAndre Fischer 
538dcb2a10SAndre Fischer 
548dcb2a10SAndre Fischer namespace svx { namespace sidebar {
558dcb2a10SAndre Fischer 
568dcb2a10SAndre Fischer class PopupContainer;
578dcb2a10SAndre Fischer class AreaTransparencyGradientControl;
588dcb2a10SAndre Fischer 
598dcb2a10SAndre Fischer class AreaPropertyPanel
608dcb2a10SAndre Fischer :   public Control,
618dcb2a10SAndre Fischer     public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
628dcb2a10SAndre Fischer {
638dcb2a10SAndre Fischer public:
648dcb2a10SAndre Fischer     static AreaPropertyPanel* Create(
658dcb2a10SAndre Fischer         Window* pParent,
668dcb2a10SAndre Fischer         const cssu::Reference<css::frame::XFrame>& rxFrame,
678dcb2a10SAndre Fischer         SfxBindings* pBindings);
688dcb2a10SAndre Fischer 
698dcb2a10SAndre Fischer     virtual void DataChanged(
708dcb2a10SAndre Fischer         const DataChangedEvent& rEvent);
718dcb2a10SAndre Fischer 
728dcb2a10SAndre Fischer     virtual void NotifyItemUpdate(
738dcb2a10SAndre Fischer         const sal_uInt16 nSId,
748dcb2a10SAndre Fischer         const SfxItemState eState,
7545da7d5eSAndre Fischer         const SfxPoolItem* pState,
7645da7d5eSAndre Fischer         const bool bIsEnabled);
778dcb2a10SAndre Fischer 
788dcb2a10SAndre Fischer     SfxBindings* GetBindings();
798dcb2a10SAndre Fischer 
808dcb2a10SAndre Fischer     const static sal_Int32 DEFAULT_CENTERX;
818dcb2a10SAndre Fischer     const static sal_Int32 DEFAULT_CENTERY;
828dcb2a10SAndre Fischer     const static sal_Int32 DEFAULT_ANGLE;
838dcb2a10SAndre Fischer     const static sal_Int32 DEFAULT_STARTVALUE;
848dcb2a10SAndre Fischer     const static sal_Int32 DEFAULT_ENDVALUE;
858dcb2a10SAndre Fischer     const static sal_Int32 DEFAULT_BORDER;
868dcb2a10SAndre Fischer 
878dcb2a10SAndre Fischer     XGradient GetGradient (const XGradientStyle eStyle) const;
888dcb2a10SAndre Fischer     void SetGradient (const XGradient& rGradient);
898dcb2a10SAndre Fischer     sal_Int32 GetSelectedTransparencyTypeIndex (void) const;
908dcb2a10SAndre Fischer 
916a606da0SAndre Fischer     virtual void Resize (void);
926a606da0SAndre Fischer 
938dcb2a10SAndre Fischer private:
948dcb2a10SAndre Fischer     sal_uInt16                                          meLastXFS;
958dcb2a10SAndre Fischer     Color                                               maLastColor;
968dcb2a10SAndre Fischer 
978dcb2a10SAndre Fischer     sal_uInt16                                          mnLastPosGradient;
988dcb2a10SAndre Fischer     sal_uInt16                                          mnLastPosHatch;
998dcb2a10SAndre Fischer     sal_uInt16                                          mnLastPosBitmap;
1008dcb2a10SAndre Fischer     sal_uInt16                                          mnLastTransSolid;
1018dcb2a10SAndre Fischer 
1028dcb2a10SAndre Fischer     XGradient                                           maGradientLinear;
1038dcb2a10SAndre Fischer     XGradient                                           maGradientAxial;
1048dcb2a10SAndre Fischer     XGradient                                           maGradientRadial;
1058dcb2a10SAndre Fischer     XGradient                                           maGradientElliptical;
1068dcb2a10SAndre Fischer     XGradient                                           maGradientSquare;
1078dcb2a10SAndre Fischer     XGradient                                           maGradientRect;
1088dcb2a10SAndre Fischer 
1098dcb2a10SAndre Fischer     // ui controls
1108dcb2a10SAndre Fischer     ::boost::scoped_ptr< FixedText >                    mpColorTextFT;
1118dcb2a10SAndre Fischer     ::boost::scoped_ptr< SvxFillTypeBox >               mpLbFillType;
1128dcb2a10SAndre Fischer     ::boost::scoped_ptr< SvxFillAttrBox >               mpLbFillAttr;
1138dcb2a10SAndre Fischer     ::boost::scoped_ptr< Window >                       mpToolBoxColorBackground;
1148dcb2a10SAndre Fischer     ::boost::scoped_ptr< ToolBox >                      mpToolBoxColor; // for new color picker
1158dcb2a10SAndre Fischer     ::boost::scoped_ptr< FixedText >                    mpTrspTextFT;
1168dcb2a10SAndre Fischer     ::boost::scoped_ptr< ListBox >                      mpLBTransType;
1178dcb2a10SAndre Fischer     ::boost::scoped_ptr< MetricField >                  mpMTRTransparent;
1188dcb2a10SAndre Fischer     ::boost::scoped_ptr< Window >                       mpBTNGradientBackground;
1198dcb2a10SAndre Fischer     ::boost::scoped_ptr< ToolBox >                      mpBTNGradient;
1208dcb2a10SAndre Fischer 
1218dcb2a10SAndre Fischer     ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpColorUpdater;
1228dcb2a10SAndre Fischer 
1238dcb2a10SAndre Fischer     ::boost::scoped_ptr< XFillStyleItem >               mpStyleItem;
1248dcb2a10SAndre Fischer     ::boost::scoped_ptr< XFillColorItem >               mpColorItem;
1258dcb2a10SAndre Fischer     ::boost::scoped_ptr< XFillGradientItem >            mpFillGradientItem;
1268dcb2a10SAndre Fischer     ::boost::scoped_ptr< XFillHatchItem >               mpHatchItem;
1278dcb2a10SAndre Fischer     ::boost::scoped_ptr< XFillBitmapItem >              mpBitmapItem;
1288dcb2a10SAndre Fischer 
1298dcb2a10SAndre Fischer     ::sfx2::sidebar::ControllerItem                     maStyleControl;
1308dcb2a10SAndre Fischer     ::sfx2::sidebar::ControllerItem                     maColorControl;
1318dcb2a10SAndre Fischer     ::sfx2::sidebar::ControllerItem                     maGradientControl;
1328dcb2a10SAndre Fischer     ::sfx2::sidebar::ControllerItem                     maHatchControl;
1338dcb2a10SAndre Fischer     ::sfx2::sidebar::ControllerItem                     maBitmapControl;
1348dcb2a10SAndre Fischer     ::sfx2::sidebar::ControllerItem                     maColorTableControl;
1358dcb2a10SAndre Fischer     ::sfx2::sidebar::ControllerItem                     maGradientListControl;
1368dcb2a10SAndre Fischer     ::sfx2::sidebar::ControllerItem                     maHatchListControl;
1378dcb2a10SAndre Fischer     ::sfx2::sidebar::ControllerItem                     maBitmapListControl;
1388dcb2a10SAndre Fischer     ::sfx2::sidebar::ControllerItem                     maFillTransparenceController;
1398dcb2a10SAndre Fischer     ::sfx2::sidebar::ControllerItem                     maFillFloatTransparenceController;
1408dcb2a10SAndre Fischer 
1418dcb2a10SAndre Fischer     Image                                               maImgAxial;
1428dcb2a10SAndre Fischer     Image                                               maImgElli;
1438dcb2a10SAndre Fischer     Image                                               maImgQuad;
1448dcb2a10SAndre Fischer     Image                                               maImgRadial;
1458dcb2a10SAndre Fischer     Image                                               maImgSquare;
1468dcb2a10SAndre Fischer     Image                                               maImgLinear;
1478dcb2a10SAndre Fischer     Image                                               maImgColor;
1488dcb2a10SAndre Fischer 
1498dcb2a10SAndre Fischer     // for high contract
1508dcb2a10SAndre Fischer     Image                                               maImgAxialH;
1518dcb2a10SAndre Fischer     Image                                               maImgElliH;
1528dcb2a10SAndre Fischer     Image                                               maImgQuadH;
1538dcb2a10SAndre Fischer     Image                                               maImgRadialH;
1548dcb2a10SAndre Fischer     Image                                               maImgSquareH;
1558dcb2a10SAndre Fischer     Image                                               maImgLinearH;
1568dcb2a10SAndre Fischer     Image                                               maImgColorH;
1578dcb2a10SAndre Fischer 
1588dcb2a10SAndre Fischer     String                                              msHelpFillType;
1598dcb2a10SAndre Fischer     String                                              msHelpFillAttr;
1608dcb2a10SAndre Fischer 
1618dcb2a10SAndre Fischer     AreaTransparencyGradientPopup maTrGrPopup;
1628dcb2a10SAndre Fischer     ColorPopup maColorPopup;
1638dcb2a10SAndre Fischer 
1648dcb2a10SAndre Fischer     ::boost::scoped_ptr< XFillFloatTransparenceItem >   mpFloatTransparenceItem;
1658dcb2a10SAndre Fischer     ::boost::scoped_ptr< SfxUInt16Item >                mpTransparanceItem;
1668dcb2a10SAndre Fischer 
1678dcb2a10SAndre Fischer     cssu::Reference<css::frame::XFrame>                 mxFrame;
1688dcb2a10SAndre Fischer     SfxBindings*                                        mpBindings;
1698dcb2a10SAndre Fischer 
170*62762835Smseidel     // bitfield
1718dcb2a10SAndre Fischer     bool                                                mbColorAvail : 1;
1728dcb2a10SAndre Fischer 
1736a606da0SAndre Fischer     ::sfx2::sidebar::GridLayouter maLayouter;
1746a606da0SAndre Fischer 
1758dcb2a10SAndre Fischer     DECL_LINK(SelectFillTypeHdl, ListBox* );
1768dcb2a10SAndre Fischer     DECL_LINK(SelectFillAttrHdl, ListBox* );
1778dcb2a10SAndre Fischer     DECL_LINK(ChangeTrgrTypeHdl_Impl, void*);
1788dcb2a10SAndre Fischer     DECL_LINK(ModifyTransparentHdl_Impl, void*);
1798dcb2a10SAndre Fischer     DECL_LINK( ImplPopupModeEndHdl, FloatingWindow* );
1808dcb2a10SAndre Fischer 
1818dcb2a10SAndre Fischer     // for transparency gradient
1828dcb2a10SAndre Fischer     PopupControl* CreateTransparencyGradientControl (PopupContainer* pParent);
1838dcb2a10SAndre Fischer     DECL_LINK( ClickTrGrHdl_Impl, ToolBox* );
1848dcb2a10SAndre Fischer 
1858dcb2a10SAndre Fischer     // for color picker
1868dcb2a10SAndre Fischer     PopupControl* CreateColorPopupControl (PopupContainer* pParent);
1878dcb2a10SAndre Fischer     DECL_LINK(ToolBoxColorDropHdl, ToolBox *); // for new color picker
1888dcb2a10SAndre Fischer 
189*62762835Smseidel     // constructor/destructor
1908dcb2a10SAndre Fischer     AreaPropertyPanel(
1918dcb2a10SAndre Fischer         Window* pParent,
1928dcb2a10SAndre Fischer         const cssu::Reference<css::frame::XFrame>& rxFrame,
1938dcb2a10SAndre Fischer         SfxBindings* pBindings);
1948dcb2a10SAndre Fischer     virtual ~AreaPropertyPanel(void);
1958dcb2a10SAndre Fischer 
1968dcb2a10SAndre Fischer     void SetupIcons(void);
1978dcb2a10SAndre Fischer     void Initialize();
1988dcb2a10SAndre Fischer     void Update();
1998dcb2a10SAndre Fischer     void ImpUpdateTransparencies();
2008dcb2a10SAndre Fischer 
2018dcb2a10SAndre Fischer     Color GetLastColor (void) const;
2028dcb2a10SAndre Fischer     void SetColor (
2038dcb2a10SAndre Fischer         const String& rsColorName,
2048dcb2a10SAndre Fischer         const Color aColor);
2058dcb2a10SAndre Fischer };
2068dcb2a10SAndre Fischer 
2078dcb2a10SAndre Fischer 
2088dcb2a10SAndre Fischer } } // end of namespace ::svx::sidebar
2098dcb2a10SAndre Fischer 
2108dcb2a10SAndre Fischer 
2118dcb2a10SAndre Fischer 
2128dcb2a10SAndre Fischer #endif // SVX_PROPERTYPANEL_AREAPAGE_HXX
2134e8031e0SArmin Le Grand 
2144e8031e0SArmin Le Grand // eof
215