X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=homescreen%2Fsrc%2Fhomescreenhandler.h;h=69599de5990c847c0399d77d443fca38e84c0ccd;hb=387c167e310124227b2d137eafa7cca992a8eb4a;hp=4afbac4bc3fee5fd0378f28eb68f7ee179876414;hpb=7d29d877baafe52cc0e0bbdf7d86deff61073651;p=apps%2Fhomescreen.git diff --git a/homescreen/src/homescreenhandler.h b/homescreen/src/homescreenhandler.h index 4afbac4..69599de 100644 --- a/homescreen/src/homescreenhandler.h +++ b/homescreen/src/homescreenhandler.h @@ -18,28 +18,33 @@ #define HOMESCREENHANDLER_H #include -#include #include -#include +#include #include using namespace std; +class QQmlApplicationEngine; + class HomescreenHandler : public QObject { Q_OBJECT public: + enum CHANGE_LAYOUT_PATTERN { + P_LEFT_METER_RIGHT_MAP = 0, + P_LEFT_MAP_RIGHT_METER + }; + Q_ENUMS(CHANGE_LAYOUT_PATTERN) explicit HomescreenHandler(QObject *parent = 0); ~HomescreenHandler(); - void init(int port, const char* token, QLibWindowmanager *qwm, QString myname); + void init(const char* role, int port, const char* token); + void attach(QQmlApplicationEngine* engine); + void setWMHandler(WMHandler &handler); - Q_INVOKABLE void tapShortcut(QString application_name, bool is_full); - Q_INVOKABLE QString getCurrentApplication(); - Q_INVOKABLE void killRunningApplications(); + Q_INVOKABLE void tapShortcut(QString application_name); + Q_INVOKABLE void changeLayout(int pattern); Q_INVOKABLE void reboot(); - void setCurrentApplication(QString application_name); - int getPidOfApplication(QString application_name); void onRep(struct json_object* reply_contents); void onEv(const string& event, struct json_object* event_contents); @@ -47,23 +52,19 @@ public: static void* myThis; static void onRep_static(struct json_object* reply_contents); static void onEv_static(const string& event, struct json_object* event_contents); - void setQuickWindow(QQuickWindow *qw); signals: - void showNotification(QString application_id, QString icon_path, QString text); - void showInformation(QString info); - void shortcutChanged(QString shortcut_id, QString shortcut_name, QString position); - void showWindow(); - void hideWindow(); + void notification(QString id, QString icon, QString text); + void information(QString text); -public slots: - void updateShortcut(QString id, struct json_object* object); +private Q_SLOTS: + void disconnect_frame_swapped(void); private: QLibHomeScreen *mp_qhs; - QLibWindowmanager *mp_qwm; - QString m_myname; - QString current_application; + LibWindowmanager *mp_wm; + std::string m_role; + QMetaObject::Connection loading; }; #endif // HOMESCREENHANDLER_H