X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;ds=sidebyside;f=homescreen%2Fsrc%2Fhomescreenhandler.cpp;h=c1cff260c6b322595a8c399e85713220feeb0294;hb=687d3fd6162d6415b0e4eb5aaf408f4824e27a0c;hp=5da8b9e11d4075d458cdcc8af5a2f9ff84801677;hpb=33d31b5bac3c8c9105d43d6566174f39ef7a4ea4;p=apps%2Fhomescreen.git diff --git a/homescreen/src/homescreenhandler.cpp b/homescreen/src/homescreenhandler.cpp index 5da8b9e..c1cff26 100644 --- a/homescreen/src/homescreenhandler.cpp +++ b/homescreen/src/homescreenhandler.cpp @@ -22,7 +22,8 @@ void* HomescreenHandler::myThis = 0; HomescreenHandler::HomescreenHandler(QObject *parent) : QObject(parent), - mp_hs(NULL) + mp_hs(NULL), + current_applciation("launcher") { } @@ -48,13 +49,34 @@ void HomescreenHandler::init(int port, const char *token) json_object_object_get(object, "display_message")); HMI_DEBUG("HomeScreen","set_event_handler Event_OnScreenMessage display_message = %s", display_message); }); - } -void HomescreenHandler::tapShortcut(QString application_name) +void HomescreenHandler::tapShortcut(QString application_name, bool is_full) { HMI_DEBUG("HomeScreen","tapShortcut %s", application_name.toStdString().c_str()); - mp_hs->tapShortcut(application_name.toStdString().c_str()); + struct json_object* j_json = json_object_new_object(); + struct json_object* value; + if(is_full) { + value = json_object_new_string("fullscreen"); + HMI_DEBUG("HomeScreen","ullscreen"); + } else { + value = json_object_new_string("normal"); + HMI_DEBUG("HomeScreen","normal"); + } + json_object_object_add(j_json, "area", value); + mp_hs->showWindow(application_name.toStdString().c_str(), j_json); +} + +void HomescreenHandler::setCurrentApplication(QString application_name) +{ + HMI_DEBUG("HomeScreen","setCurrentApplication %s", application_name.toStdString().c_str()); + current_applciation = application_name; +} + +QString HomescreenHandler::getCurrentApplication() +{ + HMI_DEBUG("HomeScreen","getCurrentApplication %s", current_applciation.toStdString().c_str()); + return current_applciation; } void HomescreenHandler::onRep_static(struct json_object* reply_contents)