79f81063e11c1ca31a0771f1fb92de938c84ef70
[framework/base/syspopup.git] / wearable / include / syspopup.h
1 /*
2  * syspopup
3  *
4  * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Jayoun Lee <airjany@samsung.com>, Sewook Park <sewook7.park@samsung.com>,
7  * Jaeho Lee <jaeho81.lee@samsung.com>
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  */
22
23
24 #ifndef __SYSPOPUP_H__
25 #define __SYSPOPUP_H__
26
27 #include <utilX.h>
28 #include <bundle.h>
29 #include <Elementary.h>
30
31 /**
32  * @mainpage
33  * 
34  * This is System Popup Library 
35  * This library help to create system popup application & to launch/destroy system popup application
36  *
37  */
38
39 /**
40  * @addtogroup APPLICATION_FRAMEWORK
41  * @{
42  *
43  * @defgroup syspopup System Popup Library 
44  * @{
45  */
46
47 /**
48  * @file        syspopup.h 
49  * @brief       System Popup UI Library
50  *
51  * Patched by   Knhoon Baik <knhoon.baik@samsung.com>
52  * Patched by   Noha Park <noha.park@samsung.com> 
53  */
54
55 /**
56  * @defgroup syspopup_ui        Helper Library to create system popup application
57  * @ingroup syspopup 
58  * @brief                       Helper Library to create system popup application
59  */
60
61 /**
62  * @addtogroup syspopup_ui
63  * @{
64  */
65
66 /** 
67  *@brief action handler supplied by user 
68  *      def_term_fn is called when event to destroy all system popup occur
69  *      def_timeout_fn is called when the system popup's timeout is expired
70  */
71 struct _syspopup_handler {
72         int (*def_term_fn) (bundle *, void *);
73         /**< handler supplied by user to process termination request */
74         int (*def_timeout_fn) (bundle *, void *);
75         /**< handler supplied by user to process timeout */
76 };
77
78 typedef struct _syspopup_handler syspopup_handler;
79
80 /**
81  * @brief       This API make elm system popup window
82  *
83  *              This API make elm system popup window. 
84  *              and then, make given elm system popup window as system popup type
85  *              and set system popup properties based on system popup information DB.\n
86  *              system popup properties to be set : timeout, default action type, ....
87  *
88  * @param[in]   b               bundle received by app_reset handler (included system popup name)
89  * @param[in]   handler         user-supplied handler for handling system popup internal event.
90  * @param[in]   parent          parent window created with elm_win_add.
91  * @param[in]   user_data       user-supplied data
92  * @return      0 if success, -1 if fail
93  * @retval      0               - success
94  * @retval      -1              - generic error
95  */
96 int syspopup_create(bundle *b, syspopup_handler *handler,
97                     Evas_Object *parent, void *user_data);
98
99 /**
100  * @brief       This API reset created the elm system popup's properties
101  *
102  *              This API reset created the elm system popup's properties based on system popup information DB after extracting popup name from given bundle
103  *              system popup properties to be reset : timeout, default action type, ....
104  *
105  * @param[in]   b               bundle received by app_reset handler (included system popup name)
106  * @return      0 if success, negative value(<0) if fail
107  * @retval      0               - success
108  * @retval      -1              - generic error
109  */
110 int syspopup_reset(bundle *b);
111
112 /**
113  * @brief       This API ask that the system popup is created and is running 
114  *
115  *              This API ask that the the system popup with popup name is created and is running after extracting popup name from given bundle. 
116  *
117  * @param[in]   b               bundle received by app_reset handler (included system popup name)
118  * @return      true / false      
119  * @retval      1       app already has the system popup
120  * @retval      0       app has not the system popup
121  */
122 int syspopup_has_popup(bundle *b);
123
124 /**
125  * @brief       This API reset timeout value of system popup.
126  *
127  *              This API reset timeout value of system popup.
128  *
129  * @param[in]   b       bundle received by app_reset handler (included system popup name)
130  * @param[in]   time    timeout time (sec)
131  * @return      0       if success, negative value(<0) if fail
132  * @retval      0       success
133  * @retval      -1      generic error
134  */
135 int syspopup_reset_timeout(bundle *b, unsigned int time);
136
137 /** @} */
138
139 #endif
140