Move function definition to aul header
[platform/core/appfw/aul-1.git] / include / aul_screen_connector.h
1 /*
2  * Copyright (c) 2016 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
18 #ifndef __AUL_SCREEN_CONNECTOR_H__
19 #define __AUL_SCREEN_CONNECTOR_H__
20
21 #include <stdbool.h>
22
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26
27 typedef enum {
28         AUL_SCREEN_TYPE_WIDGET = 0x01,
29         AUL_SCREEN_TYPE_WATCH = 0x02,
30         AUL_SCREEN_TYPE_UI = 0x04,
31         AUL_SCREEN_TYPE_COMPONENT_BASED = 0x08,
32         AUL_SCREEN_TYPE_ALL = AUL_SCREEN_TYPE_WIDGET | AUL_SCREEN_TYPE_WATCH |
33                         AUL_SCREEN_TYPE_UI | AUL_SCREEN_TYPE_COMPONENT_BASED,
34 } aul_screen_type_e;
35
36 typedef enum {
37         AUL_SCREEN_CONNECTOR_EVENT_TYPE_ADD,
38         AUL_SCREEN_CONNECTOR_EVENT_TYPE_REMOVE,
39         AUL_SCREEN_CONNECTOR_EVENT_TYPE_UPDATE,
40         AUL_SCREEN_CONNECTOR_EVENT_TYPE_FOCUS,
41 } aul_screen_connector_event_type_e;
42
43 typedef enum {
44         AUL_SCREEN_STATUS_RESUME,
45         AUL_SCREEN_STATUS_PRE_RESUME,
46         AUL_SCREEN_STATUS_PAUSE,
47 } aul_screen_status_e;
48
49 typedef void (*aul_screen_viewer_cb)(const char *appid,
50                 const char *instance_id, const int pid,
51                 const unsigned int surface_id,
52                 aul_screen_connector_event_type_e event_type, void *data);
53
54 typedef struct aul_screen_viewer_s *aul_screen_viewer_h;
55
56 /*
57  * This API is only for Appfw internally.
58  */
59 int aul_screen_connector_add_app_screen(const char *instance_id,
60                 unsigned int surf);
61
62 /*
63  * This API is only for Appfw internally.
64  */
65 int aul_screen_connector_remove_app_screen(const char *instance_id);
66
67 /*
68  * This API is only for Appfw internally.
69  */
70 int aul_screen_connector_send_update_request(const char *appid,
71                 const char *instance_id);
72
73 /*
74  * This API is only for Appfw internally.
75  */
76 int aul_screen_connector_add_screen_viewer(aul_screen_viewer_cb callback,
77                 aul_screen_type_e type, bool priv,
78                 void *data, aul_screen_viewer_h *handle);
79
80 /*
81  * This API is only for Appfw internally.
82  */
83 int aul_screen_connector_remove_screen_viewer(aul_screen_viewer_h handle);
84
85 /*
86  * This API is only for Appfw internally.
87  */
88 int aul_screen_connector_get_appid_by_surface_id(unsigned int surface_id,
89                 char **appid);
90
91 /*
92  * This API is only for Appfw internally.
93  */
94 int aul_screen_connector_get_instance_id_by_surface_id(unsigned int surface_id,
95                 char **instance_id);
96
97 /*
98  * This API is only for Appfw internally.
99  */
100 int aul_screen_connector_update_screen_viewer_status(aul_screen_status_e status,
101                 unsigned int provider_surf);
102
103 /*
104  * This API is only for Appfw internally.
105  */
106 int aul_screen_connector_trigger_focused_force(void);
107
108 #ifdef __cplusplus
109 }
110 #endif
111
112 #endif /* __AUL_SCREEN_CONNECTOR_H__ */