GCC Code Coverage Report


./
File: modules/ui/__/menubar.hpp
Date: 2025-01-21 16:21:04
Lines:
1/1
100.0%
Functions:
4/5
80.0%
Branches:
4/9
44.4%

Line Branch Exec Source
1 /************************************************************************
2 *
3 * Copyright (C) 2009-2024 IRCAD France
4 * Copyright (C) 2012-2019 IHU Strasbourg
5 *
6 * This file is part of Sight.
7 *
8 * Sight is free software: you can redistribute it and/or modify it under
9 * the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * Sight is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with Sight. If not, see <https://www.gnu.org/licenses/>.
20 *
21 ***********************************************************************/
22
23 #pragma once
24
25 #include <ui/__/menubar.hpp>
26
27 namespace sight::module::ui
28 {
29
30 /**
31 * @brief Defines the default menubar for standard application
32 */
33 class menubar : public sight::ui::menubar
34 {
35 public:
36
37
4/9
✓ Branch 0 taken 4 times.
✓ Branch 1 taken 7 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 4 times.
✗ Branch 4 not taken.
✓ Branch 6 taken 4 times.
✗ Branch 7 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
26 SIGHT_DECLARE_SERVICE(menubar, sight::ui::menubar);
38
39 /// Constructor. Do nothing.
40 menubar() noexcept;
41
42 /// Destructor. Do nothing.
43 ~menubar() noexcept override;
44
45 protected:
46
47 /** @name Service methods ( override from service::base )
48 * @{
49 */
50
51 /**
52 * @brief Configuring method allows to configure an application with menu bar.
53 * Example of configuration
54 * @code{.xml}
55 <service uid="menubar" type="ui::menubar" impl="sight::module::ui::menubar"
56 * auto_connect="false"
57 *>
58 <gui>
59 <layout>
60 <menu name="My menu"/>
61 <menu name="My menu 2"/>
62 </layout>
63 </gui>
64 <registry>
65 <menu sid="myMenu" start="true" />
66 <menu sid="myMenu2" start="true" />
67 </registry>
68 </service>
69 @endcode
70 * - \<gui\> \</gui\> : (mandatory) describe the interface of the service.
71 * - \<registry\> \</registry\> : (mandatory) describe the service management.
72 * - sid of the menu services
73 * - start or not the menu service automatically
74 *
75 * @warning
76 * - The number of item in the gui section must be equal or greater than in the registry section.
77 * - The order of the menu in each section (gui and registry) must be the same.\n
78 * For example: the menu named "My menu" will be connected with the service which have the sid = "myMenu".
79 * - A menu bar can't have the same service connected on two different menu.
80 *
81 * @see sight::ui::menubar::initialize(),
82 * sight::ui::layout::menubar_manager::initialize()
83 */
84 void configuring() override;
85
86 /**
87 * @brief Create the menus and start the managed services.
88 * @see sight::ui::menubar::create()
89 */
90 void starting() override;
91
92 /**
93 * @brief Stop all menu of this menubar and destroy menu_bar
94 * @see sight::ui::menubar::destroy()
95 */
96 void stopping() override;
97
98 /// Updating service, do nothing.
99 void updating() override;
100
101 ///@}
102 };
103
104 } // namespace sight::module::ui
105