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 SFX_SIDEBAR_CONTROLLER_FACTORY_HXX
23 #define SFX_SIDEBAR_CONTROLLER_FACTORY_HXX
24 
25 #include "sfx2/dllapi.h"
26 #include <com/sun/star/awt/XWindow.hpp>
27 #include <com/sun/star/frame/XFrame.hpp>
28 #include <com/sun/star/frame/XToolbarController.hpp>
29 
30 namespace css = ::com::sun::star;
31 namespace cssu = ::com::sun::star::uno;
32 
33 class ToolBox;
34 
35 namespace sfx2 { namespace sidebar {
36 
37 /** Convenience class for the easy creation of toolbox controllers.
38 */
39 class SFX2_DLLPUBLIC ControllerFactory
40 {
41 public:
42     static cssu::Reference<css::frame::XToolbarController> CreateToolBoxController(
43         ToolBox* pToolBox,
44         const sal_uInt16 nItemId,
45         const ::rtl::OUString& rsCommandName,
46         const cssu::Reference<css::frame::XFrame>& rxFrame,
47         const cssu::Reference<css::awt::XWindow>& rxParentWindow,
48         const sal_Int32 nItemWidth);
49 
50 private:
51     static cssu::Reference<css::frame::XToolbarController> CreateToolBarController(
52         ToolBox* pToolBox,
53         const ::rtl::OUString& rsCommandName,
54         const cssu::Reference<css::frame::XFrame>& rxFrame,
55         const sal_Int32 nWidth);
56 };
57 
58 
59 } } // end of namespace sfx2::sidebar
60 
61 #endif
62