3 * Copyright 2012 Samsung Electronics Co., Ltd
5 * Licensed under the Flora License, Version 1.1 (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
9 * http://floralicense.org/license/
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.
19 #ifndef __MEMO_ASSIST_H__
20 #define __MEMO_ASSIST_H__
24 #include <memo_string.h>
25 #include <ui-gadget.h>
28 #define DOODLE_TITLE_PREFIX "Draw_"
30 #define ARGB_JOIN(a, r, g, b) \
31 (((a) << 24) + ((r) << 16) + ((g) << 8) + (b))
33 #define IN_RECT_CHECK(x, y, rx, ry, rw, rh)\
34 (((unsigned)((x) - (rx)) < (rw)) && ((unsigned)((y) - (ry)) < (rh)))
36 #define CLIP_RECT_TO_RECT(x, y, w, h, rx, ry, rw, rh)\
41 _t1 = MIN(x + w, (rx) + (rw));\
45 _t1 = MIN(y + h, (ry) + (rh));\
50 typedef void (*Memo_Component_Callback)(void *data, const char *msg, void *event);
52 typedef struct memo_data memo_data_t;
53 typedef struct memo_data_list memo_data_list_t;
56 MOUSE_EVENT_INVALID = 0,
58 MOUSE_EVENT_DRAG_LEFT,
59 MOUSE_EVENT_DRAG_RIGHT,
61 MOUSE_EVENT_DRAG_DOWN,
64 #define MOUSE_POSITION_INVALID 9999
66 char * strcasestr (const char *haystack, const char *needle);
67 char * strptime (const char *s, const char *fmt, struct tm *tp);
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__ */