1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  *   Licensed to the Apache Software Foundation (ASF) under one or more
12  *   contributor license agreements. See the NOTICE file distributed
13  *   with this work for additional information regarding copyright
14  *   ownership. The ASF licenses this file to you under the Apache
15  *   License, Version 2.0 (the "License"); you may not use this file
16  *   except in compliance with the License. You may obtain a copy of
17  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #pragma once
21 
22 #include <com/sun/star/ui/XUIElement.hpp>
23 #include <com/sun/star/ui/DockingArea.hpp>
24 #include <com/sun/star/awt/Point.hpp>
25 #include <com/sun/star/awt/Size.hpp>
26 
27 #include <rtl/ustring.hxx>
28 #include <vcl/toolbox.hxx>
29 
30 namespace framework
31 {
32 
33 struct DockedData
34 {
DockedDataframework::DockedData35     DockedData() : m_aPos( SAL_MAX_INT32, SAL_MAX_INT32 ),
36                    m_nDockedArea( css::ui::DockingArea_DOCKINGAREA_TOP ),
37                    m_bLocked( false ) {}
38 
39     css::awt::Point      m_aPos;
40     css::ui::DockingArea m_nDockedArea;
41     bool                 m_bLocked;
42 };
43 
44 struct FloatingData
45 {
FloatingDataframework::FloatingData46     FloatingData() : m_aPos( SAL_MAX_INT32, SAL_MAX_INT32 ),
47                      m_nLines( 1 ),
48                      m_bIsHorizontal( true ) {}
49 
50     css::awt::Point  m_aPos;
51     css::awt::Size   m_aSize;
52     ToolBox::ImplToolItems::size_type m_nLines;
53     bool             m_bIsHorizontal;
54 };
55 
56 struct UIElement
57 {
UIElementframework::UIElement58     UIElement() : m_bFloating( false ),
59                   m_bVisible( true ),
60                   m_bUserActive( false ),
61                   m_bMasterHide( false ),
62                   m_bContextSensitive( false ),
63                   m_bNoClose( false ),
64                   m_bStateRead( false ),
65                   m_nStyle( ButtonType::SYMBOLONLY )
66                   {}
67 
UIElementframework::UIElement68     UIElement( const OUString& rName,
69                const OUString& rType,
70                const css::uno::Reference< css::ui::XUIElement >& rUIElement
71                ) : m_aType( rType ),
72                    m_aName( rName ),
73                    m_xUIElement( rUIElement ),
74                    m_bFloating( false ),
75                    m_bVisible( true ),
76                    m_bUserActive( false ),
77                    m_bMasterHide( false ),
78                    m_bContextSensitive( false ),
79                    m_bNoClose( false ),
80                    m_bStateRead( false ),
81                    m_nStyle( ButtonType::SYMBOLONLY ) {}
82 
83     bool operator< ( const UIElement& aUIElement ) const;
84 
85     OUString                                                      m_aType;
86     OUString                                                      m_aName;
87     OUString                                                      m_aUIName;
88     css::uno::Reference< css::ui::XUIElement >                    m_xUIElement;
89     bool                                                               m_bFloating,
90                                                                        m_bVisible,
91                                                                        m_bUserActive,
92                                                                        m_bMasterHide,
93                                                                        m_bContextSensitive;
94     bool                                                               m_bNoClose,
95                                                                        m_bStateRead;
96     ButtonType                                                         m_nStyle;
97     DockedData                                                         m_aDockedData;
98     FloatingData                                                       m_aFloatingData;
99 };
100 
101 typedef std::vector< UIElement > UIElementVector;
102 
103 } // namespace framework
104 
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
106