Add 3.0 APIs and sync APIs same as 2.4
[platform/core/convergence/service-adaptor.git] / server / sal.h
1 /*
2  * Service Adaptor
3  *
4  * Copyright (c) 2014 - 2015 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Yongjin Kim <youth.kim@samsung.com>
7  *          Jinhyeong Ahn <jinh.ahn@samsung.com>
8  *          Jiwon Kim <jiwon177.kim@samsung.com>
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License");
11  * you may not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */
23
24 #ifndef __TIZEN_CONVERGENCE_SAL_H__
25 #define __TIZEN_CONVERGENCE_SAL_H__
26
27 #include <glib.h>
28
29 #include "service_adaptor_errors.h"
30
31 #include "auth_adaptor.h"
32 #include "contact_adaptor.h"
33 #include "storage_adaptor.h"
34 #include "resource_adaptor.h"
35
36 typedef struct _sal_s
37 {
38         GList *svc_list;
39
40         auth_adaptor_h                  auth;
41         contact_adaptor_h               contact;
42         storage_adaptor_h               storage;
43         resource_adaptor_h              resource;
44
45         auth_adaptor_listener_h         auth_listener;
46         contact_adaptor_listener_h      contact_listener;
47         storage_adaptor_listener_h      storage_listener;
48         resource_adaptor_listener_h     resource_listener;
49
50         GMutex mutex;
51         GCond cond;
52         int start;
53 } sal_s;
54 typedef struct _sal_s *sal_h;
55
56 typedef struct _provider_user_data_s
57 {
58         char *uri;
59         char *name;
60         char *package;
61 } provider_user_data_s;
62 typedef struct _provider_user_data_s *provider_user_data_h;
63
64 sal_h sal_get_handle();
65 char *sal_get_root_path();
66 service_adaptor_error_e sal_adaptor_connect(const char *uri);
67 service_adaptor_error_e sal_adaptor_disconnect(const char *uri);
68 service_adaptor_error_e sal_adaptor_get_plugins(char ***plugins, int *plugins_size);
69 service_adaptor_error_e sal_provider_connect(const char *uri, const char *name, const char *package);
70 service_adaptor_error_e sal_provider_disconnect(const char *uri);
71 char *sal_provider_get_uri(const char *package);
72
73 #endif /* __TIZEN_CONVERGENCE_SAL_H__ */