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 __FRAMEWORK_LAYOUTMANAGER_UIELEMENT_HXX_
25 #define __FRAMEWORK_LAYOUTMANAGER_UIELEMENT_HXX_
26 
27 //_________________________________________________________________________________________________________________
28 //	my own includes
29 //_________________________________________________________________________________________________________________
30 
31 //_________________________________________________________________________________________________________________
32 //	interface includes
33 //_________________________________________________________________________________________________________________
34 
35 #include <com/sun/star/ui/XUIElement.hpp>
36 #include <com/sun/star/ui/DockingArea.hpp>
37 
38 //_________________________________________________________________________________________________________________
39 //	other includes
40 //_________________________________________________________________________________________________________________
41 
42 #include <rtl/ustring.hxx>
43 #include <vcl/toolbox.hxx>
44 
45 //_________________________________________________________________________________________________________________
46 //	namespace
47 //_________________________________________________________________________________________________________________
48 
49 namespace framework
50 {
51 
52 struct DockedData
53 {
DockedDataframework::DockedData54     DockedData() : m_aPos( LONG_MAX, LONG_MAX ),
55                    m_nDockedArea( ::com::sun::star::ui::DockingArea_DOCKINGAREA_TOP ),
56                    m_bLocked( false ) {}
57 
58     Point     m_aPos;
59     Size      m_aSize;
60     sal_Int16 m_nDockedArea;
61     bool      m_bLocked;
62 };
63 
64 struct FloatingData
65 {
FloatingDataframework::FloatingData66     FloatingData() : m_aPos( LONG_MAX, LONG_MAX ),
67                      m_nLines( 1 ),
68                      m_bIsHorizontal( true ) {}
69 
70     Point     m_aPos;
71     Size      m_aSize;
72     sal_Int16 m_nLines;
73     bool      m_bIsHorizontal;
74 };
75 
76 struct UIElement
77 {
UIElementframework::UIElement78     UIElement() : m_bFloating( false ),
79                   m_bVisible( true ),
80                   m_bUserActive( false ),
81                   m_bCreateNewRowCol0( false ),
82                   m_bDeactiveHide( false ),
83                   m_bMasterHide( false ),
84                   m_bContextSensitive( false ),
85                   m_bContextActive( true ),
86                   m_bNoClose( false ),
87                   m_bSoftClose( false ),
88                   m_bStateRead( false ),
89                   m_nStyle( BUTTON_SYMBOL )
90                   {}
91 
UIElementframework::UIElement92     UIElement( const rtl::OUString& rName,
93                const rtl::OUString& rType,
94                const com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement >& rUIElement,
95                bool bFloating = false
96                ) : m_aType( rType ),
97                    m_aName( rName ),
98                    m_xUIElement( rUIElement ),
99                    m_bFloating( bFloating ),
100                    m_bVisible( true ),
101                    m_bUserActive( false ),
102                    m_bCreateNewRowCol0( false ),
103                    m_bDeactiveHide( false ),
104                    m_bMasterHide( false ),
105                    m_bContextSensitive( false ),
106                    m_bContextActive( true ),
107                    m_bNoClose( false ),
108                    m_bSoftClose( false ),
109                    m_bStateRead( false ),
110                    m_nStyle( BUTTON_SYMBOL ) {}
111 
112     bool operator< ( const UIElement& aUIElement ) const;
113     UIElement& operator=( const UIElement& rUIElement );
114 
115     rtl::OUString                                                      m_aType;
116     rtl::OUString                                                      m_aName;
117     rtl::OUString                                                      m_aUIName;
118     com::sun::star::uno::Reference< ::com::sun::star::ui::XUIElement > m_xUIElement;
119     bool                                                               m_bFloating,
120                                                                        m_bVisible,
121                                                                        m_bUserActive,
122                                                                        m_bCreateNewRowCol0,
123                                                                        m_bDeactiveHide,
124                                                                        m_bMasterHide,
125                                                                        m_bContextSensitive,
126                                                                        m_bContextActive;
127     bool                                                               m_bNoClose,
128                                                                        m_bSoftClose,
129                                                                        m_bStateRead;
130     sal_Int16                                                          m_nStyle;
131     DockedData                                                         m_aDockedData;
132     FloatingData                                                       m_aFloatingData;
133 };
134 
135 typedef std::vector< UIElement > UIElementVector;
136 
137 } // namespace framework
138 
139 #endif // __FRAMEWORK_LAYOUTMANAGER_UIELEMENT_HXX_
140