1bf81fdc3664b6db18b045b4295aaa9b3e9c5a7b
[apps/home/gallery.git] / include / util / gl-ui-util.h
1 /*
2   * Copyright 2012  Samsung Electronics Co., Ltd
3   *
4   * Licensed under the Flora License, Version 1.0 (the "License");
5   * you may not use this file except in compliance with the License.
6   * You may obtain a copy of the License at
7   *
8   *     http://www.tizenopensource.org/license
9   *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16
17 #ifndef _GL_UI_UTIL_H_
18 #define _GL_UI_UTIL_H_
19
20 #include <Elementary.h>
21 #include <appcore-efl.h>
22 #include "gallery.h"
23
24 #ifdef _cplusplus
25 extern "C"
26 {
27 #endif
28
29 #define _EDJ(o)         elm_layout_edje_get(o)
30 #define _GETICON(_path) \
31                 ((1 == ecore_file_exists(_path) && (ecore_file_size(_path) > 0)) ? _path : GL_DEFAULT_THUMB_ICON)
32
33
34 typedef enum
35 {
36         GL_NAVI_ALBUMS,
37         GL_NAVI_ALBUMS_EDIT,
38         GL_NAVI_ALBUMS_RENAME,
39         GL_NAVI_ALBUMS_NEW,
40         GL_NAVI_THUMBS,
41         GL_NAVI_THUMBS_EDIT,
42 } gl_navi_mode;
43
44 typedef enum
45 {
46         GL_UI_NOTIFY_DELETED,
47         GL_UI_NOTIFY_REMOVED,
48         GL_UI_NOTIFY_ADDED,
49         GL_UI_NOTIFY_MOVED,
50 } gl_ui_notify_mode;
51
52 Evas_Object *gl_ui_create_naviframe(Evas_Object * parent);
53 Evas_Object *gl_ui_create_main_ly(Evas_Object * parent);
54 Evas_Object *gl_ui_create_view_ly(Evas_Object *parent);
55 int gl_ui_create_title_and_push(void *data, Evas_Object *parent,
56                                 Evas_Object *obj, gl_navi_mode mode, char *title);
57 int gl_ui_remake_titlebar(void *data, Evas_Object * parent, Evas_Object * obj, gl_navi_mode mode);
58 Evas_Object *gl_ui_load_edj(Evas_Object * parent, const char *file, const char *group);
59 Evas_Object *gl_ui_create_nocontents_full(void *data);
60 int gl_ui_create_selinfo(void *data, Evas_Object *parent, Elm_Object_Item *nf_it,
61                           int all_cnt, int selected_cnt, bool b_update);
62 int gl_ui_destroy_selinfo(void *data);
63 int gl_ui_update_select_widgets(void *data);
64 int gl_ui_show_selall(void *data);
65 int gl_ui_destroy_imf(void *data);
66 int gl_ui_rename_album(gl_cluster * album_item);
67 int gl_ui_set_album_lock(void *data, gl_cluster * sel_album);
68 int gl_ui_reset_toolbar_item(void *data, gl_ctrl_seg_mode seg_mode, bool force);
69 int gl_ui_back_to_normal(void *data);
70 int gl_ui_move_to_newalbum(void *data);
71 int gl_ui_edit_cancel(void *data);
72 int gl_ui_disable_toolbar_item(void *data, bool disabled, gl_navi_mode mode,
73                                bool edit);
74 int gl_ui_cancel_rename_album(void *data);
75 int gl_ui_cancel_new_album(void *data);
76 bool gl_ui_display_nocontents(void *data);
77 int gl_ui_disable_cbar_item(Elm_Object_Item *it);
78 int gl_ui_enable_cbar_item(Elm_Object_Item *it);
79 int gl_ui_disable_toolbar_items(void *data, Elm_Object_Item *nf_it);
80 int gl_ui_create_notiinfo(void *data, Evas_Object *parent,
81                            gl_ui_notify_mode n_mode);
82 int gl_ui_destroy_notiinfo(void *data);
83 int gl_ui_disable_add_account_btn(void *data, bool b_disable);
84 int _gl_ui_elm_bg_file_set(Evas_Object *bg, gl_item *git);
85
86 #ifdef _cplusplus
87 }
88 #endif
89
90 #endif // end of _GL_UI_UTIL_H_