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