Add touch_effect retrieve function.
authorSung-jae Park <nicesj.park@samsung.com>
Thu, 31 Jan 2013 02:30:36 +0000 (02:30 +0000)
committerSung-jae Park <nicesj.park@samsung.com>
Thu, 31 Jan 2013 02:30:36 +0000 (02:30 +0000)
Change-Id: I2eed2487e4a1035487e7492ba6c6085b610e439f

include/livebox-service.h
packaging/liblivebox-service.spec
src/livebox-service.c

index ada9b53..fcf77d9 100644 (file)
@@ -59,6 +59,12 @@ extern int livebox_service_size_type(int width, int height);
 extern int livebox_service_mouse_event(const char *pkgid);
 
 /*!
+ * \param[in] pkgid Livebox's appid
+ * \return true(1) / false(0)
+ */
+extern int livebox_service_touch_effect(const char *pkgid);
+
+/*!
  */
 extern int livebox_service_trigger_update(const char *pkgname, const char *cluster, const char *category);
 
index abda310..24067a9 100644 (file)
@@ -1,6 +1,6 @@
 Name: liblivebox-service
 Summary: Service API for gathering installed livebox information.
-Version: 0.3.1
+Version: 0.3.2
 Release: 1
 Group: framework/livebox
 License: Flora License
index 85fc4c0..0e39885 100644 (file)
@@ -746,6 +746,43 @@ out:
        return ret;
 }
 
+EAPI int livebox_service_touch_effect(const char *pkgid)
+{
+       sqlite3_stmt *stmt;
+       sqlite3 *handle;
+       int ret;
+
+       handle = open_db();
+       if (!handle)
+               return 0;
+
+       ret = sqlite3_prepare_v2(handle, "SELECT touch_effect FROM client WHERE pkgid = ?", -1, &stmt, NULL);
+       if (ret != SQLITE_OK) {
+               ErrPrint("Error: %s\n", sqlite3_errmsg(handle));
+               close_db(handle);
+               return 0;
+       }
+
+       ret = sqlite3_bind_text(stmt, 1, pkgid, -1, NULL);
+       if (ret != SQLITE_OK) {
+               ErrPrint("Error: %s\n", sqlite3_errmsg(handle));
+               ret = 0;
+               goto out;
+       }
+
+       ret = sqlite3_step(stmt);
+       if (ret == SQLITE_ROW)
+               ret = !!sqlite3_column_int(stmt, 0);
+       else
+               ret = 1;
+
+out:
+       sqlite3_reset(stmt);
+       sqlite3_finalize(stmt);
+       close_db(handle);
+       return ret;
+}
+
 EAPI int livebox_service_mouse_event(const char *pkgid)
 {
        sqlite3_stmt *stmt;