summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qlibhomescreen.cpp72
-rw-r--r--src/qlibhomescreen.h9
2 files changed, 79 insertions, 2 deletions
diff --git a/src/qlibhomescreen.cpp b/src/qlibhomescreen.cpp
index 13093c3..1082869 100644
--- a/src/qlibhomescreen.cpp
+++ b/src/qlibhomescreen.cpp
@@ -179,4 +179,74 @@ void QLibHomeScreen::tapShortcut(QString application_name)
{
HMI_DEBUG("qlibhomescreen","tapShortcut %s", application_name.toStdString().c_str());
this->mp_hs->tapShortcut(application_name.toStdString().c_str());
-} \ No newline at end of file
+}
+
+/**
+ * show application by application id
+ *
+ * #### Parameters
+ * - id : application id
+ * - json : json parameters
+ *
+ * #### Return
+ * - None.
+ *
+ */
+void QLibHomeScreen::showWindow(QString application_name, json_object* json)
+{
+ mp_hs->showWindow(application_name.toStdString().c_str(), json);
+}
+
+/**
+ * show application by application id, json string
+ *
+ * #### Parameters
+ * - id : application id
+ * - json : json parameters
+ *
+ * #### Return
+ * - None.
+ *
+ */
+void QLibHomeScreen::showWindow(QString application_name, QString json)
+{
+ if(json.isNull())
+ this->tapShortcut(application_name);
+ else
+ mp_hs->showWindow(application_name.toStdString().c_str(), json_tokener_parse(json.toStdString().c_str()));
+}
+
+
+/**
+ * allocate restiction App
+ *
+ * use libhomescreen api to call restriction app to display
+ *
+ * #### Parameters
+ * - area : restriction display area
+ *
+ * #### Resturn
+ * - None.
+ *
+ */
+void QLibHomeScreen::allocateRestriction(QString area)
+{
+ mp_hs->allocateRestriction(area.toStdString().c_str());
+}
+
+/**
+ * allocate restiction App
+ *
+ * use libhomescreen api to call restriction app to hide
+ *
+ * #### Parameters
+ * - area : restriction display area
+ *
+ * #### Resturn
+ * - None.
+ *
+ */
+void QLibHomeScreen::releaseRestriction(QString area)
+{
+ mp_hs->releaseRestriction(area.toStdString().c_str());
+}
diff --git a/src/qlibhomescreen.h b/src/qlibhomescreen.h
index cc0f12a..6d96bb2 100644
--- a/src/qlibhomescreen.h
+++ b/src/qlibhomescreen.h
@@ -34,7 +34,10 @@ public:
enum QEventType {
Event_TapShortcut = LibHomeScreen::Event_TapShortcut,
- Event_OnScreenReply = LibHomeScreen::Event_OnScreenReply
+ Event_ShowWindow = LibHomeScreen::Event_ShowWindow,
+ Event_OnScreenReply = LibHomeScreen::Event_OnScreenReply,
+ Event_AllocateRestriction,
+ Event_ReleaseRestriction
};
using handler_fun = std::function<void(json_object *object)>;
@@ -44,6 +47,10 @@ public:
Q_INVOKABLE int subscribe(const QString &eventName);
Q_INVOKABLE int unsubscribe(const QString &eventName);
Q_INVOKABLE void tapShortcut(QString application_name);
+ Q_INVOKABLE void showWindow(QString application_name, json_object* json);
+ Q_INVOKABLE void showWindow(QString application_name, QString json);
+ Q_INVOKABLE void allocateRestriction(QString area);
+ Q_INVOKABLE void releaseRestriction(QString area);
signals: