[bluetooth-frwk] pushMessage
[platform/core/connectivity/bluetooth-frwk.git] / include / bluetooth-api.h
index e7a6951..624abb0 100644 (file)
@@ -613,6 +613,7 @@ typedef enum {
        BLUETOOTH_EVENT_MAP_GET_MESSAGE_COMPLETE,
        BLUETOOTH_EVENT_MAP_GET_MESSAGE_INVALID_ARGUMENTS,
        BLUETOOTH_EVENT_MAP_GET_MESSAGE_FAILED,
+       BLUETOOTH_EVENT_MAP_LIST_FILTER_FIELD_COMPLETE,
 
        BLUETOOTH_EVENT_OBEX_SERVER_TRANSFER_AUTHORIZE = BLUETOOTH_EVENT_OBEX_SERVER_BASE,
                                                                /* Obex server authorize event*/
@@ -1276,6 +1277,13 @@ typedef struct {
 } bt_opc_transfer_info_t;
 
 /* TODO: MAP client structures, see above */
+/**
+ * Stucture to Map filter fields
+ */
+typedef struct {
+       char **fields;
+       int size;
+} bt_map_list_filter_fields_info_t;
 
 /* Obex Server transfer type */
 #define TRANSFER_PUT "PUT"
@@ -1796,6 +1804,88 @@ typedef struct {
        char* remote_address;
 } bt_map_client_session_info_s;
 
+typedef char* bt_map_client_message_object_t;
+
+typedef struct {
+       int16_t offset;
+       int16_t max_count;
+} bt_map_client_list_folders_filter_t;
+
+typedef struct {
+       int16_t offset;
+       int16_t max_count;
+       int8_t subject_length;
+       char *fields;
+       char *types;
+       char *period_begin;
+       char *period_end;
+       int is_read;
+       char *recipient;
+       char *sender;
+       int is_priority;
+} bt_map_client_list_messages_filter_t;
+
+typedef struct {
+       bt_map_client_message_object_t message_object;
+       char *folder;
+       char *subject;
+       char *timestamp;
+       char *sender;
+       char *sender_address;
+       char *reply_to;
+       char *recipient;
+       char *recipient_address;
+       char *type;
+       int64_t size;
+       int is_text;
+       char *status;
+       int64_t attachment_size;
+       int is_priority;
+       int is_read;
+       int is_sent;
+       int is_protected;
+} bt_map_client_message_item_t;
+
+typedef struct {
+       int is_transparent;
+       int is_retry;
+       char *charset;
+} bt_map_client_push_message_args_t;
+
+typedef struct {
+       char *folder;
+       char *subject;
+       char *timestamp;
+       char *sender;
+       char *sender_address;
+       char *reply_to;
+       char *recipient;
+       char *recipient_address;
+       char *type;
+       int64_t size;
+       char *status;
+       int is_priority;
+       int is_read;
+       int is_deleted;
+       int is_sent;
+       int is_protected;
+} bt_map_client_message_t;
+
+typedef struct {
+       char **names; // holding %size null-terminated folder names
+       int64_t size;
+} bt_map_client_folders_s;
+
+typedef struct {
+       bt_map_client_message_item_t *message_items;
+       int64_t size;
+} bt_map_client_message_items_s;
+
+typedef struct {
+       const char* target_file;
+       void* user_data;
+} bt_get_message_callback_data;
+
 /**
  * Callback pointer type
  */
@@ -4859,9 +4949,23 @@ int bluetooth_map_client_set_folder(
 
 int bluetooth_map_client_list_folders(
     bt_map_client_session_info_s *session,
-    GVariant *filter
+    bt_map_client_list_folders_filter_t *filter
 );
 
+/**
+ * @fn int bluetooth_map_client_list_filter_fields(bt_map_session_info_s* session)
+ * @brief Return all available fields that can be used in Fields filter.
+ *
+ * This function is a asynchronous call.
+ *
+ * @return   BLUETOOTH_ERROR_NONE  - Success \n
+ *              BLUETOOTH_ERROR_DEVICE_NOT_ENABLED - Device is not enabled \n
+ *              BLUETOOTH_ERROR_INTERNAL - Update inbox failed \n
+ *
+ * @exception   None
+ * @param[in]  session   Information about session.
+ * @remark       None
+ */
 int bluetooth_map_client_list_filter_fields(
     bt_map_client_session_info_s *session
 );
@@ -4869,7 +4973,7 @@ int bluetooth_map_client_list_filter_fields(
 int bluetooth_map_client_list_messages(
     bt_map_client_session_info_s *session,
     const char *folder,
-    GVariant *filter
+    bt_map_client_list_messages_filter_t *filter
 );
 
 int bluetooth_map_client_update_inbox(
@@ -4880,12 +4984,12 @@ int bluetooth_map_client_push_message(
     bt_map_client_session_info_s *session,
     const char *source_file,
     const char *folder,
-    GVariant *args
+    bt_map_client_push_message_args_t *args
 );
 
 int bluetooth_map_client_get_message(
     bt_map_client_session_info_s *session,
-    const char *message_object_name,
+    const bt_map_client_message_object_t message_object,
     const char *target_file,
     bool attachment
 );