166c1fc23SArmin Le Grand /**************************************************************
266c1fc23SArmin Le Grand  *
366c1fc23SArmin Le Grand  * Licensed to the Apache Software Foundation (ASF) under one
466c1fc23SArmin Le Grand  * or more contributor license agreements.  See the NOTICE file
566c1fc23SArmin Le Grand  * distributed with this work for additional information
666c1fc23SArmin Le Grand  * regarding copyright ownership.  The ASF licenses this file
766c1fc23SArmin Le Grand  * to you under the Apache License, Version 2.0 (the
866c1fc23SArmin Le Grand  * "License"); you may not use this file except in compliance
966c1fc23SArmin Le Grand  * with the License.  You may obtain a copy of the License at
1066c1fc23SArmin Le Grand  *
1166c1fc23SArmin Le Grand  *   http://www.apache.org/licenses/LICENSE-2.0
1266c1fc23SArmin Le Grand  *
1366c1fc23SArmin Le Grand  * Unless required by applicable law or agreed to in writing,
1466c1fc23SArmin Le Grand  * software distributed under the License is distributed on an
1566c1fc23SArmin Le Grand  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1666c1fc23SArmin Le Grand  * KIND, either express or implied.  See the License for the
1766c1fc23SArmin Le Grand  * specific language governing permissions and limitations
1866c1fc23SArmin Le Grand  * under the License.
1966c1fc23SArmin Le Grand  *
2066c1fc23SArmin Le Grand  *************************************************************/
2166c1fc23SArmin Le Grand 
2266c1fc23SArmin Le Grand #ifndef SVX_PROPERTYPANEL_AREAPAGE_HXX
2366c1fc23SArmin Le Grand #define SVX_PROPERTYPANEL_AREAPAGE_HXX
2466c1fc23SArmin Le Grand 
25facb16e7SArmin Le Grand #include <svx/sidebar/ColorPopup.hxx>
268dcb2a10SAndre Fischer #include "AreaTransparencyGradientPopup.hxx"
2766c1fc23SArmin Le Grand #include <vcl/ctrl.hxx>
2866c1fc23SArmin Le Grand #include <sfx2/sidebar/SidebarPanelBase.hxx>
2966c1fc23SArmin Le Grand #include <sfx2/sidebar/ControllerItem.hxx>
30*6a606da0SAndre Fischer #include <sfx2/sidebar/GridLayouter.hxx>
3166c1fc23SArmin Le Grand #include <svx/xgrad.hxx>
3266c1fc23SArmin Le Grand #include <svx/itemwin.hxx>
3366c1fc23SArmin Le Grand #include <svx/xfillit0.hxx>
3466c1fc23SArmin Le Grand #include <svx/xflclit.hxx>
3566c1fc23SArmin Le Grand #include <svx/xflgrit.hxx>
3666c1fc23SArmin Le Grand #include <svx/xflhtit.hxx>
3766c1fc23SArmin Le Grand #include <svx/xbtmpit.hxx>
3866c1fc23SArmin Le Grand #include <svx/drawitem.hxx>
3966c1fc23SArmin Le Grand #include <vcl/lstbox.hxx>
4066c1fc23SArmin Le Grand #include <vcl/field.hxx>
4166c1fc23SArmin Le Grand #include <vcl/fixed.hxx>
4266c1fc23SArmin Le Grand #include <svl/intitem.hxx>
4366c1fc23SArmin Le Grand #include <svx/tbxcolorupdate.hxx>
4466c1fc23SArmin Le Grand #include <com/sun/star/ui/XUIElement.hpp>
4566c1fc23SArmin Le Grand #include <boost/scoped_ptr.hpp>
4666c1fc23SArmin Le Grand 
478dcb2a10SAndre Fischer 
4866c1fc23SArmin Le Grand class XFillFloatTransparenceItem;
4966c1fc23SArmin Le Grand namespace svx { class ToolboxButtonColorUpdater; }
5066c1fc23SArmin Le Grand 
5166c1fc23SArmin Le Grand 
5266c1fc23SArmin Le Grand namespace svx { namespace sidebar {
5366c1fc23SArmin Le Grand 
548dcb2a10SAndre Fischer class PopupContainer;
558dcb2a10SAndre Fischer class AreaTransparencyGradientControl;
5602c50d82SAndre Fischer 
5766c1fc23SArmin Le Grand class AreaPropertyPanel
5866c1fc23SArmin Le Grand :   public Control,
5966c1fc23SArmin Le Grand     public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
6066c1fc23SArmin Le Grand {
6166c1fc23SArmin Le Grand public:
6266c1fc23SArmin Le Grand     static AreaPropertyPanel* Create(
6366c1fc23SArmin Le Grand         Window* pParent,
6466c1fc23SArmin Le Grand         const cssu::Reference<css::frame::XFrame>& rxFrame,
6566c1fc23SArmin Le Grand         SfxBindings* pBindings);
6666c1fc23SArmin Le Grand 
6766c1fc23SArmin Le Grand     virtual void DataChanged(
6866c1fc23SArmin Le Grand         const DataChangedEvent& rEvent);
6966c1fc23SArmin Le Grand 
7066c1fc23SArmin Le Grand     virtual void NotifyItemUpdate(
7166c1fc23SArmin Le Grand         const sal_uInt16 nSId,
7266c1fc23SArmin Le Grand         const SfxItemState eState,
7345da7d5eSAndre Fischer         const SfxPoolItem* pState,
7445da7d5eSAndre Fischer         const bool bIsEnabled);
7566c1fc23SArmin Le Grand 
7666c1fc23SArmin Le Grand     SfxBindings* GetBindings();
7766c1fc23SArmin Le Grand 
788dcb2a10SAndre Fischer     const static sal_Int32 DEFAULT_CENTERX;
798dcb2a10SAndre Fischer     const static sal_Int32 DEFAULT_CENTERY;
808dcb2a10SAndre Fischer     const static sal_Int32 DEFAULT_ANGLE;
818dcb2a10SAndre Fischer     const static sal_Int32 DEFAULT_STARTVALUE;
828dcb2a10SAndre Fischer     const static sal_Int32 DEFAULT_ENDVALUE;
838dcb2a10SAndre Fischer     const static sal_Int32 DEFAULT_BORDER;
848dcb2a10SAndre Fischer 
858dcb2a10SAndre Fischer     XGradient GetGradient (const XGradientStyle eStyle) const;
868dcb2a10SAndre Fischer     void SetGradient (const XGradient& rGradient);
878dcb2a10SAndre Fischer     sal_Int32 GetSelectedTransparencyTypeIndex (void) const;
888dcb2a10SAndre Fischer 
89*6a606da0SAndre Fischer     virtual void Resize (void);
90*6a606da0SAndre Fischer 
9166c1fc23SArmin Le Grand private:
9258e893aeSArmin Le Grand     sal_uInt16                                          meLastXFS;
9366c1fc23SArmin Le Grand     Color                                               maLastColor;
9466c1fc23SArmin Le Grand 
9566c1fc23SArmin Le Grand     sal_uInt16                                          mnLastPosGradient;
9666c1fc23SArmin Le Grand     sal_uInt16                                          mnLastPosHatch;
9766c1fc23SArmin Le Grand     sal_uInt16                                          mnLastPosBitmap;
9866c1fc23SArmin Le Grand     sal_uInt16                                          mnLastTransSolid;
9966c1fc23SArmin Le Grand 
10066c1fc23SArmin Le Grand     XGradient                                           maGradientLinear;
10166c1fc23SArmin Le Grand     XGradient                                           maGradientAxial;
10266c1fc23SArmin Le Grand     XGradient                                           maGradientRadial;
10366c1fc23SArmin Le Grand     XGradient                                           maGradientElliptical;
10466c1fc23SArmin Le Grand     XGradient                                           maGradientSquare;
10566c1fc23SArmin Le Grand     XGradient                                           maGradientRect;
10666c1fc23SArmin Le Grand 
10766c1fc23SArmin Le Grand     //ui controls
10866c1fc23SArmin Le Grand     ::boost::scoped_ptr< FixedText >                    mpColorTextFT;
10966c1fc23SArmin Le Grand     ::boost::scoped_ptr< SvxFillTypeBox >               mpLbFillType;
11066c1fc23SArmin Le Grand     ::boost::scoped_ptr< SvxFillAttrBox >               mpLbFillAttr;
1118d3cb1a4SArmin Le Grand     ::boost::scoped_ptr< Window >                       mpToolBoxColorBackground;
11266c1fc23SArmin Le Grand     ::boost::scoped_ptr< ToolBox >                      mpToolBoxColor; // for new color picker
11366c1fc23SArmin Le Grand     ::boost::scoped_ptr< FixedText >                    mpTrspTextFT;
11466c1fc23SArmin Le Grand     ::boost::scoped_ptr< ListBox >                      mpLBTransType;
11566c1fc23SArmin Le Grand     ::boost::scoped_ptr< MetricField >                  mpMTRTransparent;
1168d3cb1a4SArmin Le Grand     ::boost::scoped_ptr< Window >                       mpBTNGradientBackground;
11766c1fc23SArmin Le Grand     ::boost::scoped_ptr< ToolBox >                      mpBTNGradient;
11866c1fc23SArmin Le Grand 
11966c1fc23SArmin Le Grand     ::boost::scoped_ptr< ::svx::ToolboxButtonColorUpdater > mpColorUpdater;
12066c1fc23SArmin Le Grand 
12166c1fc23SArmin Le Grand     ::boost::scoped_ptr< XFillStyleItem >               mpStyleItem;
12266c1fc23SArmin Le Grand     ::boost::scoped_ptr< XFillColorItem >               mpColorItem;
12366c1fc23SArmin Le Grand     ::boost::scoped_ptr< XFillGradientItem >            mpFillGradientItem;
12466c1fc23SArmin Le Grand     ::boost::scoped_ptr< XFillHatchItem >               mpHatchItem;
12566c1fc23SArmin Le Grand     ::boost::scoped_ptr< XFillBitmapItem >              mpBitmapItem;
12666c1fc23SArmin Le Grand 
12766c1fc23SArmin Le Grand     ::sfx2::sidebar::ControllerItem                     maStyleControl;
12866c1fc23SArmin Le Grand     ::sfx2::sidebar::ControllerItem                     maColorControl;
12966c1fc23SArmin Le Grand     ::sfx2::sidebar::ControllerItem                     maGradientControl;
13066c1fc23SArmin Le Grand     ::sfx2::sidebar::ControllerItem                     maHatchControl;
13166c1fc23SArmin Le Grand     ::sfx2::sidebar::ControllerItem                     maBitmapControl;
13266c1fc23SArmin Le Grand     ::sfx2::sidebar::ControllerItem                     maColorTableControl;
13366c1fc23SArmin Le Grand     ::sfx2::sidebar::ControllerItem                     maGradientListControl;
13466c1fc23SArmin Le Grand     ::sfx2::sidebar::ControllerItem                     maHatchListControl;
13566c1fc23SArmin Le Grand     ::sfx2::sidebar::ControllerItem                     maBitmapListControl;
136d5370dc8SArmin Le Grand     ::sfx2::sidebar::ControllerItem                     maFillTransparenceController;
137d5370dc8SArmin Le Grand     ::sfx2::sidebar::ControllerItem                     maFillFloatTransparenceController;
13866c1fc23SArmin Le Grand 
13966c1fc23SArmin Le Grand     Image                                               maImgAxial;
14066c1fc23SArmin Le Grand     Image                                               maImgElli;
14166c1fc23SArmin Le Grand     Image                                               maImgQuad;
14266c1fc23SArmin Le Grand     Image                                               maImgRadial;
14366c1fc23SArmin Le Grand     Image                                               maImgSquare;
14466c1fc23SArmin Le Grand     Image                                               maImgLinear;
14566c1fc23SArmin Le Grand     Image                                               maImgColor;
14666c1fc23SArmin Le Grand 
14766c1fc23SArmin Le Grand     //for high contract
14866c1fc23SArmin Le Grand     Image                                               maImgAxialH;
14966c1fc23SArmin Le Grand     Image                                               maImgElliH;
15066c1fc23SArmin Le Grand     Image                                               maImgQuadH;
15166c1fc23SArmin Le Grand     Image                                               maImgRadialH;
15266c1fc23SArmin Le Grand     Image                                               maImgSquareH;
15366c1fc23SArmin Le Grand     Image                                               maImgLinearH;
15466c1fc23SArmin Le Grand     Image                                               maImgColorH;
15566c1fc23SArmin Le Grand 
15666c1fc23SArmin Le Grand     String                                              msHelpFillType;
15766c1fc23SArmin Le Grand     String                                              msHelpFillAttr;
15866c1fc23SArmin Le Grand 
1598dcb2a10SAndre Fischer     AreaTransparencyGradientPopup maTrGrPopup;
1608dcb2a10SAndre Fischer     ColorPopup maColorPopup;
16189729eb3SArmin Le Grand 
162d5370dc8SArmin Le Grand     ::boost::scoped_ptr< XFillFloatTransparenceItem >   mpFloatTransparenceItem;
163d5370dc8SArmin Le Grand     ::boost::scoped_ptr< SfxUInt16Item >                mpTransparanceItem;
16466c1fc23SArmin Le Grand 
16566c1fc23SArmin Le Grand     cssu::Reference<css::frame::XFrame>                 mxFrame;
16666c1fc23SArmin Le Grand     SfxBindings*                                        mpBindings;
16766c1fc23SArmin Le Grand 
16866c1fc23SArmin Le Grand     /// bitfield
16935fa8f12SArmin Le Grand     bool                                                mbColorAvail : 1;
17066c1fc23SArmin Le Grand 
171*6a606da0SAndre Fischer     ::sfx2::sidebar::GridLayouter maLayouter;
172*6a606da0SAndre Fischer 
17366c1fc23SArmin Le Grand     DECL_LINK(SelectFillTypeHdl, ListBox* );
17466c1fc23SArmin Le Grand     DECL_LINK(SelectFillAttrHdl, ListBox* );
17566c1fc23SArmin Le Grand     DECL_LINK(ChangeTrgrTypeHdl_Impl, void*);
17666c1fc23SArmin Le Grand     DECL_LINK(ModifyTransparentHdl_Impl, void*);
17766c1fc23SArmin Le Grand     DECL_LINK( ImplPopupModeEndHdl, FloatingWindow* );
17866c1fc23SArmin Le Grand 
17958e893aeSArmin Le Grand     // for transparency gradient
1808dcb2a10SAndre Fischer     PopupControl* CreateTransparencyGradientControl (PopupContainer* pParent);
1818dcb2a10SAndre Fischer     DECL_LINK( ClickTrGrHdl_Impl, ToolBox* );
18266c1fc23SArmin Le Grand 
18358e893aeSArmin Le Grand     // for color picker
1848dcb2a10SAndre Fischer     PopupControl* CreateColorPopupControl (PopupContainer* pParent);
1858dcb2a10SAndre Fischer     DECL_LINK(ToolBoxColorDropHdl, ToolBox *); //for new color picker
18666c1fc23SArmin Le Grand 
18758e893aeSArmin Le Grand     // constructor/destuctor
18866c1fc23SArmin Le Grand     AreaPropertyPanel(
18966c1fc23SArmin Le Grand         Window* pParent,
19066c1fc23SArmin Le Grand         const cssu::Reference<css::frame::XFrame>& rxFrame,
19166c1fc23SArmin Le Grand         SfxBindings* pBindings);
19266c1fc23SArmin Le Grand     virtual ~AreaPropertyPanel(void);
19366c1fc23SArmin Le Grand 
19466c1fc23SArmin Le Grand     void SetupIcons(void);
19566c1fc23SArmin Le Grand     void Initialize();
19658e893aeSArmin Le Grand     void Update();
197d5370dc8SArmin Le Grand     void ImpUpdateTransparencies();
1988dcb2a10SAndre Fischer 
1998dcb2a10SAndre Fischer     Color GetLastColor (void) const;
2008dcb2a10SAndre Fischer     void SetColor (
2018dcb2a10SAndre Fischer         const String& rsColorName,
2028dcb2a10SAndre Fischer         const Color aColor);
20366c1fc23SArmin Le Grand };
20466c1fc23SArmin Le Grand 
20566c1fc23SArmin Le Grand 
2068dcb2a10SAndre Fischer } } // end of namespace ::svx::sidebar
20766c1fc23SArmin Le Grand 
20866c1fc23SArmin Le Grand 
20966c1fc23SArmin Le Grand 
2108dcb2a10SAndre Fischer #endif // SVX_PROPERTYPANEL_AREAPAGE_HXX
2114e8031e0SArmin Le Grand 
2124e8031e0SArmin Le Grand // eof
213