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_CONTROL_FACTORY_HXX 23 #define SFX_SIDEBAR_CONTROL_FACTORY_HXX 24 25 #include <sfx2/dllapi.h> 26 #include <sfx2/sidebar/SidebarToolBox.hxx> 27 #include <vcl/button.hxx> 28 #include <com/sun/star/frame/XFrame.hpp> 29 class ToolBox; 30 31 namespace sfx2 { namespace sidebar { 32 33 class ToolBoxBackground; 34 35 /** Factory for controls used in sidebar panels. 36 The reason to use this factory instead of creating the controls 37 directly is that this way the sidebar has a little more control 38 over look and feel of its controls. 39 */ 40 class SFX2_DLLPUBLIC ControlFactory 41 { 42 public: 43 /** Create the menu button for the task bar. 44 */ 45 static CheckBox* CreateMenuButton (Window* pParentWindow); 46 47 static ImageRadioButton* CreateTabItem (Window* pParentWindow); 48 49 /** Create a tool box that does *not* handle its items. The 50 caller has to register callbacks to process, among others, 51 click and selection events. 52 */ 53 static SidebarToolBox* CreateToolBox ( 54 Window* pParentWindow, 55 const ResId& rResId); 56 57 /** Create a tool box that *does* handle its items. All event 58 processing is done by toolbox controllers. 59 */ 60 static SidebarToolBox* CreateToolBox ( 61 Window* pParentWindow, 62 const ResId& rResId, 63 const ::com::sun::star::uno::Reference<com::sun::star::frame::XFrame>& rxFrame); 64 65 /** Create a window that acts as background of a tool box. 66 In general it is slightly larger than the tool box. 67 @param pParentWindow 68 The parent window of the new background control. 69 @param bShowBorder 70 When <TRUE/> then the background control is made slightly 71 larger then its tool box child, once that is created. 72 Otherwise the background control will not be visible. 73 */ 74 static Window* CreateToolBoxBackground ( 75 Window* pParentWindow, 76 const bool bShowBorder = true); 77 78 static ImageRadioButton* CreateCustomImageRadionButton( 79 Window* pParentWindow, 80 const ResId& rResId ); 81 }; 82 83 84 } } // end of namespace sfx2::sidebar 85 86 #endif 87