Clean up file mode
[platform/core/base/syspopup.git] / include / syspopup.h
1 /*
2  * Copyright (c) 2000 - 2017 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 __SYSPOPUP_H__
19 #define __SYSPOPUP_H__
20
21 #include <bundle.h>
22 #include <Elementary.h>
23
24 /**
25  * @mainpage
26  *
27  * This is System Popup Library
28  * This library help to create system popup application & to launch/destroy system popup application
29  *
30  */
31
32 /**
33  * @close
34  * @ingroup APPLICATION_FRAMEWORK
35  * @defgroup syspopup System Popup Library
36  * @{
37  */
38
39 /**
40  * @file        syspopup.h
41  * @brief       System Popup UI Library
42  *
43  * Patched by   Knhoon Baik <knhoon.baik@samsung.com>
44  * Patched by   Noha Park <noha.park@samsung.com>
45  */
46
47 /**
48  * @defgroup syspopup_ui        Helper Library to create system popup application
49  * @ingroup syspopup
50  * @brief                       Helper Library to create system popup application
51  */
52
53 /**
54  * @addtogroup syspopup_ui
55  * @{
56  */
57
58 /**
59  * @brief action handler supplied by user
60  *      def_term_fn is called when event to destroy all system popup occur
61  *      def_timeout_fn is called when the system popup's timeout is expired
62  */
63 struct _syspopup_handler {
64         int (*def_term_fn) (bundle *, void *);
65         /**< handler supplied by user to process termination request */
66         int (*def_timeout_fn) (bundle *, void *);
67         /**< handler supplied by user to process timeout */
68 };
69
70 typedef struct _syspopup_handler syspopup_handler;
71
72 /**
73  * @brief       This API make elm system popup window
74  *
75  *              This API make elm system popup window.
76  *              and then, make given elm system popup window as system popup type
77  *              and set system popup properties based on system popup information DB.\n
78  *              system popup properties to be set : timeout, default action type, ....
79  *
80  * @privilege   %http://tizen.org/privilege/window.priority.set
81  * @param[in]   b               bundle received by app_reset handler (included system popup name)
82  * @param[in]   handler         user-supplied handler for handling system popup internal event.
83  * @param[in]   parent          parent window created with elm_win_add.
84  * @param[in]   user_data       user-supplied data
85  * @return      0 if success, -1 if fail
86  * @retval      0               - success
87  * @retval      -1              - generic error
88  */
89 int syspopup_create(bundle *b, syspopup_handler *handler,
90                     Evas_Object *parent, void *user_data);
91
92 /**
93  * @brief       This API reset created the elm system popup's properties
94  *
95  *              This API reset created the elm system popup's properties based on system popup information DB after extracting popup name from given bundle
96  *              system popup properties to be reset : timeout, default action type, ....
97  *
98  * @param[in]   b               bundle received by app_reset handler (included system popup name)
99  * @return      0 if success, negative value(<0) if fail
100  * @retval      0               - success
101  * @retval      -1              - generic error
102  */
103 int syspopup_reset(bundle *b);
104
105 /**
106  * @brief       This API ask that the system popup is created and is running
107  *
108  *              This API ask that the the system popup with popup name is created and is running after extracting popup name from given bundle.
109  *
110  * @param[in]   b               bundle received by app_reset handler (included system popup name)
111  * @return      true / false
112  * @retval      1       app already has the system popup
113  * @retval      0       app has not the system popup
114  */
115 int syspopup_has_popup(bundle *b);
116
117 /**
118  * @brief       This API reset timeout value of system popup.
119  *
120  *              This API reset timeout value of system popup.
121  *
122  * @param[in]   b       bundle received by app_reset handler (included system popup name)
123  * @param[in]   time    timeout time (sec)
124  * @return      0       if success, negative value(<0) if fail
125  * @retval      0       success
126  * @retval      -1      generic error
127  */
128 int syspopup_reset_timeout(bundle *b, unsigned int time);
129
130 /** @} */
131
132 #endif