cid#1607171 Data race condition
[LibreOffice.git] / framework / inc / uielement / uielement.hxx
blob8e6f0c7de470d33d41864cfbc99992310c8bd503
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
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>
27 #include <rtl/ustring.hxx>
28 #include <utility>
29 #include <vcl/toolbox.hxx>
31 namespace framework
34 struct DockedData
36 DockedData() : m_aPos( SAL_MAX_INT32, SAL_MAX_INT32 ),
37 m_nDockedArea( css::ui::DockingArea_DOCKINGAREA_TOP ),
38 m_bLocked( false ) {}
40 css::awt::Point m_aPos;
41 css::ui::DockingArea m_nDockedArea;
42 bool m_bLocked;
45 struct FloatingData
47 FloatingData() : m_aPos( SAL_MAX_INT32, SAL_MAX_INT32 ),
48 m_nLines( 1 ),
49 m_bIsHorizontal( true ) {}
51 css::awt::Point m_aPos;
52 css::awt::Size m_aSize;
53 ToolBox::ImplToolItems::size_type m_nLines;
54 bool m_bIsHorizontal;
57 struct UIElement
59 UIElement() : m_bFloating( false ),
60 m_bVisible( true ),
61 m_bUserActive( false ),
62 m_bMasterHide( false ),
63 m_bContextSensitive( false ),
64 m_bNoClose( false ),
65 m_bStateRead( false ),
66 m_nStyle( ButtonType::SYMBOLONLY )
69 UIElement( OUString aName,
70 OUString aType,
71 css::uno::Reference< css::ui::XUIElement > xUIElement
72 ) : m_aType(std::move( aType )),
73 m_aName(std::move( aName )),
74 m_xUIElement(std::move( xUIElement )),
75 m_bFloating( false ),
76 m_bVisible( true ),
77 m_bUserActive( false ),
78 m_bMasterHide( false ),
79 m_bContextSensitive( false ),
80 m_bNoClose( false ),
81 m_bStateRead( false ),
82 m_nStyle( ButtonType::SYMBOLONLY ) {}
84 bool operator< ( const UIElement& aUIElement ) const;
86 OUString m_aType;
87 OUString m_aName;
88 OUString m_aUIName;
89 css::uno::Reference< css::ui::XUIElement > m_xUIElement;
90 bool m_bFloating,
91 m_bVisible,
92 m_bUserActive,
93 m_bMasterHide,
94 m_bContextSensitive;
95 bool m_bNoClose,
96 m_bStateRead;
97 ButtonType m_nStyle;
98 DockedData m_aDockedData;
99 FloatingData m_aFloatingData;
102 typedef std::vector< UIElement > UIElementVector;
104 } // namespace framework
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */