4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Sangjin Han <sjhan.han@samsung.com>,
7 * Jiansong Jin <jiansong.jin@samsung.com>,
8 * Jonghyuk Lee <jhyuk47.lee@samsung.com>,
9 * Chaolong Lin <chaolong.lin@samsung.com>,
10 * Yongjun Zhao <yj123.zhao@samsung.com>
12 * Licensed under the Apache License, Version 2.0 (the "License");
13 * you may not use this file except in compliance with the License.
14 * You may obtain a copy of the License at
16 * http://www.apache.org/licenses/LICENSE-2.0
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS,
20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
29 #include "ge-strings.h"
30 #ifdef _USE_ROTATE_BG_GE
31 #include "ge-rotate-bg.h"
35 #define GE_PHOTOFRAME_STYLE_VIDEO_BOOKMARK "default_layout_video_bookmark"
36 #define GE_PHOTOFRAME_STYLE_VIDEO_FAVOR "default_layout_video_favor"
37 #define GE_PHOTOFRAME_STYLE_VIDEO "default_layout_video"
38 #define GE_PHOTOFRAME_STYLE_FAVOR "default_layout_favor"
39 #define GE_PHOTOFRAME_STYLE_DEFAULT "default_layout"
41 #define GE_CLASS_GENGRID "gengrid"
42 #define GE_GRP_PHOTOFRAME "photoframe"
43 #define GE_GRID_TEXT "elm.text"
45 Evas_Object *_ge_thumb_show_part_icon_image(Evas_Object *obj, char *path,
47 bool is_expired_drm, int item_size)
51 Evas_Object *layout = elm_layout_add(obj);
52 GE_CHECK_NULL(layout);
54 #ifdef _USE_ROTATE_BG_GE
55 Evas_Object *bg = _ge_rotate_bg_add(layout);
57 Evas_Object *bg = elm_bg_add(layout);
60 evas_object_del(layout);
64 #ifdef _USE_ROTATE_BG_GE
65 _ge_rotate_bg_set_file(bg, path, item_size, item_size);
66 _ge_rotate_bg_rotate_image(bg, orient);
68 elm_bg_file_set(bg, path, NULL);
69 elm_bg_load_size_set(bg, item_size, item_size);
70 evas_object_size_hint_max_set(bg, item_size, item_size);
71 evas_object_size_hint_aspect_set(bg, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
72 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
73 evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
76 // TODO: Need to check the expired drm icon file...
77 /* Expired drm icon */
79 elm_layout_theme_set(layout, GE_CLASS_GENGRID, GE_GRP_PHOTOFRAME,
80 GE_PHOTOFRAME_STYLE_FAVOR);
81 elm_object_part_content_set(layout, "elm.swallow.icon", bg);
83 Evas_Object *icon = elm_icon_add(layout);
84 elm_icon_file_set(icon, GE_LOCK_ICON, NULL);
85 evas_object_show(icon);
86 elm_object_part_content_set(layout, "elm.swallow.favoricon",
89 elm_layout_theme_set(layout, GE_CLASS_GENGRID, GE_GRP_PHOTOFRAME,
90 GE_PHOTOFRAME_STYLE_DEFAULT);
91 elm_object_part_content_set(layout, "elm.swallow.icon", bg);
94 evas_object_show(layout);
98 Evas_Object *_ge_thumb_show_part_icon_video(Evas_Object *obj, char *path,
99 unsigned int v_dur, int bk_len,
105 Evas_Object *layout = elm_layout_add(obj);
106 GE_CHECK_NULL(layout);
108 #ifdef _USE_ROTATE_BG_GE
109 Evas_Object *bg = _ge_rotate_bg_add(layout);
111 Evas_Object *bg = elm_bg_add(layout);
114 evas_object_del(layout);
118 #ifdef _USE_ROTATE_BG_GE
119 _ge_rotate_bg_set_file(bg, path, item_size, item_size);
120 _ge_rotate_bg_rotate_image(bg, GE_ORIENTATION_ROT_0);
122 elm_bg_file_set(bg, path, NULL);
123 elm_bg_load_size_set(bg, item_size, item_size);
124 evas_object_size_hint_max_set(bg, item_size, item_size);
125 evas_object_size_hint_aspect_set(bg, EVAS_ASPECT_CONTROL_VERTICAL, 1, 1);
126 evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
127 evas_object_size_hint_align_set(bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
131 elm_layout_theme_set(layout, GE_CLASS_GENGRID, GE_GRP_PHOTOFRAME,
132 GE_PHOTOFRAME_STYLE_VIDEO_BOOKMARK);
133 else if (is_expired_drm)
134 elm_layout_theme_set(layout, GE_CLASS_GENGRID, GE_GRP_PHOTOFRAME,
135 GE_PHOTOFRAME_STYLE_VIDEO_FAVOR);
137 elm_layout_theme_set(layout, GE_CLASS_GENGRID, GE_GRP_PHOTOFRAME,
138 GE_PHOTOFRAME_STYLE_VIDEO);
139 elm_object_part_content_set(layout, "elm.swallow.icon", bg);
141 // TODO: Need to check the expired drm icon file...
142 /* Expired drm icon */
143 if (is_expired_drm) {
144 Evas_Object *icon = elm_icon_add(layout);
145 elm_icon_file_set(icon, GE_LOCK_ICON, NULL);
146 evas_object_show(icon);
147 elm_object_part_content_set(layout, "elm.swallow.favoricon",
149 /* Set favourites icon */
153 Evas_Object *icon = elm_icon_add(layout);
154 elm_icon_file_set(icon, GE_THUMB_BOOKMARK, NULL);
155 evas_object_show(icon);
156 elm_object_part_content_set(layout, "elm.swallow.bookmarkicon",
160 char *dur_str = _ge_get_duration_string(v_dur);
161 GE_CHECK_NULL(dur_str);
162 elm_object_part_text_set(layout, GE_GRID_TEXT, dur_str);
165 evas_object_show(layout);