1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2008 by Sun Microsystems, Inc.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * $RCSfile: layoutmanager.hxx,v $
10*cdf0e10cSrcweir  * $Revision: 1.34 $
11*cdf0e10cSrcweir  *
12*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
13*cdf0e10cSrcweir  *
14*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
15*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
16*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
17*cdf0e10cSrcweir  *
18*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
19*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
22*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
23*cdf0e10cSrcweir  *
24*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
25*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
26*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
27*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
28*cdf0e10cSrcweir  *
29*cdf0e10cSrcweir  ************************************************************************/
30*cdf0e10cSrcweir 
31*cdf0e10cSrcweir #ifndef __FRAMEWORK_LAYOUTMANAGER_UIELEMENT_HXX_
32*cdf0e10cSrcweir #define __FRAMEWORK_LAYOUTMANAGER_UIELEMENT_HXX_
33*cdf0e10cSrcweir 
34*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
35*cdf0e10cSrcweir //	my own includes
36*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
37*cdf0e10cSrcweir 
38*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
39*cdf0e10cSrcweir //	interface includes
40*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
41*cdf0e10cSrcweir 
42*cdf0e10cSrcweir #include <com/sun/star/ui/XUIElement.hpp>
43*cdf0e10cSrcweir #include <com/sun/star/ui/DockingArea.hpp>
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
46*cdf0e10cSrcweir //	other includes
47*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
48*cdf0e10cSrcweir 
49*cdf0e10cSrcweir #include <rtl/ustring.hxx>
50*cdf0e10cSrcweir #include <vcl/toolbox.hxx>
51*cdf0e10cSrcweir 
52*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
53*cdf0e10cSrcweir //	namespace
54*cdf0e10cSrcweir //_________________________________________________________________________________________________________________
55*cdf0e10cSrcweir 
56*cdf0e10cSrcweir namespace framework
57*cdf0e10cSrcweir {
58*cdf0e10cSrcweir 
59*cdf0e10cSrcweir struct DockedData
60*cdf0e10cSrcweir {
61*cdf0e10cSrcweir     DockedData() : m_aPos( LONG_MAX, LONG_MAX ),
62*cdf0e10cSrcweir                    m_nDockedArea( ::com::sun::star::ui::DockingArea_DOCKINGAREA_TOP ),
63*cdf0e10cSrcweir                    m_bLocked( false ) {}
64*cdf0e10cSrcweir 
65*cdf0e10cSrcweir     Point     m_aPos;
66*cdf0e10cSrcweir     Size      m_aSize;
67*cdf0e10cSrcweir     sal_Int16 m_nDockedArea;
68*cdf0e10cSrcweir     bool      m_bLocked;
69*cdf0e10cSrcweir };
70*cdf0e10cSrcweir 
71*cdf0e10cSrcweir struct FloatingData
72*cdf0e10cSrcweir {
73*cdf0e10cSrcweir     FloatingData() : m_aPos( LONG_MAX, LONG_MAX ),
74*cdf0e10cSrcweir                      m_nLines( 1 ),
75*cdf0e10cSrcweir                      m_bIsHorizontal( true ) {}
76*cdf0e10cSrcweir 
77*cdf0e10cSrcweir     Point     m_aPos;
78*cdf0e10cSrcweir     Size      m_aSize;
79*cdf0e10cSrcweir     sal_Int16 m_nLines;
80*cdf0e10cSrcweir     bool      m_bIsHorizontal;
81*cdf0e10cSrcweir };
82*cdf0e10cSrcweir 
83*cdf0e10cSrcweir struct UIElement
84*cdf0e10cSrcweir {
85*cdf0e10cSrcweir     UIElement() : m_bFloating( false ),
86*cdf0e10cSrcweir                   m_bVisible( true ),
87*cdf0e10cSrcweir                   m_bUserActive( false ),
88*cdf0e10cSrcweir                   m_bCreateNewRowCol0( false ),
89*cdf0e10cSrcweir                   m_bDeactiveHide( false ),
90*cdf0e10cSrcweir                   m_bMasterHide( false ),
91*cdf0e10cSrcweir                   m_bContextSensitive( false ),
92*cdf0e10cSrcweir                   m_bContextActive( true ),
93*cdf0e10cSrcweir                   m_bNoClose( false ),
94*cdf0e10cSrcweir                   m_bSoftClose( false ),
95*cdf0e10cSrcweir                   m_bStateRead( false ),
96*cdf0e10cSrcweir                   m_nStyle( BUTTON_SYMBOL )
97*cdf0e10cSrcweir                   {}
98*cdf0e10cSrcweir 
99*cdf0e10cSrcweir     UIElement( const rtl::OUString& rName,
100*cdf0e10cSrcweir                const rtl::OUString& rType,
101*cdf0e10cSrcweir                const com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement >& rUIElement,
102*cdf0e10cSrcweir                bool bFloating = false
103*cdf0e10cSrcweir                ) : m_aType( rType ),
104*cdf0e10cSrcweir                    m_aName( rName ),
105*cdf0e10cSrcweir                    m_xUIElement( rUIElement ),
106*cdf0e10cSrcweir                    m_bFloating( bFloating ),
107*cdf0e10cSrcweir                    m_bVisible( true ),
108*cdf0e10cSrcweir                    m_bUserActive( false ),
109*cdf0e10cSrcweir                    m_bCreateNewRowCol0( false ),
110*cdf0e10cSrcweir                    m_bDeactiveHide( false ),
111*cdf0e10cSrcweir                    m_bMasterHide( false ),
112*cdf0e10cSrcweir                    m_bContextSensitive( false ),
113*cdf0e10cSrcweir                    m_bContextActive( true ),
114*cdf0e10cSrcweir                    m_bNoClose( false ),
115*cdf0e10cSrcweir                    m_bSoftClose( false ),
116*cdf0e10cSrcweir                    m_bStateRead( false ),
117*cdf0e10cSrcweir                    m_nStyle( BUTTON_SYMBOL ) {}
118*cdf0e10cSrcweir 
119*cdf0e10cSrcweir     bool operator< ( const UIElement& aUIElement ) const;
120*cdf0e10cSrcweir     UIElement& operator=( const UIElement& rUIElement );
121*cdf0e10cSrcweir 
122*cdf0e10cSrcweir     rtl::OUString                                                      m_aType;
123*cdf0e10cSrcweir     rtl::OUString                                                      m_aName;
124*cdf0e10cSrcweir     rtl::OUString                                                      m_aUIName;
125*cdf0e10cSrcweir     com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement > m_xUIElement;
126*cdf0e10cSrcweir     bool                                                               m_bFloating,
127*cdf0e10cSrcweir                                                                        m_bVisible,
128*cdf0e10cSrcweir                                                                        m_bUserActive,
129*cdf0e10cSrcweir                                                                        m_bCreateNewRowCol0,
130*cdf0e10cSrcweir                                                                        m_bDeactiveHide,
131*cdf0e10cSrcweir                                                                        m_bMasterHide,
132*cdf0e10cSrcweir                                                                        m_bContextSensitive,
133*cdf0e10cSrcweir                                                                        m_bContextActive;
134*cdf0e10cSrcweir     bool                                                               m_bNoClose,
135*cdf0e10cSrcweir                                                                        m_bSoftClose,
136*cdf0e10cSrcweir                                                                        m_bStateRead;
137*cdf0e10cSrcweir     sal_Int16                                                          m_nStyle;
138*cdf0e10cSrcweir     DockedData                                                         m_aDockedData;
139*cdf0e10cSrcweir     FloatingData                                                       m_aFloatingData;
140*cdf0e10cSrcweir };
141*cdf0e10cSrcweir 
142*cdf0e10cSrcweir typedef std::vector< UIElement > UIElementVector;
143*cdf0e10cSrcweir 
144*cdf0e10cSrcweir } // namespace framework
145*cdf0e10cSrcweir 
146*cdf0e10cSrcweir #endif // __FRAMEWORK_LAYOUTMANAGER_UIELEMENT_HXX_
147