1*0d4dbf8bSAndre Fischer /**************************************************************
2*0d4dbf8bSAndre Fischer  *
3*0d4dbf8bSAndre Fischer  * Licensed to the Apache Software Foundation (ASF) under one
4*0d4dbf8bSAndre Fischer  * or more contributor license agreements.  See the NOTICE file
5*0d4dbf8bSAndre Fischer  * distributed with this work for additional information
6*0d4dbf8bSAndre Fischer  * regarding copyright ownership.  The ASF licenses this file
7*0d4dbf8bSAndre Fischer  * to you under the Apache License, Version 2.0 (the
8*0d4dbf8bSAndre Fischer  * "License"); you may not use this file except in compliance
9*0d4dbf8bSAndre Fischer  * with the License.  You may obtain a copy of the License at
10*0d4dbf8bSAndre Fischer  *
11*0d4dbf8bSAndre Fischer  *   http://www.apache.org/licenses/LICENSE-2.0
12*0d4dbf8bSAndre Fischer  *
13*0d4dbf8bSAndre Fischer  * Unless required by applicable law or agreed to in writing,
14*0d4dbf8bSAndre Fischer  * software distributed under the License is distributed on an
15*0d4dbf8bSAndre Fischer  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*0d4dbf8bSAndre Fischer  * KIND, either express or implied.  See the License for the
17*0d4dbf8bSAndre Fischer  * specific language governing permissions and limitations
18*0d4dbf8bSAndre Fischer  * under the License.
19*0d4dbf8bSAndre Fischer  *
20*0d4dbf8bSAndre Fischer  *************************************************************/
21*0d4dbf8bSAndre Fischer 
22*0d4dbf8bSAndre Fischer #ifndef SVX_SIDEBAR_INSERT_PROPERTY_PAGE_HXX
23*0d4dbf8bSAndre Fischer #define SVX_SIDEBAR_INSERT_PROPERTY_PAGE_HXX
24*0d4dbf8bSAndre Fischer 
25*0d4dbf8bSAndre Fischer #include <boost/scoped_ptr.hpp>
26*0d4dbf8bSAndre Fischer 
27*0d4dbf8bSAndre Fischer #include <vcl/ctrl.hxx>
28*0d4dbf8bSAndre Fischer #include <com/sun/star/frame/XFrame.hpp>
29*0d4dbf8bSAndre Fischer #include <com/sun/star/frame/XDispatch.hpp>
30*0d4dbf8bSAndre Fischer #include <com/sun/star/frame/XToolbarController.hpp>
31*0d4dbf8bSAndre Fischer 
32*0d4dbf8bSAndre Fischer #include <map>
33*0d4dbf8bSAndre Fischer 
34*0d4dbf8bSAndre Fischer 
35*0d4dbf8bSAndre Fischer namespace css = ::com::sun::star;
36*0d4dbf8bSAndre Fischer namespace cssu = ::com::sun::star::uno;
37*0d4dbf8bSAndre Fischer 
38*0d4dbf8bSAndre Fischer class ToolBox;
39*0d4dbf8bSAndre Fischer 
40*0d4dbf8bSAndre Fischer namespace svx { namespace sidebar {
41*0d4dbf8bSAndre Fischer 
42*0d4dbf8bSAndre Fischer class InsertPropertyPanel
43*0d4dbf8bSAndre Fischer     : public Control
44*0d4dbf8bSAndre Fischer {
45*0d4dbf8bSAndre Fischer public:
46*0d4dbf8bSAndre Fischer     InsertPropertyPanel (
47*0d4dbf8bSAndre Fischer         Window* pParent,
48*0d4dbf8bSAndre Fischer         const cssu::Reference<css::frame::XFrame>& rxFrame);
49*0d4dbf8bSAndre Fischer     virtual ~InsertPropertyPanel (void);
50*0d4dbf8bSAndre Fischer 
51*0d4dbf8bSAndre Fischer private:
52*0d4dbf8bSAndre Fischer 	::boost::scoped_ptr<Window> mpStandardShapesBackground;
53*0d4dbf8bSAndre Fischer     ::boost::scoped_ptr<ToolBox> mpStandardShapesToolBox;
54*0d4dbf8bSAndre Fischer 	::boost::scoped_ptr<Window> mpCustomShapesBackground;
55*0d4dbf8bSAndre Fischer     ::boost::scoped_ptr<ToolBox> mpCustomShapesToolBox;
56*0d4dbf8bSAndre Fischer     class ItemDescriptor
57*0d4dbf8bSAndre Fischer     {
58*0d4dbf8bSAndre Fischer     public:
59*0d4dbf8bSAndre Fischer         cssu::Reference<css::frame::XToolbarController> mxController;
60*0d4dbf8bSAndre Fischer         css::util::URL maURL;
61*0d4dbf8bSAndre Fischer         rtl::OUString msCurrentCommand;
62*0d4dbf8bSAndre Fischer         cssu::Reference<css::frame::XDispatch> mxDispatch;
63*0d4dbf8bSAndre Fischer     };
64*0d4dbf8bSAndre Fischer     typedef ::std::map<sal_uInt16, ItemDescriptor> ControllerContainer;
65*0d4dbf8bSAndre Fischer     ControllerContainer maControllers;
66*0d4dbf8bSAndre Fischer     const cssu::Reference<css::frame::XFrame> mxFrame;
67*0d4dbf8bSAndre Fischer 
68*0d4dbf8bSAndre Fischer     /** Add listeners to toolbox and update its size to match its
69*0d4dbf8bSAndre Fischer         content.
70*0d4dbf8bSAndre Fischer     */
71*0d4dbf8bSAndre Fischer     void SetupToolBox (ToolBox& rToolBox);
72*0d4dbf8bSAndre Fischer     cssu::Reference<css::frame::XToolbarController> GetControllerForItemId (
73*0d4dbf8bSAndre Fischer         const sal_uInt16 nItemId) const;
74*0d4dbf8bSAndre Fischer     ToolBox* GetToolBoxForItemId (const sal_uInt16 nItemId) const;
75*0d4dbf8bSAndre Fischer     sal_uInt16 GetItemIdForSubToolbarName (
76*0d4dbf8bSAndre Fischer         const ::rtl::OUString& rsCOmmandName) const;
77*0d4dbf8bSAndre Fischer 
78*0d4dbf8bSAndre Fischer     /** Create toolbox controller for one item.
79*0d4dbf8bSAndre Fischer     */
80*0d4dbf8bSAndre Fischer     void CreateController (
81*0d4dbf8bSAndre Fischer         const sal_uInt16 nItemId);
82*0d4dbf8bSAndre Fischer     void UpdateIcons (void);
83*0d4dbf8bSAndre Fischer 
84*0d4dbf8bSAndre Fischer     DECL_LINK(DropDownClickHandler, ToolBox*);
85*0d4dbf8bSAndre Fischer     DECL_LINK(ClickHandler, ToolBox*);
86*0d4dbf8bSAndre Fischer     DECL_LINK(DoubleClickHandler, ToolBox*);
87*0d4dbf8bSAndre Fischer     DECL_LINK(SelectHandler, ToolBox*);
88*0d4dbf8bSAndre Fischer     DECL_LINK(WindowEventListener, VclSimpleEvent*);
89*0d4dbf8bSAndre Fischer     DECL_LINK(Activate, ToolBox*);
90*0d4dbf8bSAndre Fischer     DECL_LINK(Deactivate, ToolBox*);
91*0d4dbf8bSAndre Fischer };
92*0d4dbf8bSAndre Fischer 
93*0d4dbf8bSAndre Fischer 
94*0d4dbf8bSAndre Fischer } } // end of namespace ::svx::sidebar
95*0d4dbf8bSAndre Fischer 
96*0d4dbf8bSAndre Fischer #endif
97