Merge branch 'master' into tizen_2.1
[platform/core/connectivity/bluetooth-agent.git] / map-agent / map_bmessage.h
1 /*
2  * bluetooth-agent
3  *
4  * Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *              http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20  #ifndef __BMSG_H
21 #define __BMSG_H
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 struct bmsg_vcard {
28         gchar *version;
29         gchar *n;
30         gchar *fn;
31         gchar *tel;
32         gchar *email;
33 };
34
35 struct bmsg_bbody {
36         guint16 part_id;
37         gchar *encoding;
38         gchar *charset;
39         gchar *language;
40         guint64 length;
41         gchar *msg;
42 };
43
44 struct benv_data {
45         guint8 encapsulation_level;
46         GSList *recipient_vcard;
47         struct bmsg_bbody *body_content;
48 };
49
50 struct bmsg_envelope {
51         GSList *env_data;       /* Add benv_data here*/
52 };
53
54 struct bmsg_data {
55         gchar *version;
56         gchar *status;
57         gchar *type;
58         gchar *folder;
59         struct bmsg_vcard *originator_vcard_data;
60         struct bmsg_envelope *envelope_data;
61 };
62
63 struct bmsg_data * bmsg_parse(gchar *buf);
64 char *bmsg_get_msg_folder(struct bmsg_data *bmsg);
65 char *bmsg_get_msg_body(struct bmsg_data *bmsg, gboolean utf);
66 GSList *bmsg_get_msg_recepients(struct bmsg_data *bmsg);
67
68 #ifdef __cplusplus
69 }
70 #endif
71
72 #endif /* __BMSG_H */