/* * Copyright (c) 2018-2020, Andreas Kling * Copyright (c) 2021, sin-ack * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include namespace GUI { class Menubar : public Core::Object { C_OBJECT(Menubar); public: ~Menubar() { } Menu& add_menu(Badge, String name) { auto& menu = add(move(name)); m_menus.append(menu); return menu; } void for_each_menu(Function callback) { for (auto& menu : m_menus) { if (callback(menu) == IterationDecision::Break) { return; } } } private: Menubar() { } NonnullRefPtrVector m_menus; }; }