Debian Codegraph @

src/Base/ProgressIndicatorPy.h

raw
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2
3 /***************************************************************************
4 * Copyright (c) 2022 Werner Mayer <wmayer[at]users.sourceforge.net> *
5 * *
6 * This file is part of the FreeCAD CAx development system. *
7 * *
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU Library General Public *
10 * License as published by the Free Software Foundation; either *
11 * version 2 of the License, or (at your option) any later version. *
12 * *
13 * This library 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 Library General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Library General Public *
19 * License along with this library; see the file COPYING.LIB. If not, *
20 * write to the Free Software Foundation, Inc., 59 Temple Place, *
21 * Suite 330, Boston, MA 02111-1307, USA *
22 * *
23 ***************************************************************************/
24
25
26 #ifndef BASE_PROGRESSINDICATORPY_H
27 #define BASE_PROGRESSINDICATORPY_H
28
29 #include <memory>
30 #include <CXX/Extensions.hxx>
31 #include <Base/Sequencer.h>
32
33 namespace Base
34 {
35 // NOLINTNEXTLINE
36 class BaseExport ProgressIndicatorPy: public Py::PythonExtension<ProgressIndicatorPy>
37 {
38 public:
39 static void init_type(); // announce properties and methods
40 static Py::PythonType& behaviors();
41 static PyTypeObject* type_object();
42 static bool check(PyObject* py);
43
44 ProgressIndicatorPy();
45 ~ProgressIndicatorPy() override;
46
47 Py::Object repr() override;
48
49 Py::Object start(const Py::Tuple&);
50 Py::Object next(const Py::Tuple&);
51 Py::Object stop(const Py::Tuple&);
52
53 private:
54 static PyObject* PyMake(struct _typeobject*, PyObject*, PyObject*);
55
56 private:
57 std::unique_ptr<SequencerLauncher> _seq;
58 };
59
60 } // namespace Base
61
62 #endif // BASE_PROGRESSINDICATORPY_H