c5643dbc98017470724c3473d2b9bc534d72b9a2
[platform/core/uifw/capi-ui-sticker.git] / client / sticker_dbus.h
1 /*
2  * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
3  *
4  * Licensed under the Apache License, Version 2.0 (the License);
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an AS IS BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef __TIZEN_UIX_STICKER_DBUS_H__
18 #define __TIZEN_UIX_STICKER_DBUS_H__
19
20 #include <stdio.h>
21 #include <stdlib.h>
22 #include <stdbool.h>
23 #include <glib.h>
24 #include <gio/gio.h>
25 #include <dbus/dbus.h>
26 #include "sticker_defs.h"
27 #include "sticker_data.h"
28 #include "sticker_data_main.h"
29 #include "sticker_provider_main.h"
30 #include "sticker_consumer_main.h"
31
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35
36 enum sticker_client_error {
37     STICKER_CLIENT_ERROR_NONE,
38     STICKER_CLIENT_ERROR_INVALID_PARAMETER,
39     STICKER_CLIENT_ERROR_PERMISSION_DENIED,
40     STICKER_CLIENT_ERROR_OUT_OF_MEMORY,
41     STICKER_CLIENT_ERROR_SERVICE_NOT_READY,
42     STICKER_CLIENT_ERROR_OPERATION_FAILED,
43     STICKER_CLIENT_ERROR_IO_ERROR,
44     STICKER_CLIENT_ERROR_DB_FAILED,
45     STICKER_CLIENT_ERROR_FILE_EXISTS,
46     STICKER_CLIENT_ERROR_NO_SUCH_FILE,
47 };
48
49 int sticker_dbus_init(GDBusConnection **gdbus_connection, int *server_watcher_id,
50                       int *monitor_id, int *server_monitor_id, CLIENT_LIB lib, void *data);
51 int sticker_dbus_shutdown(GDBusConnection *gdbus_connection, int *server_watcher_id, int *server_monitor_id, int *monitor_id, CLIENT_LIB lib);
52 int sticker_dbus_insert_sticker_info(GDBusConnection *gdbus_connection, sticker_data_h sticker_data);
53 int sticker_dbus_insert_sticker_info_by_json(GDBusConnection *gdbus_connection, const char *app_id, const char *json_path);
54 int sticker_dbus_delete_sticker_info(GDBusConnection *gdbus_connection, int record_id);
55 int sticker_dbus_delete_sticker_info_by_uri(GDBusConnection *gdbus_connection, const char *uri);
56 int sticker_dbus_update_sticker_info(GDBusConnection *gdbus_connection, sticker_data_h sticker_data);
57 int sticker_dbus_get_sticker_info_by_record_id(GDBusConnection *gdbus_connection, sticker_data_h sticker_data, int record_id);
58 int sticker_dbus_get_group_list(GDBusConnection *gdbus_connection, const char *app_id, GList **group_list);
59 int sticker_dbus_get_keyword_list(GDBusConnection *gdbus_connection, const char *app_id, GList **keyword_list);
60 int sticker_dbus_get_sticker_count(GDBusConnection *gdbus_connection, const char *app_id, int *count);
61 int sticker_dbus_get_all_sticker_info(GDBusConnection *gdbus_connection, const char *app_id, int offset, int count, GVariantIter **id_iter);
62 int sticker_dbus_get_sticker_info_by_appid(GDBusConnection *gdbus_connection, const char *app_id, int offset, int count, GVariantIter **id_iter);
63 int sticker_dbus_get_sticker_info_by_type(GDBusConnection *gdbus_connection, const char *app_id, sticker_data_uri_type_e type, int offset, int count, GVariantIter **id_iter);
64 int sticker_dbus_get_sticker_info_by_group(GDBusConnection *gdbus_connection, const char *app_id, const char *group, int offset, int count, GVariantIter **id_iter);
65 int sticker_dbus_get_sticker_info_by_keyword(GDBusConnection *gdbus_connection, const char *app_id, const char *keyword, int offset, int count, GVariantIter **id_iter);
66 int sticker_dbus_get_sticker_info_by_display_type(GDBusConnection *gdbus_connection, const char *app_id, sticker_data_display_type_e type, int offset, int count, GVariantIter **id_iter);
67 int sticker_dbus_get_group_list_by_display_type(GDBusConnection *gdbus_connection, const char *app_id, sticker_data_display_type_e type, GList **group_list);
68 int sticker_dbus_check_file_exists(GDBusConnection *gdbus_connection, const char *uri, int *result);
69 int sticker_dbus_insert_recent_sticker_info(GDBusConnection *gdbus_connection, int record_id);
70 int sticker_dbus_get_recent_sticker_list(GDBusConnection *gdbus_connection, int count, GVariantIter **id_iter);
71 int sticker_dbus_get_sticker_info_by_uri(GDBusConnection *gdbus_connection, sticker_data_h sticker_data, const char *uri);
72
73 #ifdef __cplusplus
74 }
75 #endif
76
77 #endif  /* __TIZEN_UIX_STICKER_DBUS_H__ */