blob: 790a25e4a1dff066ad69b7cb5b8264fe60a256fc [file] [log] [blame]
Tristan Matthews0a329cc2013-07-17 13:20:14 -04001// Default empty project template
2#ifndef ApplicationUI_HPP_
3#define ApplicationUI_HPP_
4
5#include <QObject>
6
7#include "../../pjsua_app.h"
8
9namespace bb { namespace cascades { class Application; }}
10
11/*!
12 * @brief Application pane object
13 *
14 *Use this object to create and init app UI, to create context objects, to register the new meta types etc.
15 */
16class ApplicationUI : public QObject
17{
18 Q_OBJECT
19public:
20 ApplicationUI(bb::cascades::Application *app);
21 virtual ~ApplicationUI();
22
23 bool isShuttingDown;
24 static ApplicationUI *instance();
25
26 /* Write msg to label (from different thread) */
27 static void extDisplayMsg(const char *msg);
28
29 /* Restart request (from different thread) */
30 void extRestartRequest(int argc, char **argv);
31
32public slots:
33 void aboutToQuit();
34
35 Q_INVOKABLE void restartPjsua();
36 Q_INVOKABLE void displayMsg(const QString &msg);
37
38private:
39 static ApplicationUI *instance_;
40 char **restartArgv;
41 int restartArgc;
42
43 /* pjsua main operations */
44 void pjsuaStart();
45 void pjsuaDestroy();
46
47 /* pjsua app callbacks */
48 static void pjsuaOnStartedCb(pj_status_t status, const char* msg);
49 static void pjsuaOnStoppedCb(pj_bool_t restart, int argc, char** argv);
50 static void pjsuaOnAppConfigCb(pjsua_app_config *cfg);
51};
52
53
54#endif /* ApplicationUI_HPP_ */