Debian Codegraph @

src/Gui/GuiApplicationNativeEventAware.h

raw
1 /***************************************************************************
2 * Copyright (c) 2010 Thomas Anderson <ta@nextgenengineering> *
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 #ifndef GUIAPPLICATIONNATIVEEVENTAWARE_H
24 #define GUIAPPLICATIONNATIVEEVENTAWARE_H
25
26 #include <QApplication>
27 #include <vector>
28
29
30 class QMainWindow;
31
32 namespace Gui
33 {
34 #if defined(_USE_3DCONNEXION_SDK) || defined(SPNAV_FOUND)
35 class GuiNativeEvent;
36 #endif // Spacemice
37 class GUIApplicationNativeEventAware: public QApplication
38 {
39 Q_OBJECT
40 public:
41 GUIApplicationNativeEventAware(int& argc, char* argv[]);
42 ~GUIApplicationNativeEventAware() override;
43 void initSpaceball(QMainWindow* window);
44 bool isSpaceballPresent() const
45 {
46 return spaceballPresent;
47 }
48 void setSpaceballPresent(bool present)
49 {
50 spaceballPresent = present;
51 }
52 bool processSpaceballEvent(QObject* object, QEvent* event);
53 void postMotionEvent(std::vector<int> motionDataArray);
54 void postButtonEvent(int buttonNumber, int buttonPress);
55
56 private:
57 bool spaceballPresent;
58 void importSettings(std::vector<int>& motionDataArray);
59 float convertPrefToSensitivity(int value);
60 #if defined(_USE_3DCONNEXION_SDK) || defined(SPNAV_FOUND)
61 GuiNativeEvent* nativeEvent;
62 #endif
63 }; // end class GUIApplicationNativeEventAware
64 } // end namespace Gui
65
66 #endif // GUIAPPLICATIONNATIVEEVENTAWARE_H