// SPDX-License-Identifier: LGPL-2.1-or-later /**************************************************************************** * * * Copyright (c) 2025 Kindred Systems * * * * This file is part of FreeCAD. * * * * FreeCAD is free software: you can redistribute it and/or modify it * * under the terms of the GNU Lesser General Public License as * * published by the Free Software Foundation, either version 2.1 of the * * License, or (at your option) any later version. * * * * FreeCAD is distributed in the hope that it will be useful, but * * WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * Lesser General Public License for more details. * * * * You should have received a copy of the GNU Lesser General Public * * License along with FreeCAD. If not, see * * . * * * ***************************************************************************/ #ifndef KCSDK_PYIMENUPROVIDER_H #define KCSDK_PYIMENUPROVIDER_H #include #include #include namespace KCSDK { /// pybind11 trampoline class for IMenuProvider. /// Enables Python subclasses that override virtual methods. class PyIMenuProvider : public IMenuProvider { public: using IMenuProvider::IMenuProvider; // ── Pure virtuals ────────────────────────────────────────────── std::string id() const override { PYBIND11_OVERRIDE_PURE(std::string, IMenuProvider, id); } std::string menu_path() const override { PYBIND11_OVERRIDE_PURE(std::string, IMenuProvider, menu_path); } std::vector items() const override { PYBIND11_OVERRIDE_PURE(std::vector, IMenuProvider, items); } // ── Virtuals with defaults ───────────────────────────────────── std::vector context_ids() const override { PYBIND11_OVERRIDE(std::vector, IMenuProvider, context_ids); } }; } // namespace KCSDK #endif // KCSDK_PYIMENUPROVIDER_H