Tizen 2.0 Release
[apps/home/ug-memo-efl.git] / include / memo-assist.h
1 /*
2 *
3 * Copyright 2012  Samsung Electronics Co., Ltd
4 *
5 * Licensed under the Flora License, Version 1.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 *    http://floralicense.org/license/
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 */
18
19 #ifndef __MEMO_ASSIST_H__
20 #define __MEMO_ASSIST_H__
21
22 #include <memo-db.h>
23 #include <bundle.h>
24 #include <memo_string.h>
25 #include <ui-gadget.h>
26
27
28 #define DOODLE_TITLE_PREFIX     "Draw_"
29
30 #define ARGB_JOIN(a, r, g, b) \
31     (((a) << 24) + ((r) << 16) + ((g) << 8) + (b))
32
33 #define  IN_RECT_CHECK(x, y, rx, ry, rw, rh)\
34     (((unsigned)((x) - (rx)) < (rw)) && ((unsigned)((y) - (ry)) < (rh)))
35
36 #define CLIP_RECT_TO_RECT(x, y, w, h, rx, ry, rw, rh)\
37 {\
38     int   _t0, _t1;\
39 \
40     _t0 = MAX(x, (rx));\
41     _t1 = MIN(x + w, (rx) + (rw));\
42     x = _t0;\
43     w = _t1 - _t0;\
44     _t0 = MAX(y, (ry));\
45     _t1 = MIN(y + h, (ry) + (rh));\
46     y = _t0;\
47     h = _t1 - _t0;\
48 }
49
50 typedef void (*Memo_Component_Callback)(void *data, const char *msg, void *event);
51
52 typedef struct memo_data memo_data_t;
53 typedef struct memo_data_list memo_data_list_t;
54
55 typedef enum {
56     MOUSE_EVENT_INVALID = 0,
57     MOUSE_EVENT_CLICK,
58     MOUSE_EVENT_DRAG_LEFT,
59     MOUSE_EVENT_DRAG_RIGHT,
60     MOUSE_EVENT_DRAG_UP,
61     MOUSE_EVENT_DRAG_DOWN,
62 } mouse_behaviour_t;
63
64 #define MOUSE_POSITION_INVALID 9999
65
66 char * strcasestr (const char *haystack, const char *needle);
67 char * strptime (const char *s, const char *fmt, struct tm *tp);
68 void icu_init();
69 char *memo_get_doodle_title();
70 void memo_time_format(char *buf, int len, time_t time);
71 time_t memo_get_binary_release_date();
72 mouse_behaviour_t mouse_event_identify(int startx, int starty, int endx, int endy);
73 void evas_object_flick_callback_add(Evas_Object *obj, Evas_Smart_Cb on_flick, void *data);
74 void memo_com_dummy_cb(void *data, const char *msg, void *event);
75 void memo_create_yes_no_popup(Evas_Object *win, const char *msg, Evas_Smart_Cb on_yes, Evas_Smart_Cb on_no, void *data);
76 void memo_tool_btn_focus_set(Evas_Object *eo, Eina_Bool status);
77 void *memo_load_font_size_selector(Evas_Object *parent, service_h service, Memo_Component_Callback cb, void *data);
78 void memo_del_font_size_selector(void *h_fss);
79 void *memo_load_color_selector(Evas_Object *parent, service_h service, Memo_Component_Callback cb, void *data);
80 void memo_del_color_selector(void *h_cs);
81 void *memo_load_pencil_size_selector(Evas_Object *parent, service_h service, Memo_Component_Callback cb, void *data);
82 void memo_del_pencil_size_selector(void *h_pss);
83 void memo_navigator_pop(Evas_Object *navi);
84 Elm_Object_Item *memo_naviframe_item_push(Evas_Object *obj, const char *title_label,
85     Evas_Object *prev_btn, Evas_Object *next_btn, Evas_Object *content, const char *item_style);
86 Evas_Object *memo_controlbar_add(Evas_Object *parent);
87 void memo_comment_recover(Evas_Object *entry, const char *orig_utf8);
88 #endif                /* __MEMO_ASSIST_H__ */