20 */ |
20 */ |
21 #ifndef __GINEBRA_APPLICATION_H__ |
21 #ifndef __GINEBRA_APPLICATION_H__ |
22 #define __GINEBRA_APPLICATION_H__ |
22 #define __GINEBRA_APPLICATION_H__ |
23 |
23 |
24 #include <QObject> |
24 #include <QObject> |
|
25 #include <QAction> |
25 |
26 |
26 #ifdef ORBIT_UI |
27 #ifdef ORBIT_UI |
27 #define UI_FRAMEWORK "orbit_ui" |
28 #define UI_FRAMEWORK "orbit_ui" |
|
29 #elif defined(Q_WS_MAEMO_5) |
|
30 #define UI_FRAMEWORK "maemo5_ui" |
28 #else |
31 #else |
29 #define UI_FRAMEWORK "" |
32 #define UI_FRAMEWORK "" |
30 #endif // ORBIT_UI |
33 #endif // ORBIT_UI |
31 |
34 |
32 #ifdef QT_MOBILITY_SERVICE_FRAMEWORK |
35 #ifdef QT_MOBILITY_SERVICE_FRAMEWORK |
33 #define MOBILITY_SERVICE_FRAMEWORK "mobility_service_framework" |
36 #define MOBILITY_SERVICE_FRAMEWORK "mobility_service_framework" |
34 #else |
37 #else |
35 #define MOBILITY_SERVICE_FRAMEWORK "junk" |
38 #define MOBILITY_SERVICE_FRAMEWORK "junk" |
36 #endif // QT_MOBILITY_SERVICE_FRAMEWORK |
39 #endif // QT_MOBILITY_SERVICE_FRAMEWORK |
|
40 |
|
41 #ifdef QT_GEOLOCATION |
|
42 #define GEOLOCATION true |
|
43 #else |
|
44 #define GEOLOCATION false |
|
45 #endif |
37 |
46 |
38 class QCoreApplication; |
47 class QCoreApplication; |
39 |
48 |
40 namespace GVA { |
49 namespace GVA { |
41 |
50 |
57 void quit(); |
66 void quit(); |
58 void debug(const QString &msg); |
67 void debug(const QString &msg); |
59 QString ui() const { return UI_FRAMEWORK; } |
68 QString ui() const { return UI_FRAMEWORK; } |
60 QString layoutType() ; |
69 QString layoutType() ; |
61 QString serviceFramework() const { return MOBILITY_SERVICE_FRAMEWORK; } |
70 QString serviceFramework() const { return MOBILITY_SERVICE_FRAMEWORK; } |
|
71 bool geolocation() const { return GEOLOCATION; } |
62 void sendToBackground(); |
72 void sendToBackground(); |
|
73 |
|
74 /// Create a QAction object |
|
75 QObject *createAction(const QString &text = QString::null, const QString &iconPath = QString::null, bool checkable = false); |
|
76 void addMenuBarAction(QObject *action); |
|
77 void setMenuBarEnabled(bool value); |
|
78 |
63 /* |
79 /* |
64 * You can use this to breakpoint inside your javascript. Here's how: |
80 * You can use this to breakpoint inside your javascript. Here's how: |
65 * 1) put a breakpoint on this function |
81 * 1) put a breakpoint on this function |
66 * 2) to your javascript, add: app.breakpoint(); |
82 * 2) to your javascript, add: app.breakpoint(); |
67 * 3) when the breakpoint hits, you will be in the C++ stack at the point of that JS execution |
83 * 3) when the breakpoint hits, you will be in the C++ stack at the point of that JS execution |
68 * It doesn't really help you step through javascript (unless you know the javascript core well), but helps you debug C++ and javascript interaction |
84 * It doesn't really help you step through javascript (unless you know the javascript core well), but helps you debug C++ and javascript interaction |
69 */ |
85 */ |
70 void breakpoint() {} |
86 void breakpoint() {} |
71 signals: |
87 signals: |
72 void aboutToQuit(); |
88 void aboutToQuit(); |
|
89 |
|
90 /// Sent when an action needs to be added to the platform menu bar. |
|
91 void addMenuBarActionRequest(QAction *action); |
|
92 |
|
93 /// Sent when the platform menu bar's menu should be disabled. |
|
94 void setMenuBarEnabledRequest(bool value); |
|
95 |
73 private: |
96 private: |
74 QCoreApplication * m_app; |
97 QCoreApplication * m_app; |
75 }; |
98 }; |
76 |
99 |
77 } |
100 } |