Debian Codegraph @

src/Base/Translate.h

raw
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2
3 /***************************************************************************
4 * Copyright (c) 2018 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., 51 Franklin Street, *
21 * Fifth Floor, Boston, MA 02110-1301, USA *
22 * *
23 ***************************************************************************/
24
25
26 #ifndef BASE_TRANSLATE_H
27 #define BASE_TRANSLATE_H
28
29 #include <CXX/Extensions.hxx>
30 #include <QTranslator>
31 #include <memory>
32 #include <list>
33 #ifndef FC_GLOBAL_H
34 # include <FCGlobal.h>
35 #endif
36
37 namespace Py
38 {
39 class Object;
40 class Tuple;
41 } // namespace Py
42
43 namespace Base
44 {
45
46 class BaseExport Translate: public Py::ExtensionModule<Translate> // NOLINT
47 {
48 public:
49 Translate();
50 ~Translate() override;
51
52 private:
53 Py::Object translate(const Py::Tuple& args);
54 Py::Object translateNoop(const Py::Tuple& args);
55 Py::Object translateNoop3(const Py::Tuple& args);
56 Py::Object trNoop(const Py::Tuple& args);
57 Py::Object installTranslator(const Py::Tuple& args);
58 Py::Object removeTranslators(const Py::Tuple& args);
59
60 private:
61 std::list<std::shared_ptr<QTranslator>> translators;
62 };
63
64 } // namespace Base
65
66 #endif // BASE_TRANSLATE_H