1 /**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21 
22 #ifndef SW_SIDEBAR_WRAP_PROPERTY_PANEL_HXX
23 #define SW_SIDEBAR_WRAP_PROPERTY_PANEL_HXX
24 
25 #include <vcl/button.hxx>
26 #include <vcl/image.hxx>
27 
28 #include <sfx2/sidebar/ControllerItem.hxx>
29 #include <com/sun/star/frame/XFrame.hpp>
30 
31 #include <boost/scoped_ptr.hpp>
32 
33 
34 namespace sw { namespace sidebar {
35 
36     class WrapPropertyPanel
37         : public Control
38         , public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
39     {
40     public:
41         static WrapPropertyPanel* Create(
42             Window* pParent,
43             const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame>& rxFrame,
44             SfxBindings* pBindings );
45 
46         // interface of ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
47         virtual void NotifyItemUpdate(
48             const sal_uInt16 nSId,
49             const SfxItemState eState,
50             const SfxPoolItem* pState,
51             const bool bIsEnabled);
52 
53     private:
54         WrapPropertyPanel(
55             Window* pParent,
56             const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
57             SfxBindings* pBindings );
58 
59         virtual ~WrapPropertyPanel();
60 
61         ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
62         SfxBindings* mpBindings;
63 
64         ::boost::scoped_ptr<ImageRadioButton> mpRBNoWrap;
65         ::boost::scoped_ptr<ImageRadioButton> mpRBWrapLeft;
66         ::boost::scoped_ptr<ImageRadioButton> mpRBWrapRight;
67         ::boost::scoped_ptr<ImageRadioButton> mpRBWrapParallel;
68         ::boost::scoped_ptr<ImageRadioButton> mpRBWrapThrough;
69         ::boost::scoped_ptr<ImageRadioButton> mpRBIdealWrap;
70 
71         //Image resource.
72         ImageList aWrapIL;
73         ImageList aWrapILH;
74 
75         //Controler Items==================================
76         ::sfx2::sidebar::ControllerItem maSwNoWrapControl;
77         ::sfx2::sidebar::ControllerItem maSwWrapLeftControl;
78         ::sfx2::sidebar::ControllerItem maSwWrapRightControl;
79         ::sfx2::sidebar::ControllerItem maSwWrapParallelControl;
80         ::sfx2::sidebar::ControllerItem maSwWrapThroughControl;
81         ::sfx2::sidebar::ControllerItem maSwWrapIdealControl;
82 
83         void Initialize();
84 
85         DECL_LINK(WrapTypeHdl, void*);
86     };
87 
88 } } // end of namespace ::sw::sidebar
89 
90 #endif
91