xref: /aoo42x/main/svx/source/inc/formtoolbars.hxx (revision 3334a7e6)
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 SVX_SOURCE_INC_FORMTOOLBARS_HXX
25 #define SVX_SOURCE_INC_FORMTOOLBARS_HXX
26 
27 #include "fmdocumentclassification.hxx"
28 #include <com/sun/star/frame/XLayoutManager.hpp>
29 
30 #include <tools/solar.h>
31 
32 #include <svx/svxdllapi.h>
33 
34 //........................................................................
35 namespace svxform
36 {
37 //........................................................................
38 
39 	//====================================================================
40 	//= FormToolboxes
41 	//====================================================================
42 	class FormToolboxes
43 	{
44     private:
45         ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager >
46                         m_xLayouter;
47 
48     public:
49         /** constructs an instance
50             @param _rxFrame
51                 the frame to analyze
52         */
53         SVX_DLLPUBLIC FormToolboxes(
54             const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame
55         );
56 
57     public:
58         /** retrieves the URI for the toolbox associated with the given slot, depending
59             on the type of our document
60         */
61         SVX_DLLPUBLIC ::rtl::OUString
62                 getToolboxResourceName( sal_uInt16 _nSlotId ) const;
63 
64         /** toggles the toolbox associated with the given slot
65         */
66         SVX_DLLPUBLIC void    toggleToolbox( sal_uInt16 _nSlotId ) const;
67 
68         /** determines whether the toolbox associated with the given slot is currently visible
69         */
70         SVX_DLLPUBLIC bool    isToolboxVisible( sal_uInt16 _nSlotId ) const;
71 
72         /** ensures that a given toolbox is visible
73         */
showToolbox(sal_uInt16 _SlotId) const74         inline void showToolbox( sal_uInt16 _SlotId ) const
75         {
76             if ( !isToolboxVisible( _SlotId ) )
77                 toggleToolbox( _SlotId );
78         }
79 	};
80 
81 //........................................................................
82 } // namespace svxform
83 //........................................................................
84 
85 #endif // SVX_SOURCE_INC_FORMTOOLBARS_HXX
86 
87