BOX_TYPE,
AUTO_LAUNCH,
MOUSE_EVENT,
+ PD_FAST_OPEN,
};
// TODO this default type should be retrieved more automatically
return mouseEvent;
}
+int web_provider_livebox_get_pd_fast_open(const char* box_id)
+{
+ if (!box_id) {
+ return NULL;
+ }
+
+ std::shared_ptr<WebProviderDB> handle(new WebProviderDB());
+ if (!handle->openDB()) {
+ return NULL;
+ }
+
+ std::string query = "select * from " + infoTable + " where box_id = ?";
+ if (!handle->setCommand(query, "s", box_id)) {
+ handle->closeDB();
+ return NULL;
+ }
+
+ if (!handle->executeCommand()) {
+ handle->closeDB();
+ return NULL;
+ }
+
+ int pdFastOpen = handle->getInt(InfoTableField::PD_FAST_OPEN);
+ handle->closeDB();
+
+ return pdFastOpen;
+}
+
int web_provider_livebox_insert_box_info(
const char* box_id,
const char* app_id,
const char* box_type,
int auto_launch,
- int mouse_event)
+ int mouse_event,
+ int pd_fast_open)
{
if (!box_id || !app_id || !box_type) {
return -1;
std::string query =
"insert into " + infoTable +
- " (box_id, app_id, box_type, auto_launch, mouse_event) values (?,?,?,?,?)";
+ " (box_id, app_id, box_type, auto_launch, mouse_event, pd_fast_open) \
+ values (?,?,?,?,?,?)";
if (!handle->setCommand(
- query, "sssii",
- box_id, app_id, box_type, auto_launch, mouse_event)) {
+ query, "sssiii",
+ box_id, app_id, box_type, auto_launch, mouse_event, pd_fast_open)) {
handle->closeDB();
return -1;
}
const char* app_id,
const char* box_type)
{
- return web_provider_livebox_insert_box_info(box_id, app_id, box_type, 0, 0);
+ return web_provider_livebox_insert_box_info(box_id, app_id, box_type, 0, 0, 0);
}
int web_provider_livebox_delete_by_box_id(const char* box_id)
const char* app_id,
const char* box_type)
{
- return web_provider_livebox_insert_box_info(box_id, app_id, box_type, 0, 0);
+ return web_provider_livebox_insert_box_info(box_id, app_id, box_type, 0, 0, 0);
}
int web_provider_info_delete_by_box_id(const char* box_id)