xref: /trunk/main/svx/source/inc/formtoolbars.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef SVX_SOURCE_INC_FORMTOOLBARS_HXX
29 #define SVX_SOURCE_INC_FORMTOOLBARS_HXX
30 
31 #include "fmdocumentclassification.hxx"
32 #include <com/sun/star/frame/XLayoutManager.hpp>
33 
34 #include <tools/solar.h>
35 
36 #include <svx/svxdllapi.h>
37 
38 //........................................................................
39 namespace svxform
40 {
41 //........................................................................
42 
43 	//====================================================================
44 	//= FormToolboxes
45 	//====================================================================
46 	class FormToolboxes
47 	{
48     private:
49         ::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager >
50                         m_xLayouter;
51 
52     public:
53         /** constructs an instance
54             @param _rxFrame
55                 the frame to analyze
56         */
57         SVX_DLLPUBLIC FormToolboxes(
58             const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxFrame
59         );
60 
61     public:
62         /** retrieves the URI for the toolbox associated with the given slot, depending
63             on the type of our document
64         */
65         SVX_DLLPUBLIC ::rtl::OUString
66                 getToolboxResourceName( sal_uInt16 _nSlotId ) const;
67 
68         /** toggles the toolbox associated with the given slot
69         */
70         SVX_DLLPUBLIC void    toggleToolbox( sal_uInt16 _nSlotId ) const;
71 
72         /** determines whether the toolbox associated with the given slot is currently visible
73         */
74         SVX_DLLPUBLIC bool    isToolboxVisible( sal_uInt16 _nSlotId ) const;
75 
76         /** ensures that a given toolbox is visible
77         */
78         inline void showToolbox( sal_uInt16 _SlotId ) const
79         {
80             if ( !isToolboxVisible( _SlotId ) )
81                 toggleToolbox( _SlotId );
82         }
83 	};
84 
85 //........................................................................
86 } // namespace svxform
87 //........................................................................
88 
89 #endif // SVX_SOURCE_INC_FORMTOOLBARS_HXX
90 
91