2 * Copyright 2012 Samsung Electronics Co., Ltd
\r
4 * Licensed under the Flora License, Version 1.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.tizenopensource.org/license
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
17 #ifndef BROWSER_BOOKMARK_DB_H
\r
18 #define BROWSER_BOOKMARK_DB_H
\r
20 #include "browser-config.h"
\r
23 #include "db-util.h"
\r
30 class Browser_Bookmark_DB {
\r
32 struct bookmark_item {
\r
36 Eina_Bool is_folder;
\r
39 Eina_Bool is_editable;
\r
40 Eina_Bool is_delete;
\r
46 struct bookmark_item_type {
\r
51 Browser_Bookmark_DB();
\r
52 ~Browser_Bookmark_DB();
\r
54 Eina_Bool get_bookmark_list(std::vector<bookmark_item *> &list, int folder_id);
\r
55 Eina_Bool get_folder_list(std::vector<bookmark_item *> &list);
\r
56 Eina_Bool get_folder_id(int current_folder_id, const char *folder_name, int *folder_id);
\r
57 std::string get_folder_name_by_id(const int folder_id);
\r
58 Eina_Bool get_bookmark_id_by_title_url(int folder_id, const char *title, const char *url, int *bookmark_id);
\r
59 bookmark_item *get_bookmark_item_by_id(int bookmark_id);
\r
60 Eina_Bool get_untitled_folder_count(int *count);
\r
61 Eina_Bool is_duplicated(int folder_id, const char *title, const char *url);
\r
62 Eina_Bool is_duplicated(const char *folder_name);
\r
63 Eina_Bool is_full(void);
\r
64 Eina_Bool save_bookmark(int folder_id, const char *title, const char *url);
\r
65 Eina_Bool save_folder(const char *folder_name);
\r
66 Eina_Bool delete_bookmark(int bookmark_id);
\r
67 Eina_Bool delete_folder(int folder_id);
\r
68 Eina_Bool modify_bookmark_title(int bookmark_id, const char *title);
\r
69 Eina_Bool modify_bookmark(int bookmark_id, int folder_id, const char *title, const char *url);
\r
70 Eina_Bool modify_bookmark_order_index(int bookmark_id, int folder_id, int order_index);
\r
72 Eina_Bool _open_db(void);
\r
73 Eina_Bool _close_db(void);
\r
74 Eina_Bool _get_last_index(int folder_id, int *last_index);
\r
76 static sqlite3* m_db_descriptor;
\r
79 #endif /* BROWSER_BOOKMARK_DB_H */
\r