Apply tizen coding rule 26/172326/9 accepted/tizen/unified/20180322.060149 submit/tizen/20180318.231541 submit/tizen/20180320.044006
authorSeonah Moon <seonah1.moon@samsung.com>
Tue, 13 Mar 2018 08:02:12 +0000 (17:02 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Thu, 15 Mar 2018 08:33:12 +0000 (17:33 +0900)
Change-Id: I6a45a1cac7085f91614f022788ede234e424c790
Signed-off-by: Seonah Moon <seonah1.moon@samsung.com>
39 files changed:
AUTHORS [deleted file]
download_db_service/download-db-service-main.cpp
download_db_service/download-db-service.cpp
download_db_service/include/download-db-service-common.h
download_db_service/include/download-db-service-debug.h
download_db_service/include/download-db-service-main.h
oma-parser/oma-parser-common.c
oma-parser/oma-parser-common.h
oma-parser/oma-parser-dd1.c
oma-parser/oma-parser-dd1.h
oma-parser/oma-parser-interface.c
oma-parser/oma-parser-interface.h
src/download-manager-dateTime.cpp
src/download-manager-downloadItem.cpp
src/download-manager-downloadRequest.cpp
src/download-manager-event.cpp
src/download-manager-history-db.cpp
src/download-manager-item.cpp
src/download-manager-items.cpp
src/download-manager-network.cpp
src/download-manager-notification.cpp
src/download-manager-util.cpp
src/download-manager-view.cpp
src/download-manager-viewItem.cpp
src/include/download-manager-common.h
src/include/download-manager-dateTime.h
src/include/download-manager-debug.h
src/include/download-manager-downloadItem.h
src/include/download-manager-downloadRequest.h
src/include/download-manager-event.h
src/include/download-manager-history-db.h
src/include/download-manager-item.h
src/include/download-manager-items.h
src/include/download-manager-network.h
src/include/download-manager-notification.h
src/include/download-manager-util.h
src/include/download-manager-view.h
src/include/download-manager-viewItem.h
src/main.cpp

diff --git a/AUTHORS b/AUTHORS
deleted file mode 100644 (file)
index f2a0094..0000000
--- a/AUTHORS
+++ /dev/null
@@ -1 +0,0 @@
-Jungki Kwak <jungki.kwak@samsung.com>\r
index 13ed7ba..86b697c 100755 (executable)
-/*\r
- * Copyright 2012  Samsung Electronics Co., Ltd\r
- *\r
- * Licensed under the Flora License, Version 1.1 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- *    http://floralicense.org/license/\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-/**\r
- * @file       download-manager-history-db.cpp\r
- * @author     Jungki Kwak (jungki.kwak@samsung.com)\r
- * @brief      Manager for a download history DB\r
- */\r
-\r
-#include <list>\r
-#include <string>\r
-#include <iostream>\r
-#include <memory>\r
-\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
-#include <glib.h>\r
-\r
-#include <sstream>\r
-//#include "download-manager-common.h"\r
-//#include "download-manager-history-db.h"\r
-#include "download-db-service-main.h"\r
-#include "download-db-service-debug.h"\r
-\r
-\r
-#define FINALIZE_ON_ERROR( stmt ) { \\r
-       DM_LOGE("SQL error:%d[%s]", ret, sqlite3_errmsg(historyDb));\\r
-       if (sqlite3_finalize(stmt) != SQLITE_OK)\\r
-               DM_LOGE("sqlite3_finalize is failed");\\r
-       closeDB();\\r
-       return false; \\r
-}\r
-\r
-sqlite3 *DownloadHistoryDB::historyDb = NULL;\r
-\r
-DownloadHistoryDB::DownloadHistoryDB()\r
-{\r
-}\r
-\r
-DownloadHistoryDB::~DownloadHistoryDB()\r
-{\r
-}\r
-\r
-bool DownloadHistoryDB::openDB()\r
-{\r
-       DM_LOGV("");\r
-       int ret = 0;\r
-       if (historyDb == NULL) {\r
-               DM_LOGD("TRY to open [%s]", DBDATADIR"/"HISTORYDB);\r
-               if (sqlite3_open_v2(DBDATADIR"/"HISTORYDB, &historyDb,\r
-                               SQLITE_OPEN_READWRITE, NULL) != SQLITE_OK) {\r
-                       DM_LOGD("[ERROR][%s][%s]", DBDATADIR"/"HISTORYDB,\r
-                               sqlite3_errmsg(historyDb));\r
-\r
-                       int errorcode = sqlite3_errcode(historyDb);\r
-                       closeDB();\r
-                       if (errorcode == SQLITE_CORRUPT) {\r
-                               DM_LOGD("unlink [%s]", DBDATADIR"/"HISTORYDB);\r
-                               //unlink(DBDATADIR"/"HISTORYDB);\r
-                               errorcode = SQLITE_CANTOPEN;\r
-                       }\r
-\r
-                       if (errorcode == SQLITE_CANTOPEN) {\r
-                               DM_LOGD("Error :: CANTOPEN");\r
-                               int trycount = 0;\r
-                               while ((loadSqlSchema() == false) && (++trycount <= 3));\r
-                               if (trycount > 3)\r
-                                       DM_LOGD("[ERROR] Could not restore DB");\r
-                               return isOpen();\r
-                       }\r
-                       return false;\r
-               }\r
-               ret = sqlite3_exec(historyDb, "PRAGMA journal_mode=PERSIST;", 0, 0, 0);\r
-               if (SQLITE_OK != ret)\r
-                       return false;\r
-       }\r
-\r
-       return isOpen();\r
-}\r
-\r
-void DownloadHistoryDB::closeDB()\r
-{\r
-       DM_LOGV("");\r
-       if (historyDb) {\r
-               sqlite3_close(historyDb);\r
-               historyDb = NULL;\r
-       }\r
-}\r
-\r
-bool DownloadHistoryDB::loadSqlSchema(void)\r
-{\r
-       if (sqlite3_open_v2(DBDATADIR"/"HISTORYDB, &historyDb,\r
-                               SQLITE_OPEN_READWRITE |SQLITE_OPEN_CREATE, NULL) != SQLITE_OK) {\r
-               DM_LOGD("[ERROR][%s][%s]", DBDATADIR"/"HISTORYDB,\r
-                               sqlite3_errmsg(historyDb));\r
-               closeDB();\r
-               return false;\r
-       }\r
-\r
-       char *error_msg = NULL;\r
-       int ret = 0;\r
-       ret = sqlite3_exec(historyDb, REBUILD_QUERY, 0, 0, &error_msg);\r
-       if((error_msg != NULL) || (SQLITE_OK != ret)) {\r
-               DM_LOGD("SQL error :: [%s]",error_msg);\r
-               sqlite3_free(error_msg);\r
-               error_msg = NULL;\r
-               closeDB();\r
-               return false;\r
-       }\r
-\r
-       ret = sqlite3_exec(historyDb, REBUILD_QUERY_INDEX, 0, 0, &error_msg);\r
-       if((error_msg != NULL) || (SQLITE_OK != ret)) {\r
-               DM_LOGD("SQL error :: [%s]",error_msg);\r
-               sqlite3_free(error_msg);\r
-               error_msg = NULL;\r
-       }\r
-       return true;\r
-}\r
-\r
-void DownloadHistoryDB::insert_request_cb(int request_id, data_control_h provider, bundle *insert_data)\r
-{\r
-       char* command = data_control_provider_create_insert_statement(provider, insert_data);\r
-\r
-       if (!openDB()) {\r
-               DM_LOGE("NULL Check:historyDB");\r
-               free(command);\r
-               return ;\r
-       }\r
-\r
-       int ret = sqlite3_exec(historyDb, command, NULL, NULL, NULL);\r
-\r
-       if (ret != SQLITE_OK) {\r
-               data_control_provider_send_error(request_id, sqlite3_errmsg(historyDb));\r
-               free(command);\r
-               return;\r
-       }\r
-       DM_LOGI("[insert_request_cb] insert success");\r
-\r
-       long long inserted_row_id = sqlite3_last_insert_rowid(historyDb);\r
-       ret = data_control_provider_send_insert_result(request_id, inserted_row_id);\r
-       if (ret != DATA_CONTROL_ERROR_NONE)\r
-               DM_LOGE("insert_send_result failed with error: %d", ret);\r
-       DM_LOGI("[insert_request_cb] send result success");\r
-\r
-       free(command);\r
-}\r
-\r
-void DownloadHistoryDB::delete_request_cb(int request_id, data_control_h provider, const char *where)\r
-{\r
-       DM_LOGI("[delete_request_cb] request_id(%d)", request_id);\r
-\r
-       char* command = data_control_provider_create_delete_statement(provider, where);\r
-\r
-       if (!openDB()) {\r
-               DM_LOGE("NULL Check:historyDB");\r
-               free(command);\r
-               return ;\r
-       }\r
-\r
-       int ret = sqlite3_exec(historyDb, command, NULL, NULL, NULL);\r
-       if (ret != SQLITE_OK) {\r
-               data_control_provider_send_error(request_id, sqlite3_errmsg(historyDb));\r
-               free(command);\r
-               return;\r
-       }\r
-\r
-       ret = data_control_provider_send_delete_result(request_id);\r
-       if (ret != DATA_CONTROL_ERROR_NONE)\r
-               DM_LOGE("delete_send_result failed with error: %d", ret);\r
-       DM_LOGI("[delete_request_cb] delete success");\r
-\r
-       free(command);\r
-}\r
-\r
-void DownloadHistoryDB::select_request_cb(int request_id, data_control_h provider, const char **column_list,\r
-                                       int column_count, const char *where, const char *order)\r
-{\r
-       sqlite3_stmt* sql_stmt = NULL;\r
-\r
-       char* command = data_control_provider_create_select_statement(provider, column_list,\r
-                                                                                                                                                       column_count, where, order);\r
-\r
-       if (!openDB()) {\r
-               DM_LOGE("NULL Check:historyDB");\r
-               free(command);\r
-               return ;\r
-       }\r
-\r
-       int ret = sqlite3_prepare_v2(historyDb, command, strlen(command), &sql_stmt, NULL);\r
-       if (ret != SQLITE_OK) {\r
-               data_control_provider_send_error(request_id, sqlite3_errmsg(historyDb));\r
-               free(command);\r
-               return;\r
-       }\r
-\r
-       ret = data_control_provider_send_select_result(request_id, (void *)sql_stmt);\r
-       if (ret != DATA_CONTROL_ERROR_NONE)\r
-               DM_LOGE("select_send_result failed with error: %d", ret);\r
-       DM_LOGI("[select_request_cb] send result success");\r
-\r
-       sqlite3_finalize(sql_stmt);\r
-       free(command);\r
-}\r
-\r
-void DownloadHistoryDB::update_request_cb(int request_id, data_control_h provider, bundle *update_data, const char *where)\r
-{\r
-       char* command = data_control_provider_create_update_statement(provider, update_data, where);\r
-\r
-       if (!openDB()) {\r
-               DM_LOGE("NULL Check:historyDB");\r
-               free(command);\r
-               return ;\r
-       }\r
-\r
-       int ret = sqlite3_exec(historyDb, command, NULL, NULL, NULL);\r
-       if (ret != SQLITE_OK) {\r
-               data_control_provider_send_error(request_id, sqlite3_errmsg(historyDb));\r
-               free(command);\r
-               return;\r
-       }\r
-\r
-       ret = data_control_provider_send_update_result(request_id);\r
-       if (ret != DATA_CONTROL_ERROR_NONE)\r
-               DM_LOGE("update_send_result failed with error: %d", ret);\r
-       DM_LOGI("[update_request_cb] send result success");\r
-\r
-       free(command);\r
-}\r
-\r
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <list>
+#include <string>
+#include <iostream>
+#include <memory>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <glib.h>
+
+#include <sstream>
+//#include "download-manager-common.h"
+//#include "download-manager-history-db.h"
+#include "download-db-service-main.h"
+#include "download-db-service-debug.h"
+
+
+#define FINALIZE_ON_ERROR(stmt) { \
+       DM_LOGE("SQL error:%d[%s]", ret, sqlite3_errmsg(historyDb));\
+       if (sqlite3_finalize(stmt) != SQLITE_OK)\
+               DM_LOGE("sqlite3_finalize is failed");\
+       closeDB();\
+       return false; \
+}
+
+sqlite3 *DownloadHistoryDB::historyDb = NULL;
+
+DownloadHistoryDB::DownloadHistoryDB()
+{
+}
+
+DownloadHistoryDB::~DownloadHistoryDB()
+{
+}
+
+bool DownloadHistoryDB::openDB()
+{
+       DM_LOGV("");
+       int ret = 0;
+       if (historyDb == NULL) {
+               DM_LOGD("TRY to open [%s]", DBDATADIR"/"HISTORYDB);
+               if (sqlite3_open_v2(DBDATADIR"/"HISTORYDB, &historyDb,
+                               SQLITE_OPEN_READWRITE, NULL) != SQLITE_OK) {
+                       DM_LOGD("[ERROR][%s][%s]", DBDATADIR"/"HISTORYDB,
+                               sqlite3_errmsg(historyDb));
+
+                       int errorcode = sqlite3_errcode(historyDb);
+                       closeDB();
+                       if (errorcode == SQLITE_CORRUPT) {
+                               DM_LOGD("unlink [%s]", DBDATADIR"/"HISTORYDB);
+                               //unlink(DBDATADIR"/"HISTORYDB);
+                               errorcode = SQLITE_CANTOPEN;
+                       }
+
+                       if (errorcode == SQLITE_CANTOPEN) {
+                               DM_LOGD("Error :: CANTOPEN");
+                               int trycount = 0;
+                               while ((loadSqlSchema() == false) && (++trycount <= 3));
+                               if (trycount > 3)
+                                       DM_LOGD("[ERROR] Could not restore DB");
+                               return isOpen();
+                       }
+                       return false;
+               }
+               ret = sqlite3_exec(historyDb, "PRAGMA journal_mode=PERSIST;", 0, 0, 0);
+               if (SQLITE_OK != ret)
+                       return false;
+       }
+
+       return isOpen();
+}
+
+void DownloadHistoryDB::closeDB()
+{
+       DM_LOGV("");
+       if (historyDb) {
+               sqlite3_close(historyDb);
+               historyDb = NULL;
+       }
+}
+
+bool DownloadHistoryDB::loadSqlSchema(void)
+{
+       if (sqlite3_open_v2(DBDATADIR"/"HISTORYDB, &historyDb,
+                               SQLITE_OPEN_READWRITE |SQLITE_OPEN_CREATE, NULL) != SQLITE_OK) {
+               DM_LOGD("[ERROR][%s][%s]", DBDATADIR"/"HISTORYDB,
+                               sqlite3_errmsg(historyDb));
+               closeDB();
+               return false;
+       }
+
+       char *error_msg = NULL;
+       int ret = 0;
+       ret = sqlite3_exec(historyDb, REBUILD_QUERY, 0, 0, &error_msg);
+       if((error_msg != NULL) || (SQLITE_OK != ret)) {
+               DM_LOGD("SQL error :: [%s]", error_msg);
+               sqlite3_free(error_msg);
+               error_msg = NULL;
+               closeDB();
+               return false;
+       }
+
+       ret = sqlite3_exec(historyDb, REBUILD_QUERY_INDEX, 0, 0, &error_msg);
+       if((error_msg != NULL) || (SQLITE_OK != ret)) {
+               DM_LOGD("SQL error :: [%s]", error_msg);
+               sqlite3_free(error_msg);
+               error_msg = NULL;
+       }
+       return true;
+}
+
+void DownloadHistoryDB::insert_request_cb(int request_id, data_control_h provider, bundle *insert_data)
+{
+       char* command = data_control_provider_create_insert_statement(provider, insert_data);
+
+       if (!openDB()) {
+               DM_LOGE("NULL Check:historyDB");
+               free(command);
+               return ;
+       }
+
+       int ret = sqlite3_exec(historyDb, command, NULL, NULL, NULL);
+
+       if (ret != SQLITE_OK) {
+               data_control_provider_send_error(request_id, sqlite3_errmsg(historyDb));
+               free(command);
+               return;
+       }
+       DM_LOGI("[insert_request_cb] insert success");
+
+       long long inserted_row_id = sqlite3_last_insert_rowid(historyDb);
+       ret = data_control_provider_send_insert_result(request_id, inserted_row_id);
+       if (ret != DATA_CONTROL_ERROR_NONE)
+               DM_LOGE("insert_send_result failed with error: %d", ret);
+       DM_LOGI("[insert_request_cb] send result success");
+
+       free(command);
+}
+
+void DownloadHistoryDB::delete_request_cb(int request_id, data_control_h provider, const char *where)
+{
+       DM_LOGI("[delete_request_cb] request_id(%d)", request_id);
+
+       char* command = data_control_provider_create_delete_statement(provider, where);
+
+       if (!openDB()) {
+               DM_LOGE("NULL Check:historyDB");
+               free(command);
+               return ;
+       }
+
+       int ret = sqlite3_exec(historyDb, command, NULL, NULL, NULL);
+       if (ret != SQLITE_OK) {
+               data_control_provider_send_error(request_id, sqlite3_errmsg(historyDb));
+               free(command);
+               return;
+       }
+
+       ret = data_control_provider_send_delete_result(request_id);
+       if (ret != DATA_CONTROL_ERROR_NONE)
+               DM_LOGE("delete_send_result failed with error: %d", ret);
+       DM_LOGI("[delete_request_cb] delete success");
+
+       free(command);
+}
+
+void DownloadHistoryDB::select_request_cb(int request_id, data_control_h provider, const char **column_list,
+                                       int column_count, const char *where, const char *order)
+{
+       sqlite3_stmt* sql_stmt = NULL;
+
+       char* command = data_control_provider_create_select_statement(provider, column_list,
+                                                                                                                                                       column_count, where, order);
+
+       if (!openDB()) {
+               DM_LOGE("NULL Check:historyDB");
+               free(command);
+               return ;
+       }
+
+       int ret = sqlite3_prepare_v2(historyDb, command, strlen(command), &sql_stmt, NULL);
+       if (ret != SQLITE_OK) {
+               data_control_provider_send_error(request_id, sqlite3_errmsg(historyDb));
+               free(command);
+               return;
+       }
+
+       ret = data_control_provider_send_select_result(request_id, (void *)sql_stmt);
+       if (ret != DATA_CONTROL_ERROR_NONE)
+               DM_LOGE("select_send_result failed with error: %d", ret);
+       DM_LOGI("[select_request_cb] send result success");
+
+       sqlite3_finalize(sql_stmt);
+       free(command);
+}
+
+void DownloadHistoryDB::update_request_cb(int request_id, data_control_h provider, bundle *update_data, const char *where)
+{
+       char* command = data_control_provider_create_update_statement(provider, update_data, where);
+
+       if (!openDB()) {
+               DM_LOGE("NULL Check:historyDB");
+               free(command);
+               return ;
+       }
+
+       int ret = sqlite3_exec(historyDb, command, NULL, NULL, NULL);
+       if (ret != SQLITE_OK) {
+               data_control_provider_send_error(request_id, sqlite3_errmsg(historyDb));
+               free(command);
+               return;
+       }
+
+       ret = data_control_provider_send_update_result(request_id);
+       if (ret != DATA_CONTROL_ERROR_NONE)
+               DM_LOGE("update_send_result failed with error: %d", ret);
+       DM_LOGI("[update_request_cb] send result success");
+
+       free(command);
+}
+
index 68858f7..e267222 100755 (executable)
  * limitations under the License.\r
  */\r
 \r
-/**\r
- * @file       main.cpp\r
- * @author     Jungki Kwak (jungki.kwak@samsung.com)\r
- * @brief      main file for download manager\r
- */\r
-\r
 #include <list>\r
 #include <string>\r
 #include <iostream>\r
index 4021e64..79b7658 100755 (executable)
-/*\r
- * Copyright 2012  Samsung Electronics Co., Ltd\r
- *\r
- * Licensed under the Flora License, Version 1.1 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- *    http://floralicense.org/license/\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-/**\r
- * @file       download-manager-common.h\r
- * @author     Jungki Kwak (jungki.kwak@samsung.com)\r
- * @brief      Common define and data\r
- */\r
-\r
-#ifndef DOWNLOAD_DB_SERVICE_COMMON_H\r
-#define DOWNLOAD_DB_SERVICE_COMMON_H\r
-\r
-#include <libintl.h>\r
-#include "download-db-service-debug.h"\r
-#include <tzplatform_config.h>\r
-\r
-#define _EDJ(o) elm_layout_edje_get(o)\r
-#define __(s) dgettext(PROJ_NAME, s)\r
-#define S_(s) dgettext("sys_string", s)\r
-\r
-#define DM_LOCALEDIR LOCALEDIR\r
-#define DM_DOMAIN PROJ_NAME\r
-\r
-// Download Manager Common Strings.\r
-#define ERROR_POPUP_LOW_MEM_DEFAULT_PHONE_WITH_SD_CARD __("IDS_DM_BODY_THERE_IS_NOT_ENOUGH_SPACE_IN_YOUR_DEVICE_STORAGE_GO_TO_PS_SETTINGS_TO_FREE_UP_SOME_STORAGE_SPACE_THEN_TRY_AGAIN")\r
-#define ERROR_POPUP_LOW_MEM_DEFAULT_PHONE_WITHOUT_SD_CARD __("IDS_DM_BODY_THERE_IS_NOT_ENOUGH_SPACE_IN_YOUR_DEVICE_STORAGE_GO_TO_PS_SETTINGS_TO_DELETE_SOME_DATA_OR_INSERT_AN_SD_CARD")\r
-#define ERROR_POPUP_LOW_MEM_DEFAULT_MMC_WITH_NO_PHONE_MEMORY_AVAILABLE __("IDS_DM_BODY_THERE_IS_NOT_ENOUGH_SPACE_ON_YOUR_SD_CARD_GO_TO_PS_SETTINGS_TO_DELETE_SOME_DATA_THEN_TRY_AGAIN")\r
-#define ERROR_POPUP_LOW_MEM_DEFAULT_MMC_WITH_PHONE_MEMORY_AVAILABLE __("IDS_DM_BODY_THERE_IS_NOT_ENOUGH_SPACE_ON_YOUR_SD_CARD_GO_TO_PS_SETTINGS_TO_DELETE_SOME_DATA_OR_CHANGE_THE_DEFAULT_STORAGE_LOCATION_TO_DEVICE")\r
-\r
-#define DM_POP_TEXT_DOWNLOAD_COMPLETE __("IDS_DM_HEADER_DOWNLOAD_COMPLETE")\r
-#define DM_POP_TEXT_DOWNLOAD_FAILED __("IDS_DM_BODY_DOWNLOAD_FAILED_M_STATUS_ABB")\r
-#define DM_DOWNLOAD_COMPLETE_STRING_ID __("IDS_DM_HEADER_DOWNLOAD_COMPLETE")\r
-#define DM_DOWNLOAD_FAILED_STRING_ID __("IDS_DM_BODY_DOWNLOAD_FAILED_M_STATUS_ABB")\r
-\r
-#ifdef _TIZEN_2_3_UX\r
-#define DM_POP_TEXT_ERROR ""\r
-#define DM_BODY_TEXT_NO_NAME "No name"\r
-#define DM_BODY_TEXT_UNSUPPORTED_FILE_TYPE "Unsupported file type"\r
-#define DM_OPT_TEXT_DELETE __("IDS_DM_OPT_DELETE")\r
-#define DM_SK_TEXT_CANCEL __("IDS_DM_BUTTON_CANCEL_ABB2")\r
-#define DM_SK_TEXT_OK __("IDS_DM_BUTTON_OK_ABB")\r
-#define DM_BODY_TEXT_SELECT_ALL __("IDS_DM_MBODY_SELECT_ALL")\r
-#define DM_BODY_TEXT_PD_SELECTED __("IDS_DM_HEADER_PD_SELECTED_ABB3")\r
-#define DM_SK_TEXT_DOWNLOAD __("IDS_DM_BUTTON_DOWNLOAD_ABB2")\r
-#define DM_BODY_TEXT_TODAY __("IDS_DM_HEADER_TODAY")\r
-#define DM_BODY_TEXT_YESTERDAY __("IDS_DM_HEADER_YESTERDAY")\r
-#define DM_POP_TEXT_FAILED __("IDS_DM_BODY_DOWNLOAD_FAILED_M_STATUS_ABB")\r
-#define DM_HEADER_DOWNLOAD_MANAGER __("IDS_DM_HEADER_DOWNLOAD_MANAGER_ABB")\r
-#else\r
-#define DM_POP_TEXT_ERROR S_("IDS_COM_POP_ERROR")\r
-#define DM_BODY_TEXT_NO_NAME S_("IDS_COM_BODY_NO_NAME")\r
-#define DM_BODY_TEXT_UNSUPPORTED_FILE_TYPE S_("IDS_COM_BODY_UNSUPPORTED_FILE_TYPE")\r
-#define DM_OPT_TEXT_DELETE S_("IDS_COM_OPT_DELETE")\r
-#define DM_SK_TEXT_CANCEL S_("IDS_COM_SK_CANCEL")\r
-#define DM_SK_TEXT_OK S_("IDS_COM_SK_OK")\r
-#define DM_BODY_TEXT_SELECT_ALL S_("IDS_COM_BODY_SELECT_ALL")\r
-#define DM_BODY_TEXT_PD_SELECTED S_("IDS_COM_BODY_PD_SELECTED")\r
-#define DM_SK_TEXT_DOWNLOAD S_("IDS_COM_SK_DOWNLOAD")\r
-#define DM_BODY_TEXT_TODAY S_("IDS_COM_BODY_TODAY")\r
-#define DM_BODY_TEXT_YESTERDAY S_("IDS_COM_BODY_YESTERDAY")\r
-#define DM_POP_TEXT_FAILED S_("IDS_COM_POP_FAILED")\r
-#endif\r
-\r
-// Other defines\r
-#define MAX_FILE_PATH_LEN 256\r
-#define MAX_BUF_LEN 256\r
-#define LOAD_HISTORY_COUNT 500\r
-#define WAITING_RO_MAX_SECONDS 20\r
-\r
-#define KEY_MODE "mode"\r
-#define KEY_REQ_HTTP_HEADER_FIELD "req_http_header_field"\r
-#define KEY_REQ_HTTP_HEADER_VALUE "req_http_header_value"\r
-#define KEY_MODE_VALUE_VIEW "view"\r
-#define KEY_MODE_VALUE_SILENT "silent"\r
-#define KEY_FAILED_HISTORYID "failed_historyid"\r
-#define KEY_DOWNLOADING_HISTORYID "downloading_historyid"\r
-#define KEY_DEFAULT_STORAGE "default_storage"\r
-#define KEY_NETWORK_BONDING "network_bonding"\r
-#define KEY_FILE_NAME "file_name"\r
-\r
-#define DM_DRM_MIME_STR "application/vnd.oma.drm.message"\r
-#define DM_DCF_MIME_STR "application/vnd.oma.drm.content"\r
-\r
-#define MYFILE_PKG_NAME "org.tizen.myfile"\r
-\r
-#define DM_DEFAULT_PHONE_INSTALL_DIR "/opt/usr/media/Downloads"\r
-\r
-#define DM_DEFAULT_MMC_TEMP_DIR "/opt/media/SDCardA1/.temp_download"\r
-#define DM_DEFAULT_MMC_INSTALL_DIR "/opt/media/SDCardA1/"\r
-\r
-#define DM_TEMP_DIR_NAME ".temp_download/"\r
-#define DM_INVALID_PATH_STRING ";\\\":*?<>|()"\r
-enum\r
-{\r
-       DM_CONTENT_NONE = 0,\r
-       DM_CONTENT_IMAGE,\r
-       DM_CONTENT_VIDEO,\r
-       DM_CONTENT_MUSIC,\r
-       DM_CONTENT_PDF,\r
-       DM_CONTENT_WORD,\r
-       DM_CONTENT_PPT, // 5\r
-       DM_CONTENT_EXCEL,\r
-       DM_CONTENT_HTML,\r
-       DM_CONTENT_TEXT,\r
-       DM_CONTENT_DRM,\r
-       DM_CONTENT_SD_DRM,//10\r
-       DM_CONTENT_FLASH,\r
-       DM_CONTENT_TPK,\r
-       DM_CONTENT_VCAL,\r
-       DM_CONTENT_UNKOWN //14\r
-};\r
-\r
-namespace DL_TYPE{\r
-enum TYPE {\r
-       TYPE_NONE,\r
-       HTTP_DOWNLOAD,\r
-};\r
-}\r
-\r
-namespace ERROR {\r
-enum CODE {\r
-       NONE = 0,\r
-       INVALID_URL,\r
-       NETWORK_FAIL,\r
-       NOT_ENOUGH_MEMORY,\r
-       FAIL_TO_INSTALL,\r
-       ENGINE_FAIL,\r
-#ifdef _ENABLE_OMA_DOWNLOAD\r
-       PARSING_FAIL,\r
-#endif\r
-       UNKNOWN\r
-};\r
-}\r
-\r
-namespace NOTIFICATION_TYPE{\r
-enum TYPE {\r
-       NOTI_NONE = 0,\r
-       NOTI_DOWNLOADING,\r
-       NOTI_FAILED,\r
-       NOTI_COMPLETED\r
-};\r
-}\r
-\r
-#endif /* DOWNLOAD_DB_SERVICE_COMMON_H */\r
-\r
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef DOWNLOAD_DB_SERVICE_COMMON_H
+#define DOWNLOAD_DB_SERVICE_COMMON_H
+
+#include <libintl.h>
+#include "download-db-service-debug.h"
+#include <tzplatform_config.h>
+
+#define _EDJ(o) elm_layout_edje_get(o)
+#define __(s) dgettext(PROJ_NAME, s)
+#define S_(s) dgettext("sys_string", s)
+
+#define DM_LOCALEDIR LOCALEDIR
+#define DM_DOMAIN PROJ_NAME
+
+// Download Manager Common Strings.
+#define ERROR_POPUP_LOW_MEM_DEFAULT_PHONE_WITH_SD_CARD __("IDS_DM_BODY_THERE_IS_NOT_ENOUGH_SPACE_IN_YOUR_DEVICE_STORAGE_GO_TO_PS_SETTINGS_TO_FREE_UP_SOME_STORAGE_SPACE_THEN_TRY_AGAIN")
+#define ERROR_POPUP_LOW_MEM_DEFAULT_PHONE_WITHOUT_SD_CARD __("IDS_DM_BODY_THERE_IS_NOT_ENOUGH_SPACE_IN_YOUR_DEVICE_STORAGE_GO_TO_PS_SETTINGS_TO_DELETE_SOME_DATA_OR_INSERT_AN_SD_CARD")
+#define ERROR_POPUP_LOW_MEM_DEFAULT_MMC_WITH_NO_PHONE_MEMORY_AVAILABLE __("IDS_DM_BODY_THERE_IS_NOT_ENOUGH_SPACE_ON_YOUR_SD_CARD_GO_TO_PS_SETTINGS_TO_DELETE_SOME_DATA_THEN_TRY_AGAIN")
+#define ERROR_POPUP_LOW_MEM_DEFAULT_MMC_WITH_PHONE_MEMORY_AVAILABLE __("IDS_DM_BODY_THERE_IS_NOT_ENOUGH_SPACE_ON_YOUR_SD_CARD_GO_TO_PS_SETTINGS_TO_DELETE_SOME_DATA_OR_CHANGE_THE_DEFAULT_STORAGE_LOCATION_TO_DEVICE")
+
+#define DM_POP_TEXT_DOWNLOAD_COMPLETE __("IDS_DM_HEADER_DOWNLOAD_COMPLETE")
+#define DM_POP_TEXT_DOWNLOAD_FAILED __("IDS_DM_BODY_DOWNLOAD_FAILED_M_STATUS_ABB")
+#define DM_DOWNLOAD_COMPLETE_STRING_ID __("IDS_DM_HEADER_DOWNLOAD_COMPLETE")
+#define DM_DOWNLOAD_FAILED_STRING_ID __("IDS_DM_BODY_DOWNLOAD_FAILED_M_STATUS_ABB")
+
+#ifdef _TIZEN_2_3_UX
+#define DM_POP_TEXT_ERROR ""
+#define DM_BODY_TEXT_NO_NAME "No name"
+#define DM_BODY_TEXT_UNSUPPORTED_FILE_TYPE "Unsupported file type"
+#define DM_OPT_TEXT_DELETE __("IDS_DM_OPT_DELETE")
+#define DM_SK_TEXT_CANCEL __("IDS_DM_BUTTON_CANCEL_ABB2")
+#define DM_SK_TEXT_OK __("IDS_DM_BUTTON_OK_ABB")
+#define DM_BODY_TEXT_SELECT_ALL __("IDS_DM_MBODY_SELECT_ALL")
+#define DM_BODY_TEXT_PD_SELECTED __("IDS_DM_HEADER_PD_SELECTED_ABB3")
+#define DM_SK_TEXT_DOWNLOAD __("IDS_DM_BUTTON_DOWNLOAD_ABB2")
+#define DM_BODY_TEXT_TODAY __("IDS_DM_HEADER_TODAY")
+#define DM_BODY_TEXT_YESTERDAY __("IDS_DM_HEADER_YESTERDAY")
+#define DM_POP_TEXT_FAILED __("IDS_DM_BODY_DOWNLOAD_FAILED_M_STATUS_ABB")
+#define DM_HEADER_DOWNLOAD_MANAGER __("IDS_DM_HEADER_DOWNLOAD_MANAGER_ABB")
+#else
+#define DM_POP_TEXT_ERROR S_("IDS_COM_POP_ERROR")
+#define DM_BODY_TEXT_NO_NAME S_("IDS_COM_BODY_NO_NAME")
+#define DM_BODY_TEXT_UNSUPPORTED_FILE_TYPE S_("IDS_COM_BODY_UNSUPPORTED_FILE_TYPE")
+#define DM_OPT_TEXT_DELETE S_("IDS_COM_OPT_DELETE")
+#define DM_SK_TEXT_CANCEL S_("IDS_COM_SK_CANCEL")
+#define DM_SK_TEXT_OK S_("IDS_COM_SK_OK")
+#define DM_BODY_TEXT_SELECT_ALL S_("IDS_COM_BODY_SELECT_ALL")
+#define DM_BODY_TEXT_PD_SELECTED S_("IDS_COM_BODY_PD_SELECTED")
+#define DM_SK_TEXT_DOWNLOAD S_("IDS_COM_SK_DOWNLOAD")
+#define DM_BODY_TEXT_TODAY S_("IDS_COM_BODY_TODAY")
+#define DM_BODY_TEXT_YESTERDAY S_("IDS_COM_BODY_YESTERDAY")
+#define DM_POP_TEXT_FAILED S_("IDS_COM_POP_FAILED")
+#endif
+
+// Other defines
+#define MAX_FILE_PATH_LEN 256
+#define MAX_BUF_LEN 256
+#define LOAD_HISTORY_COUNT 500
+#define WAITING_RO_MAX_SECONDS 20
+
+#define KEY_MODE "mode"
+#define KEY_REQ_HTTP_HEADER_FIELD "req_http_header_field"
+#define KEY_REQ_HTTP_HEADER_VALUE "req_http_header_value"
+#define KEY_MODE_VALUE_VIEW "view"
+#define KEY_MODE_VALUE_SILENT "silent"
+#define KEY_FAILED_HISTORYID "failed_historyid"
+#define KEY_DOWNLOADING_HISTORYID "downloading_historyid"
+#define KEY_DEFAULT_STORAGE "default_storage"
+#define KEY_NETWORK_BONDING "network_bonding"
+#define KEY_FILE_NAME "file_name"
+
+#define DM_DRM_MIME_STR "application/vnd.oma.drm.message"
+#define DM_DCF_MIME_STR "application/vnd.oma.drm.content"
+
+#define MYFILE_PKG_NAME "org.tizen.myfile"
+
+#define DM_DEFAULT_PHONE_INSTALL_DIR "/opt/usr/media/Downloads"
+
+#define DM_DEFAULT_MMC_TEMP_DIR "/opt/media/SDCardA1/.temp_download"
+#define DM_DEFAULT_MMC_INSTALL_DIR "/opt/media/SDCardA1/"
+
+#define DM_TEMP_DIR_NAME ".temp_download/"
+#define DM_INVALID_PATH_STRING ";\\\":*?<>|()"
+enum {
+       DM_CONTENT_NONE = 0,
+       DM_CONTENT_IMAGE,
+       DM_CONTENT_VIDEO,
+       DM_CONTENT_MUSIC,
+       DM_CONTENT_PDF,
+       DM_CONTENT_WORD,
+       DM_CONTENT_PPT, // 5
+       DM_CONTENT_EXCEL,
+       DM_CONTENT_HTML,
+       DM_CONTENT_TEXT,
+       DM_CONTENT_DRM,
+       DM_CONTENT_SD_DRM,//10
+       DM_CONTENT_FLASH,
+       DM_CONTENT_TPK,
+       DM_CONTENT_VCAL,
+       DM_CONTENT_UNKOWN //14
+};
+
+namespace DL_TYPE{
+enum TYPE {
+       TYPE_NONE,
+       HTTP_DOWNLOAD,
+};
+}
+
+namespace ERROR {
+enum CODE {
+       NONE = 0,
+       INVALID_URL,
+       NETWORK_FAIL,
+       NOT_ENOUGH_MEMORY,
+       FAIL_TO_INSTALL,
+       ENGINE_FAIL,
+#ifdef _ENABLE_OMA_DOWNLOAD
+       PARSING_FAIL,
+#endif
+       UNKNOWN
+};
+}
+
+namespace NOTIFICATION_TYPE{
+enum TYPE {
+       NOTI_NONE = 0,
+       NOTI_DOWNLOADING,
+       NOTI_FAILED,
+       NOTI_COMPLETED
+};
+}
+
+#endif /* DOWNLOAD_DB_SERVICE_COMMON_H */
+
index 5065427..df6b90f 100755 (executable)
  * limitations under the License.
  */
 
-/**
- * @file       download-manager-debug.h
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief      debug function
- */
-
 #ifndef DOWNLOAD_DB_SERVICE_DEBUG_H
 #define DOWNLOAD_DB_SERVICE_DEBUG_H
 
 #include <pthread.h>
 
 #define DM_LOGD(args...) do {\
-               printf("[D:%s][LN:%d][%lu]",__func__,__LINE__,pthread_self());\
-               printf(args);printf("\n");}while(0)
+               printf("[D:%s][LN:%d][%lu]", __func__, __LINE__, pthread_self());\
+               printf(args); printf("\n"); } while (0)
 #define DM_LOGI(args...) do {\
-               printf("[I:%s][LN:%d][%lu]",__func__,__LINE__,pthread_self());\
-               printf(args);printf("\n");}while(0)
+               printf("[I:%s][LN:%d][%lu]", __func__, __LINE__, pthread_self());\
+               printf(args); printf("\n"); } while (0)
 #define DM_LOGE(args...) do {\
-               printf("[ERR:%s][LN:%d][%lu]",__func__,__LINE__,pthread_self());\
-               printf(args);printf("\n");}while(0)
+               printf("[ERR:%s][LN:%d][%lu]", __func__, __LINE__, pthread_self());\
+               printf(args); printf("\n"); } while (0)
 #define DM_SLOGD DM_LOGD
 #define DM_SLOGI DM_LOGI
 #define DM_SLOGE DM_LOGE
index 04383c6..1bbceb9 100755 (executable)
@@ -1,81 +1,75 @@
-/*\r
- * Copyright 2012  Samsung Electronics Co., Ltd\r
- *\r
- * Licensed under the Flora License, Version 1.1 (the "License");\r
- * you may not use this file except in compliance with the License.\r
- * You may obtain a copy of the License at\r
- *\r
- *    http://floralicense.org/license/\r
- *\r
- * Unless required by applicable law or agreed to in writing, software\r
- * distributed under the License is distributed on an "AS IS" BASIS,\r
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- * See the License for the specific language governing permissions and\r
- * limitations under the License.\r
- */\r
-\r
-/**\r
- * @file       download-manager-history-db.h\r
- * @author     Jungki Kwak (jungki.kwak@samsung.com)\r
- * @brief      Manager for a download history DB\r
- */\r
-\r
-#ifndef DOWNLOAD_DB_SERVICE_MAIN_H\r
-#define DOWNLOAD_DB_SERVICE_MAIN_H\r
-\r
-#include <string>\r
-#include <queue>\r
-#include <sqlite3.h>\r
-//#include "download-manager-item.h"\r
-#include "data_control.h"\r
-#include <libintl.h>\r
-\r
-extern "C" {\r
-#include <unicode/utypes.h>\r
-}\r
-#define  REBUILD_QUERY "CREATE TABLE IF NOT EXISTS history( \\r
-id INTEGER PRIMARY KEY AUTOINCREMENT, \\r
-downloadid INTEGER, \\r
-historyid INTEGER, \\r
-downloadtype INTEGER, \\r
-contenttype INTEGER, \\r
-state INTEGER, \\r
-err INTEGER, \\r
-name, \\r
-path, \\r
-url, \\r
-filename, \\r
-headerfield, \\r
-headervalue, \\r
-installdir, \\r
-installnotifyurl, \\r
-etag, \\r
-tempfilepath, \\r
-date datetime, \\r
-filesize UNSIGNED BIG INT DEFAULT 0);"\r
-#define  REBUILD_QUERY_INDEX "CREATE INDEX history_date_index on history (date);"\r
-\r
-using namespace std;\r
-\r
-class DownloadHistoryDB\r
-{\r
-public:\r
-       static bool openDBConn(void) { return openDB(); }\r
-       static void closeDBConn(void) { closeDB(); }\r
-       static void insert_request_cb(int request_id, data_control_h provider, bundle *insert_data);\r
-       static void delete_request_cb(int request_id, data_control_h provider, const char *where);\r
-       static void select_request_cb(int request_id, data_control_h provider, const char **column_list, int column_count, const char *where, const char *order);\r
-       static void update_request_cb(int request_id, data_control_h provider, bundle *update_data, const char *where);\r
-private:\r
-       DownloadHistoryDB(void);\r
-       ~DownloadHistoryDB(void);\r
-       static sqlite3 *historyDb;\r
-       static bool openDB(void);\r
-       static bool isOpen(void) { return historyDb ? true : false; }\r
-       static void closeDB(void);\r
-       static bool loadSqlSchema(void);\r
-};\r
-\r
-#endif /* DOWNLOAD_DB_SERVICE_MAIN_H */\r
-\r
-\r
+/*
+ * Copyright 2012  Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *    http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef DOWNLOAD_DB_SERVICE_MAIN_H
+#define DOWNLOAD_DB_SERVICE_MAIN_H
+
+#include <string>
+#include <queue>
+#include <sqlite3.h>
+//#include "download-manager-item.h"
+#include "data_control.h"
+#include <libintl.h>
+
+extern "C" {
+#include <unicode/utypes.h>
+}
+#define  REBUILD_QUERY "CREATE TABLE IF NOT EXISTS history( \
+id INTEGER PRIMARY KEY AUTOINCREMENT, \
+downloadid INTEGER, \
+historyid INTEGER, \
+downloadtype INTEGER, \
+contenttype INTEGER, \
+state INTEGER, \
+err INTEGER, \
+name, \
+path, \
+url, \
+filename, \
+headerfield, \
+headervalue, \
+installdir, \
+installnotifyurl, \
+etag, \
+tempfilepath, \
+date datetime, \
+filesize UNSIGNED BIG INT DEFAULT 0);"
+#define  REBUILD_QUERY_INDEX "CREATE INDEX history_date_index on history (date);"
+
+using namespace std;
+
+class DownloadHistoryDB
+{
+public:
+       static bool openDBConn(void) { return openDB(); }
+       static void closeDBConn(void) { closeDB(); }
+       static void insert_request_cb(int request_id, data_control_h provider, bundle *insert_data);
+       static void delete_request_cb(int request_id, data_control_h provider, const char *where);
+       static void select_request_cb(int request_id, data_control_h provider, const char **column_list, int column_count, const char *where, const char *order);
+       static void update_request_cb(int request_id, data_control_h provider, bundle *update_data, const char *where);
+private:
+       DownloadHistoryDB(void);
+       ~DownloadHistoryDB(void);
+       static sqlite3 *historyDb;
+       static bool openDB(void);
+       static bool isOpen(void) { return historyDb ? true : false; }
+       static void closeDB(void);
+       static bool loadSqlSchema(void);
+};
+
+#endif /* DOWNLOAD_DB_SERVICE_MAIN_H */
+
+
index bdf2ed4..f0de4bc 100755 (executable)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-/*
- * @file               oma-parser-common.c
- * @brief              common function for oma dd parser
- * @author             Jungki Kwak(jungki.kwak@samsung.com)
- *
- */
 
 #include <stdlib.h>
 #include <string.h>
@@ -165,9 +159,8 @@ void op_com_utils_convert_amp_string(char *amp_string)
                        matched_str++;
                        trailing_str_ptr = matched_str;
                        trailing_end_ptr = matched_str + len - 1;
-                       while (*trailing_end_ptr) {
+                       while (*trailing_end_ptr)
                                *matched_str++ = *trailing_end_ptr++;
-                       }
                        *matched_str = '\0';
                }
        }
index 4711c94..4505cdd 100755 (executable)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-/*
- * @file               oma-parser-common.h
- * @brief              common header file for oma dd parser
- * @author             Jungki Kwak(jungki.kwak@samsung.com)
- */
 
 #ifndef OMA_PARSER_COMMON_H_
 #define OMA_PARSER_COMMON_H_
@@ -107,8 +102,7 @@ struct _amp_character_table {
 };
 
 int op_com_util_remove_blankspace(char *Source, int srcLen);
-int op_com_util_resolve_version(char *source, int *major, int *minor,
-                int *micro);
+int op_com_util_resolve_version(char *source, int *major, int *minor, int *micro);
 void op_com_utils_convert_amp_string(char *amp_string);
 int op_com_utils_is_number(const char *source);
 char *op_com_utils_concat(char *source, char *substring);
index cd03435..16c23e4 100644 (file)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-/*
- * @file               oma-parser-dd1.c
- * @brief              function for oma 1.0 dd parser
- * @author             Jungki Kwak(jungki.kwak@samsung.com)
- */
 
 #include <stdio.h>
 #include <string.h>
index e448ebb..c639532 100755 (executable)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-/*
- * @file               oma-parser-dd1.h
- * @brief              header file for oma 1.0 dd parser
- * @author             Jungki Kwak(jungki.kwak@samsung.com)
- */
 
 #ifndef OMA_PARSER_DD1_H_
 #define OMA_PARSER_DD1_H_
index cb0e9b5..739819f 100644 (file)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-/*
- * @file               oma-parser-interface.c
- * @brief              interface function for oma dd parser
- * @author             Jungki Kwak(jungki.kwak@samsung.com)
- */
 
 #include <expat.h>
 #include <string.h>
@@ -37,10 +32,7 @@ void op_parser_deinit(void)
        xmlCleanupParser();
 }
 
-int op_parse_dd_file(
-        const char *dd_file_path,
-        void **dd_info,
-        int *error_code)
+int op_parse_dd_file(const char *dd_file_path, void **dd_info, int *error_code)
 {
        int b_ret = OP_TRUE;
        op_parser_app_data_t *app_data = OP_NULL;
index 23a86a6..6fb89ea 100755 (executable)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-/**
- * @file               oma-parser-interface.h
- * @brief              Including interface functions regarding oma dd parser
- * @author             Jungki Kwak(jungki.kwak@samsung.com)
- */
 
 #ifndef _OMA_PARSER_INTERFACE_H
 #define _OMA_PARSER_INTERFACE_H
 
 
 #ifdef __cplusplus
- extern "C"
- {
+extern "C"
+{
 #endif
 
 #include "oma-parser-dd1.h"
@@ -67,7 +62,7 @@ void op_free_dd_info(void* dd_info);
  */
 
 #ifdef __cplusplus
-  }
+}
 #endif
 
 
index a7fc73e..0d08c9d 100755 (executable)
  * limitations under the License.
  */
 
-/**
- * @file       download-manager-dateTime.cpp
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief      data and utility APIs for Date and Time
- */
-
 #include <string>
 #include <stdlib.h>
 #include <system_settings.h>
index 1d9a6d8..1ea5f1b 100755 (executable)
  * limitations under the License.
  */
 
-/**
- * @file       download-manager-downloadItem.cpp
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief      download item class for interface of download agent
- */
-
 #include <iostream>
 #ifdef _ENABLE_OMA_DOWNLOAD
 #include <unistd.h>
@@ -161,9 +155,9 @@ struct pipe_data_t {
 
 CbData::CbData()
        :m_type(DA_CB::STARTED)
-       ,m_userData(NULL)
-       ,m_download_id(-1)
-       ,m_receivedFileSize(0)
+       , m_userData(NULL)
+       , m_download_id(-1)
+       , m_receivedFileSize(0)
 {
 }
 
@@ -360,8 +354,7 @@ void CbData::updateCompletedItem()
                        if (fileObj.deleteFile(registeredFilePath))
                                DM_LOGD("The dd file deleted successfully.");
                        downloadItem->destroyId();
-               }
-               else if (!fileObj.checkAvailableMemory(dd_info->size)) {
+               } else if (!fileObj.checkAvailableMemory(dd_info->size)) {
                        downloadItem->setState(DL_ITEM::FAILED);
                        downloadItem->setErrorCode(ERROR::NOT_ENOUGH_MEMORY);
                        if (dd_info->install_notify_uri) {
@@ -782,7 +775,6 @@ bool DownloadItem::start(int id)
 
        ret = download_start(m_download_id);
        DM_LOGI("URL download id:[%d] ret[%d]", m_download_id, ret);
-       
 
        if (ret != DOWNLOAD_ERROR_NONE) {
                DM_LOGE("Fail to start:[%s]", __convertErrToString(ret));
@@ -812,7 +804,6 @@ ERROR::CODE DownloadItem::_convert_error(int err)
        default :
                return ERROR::UNKNOWN;
        }
-
 }
 #ifdef _ENABLE_OMA_DOWNLOAD
 int DownloadItem::convertInstallStatus(int err)
@@ -994,10 +985,10 @@ OmaItem::OmaItem(dd_oma1_t *dd_info)
        th = NULL;
        notifyFinished = false;
        if (dd_info) {
-               if (strlen(dd_info->name)>0)
+               if (strlen(dd_info->name) > 0)
                        name = string(dd_info->name);
-               if (dd_info->major_version>0 || dd_info->minor_version) {
-                       char buf[256] = {0,};
+               if (dd_info->major_version > 0 || dd_info->minor_version) {
+                       char buf[256] = {0, };
                        snprintf(buf, sizeof(buf), "%d.%d", dd_info->major_version, dd_info->minor_version);
                        version = string(buf);
                }
@@ -1222,7 +1213,7 @@ void OmaItem::sendInstallNotifyCB(void *data, Ecore_Thread *th)
        if (curl) {
                curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
                curl_easy_setopt(curl, CURLOPT_URL, item->getInstallUri().c_str());
-               DM_SLOGD("install notify url[%s]",item->getInstallUri().c_str());
+               DM_SLOGD("install notify url[%s]", item->getInstallUri().c_str());
                curl_easy_setopt(curl, CURLOPT_POSTFIELDS, msg.c_str());
                curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, msg.length() + 1);
                if (!proxyAddr.empty())
@@ -1231,8 +1222,7 @@ void OmaItem::sendInstallNotifyCB(void *data, Ecore_Thread *th)
                        DM_LOGI("proxy is not set");
                /* debug */
                curl_easy_setopt(curl, CURLOPT_DEBUGFUNCTION, myTrace);
-       }
-       else{
+       } else {
            DM_LOGE("[CRITICAL]NULL Check: curl");
            return;
        }
index 0d6e590..9e7f2e8 100755 (executable)
  * limitations under the License.
  */
 
-/**
- * @file       download-provier-downloadRequest.cpp
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief      download request data class
- */
 #include "download-manager-downloadRequest.h"
 
 DownloadRequest::DownloadRequest(string url, string reqHeaderField, string reqHeaderValue,
index bcef09b..277bc91 100755 (executable)
  * limitations under the License.
  */
 
-/**
- * @file       download-manager-event.cpp
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief      download event class for event flow
- */
 #include "download-manager-event.h"
 #include "download-manager-common.h"
 
@@ -48,7 +43,7 @@ void Subject::notify(void)
        while (it < _observers.end()) {
                curObserver = *it;
 
-               DM_LOGV("[%s]Call Update",curObserver->name().c_str());
+               DM_LOGV("[%s]Call Update", curObserver->name().c_str());
                (*it)->update(this);
 
                if (curObserver != *it)
index 091fc9f..1fa15f8 100755 (executable)
  * limitations under the License.
  */
 
-/**
- * @file       download-manager-history-db.cpp
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief      Manager for a download history DB
- */
-
 #include <sstream>
 #include "download-manager-common.h"
 #include "download-manager-history-db.h"
 
-#define FINALIZE_ON_ERROR( stmt ) { \
+#define FINALIZE_ON_ERROR(stmt) { \
        DM_LOGE("SQL error:%d[%s]", ret, sqlite3_errmsg(historyDb));\
        if (sqlite3_finalize(stmt) != SQLITE_OK)\
                DM_LOGE("sqlite3_finalize is failed");\
@@ -110,8 +104,8 @@ bool DownloadHistoryDB::createItemToDB(Item *item)
                return false;
        }
 
-       const string statement = "insert into history (historyid, \
-               downloadtype, contenttype, state, name, url, filename, \
+       const string statement = "insert into history \
+               (historyid, downloadtype, contenttype, state, name, url, filename, \
                headerfield, headervalue, installdir, date) \
                values(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)";
 
@@ -204,9 +198,9 @@ bool DownloadHistoryDB::updateHistoryToDB(Item *item)
                DM_LOGE("NULL Check:historyDB");
                return false;
        }
-       const string statement = "update history set downloadtype=?,\
-               contenttype=?, state=?, err=?, name=?, path=?, url=?, filename=?,\
-               headerfield=?, headervalue=?, installdir=?, date=? where historyid = ?";
+       const string statement = "update history set downloadtype = ?, \
+               contenttype = ?, state = ?, err = ?, name = ?, path = ?, url = ?, filename = ?, \
+               headerfield = ?, headervalue = ?, installdir = ?, date = ? where historyid = ?";
 
        ret = sqlite3_prepare_v2(historyDb, statement.c_str(), -1, &stmt, NULL);
 
@@ -305,8 +299,8 @@ bool DownloadHistoryDB::updateCanceledItemToDB(Item *item)
                DM_LOGE("NULL Check:historyDB");
                return false;
        }
-       const string statement = "update history set state=?, err=?, \
-               date=? where historyid = ?";
+       const string statement = "update history set state = ?, err = ?, \
+               date = ? where historyid = ?";
 
        ret = sqlite3_prepare_v2(historyDb, statement.c_str(), -1, &stmt, NULL);
 
@@ -414,13 +408,13 @@ bool DownloadHistoryDB::updateDownloadInfoToDB(Item *item)
                return false;
        }
 #ifdef _ENABLE_OMA_DOWNLOAD
-       const string statement = "update history set downloadtype=?,\
-               contenttype=?, state=?, name=?, etag=?, tempfilepath=?,\
-               installnotifyurl=?, date=?, filesize=? where historyid = ?";
+       const string statement = "update history set downloadtype = ?, \
+               contenttype = ?, state = ?, name = ?, etag = ?, tempfilepath = ?, \
+               installnotifyurl = ?, date = ?, filesize = ? where historyid = ?";
 #else
-       const string statement = "update history set downloadtype=?,\
-               contenttype=?, state=?, name=?, etag=?, tempfilepath=?,\
-               date=?, filesize=? where historyid = ?";
+       const string statement = "update history set downloadtype = ?, \
+               contenttype = ?, state = ?, name = ?, etag = ?, tempfilepath = ?, \
+               date = ?, filesize = ? where historyid = ?";
 #endif
        ret = sqlite3_prepare_v2(historyDb, statement.c_str(), -1, &stmt, NULL);
 
@@ -521,7 +515,7 @@ bool DownloadHistoryDB::updateStateToDB(Item *item)
                return false;
        }
 
-       const string statement = "update history set state=? \
+       const string statement = "update history set state = ? \
                where historyid = ?";
 
        ret = sqlite3_prepare_v2(historyDb, statement.c_str(), -1, &stmt, NULL);
@@ -572,7 +566,7 @@ bool DownloadHistoryDB::updateDownloadIdToDB(Item *item)
                return false;
        }
 
-       const string statement = "update history set downloadid=? \
+       const string statement = "update history set downloadid = ? \
                where historyid = ?";
 
        ret = sqlite3_prepare_v2(historyDb, statement.c_str(), -1, &stmt, NULL);
@@ -619,8 +613,8 @@ bool DownloadHistoryDB::getCountOfHistory(int *count)
        DM_LOGD("SQL return: %s",
                        (ret == SQLITE_ROW || ret == SQLITE_OK)?"Success":"Fail");
        if (ret == SQLITE_ROW) {
-               *count = sqlite3_column_int(stmt,0);
-               DM_LOGI("count[%d]",*count);
+               *count = sqlite3_column_int(stmt, 0);
+               DM_LOGI("count[%d]", *count);
        } else {
                DM_LOGE("SQL query error:%s", sqlite3_errmsg(historyDb));
                *count = 0;
@@ -751,8 +745,9 @@ bool DownloadHistoryDB::createRemainedItemsFromHistoryDB(int limit, int offset)
                        item->attachHistoryItem();
                        item->setRetryData(url, reqHeaderField, reqHeaderValue,
                                        installDir, fileName, tempFilePath, etag);
-               } else
+               } else {
                        break;
+               }
        }
        DM_LOGD("SQL return: %s",
                                (ret == SQLITE_ROW || ret == SQLITE_OK)?"Success":"Fail");
@@ -862,8 +857,9 @@ bool DownloadHistoryDB::createItemsFromHistoryDB()
                        item->attachHistoryItem();
                        item->setRetryData(url, reqHeaderField, reqHeaderValue,
                                        installDir, fileName, tempFilePath, etag);
-               } else
+               } else {
                        break;
+               }
        }
 
        if (sqlite3_finalize(stmt) != SQLITE_OK)
@@ -921,15 +917,15 @@ bool DownloadHistoryDB::deleteMultipleItem(queue <unsigned int> &q)
                DM_LOGE("NULL Check:historyDB");
                return false;
        }
-       ret = sqlite3_exec(historyDb, "PRAGMA synchronous=OFF;\
-               PRAGMA count_changes=OFF; PRAGMA temp_store=memory;",
+       ret = sqlite3_exec(historyDb, "PRAGMA synchronous = OFF;\
+               PRAGMA count_changes = OFF; PRAGMA temp_store = memory;",
                NULL, NULL, &errmsg);
        if (SQLITE_OK != ret) {
                sqlite3_free(errmsg);
                return false;
        }
 
-       DM_LOGI("queue size[%d]",q.size());
+       DM_LOGI("queue size[%d]", q.size());
        while (!q.empty()) {
                ret = sqlite3_prepare_v2(historyDb, "delete from history where historyid=?",
                        -1, &stmt, NULL);
@@ -993,7 +989,7 @@ bool DownloadHistoryDB::loadSqlSchema(void)
        int ret = 0;
        ret = sqlite3_exec(historyDb, REBUILD_QUERY, 0, 0, &error_msg);
        if((error_msg != NULL) || (SQLITE_OK != ret)) {
-               DM_LOGD("SQL error :: [%s]",error_msg);
+               DM_LOGD("SQL error :: [%s]", error_msg);
                sqlite3_free(error_msg);
                error_msg = NULL;
                closeDB();
@@ -1002,7 +998,7 @@ bool DownloadHistoryDB::loadSqlSchema(void)
 
        ret = sqlite3_exec(historyDb, REBUILD_QUERY_INDEX, 0, 0, &error_msg);
        if((error_msg != NULL) || (SQLITE_OK != ret)) {
-               DM_LOGD("SQL error :: [%s]",error_msg);
+               DM_LOGD("SQL error :: [%s]", error_msg);
                sqlite3_free(error_msg);
                error_msg = NULL;
        }
index c05c926..5cc5934 100755 (executable)
  * limitations under the License.
  */
 
-/**
- * @file       download-manager-item.cpp
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief      item class for saving download data
- */
-
 #include <iostream>
 #include <time.h>
 #include "download-manager-item.h"
@@ -91,7 +85,7 @@ void Item::create(DownloadRequest &rRequest)
        items.attachItem(newItem);
 
        ViewItem::create(newItem);
-       DM_LOGV("newItem[%p]",newItem);
+       DM_LOGV("newItem[%p]", newItem);
 
        newItem->download();
        newItem->notify();
@@ -109,7 +103,7 @@ Item *Item::createHistoryItem()
 
        Item *newItem = new Item(request);
 
-       DM_LOGV("new History Item[%p]",newItem);
+       DM_LOGV("new History Item[%p]", newItem);
 
        return newItem;
 }
@@ -118,7 +112,7 @@ void Item::attachHistoryItem()
 {
        Items &items = Items::getInstance();
 
-       DM_LOGI("attach History Item[%p] state[%d]",this, getState());
+       DM_LOGI("attach History Item[%p] state[%d]", this, getState());
        items.attachItem(this);
        if (!isFinished()) {
                DM_LOGI("Change downloading state to fail state");
@@ -143,7 +137,7 @@ void Item::destroy()
        FileUtility fileObj;
        // FIXME prohibit to destroy if downloading
        if (!isFinished()) {
-               DM_LOGE("Cannot delete this item:state[%d]",m_state);
+               DM_LOGE("Cannot delete this item:state[%d]", m_state);
                return;
        }
 
@@ -512,7 +506,6 @@ Eina_Bool Item::checkInstallNotifyCB(void *data)
        } else {
                return ECORE_CALLBACK_RENEW;
        }
-
 }
 #endif
 
@@ -868,9 +861,7 @@ void Item::handleUserConfirm(bool res)
                m_aptr_downloadItem->sendInstallNotification(902);
                handleFinishedItem();
                notify();
-
        }
-
 }
 #endif
 
@@ -925,7 +916,6 @@ bool Item::isPreparingDownload()
                break;
        }
        return ret;
-
 }
 
 bool Item::isCompletedDownload()
index 32ff334..c272984 100755 (executable)
  * limitations under the License.
  */
 
-/**
- * @file       download-manager-items.cpp
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief      Interface API with item list
- */
 #include "download-manager-items.h"
 
 void Items::attachItem(Item *item)
index fa371dc..c1f5f0d 100755 (executable)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-/**
- * @file       download-manager-network.cpp
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief      Download netowkr manager
- */
 
 #include <stdlib.h>
 #include "download-manager-common.h"
index a5aee91..36cc796 100755 (executable)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-/*
- * @file       download-manager-notification.cpp
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief   Noti APIs and interface
- */
 
 #include <stdio.h>
 #include <vector>
index 4654894..344ff76 100755 (executable)
  * limitations under the License.
  */
 
-/*
- * @file       download-manager-util.cpp
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief   Utility APIs and interface with content player
- */
-
 #include <stdio.h>
 #include <string.h>
 #include <dlfcn.h>
@@ -57,27 +51,27 @@ const char *ambiguousMIMETypeList[] = {
 
 struct MimeTableType MimeTable[]={
                // PDF
-               {"application/pdf",DM_CONTENT_PDF},
+               {"application/pdf", DM_CONTENT_PDF},
                // word
-               {"application/msword",DM_CONTENT_WORD},
-               {"application/vnd.openxmlformats-officedocument.wordprocessingml.document",DM_CONTENT_WORD},
+               {"application/msword", DM_CONTENT_WORD},
+               {"application/vnd.openxmlformats-officedocument.wordprocessingml.document", DM_CONTENT_WORD},
                // ppt
-               {"application/vnd.ms-powerpoint",DM_CONTENT_PPT},
-               {"application/vnd.openxmlformats-officedocument.presentationml.presentation",DM_CONTENT_PPT},
+               {"application/vnd.ms-powerpoint", DM_CONTENT_PPT},
+               {"application/vnd.openxmlformats-officedocument.presentationml.presentation", DM_CONTENT_PPT},
                // excel
-               {"application/vnd.ms-excel",DM_CONTENT_EXCEL},
-               {"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",DM_CONTENT_EXCEL},
+               {"application/vnd.ms-excel", DM_CONTENT_EXCEL},
+               {"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", DM_CONTENT_EXCEL},
                // html
-               {"text/html",DM_CONTENT_HTML},
+               {"text/html", DM_CONTENT_HTML},
                // txt
-               {"text/txt",DM_CONTENT_TEXT},
-               {"text/plain",DM_CONTENT_TEXT},
+               {"text/txt", DM_CONTENT_TEXT},
+               {"text/plain", DM_CONTENT_TEXT},
                // DRM
-               {"application/vnd.oma.drm.content",DM_CONTENT_SD_DRM},
-               {"application/vnd.oma.drm.message",DM_CONTENT_DRM},
+               {"application/vnd.oma.drm.content", DM_CONTENT_SD_DRM},
+               {"application/vnd.oma.drm.message", DM_CONTENT_DRM},
                {"application/x-shockwave-flash", DM_CONTENT_FLASH},
                {"application/vnd.tizen.package", DM_CONTENT_TPK},
-               {"text/calendar",DM_CONTENT_VCAL},
+               {"text/calendar", DM_CONTENT_VCAL},
 };
 
 void FileUtility::cleanTempDir()
@@ -95,17 +89,17 @@ void FileUtility::cleanTempDir()
                        DM_LOGE("Fail to call opendir");
                        return;
                } else {
-                   while(readdir_r(dir, &entry, &dirInfo) == 0 && dirInfo != NULL) {
-                               DM_SLOGD("%s",dirInfo->d_name);
-                               if (0 == strncmp(dirInfo->d_name,".",strlen(".")) ||
-                                               0 == strncmp(dirInfo->d_name,"..",strlen("..")))
+                   while (readdir_r(dir, &entry, &dirInfo) == 0 && dirInfo != NULL) {
+                               DM_SLOGD("%s", dirInfo->d_name);
+                               if (0 == strncmp(dirInfo->d_name, ".", strlen(".")) ||
+                                               0 == strncmp(dirInfo->d_name, "..", strlen("..")))
                                        continue;
                                filePath.append(defTempPath);
                                filePath.append("/");
                                filePath.append(dirInfo->d_name);
                                /* The sub-directory should not be created under temporary directory */
                                if (isExistedFile(filePath, false)) {
-                                       if (remove(filePath.c_str())<0)
+                                       if (remove(filePath.c_str()) < 0)
                                                DM_LOGE("Fail to Remove");
                                } else {
                                        DM_LOGE("Cannot enter here type[%d]", dirInfo->d_type);
@@ -122,8 +116,6 @@ bool FileUtility::isExistedFile(string path, bool isDir)
        struct stat fileState;
        int stat_ret;
 
-//     DM_LOGD("");
-
        if (path.empty())
                return false;
        stat_ret = stat(path.c_str(), &fileState);
@@ -364,12 +356,10 @@ string FileUtility::getDefaultPath(bool optionTempDir)
 {
        string path;
 
-       if (optionTempDir)
-       {
+       if (optionTempDir) {
            path.assign(DM_DEFAULT_PHONE_INSTALL_DIR);
            path.append("/.temp_download");
-       }
-       else{
+       } else {
            path.assign(DM_DEFAULT_PHONE_INSTALL_DIR);
            path.append("/");
        }
@@ -440,23 +430,22 @@ int DownloadUtil::getContentType(const char *mime, const char *filePath)
                unaliasedMime = xdg_mime_unalias_mime_type(tempMime);
 
                if (unaliasedMime != NULL) {
-                       DM_SLOGD("unaliased mime type[%s]",unaliasedMime);
-                       if (strstr(unaliasedMime,"video/") != NULL)
+                       DM_SLOGD("unaliased mime type[%s]", unaliasedMime);
+                       if (strstr(unaliasedMime, "video/") != NULL)
                                type = DM_CONTENT_VIDEO;
-                       else if (strstr(unaliasedMime,"audio/") != NULL)
+                       else if (strstr(unaliasedMime, "audio/") != NULL)
                                type = DM_CONTENT_MUSIC;
-                       else if (strstr(unaliasedMime,"image/") != NULL)
+                       else if (strstr(unaliasedMime, "image/") != NULL)
                                type = DM_CONTENT_IMAGE;
                }
        }
        free(tempMime);
-       DM_LOGV("type[%d]",type);
+       DM_LOGV("type[%d]", type);
        return type;
 }
 
 bool DownloadUtil::isAmbiguousMIMEType(const char *mimeType)
 {
-
        if (!mimeType)
                return false;
 
@@ -478,7 +467,7 @@ string DownloadUtil::saveContent(string filePath, string userInstallDir)
        string finalPath = string();
        string dirPath;
        size_t found1 = string::npos;
-       size_t found2= string::npos;
+       size_t found2 = string::npos;
        size_t len = string::npos;
        string str1 = ".temp_download";
        string contentName;
@@ -609,7 +598,7 @@ bool app_matched_cb(app_control_h handle, const char *appid, void *user_data)
        int *count = NULL;
        count = (int *)user_data;
        if (appid) {
-               DM_SLOGD("appid[%s]",appid);
+               DM_SLOGD("appid[%s]", appid);
                *count = *count + 1;
        }
        return true;
index 9d0d6dc..2cdce0a 100755 (executable)
  * limitations under the License.
  */
 
-/**
- * @file       download-manager-view.cpp
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief      UI manager class for download list view and delete view
- */
 #include <sstream>
 #include <queue>
 //#include "utilX.h"
index 5906362..c4b194b 100755 (executable)
  * limitations under the License.
  */
 
-/**
- * @file       download-manager-viewItem.cpp
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief      item data class for download view
- */
-
 #include <stdio.h>
 
 #include "download-manager-viewItem.h"
@@ -154,7 +148,7 @@ void ViewItem::updateFromItem()
                        DM_LOGE("Check NULL:m_glItem");
                        return;
                }
-               DM_LOGTEST("DEL:glItem[%p]viewItem[%p]",m_glItem, this);
+               DM_LOGTEST("DEL:glItem[%p]viewItem[%p]", m_glItem, this);
 
                item = elm_genlist_item_next_get(m_glItem);
                if (item) {
@@ -191,8 +185,9 @@ void ViewItem::updateFromItem()
                        if (fp != NULL) {
                                msg = ERROR_POPUP_LOW_MEM_DEFAULT_PHONE_WITH_SD_CARD;
                                fclose(fp);
-                       } else
+                       } else {
                                msg = ERROR_POPUP_LOW_MEM_DEFAULT_PHONE_WITHOUT_SD_CARD;
+                       }
                } else if (installDir.compare(DM_DEFAULT_MMC_INSTALL_DIR) == 0) {
                        FileUtility  fileObj;
                        if (fileObj.checkAvailableMemory(0))
@@ -206,7 +201,7 @@ void ViewItem::updateFromItem()
                view.showMemoryFullPopup(msg);
        }
 
-       DM_LOGTEST("Update:glItem[%p]viewItem[%p]",m_glItem, this);
+       DM_LOGTEST("Update:glItem[%p]viewItem[%p]", m_glItem, this);
        if (state == ITEM::SUSPENDED) {
                return;
        } else if (state == ITEM::DOWNLOADING) {
@@ -219,14 +214,14 @@ void ViewItem::updateFromItem()
                        double percentageProgress = 0.0;
                        percentageProgress = (double)getReceivedFileSize() /
                                        (double)getFileSize();
-                       DM_LOGV("progress value[%.2f]",percentageProgress);
+                       DM_LOGV("progress value[%.2f]", percentageProgress);
                        elm_progressbar_value_set(progress, percentageProgress);
                }
 #ifdef _TIZEN_2_3_UX
-               elm_genlist_item_fields_update(m_glItem,"elm.text.progress",
+               elm_genlist_item_fields_update(m_glItem, "elm.text.progress",
                        ELM_GENLIST_ITEM_FIELD_TEXT);
 #else
-               elm_genlist_item_fields_update(m_glItem,"elm.text.2",
+               elm_genlist_item_fields_update(m_glItem, "elm.text.2",
                        ELM_GENLIST_ITEM_FIELD_TEXT);
 #endif
        } else if (m_isRetryCase && state == ITEM::PREPARE_TO_RETRY) {
@@ -337,15 +332,14 @@ Evas_Object *ViewItem::getGenlistIcon(Evas_Object *obj, const char *part)
 
 #ifdef _TIZEN_2_3_UX
        DownloadView &view = DownloadView::getInstance();
-       if (strcmp(part,"elm.icon.1") == 0) {
+       if (strcmp(part, "elm.icon.1") == 0) {
                Evas_Object *icon = elm_icon_add(obj);
 
                elm_image_file_set(icon, getIconPath(), NULL);
                evas_object_size_hint_min_set(icon, ELM_SCALE_SIZE(GENLIST_ICON_SIZE),
                                                                                          ELM_SCALE_SIZE(GENLIST_ICON_SIZE));
                return icon;
-       }
-       else if (strcmp(part,"elm.swallow.icon") == 0) {
+       } else if (strcmp(part, "elm.swallow.icon") == 0) {
         Evas_Object *image = elm_image_add(obj);
         elm_image_file_set(image, getIconPath(), NULL);
         evas_object_size_hint_min_set(image, ELM_SCALE_SIZE(GENLIST_ICON_SIZE),
@@ -355,9 +349,9 @@ Evas_Object *ViewItem::getGenlistIcon(Evas_Object *obj, const char *part)
        } else if (getState() < ITEM::FINISH_DOWNLOAD) {
                if (strcmp(part, "elm.icon") == 0)
                        return createProgressBar(obj);
-               else if (strcmp(part,"elm.icon.2") == 0)
+               else if (strcmp(part, "elm.icon.2") == 0)
                        return createCancelBtn(obj);
-       } else if (view.isGenlistEditMode() && strcmp(part,"elm.swallow.icon.2") == 0) {
+       } else if (view.isGenlistEditMode() && strcmp(part, "elm.swallow.icon.2") == 0) {
                Evas_Object *check = elm_check_add(obj);
                elm_check_state_pointer_set(check, &m_checked);
                evas_object_repeat_events_set(check, EINA_FALSE);
@@ -369,7 +363,7 @@ Evas_Object *ViewItem::getGenlistIcon(Evas_Object *obj, const char *part)
        return NULL;
 #else
        if (elm_genlist_decorate_mode_get(obj) && isFinished()) {
-               if (strncmp(part,"elm.edit.icon.1", strlen("elm.edit.icon.1")) == 0) {
+               if (strncmp(part, "elm.edit.icon.1", strlen("elm.edit.icon.1")) == 0) {
                        Evas_Object *checkBtn = elm_check_add(obj);
                        elm_object_style_set(checkBtn, "default/genlist");
                        elm_check_state_pointer_set(checkBtn, &m_checked);
@@ -378,27 +372,27 @@ Evas_Object *ViewItem::getGenlistIcon(Evas_Object *obj, const char *part)
                        elm_access_object_unregister(checkBtn);
                        m_checkedBtn = checkBtn;
                        return checkBtn;
-               } else if (strncmp(part,"elm.edit.icon.2", strlen("elm.edit.icon.2")) ==
+               } else if (strncmp(part, "elm.edit.icon.2", strlen("elm.edit.icon.2")) ==
                        0) {
                        return NULL;
                }
        }
        /* elm.icon.2 should be checked prior to elm.icon */
-       if (strncmp(part,"elm.icon.2", strlen("elm.icon.2")) == 0) {
+       if (strncmp(part, "elm.icon.2", strlen("elm.icon.2")) == 0) {
                if (getState() == ITEM::RECEIVING_DOWNLOAD_INFO ||
                        getState() == ITEM::DOWNLOADING ||
                        isPreparingDownload())
                        return createCancelBtn(obj);
                else
                        return NULL;
-       } else if (strncmp(part,"elm.icon.1", strlen("elm.icon.1")) == 0 ||
+       } else if (strncmp(part, "elm.icon.1", strlen("elm.icon.1")) == 0 ||
                strncmp(part, "elm.icon", strlen("elm.icon")) == 0) {
                Evas_Object *icon = elm_image_add(obj);
                elm_image_file_set(icon, getIconPath(), NULL);
                evas_object_size_hint_align_set(icon, EVAS_HINT_FILL, EVAS_HINT_FILL);
                evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
                return icon;
-       } else if (strcmp(part,"elm.swallow.progress") == 0) {
+       } else if (strcmp(part, "elm.swallow.progress") == 0) {
                return createProgressBar(obj);
        } else {
                DM_LOGE("Cannot enter here");
@@ -698,11 +692,11 @@ Evas_Object *ViewItem::createProgressBar(Evas_Object *parent)
 #endif
                elm_progressbar_horizontal_set(progress, EINA_TRUE);
 
-               if (isCompletedDownload())
+               if (isCompletedDownload()) {
                        elm_progressbar_value_set(progress, 1.0);
                /* When realized event is happened, the progress is created.
                   This is needed for that case */
-               else if (getState() == ITEM::DOWNLOADING) {
+               else if (getState() == ITEM::DOWNLOADING) {
                        double percentageProgress = 0.0;
                        percentageProgress = (double)(getReceivedFileSize()) /
                                (double)(getFileSize());
@@ -715,7 +709,7 @@ Evas_Object *ViewItem::createProgressBar(Evas_Object *parent)
 
 Evas_Object *ViewItem::createCancelBtn(Evas_Object *parent)
 {
-       DM_LOGV ("");
+       DM_LOGV("");
 #ifdef _TIZEN_2_3_UX
        Evas_Object *button = elm_button_add(parent);
        elm_object_style_set(button, "dm_cancel_button");
@@ -725,15 +719,15 @@ Evas_Object *ViewItem::createCancelBtn(Evas_Object *parent)
        evas_object_size_hint_weight_set(icon, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
 
        elm_object_part_content_set(button, "elm.swallow.icon", icon) ;
-       evas_object_propagate_events_set(button, EINA_FALSE);  //
-       evas_object_smart_callback_add(button,"clicked", cancelBtnClickedCB, this);  //
+       evas_object_propagate_events_set(button, EINA_FALSE);
+       evas_object_smart_callback_add(button, "clicked", cancelBtnClickedCB, this);
 
        return button;
 #else
        Evas_Object *button = elm_button_add(parent);
        elm_object_text_set(button, DM_SK_TEXT_CANCEL);
        evas_object_propagate_events_set(button, EINA_FALSE);
-       evas_object_smart_callback_add(button,"clicked", cancelBtnClickedCB, this);
+       evas_object_smart_callback_add(button, "clicked", cancelBtnClickedCB, this);
        return button;
 #endif
        return NULL;
index 5de0d4b..ef33bf6 100755 (executable)
  * limitations under the License.
  */
 
-/**
- * @file       download-manager-common.h
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief      Common define and data
- */
-
 #ifndef DOWNLOAD_MANAGER_DOWNLOAD_COMMON_H
 #define DOWNLOAD_MANAGER_DOWNLOAD_COMMON_H
 
index 77e59a3..659f06b 100755 (executable)
  * limitations under the License.
  */
 
-/**
- * @file       download-manager-dateTime.h
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief      data and utility APIs for Date and Time
- */
 
 #ifndef DOWNLOAD_MANAGER_DATE_TIME_H
 #define DOWNLOAD_MANAGER_DATE_TIME_H
@@ -54,7 +49,6 @@ private:
        i18n_udate_format_h dateShortFormat;
        i18n_udate_format_h timeFormat12H;
        i18n_udate_format_h timeFormat24H;
-
 };
 
 #endif /* DOWNLOAD_MANAGER_DATE_TIME_H */
index 49e5ee0..f8f7ff3 100755 (executable)
  * limitations under the License.
  */
 
-/**
- * @file       download-manager-debug.h
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief      debug function
- */
 
 #ifndef DOWNLOAD_MANAGER_DEBUG_H
 #define DOWNLOAD_MANAGER_DEBUG_H
 #include <pthread.h>
 
 #define DM_LOGD(args...) do {\
-               printf("[D:%s][LN:%d][%lu]",__func__,__LINE__,pthread_self());\
+               printf("[D:%s][LN:%d][%lu]", __func__, __LINE__, pthread_self());\
                printf(args);printf("\n");}while(0)
 #define DM_LOGI(args...) do {\
-               printf("[I:%s][LN:%d][%lu]",__func__,__LINE__,pthread_self());\
+               printf("[I:%s][LN:%d][%lu]", __func__, __LINE__, pthread_self());\
                printf(args);printf("\n");}while(0)
 #define DM_LOGE(args...) do {\
-               printf("[ERR:%s][LN:%d][%lu]",__func__,__LINE__,pthread_self());\
+               printf("[ERR:%s][LN:%d][%lu]", __func__, __LINE__, pthread_self());\
                printf(args);printf("\n");}while(0)
 #define DM_SLOGD DM_LOGD
 #define DM_SLOGI DM_LOGI
index b7dbea0..57eebc5 100755 (executable)
  * limitations under the License.
  */
 
-/**
- * @file       download-manager-downloadItem.h
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief      download item class
- */
-
 #ifndef DOWNLOAD_MANAGER_DOWNLOAD_ITEM_H
 #define DOWNLOAD_MANAGER_DOWNLOAD_ITEM_H
 
@@ -189,12 +183,11 @@ public:
        string getUserMessage(void);
        inline void sendInstallNotification(int status)
        {
-        if (m_oma_item.get()){
-            if(!m_oma_item->getInstallUri().empty()){
+        if (m_oma_item.get()) {
+            if (!m_oma_item->getInstallUri().empty()) {
                 m_oma_item->sendInstallNotification(status);
             }
-        }
-        else{
+        } else {
             return;
         }
        }
@@ -269,17 +262,17 @@ private:
 };
 
 class DownloadEngine {
-public:
-       static DownloadEngine &getInstance(void) {
-               static DownloadEngine downloadEngine;
-               return downloadEngine;
-       }
+       public:
+               static DownloadEngine &getInstance(void) {
+                       static DownloadEngine downloadEngine;
+                       return downloadEngine;
+               }
 
-       void initEngine(void);
-       void deinitEngine(void);
-private:
-       DownloadEngine(void);
-       ~DownloadEngine(void);
+               void initEngine(void);
+               void deinitEngine(void);
+       private:
+               DownloadEngine(void);
+               ~DownloadEngine(void);
 };
 
 
index bfbeab1..5d64723 100755 (executable)
  * limitations under the License.
  */
 
-/**
- * @file       download-manager-downloadRequest.h
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief      Download Request class
- */
-
 #ifndef DOWNLOAD_MANAGER_DOWNLOAD_REQUEST_H
 #define DOWNLOAD_MANAGER_DOWNLOAD_REQUEST_H
 
index 48638de..09d6422 100755 (executable)
  * limitations under the License.
  */
 
-/**
- * @file       download-manager-event.h
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief      Download event class
- */
 #ifndef DOWNLOAD_MANAGER_EVENT_H
 #define DOWNLOAD_MANAGER_EVENT_H
 
index 5d77820..9a77f29 100755 (executable)
  * limitations under the License.
  */
 
-/**
- * @file       download-manager-history-db.h
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief      Manager for a download history DB
- */
-
 #ifndef DOWNLOAD_MANAGER_HISTORY_DB_H
 #define DOWNLOAD_MANAGER_HISTORY_DB_H
 
index 398b10c..26d3e04 100755 (executable)
  * limitations under the License.
  */
 
-/**
- * @file       download-manager-item.h
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief      Item class
- */
 #ifndef DOWNLOAD_MANAGER_ITEM_H
 #define DOWNLOAD_MANAGER_ITEM_H
 
index 7038794..d8b219d 100755 (executable)
  * limitations under the License.
  */
 
-/*
- * @file       download-manager-items.h
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief   item inventory class
- */
 #ifndef DOWNLOAD_MANAGER_ITEMS_H
 #define DOWNLOAD_MANAGER_ITEMS_H
 
index 580e812..e49c234 100755 (executable)
  * limitations under the License.
  */
 
-/**
- * @file       download-manager-network.h
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief      Download netowkr manager
- */
-
 #ifndef DOWNLOAD_MANAGER_NETWORK_H
 #define DOWNLOAD_MANAGER_NETWORK_H
 
index a590fe3..bbfa5f8 100755 (executable)
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-/*
- * @file       download-manager-notification.h
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief   Noti APIs and interface
- */
 
 #ifndef DOWNLOAD_MANAGER_NOTIFICATION_H
 #define DOWNLOAD_MANAGER_NOTIFICATION_H
index cb0ce4e..e0fa9fc 100755 (executable)
  * limitations under the License.
  */
 
-/*
- * @file       download-manager-util.h
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief   Utility APIs and interface with content player
- */
-
 #ifndef DOWNLOAD_MANAGER_UTIL_H
 #define DOWNLOAD_MANAGER_UTIL_H
 
index 212aad7..af9ce97 100755 (executable)
  * limitations under the License.
  */
 
-/**
- * @file       download-manager-view.h
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief      Download UI View manager
- */
-
 #ifndef DOWNLOAD_MANAGER_VIEW_H
 #define DOWNLOAD_MANAGER_VIEW_H
 
index 01f2292..3f99c19 100755 (executable)
  * limitations under the License.
  */
 
-/**
- * @file       download-manager-viewItem.h
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief      Item class for Download view
- */
-
 #ifndef DOWNLOAD_MANAGER_VIEW_ITEM_H
 #define DOWNLOAD_MANAGER_VIEW_ITEM_H
 
@@ -86,31 +80,36 @@ public:
                else
                        return ITEM::IDLE;
        }
-       inline const char* stateStr(void) {
+       inline const char* stateStr(void)
+       {
                if (m_item)
                        return m_item->stateStr();
                else
                        return NULL;
        }
-       inline bool isFinished(void) {
+       inline bool isFinished(void)
+       {
                if (m_item)
                        return m_item->isFinished();
                else
                        return false;
        }
-       inline bool isFinishedWithErr(void) {
+       inline bool isFinishedWithErr(void)
+       {
                if (m_item)
                        return m_item->isFinishedWithErr();
                else
                        return false;
        }
-       inline bool isPreparingDownload(void) {
+       inline bool isPreparingDownload(void)
+       {
                if (m_item)
                        return m_item->isPreparingDownload();
                else
                        return false;
        }
-       inline bool isCompletedDownload(void) {
+       inline bool isCompletedDownload(void)
+       {
                if (m_item)
                        return m_item->isCompletedDownload();
                else
index f4354d2..a4d602e 100755 (executable)
  * limitations under the License.
  */
 
-/**
- * @file       main.cpp
- * @author     Jungki Kwak (jungki.kwak@samsung.com)
- * @brief      main file for download manager
- */
-
 #include <list>
 #include <string>
 #include <iostream>