Initialize Tizen 2.3
[framework/base/syspopup.git] / mobile / include / syspopup_core.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_CORE_H__
25 #define __SYSPOPUP_CORE_H__
26
27 #include <glib.h>
28 #include <bundle.h>
29 #include "syspopup_db.h"
30
31 #define SYSPOPUP_DEFAULT_TIMEOUT 20     /* sec */
32 #define SYSPOPUP_TERM_NOTI_PATH  "/usr/share/popup_noti_term"
33
34 struct _syspopup {
35         int id;
36         char *name;
37         int (*def_term_fn) (bundle *, void *);
38         int (*def_timeout_fn) (bundle *, void *);
39         guint timeout_id;
40         def_term_action_t term_act;
41         def_endkey_action_t endkey_act;
42         void *user_data;
43         void *internal_data;
44         void *win;
45         int (*rotate_cb) (void *, void *, void *);
46         bundle *dupped_bundle;
47         struct _syspopup *next;
48 };
49
50 typedef struct _syspopup syspopup;
51
52 syspopup *_syspopup_get_head();
53 int _syspopup_add_new(syspopup *pinfo);
54 syspopup *_syspopup_find(const char *name);
55 syspopup *_syspopup_find_by_id(int id);
56 void _syspopup_del(int id);
57
58 int _syspopup_init(void (*term_handler) (void *),
59                    gboolean(*timeout_handler) (void *));
60 int _syspopup_reset_timeout(syspopup *sp, syspopup_info_t *info);
61 int _syspopup_set_term_type(syspopup *sp, syspopup_info_t *info);
62 int _syspopup_set_endkey_type(syspopup *sp, syspopup_info_t *info);
63
64 const char *_syspopup_get_name_from_bundle(bundle *b);
65 int _syspopup_set_name_to_bundle(bundle *b, char *popup_name);
66
67 #endif
68