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 
23 
24 #ifndef SW_SIDEBAR_WRAP_PROPERTY_PANEL_HXX
25 #define SW_SIDEBAR_WRAP_PROPERTY_PANEL_HXX
26 
27 #include <vcl/button.hxx>
28 #include <vcl/image.hxx>
29 
30 #include <sfx2/sidebar/ControllerItem.hxx>
31 #include <com/sun/star/frame/XFrame.hpp>
32 
33 #include <boost/scoped_ptr.hpp>
34 
35 
36 namespace sw { namespace sidebar {
37 
38 	class WrapPropertyPanel
39 		: public Control
40 		, public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
41 	{
42 	public:
43 		static WrapPropertyPanel* Create(
44 			Window* pParent,
45 			const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame>& rxFrame,
46 			SfxBindings* pBindings );
47 
48 		// interface of ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
49 		virtual void NotifyItemUpdate(
50 			const sal_uInt16 nSId,
51 			const SfxItemState eState,
52 			const SfxPoolItem* pState,
53 			const bool bIsEnabled);
54 
55 	private:
56 		WrapPropertyPanel(
57 			Window* pParent,
58 			const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
59 			SfxBindings* pBindings );
60 
61 		virtual ~WrapPropertyPanel();
62 
63 		::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > mxFrame;
64 		SfxBindings* mpBindings;
65 
66 		::boost::scoped_ptr<ImageRadioButton> mpRBNoWrap;
67 		::boost::scoped_ptr<ImageRadioButton> mpRBWrapLeft;
68 		::boost::scoped_ptr<ImageRadioButton> mpRBWrapRight;
69 		::boost::scoped_ptr<ImageRadioButton> mpRBWrapParallel;
70 		::boost::scoped_ptr<ImageRadioButton> mpRBWrapThrough;
71 		::boost::scoped_ptr<ImageRadioButton> mpRBIdealWrap;
72 
73 		// Image resource
74 		ImageList aWrapIL;
75 		ImageList aWrapILH;
76 
77 		// Controller Items
78 		::sfx2::sidebar::ControllerItem maSwNoWrapControl;
79 		::sfx2::sidebar::ControllerItem maSwWrapLeftControl;
80 		::sfx2::sidebar::ControllerItem maSwWrapRightControl;
81 		::sfx2::sidebar::ControllerItem maSwWrapParallelControl;
82 		::sfx2::sidebar::ControllerItem maSwWrapThroughControl;
83 		::sfx2::sidebar::ControllerItem maSwWrapIdealControl;
84 
85 		void Initialize();
86 
87 		DECL_LINK(WrapTypeHdl, void*);
88 	};
89 
90 } } // end of namespace ::sw::sidebar
91 
92 #endif
93 
94 /* vim: set noet sw=4 ts=4: */
95