Debian Codegraph @

src/Gui/MDIViewPy.h

raw
1 /***************************************************************************
2 * Copyright (c) 2019 Werner Mayer <wmayer[at]users.sourceforge.net> *
3 * *
4 * This file is part of the FreeCAD CAx development system. *
5 * *
6 * This library is free software; you can redistribute it and/or *
7 * modify it under the terms of the GNU Library General Public *
8 * License as published by the Free Software Foundation; either *
9 * version 2 of the License, or (at your option) any later version. *
10 * *
11 * This library is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU Library General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU Library General Public *
17 * License along with this library; see the file COPYING.LIB. If not, *
18 * write to the Free Software Foundation, Inc., 59 Temple Place, *
19 * Suite 330, Boston, MA 02111-1307, USA *
20 * *
21 ***************************************************************************/
22
23
24 #ifndef GUI_MDIVIEWPY_H
25 #define GUI_MDIVIEWPY_H
26
27 #include <Base/PyObjectBase.h>
28 #include <CXX/Extensions.hxx>
29 #include <QPointer>
30 #include <FCGlobal.h>
31
32 #include "MDIView.h"
33
34 namespace Gui
35 {
36 class MDIView;
37
38 class GuiExport MDIViewPy: public Py::PythonExtension<MDIViewPy>
39 {
40 public:
41 static void init_type(); // announce properties and methods
42 static PyObject* extension_object_new(PyTypeObject* subtype, PyObject* /*args*/, PyObject* /*kwds*/);
43
44 static Py::Object type();
45 static Py::ExtensionObject<MDIViewPy> create(MDIView* mdi);
46
47 explicit MDIViewPy(MDIView* mdi);
48 ~MDIViewPy() override;
49
50 Py::Object repr() override;
51
52 /** @name Printing */
53 //@{
54 Py::Object printView(const Py::Tuple&);
55 Py::Object printPdf(const Py::Tuple&);
56 Py::Object printPreview(const Py::Tuple&);
57 //@}
58
59 /** @name Undo/Redo actions */
60 //@{
61 Py::Object undoActions(const Py::Tuple&);
62 Py::Object redoActions(const Py::Tuple&);
63 //@}
64
65 Py::Object sendMessage(const Py::Tuple&);
66 Py::Object supportMessage(const Py::Tuple&);
67 Py::Object fitAll(const Py::Tuple&);
68 Py::Object setActiveObject(const Py::Tuple&);
69 Py::Object getActiveObject(const Py::Tuple&);
70 Py::Object cast_to_base(const Py::Tuple&);
71
72 MDIView* getMDIViewPtr()
73 {
74 return _view.data();
75 }
76
77 private:
78 QPointer<MDIView> _view;
79 };
80
81 } // namespace Gui
82
83 #endif // GUI_MDIVIEWPY_H