summaryrefslogtreecommitdiff
path: root/main/src/view/ivug-details-view.c
blob: 77fefdbd05f49e6b74b540e13e5025d62ef41e24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
/*
 * Copyright 2012  Samsung Electronics Co., Ltd
 *
 * Licensed under the Flora License, Version 1.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *	  http://www.tizenopensource.org/license
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <ui-gadget-module.h>

#include "ivug-common.h"
#include "ivug-main-view.h"
#include "ivug-string.h"
#include "ivug-file-info.h"

#include "ivug-details-view.h"
#include "ivug-detail-info.h"

#include "ivug-drm.h"

#define DETAILS_EDJ_FILE EDJ_PATH"/ivug-details.edj"

#define FILE_DETILES_NUM 				6
#define FILE_EXIF_INFO_NUM 				2


/*
	this structure represent one item in genlist.
*/
typedef struct
{
	char *m_ItemName;
	Ivug_DetailsView *pDetailsView;
} ivug_file_list_item;


static void _ivug_details_free_file_info(ivug_file_info_t * const pFileInfo)
{
	if(pFileInfo->filename)
	{
		free(pFileInfo->filename);
		pFileInfo->filename = NULL;
	}

	if(pFileInfo->filepath)
	{
		free(pFileInfo->filepath);
		pFileInfo->filepath = NULL;
	}

	if(pFileInfo->filesize)
	{
		free(pFileInfo->filesize);
		pFileInfo->filesize = NULL;
	}

	if(pFileInfo->file_ext)
	{
		free(pFileInfo->file_ext);
		pFileInfo->file_ext = NULL;
	}

	if(pFileInfo->file_location)
	{
		free(pFileInfo->file_location);
		pFileInfo->file_location = NULL;
	}

	if(pFileInfo->create_date)
	{
		free(pFileInfo->create_date);
		pFileInfo->create_date = NULL;
	}

	if(pFileInfo->resolution)
	{
		free(pFileInfo->resolution);
		pFileInfo->resolution = NULL;
	}

	if(pFileInfo->latitude)
	{
		free(pFileInfo->latitude);
		pFileInfo->latitude = NULL;
	}

	if(pFileInfo->longitude)
	{
		free(pFileInfo->longitude);
		pFileInfo->longitude = NULL;
	}

	if(pFileInfo->vendor)
	{
		free(pFileInfo->vendor);
		pFileInfo->vendor = NULL;
	}

	if(pFileInfo->forwarding)
	{
		free(pFileInfo->forwarding);
		pFileInfo->forwarding = NULL;
	}

	if(pFileInfo->type)
	{
		free(pFileInfo->type);
		pFileInfo->type = NULL;

	}

}

static char *
_ivug_details_gl_label_get(void *data, Evas_Object *obj, const char *part )
{
	ivug_file_list_item *params = (ivug_file_list_item *)data;

	ivug_retvm_if(params == NULL, NULL, "params is NULL");

	Ivug_DetailsView *pDetailsView = (Ivug_DetailsView *)params->pDetailsView;
	ivug_retvm_if(pDetailsView == NULL, NULL, "pDetailsView is NULL");

	//MSG_DETAIL_HIGH("m_ItemName is %s", params->m_ItemName);

	if(strcmp(part, "elm.text.1") == 0)
	{
		if(params->m_ItemName)
		{
			return strdup(params->m_ItemName);

		}
		else
		{
			return strdup(IDS_UNKNOWN);
		}
	}
	else if(strcmp(part, "elm.text.2")==0)
	{
		char *text2 = NULL;
		if(strncmp(IDS_NAME, params->m_ItemName, strlen(IDS_NAME)) == 0)
		{
			text2 = pDetailsView->file_Info.filename;
		}
		else if(strncmp(IDS_SIZE, params->m_ItemName, strlen(IDS_SIZE)) == 0)
		{
			text2 = pDetailsView->file_Info.filesize;
		}
		else if(strncmp(IDS_FORMAT, params->m_ItemName, strlen(IDS_FORMAT)) == 0)
		{
			text2 = pDetailsView->file_Info.file_ext;
		}
		else if(strncmp(IDS_RESOLUTION, params->m_ItemName, strlen(IDS_RESOLUTION)) == 0)
		{
			text2 = pDetailsView->file_Info.resolution;
		}
		else if(strncmp(IDS_DATE_CREATED, params->m_ItemName, strlen(IDS_DATE_CREATED)) == 0)
		{
			text2 = pDetailsView->file_Info.create_date;
		}
		else if(strncmp(IDS_FILE_LOCATION, params->m_ItemName, strlen(IDS_FILE_LOCATION)) == 0)
		{
			text2 = pDetailsView->file_Info.file_location;
		}
		else if(strncmp(IDS_LATITUDE, params->m_ItemName, strlen(IDS_LATITUDE)) == 0)
		{
			text2 = pDetailsView->file_Info.latitude;
		}
		else if(strncmp(IDS_LONGITUDE, params->m_ItemName, strlen(IDS_LONGITUDE)) == 0)
		{
			text2 = pDetailsView->file_Info.longitude;
		}
		else if(strncmp(IDS_VENDOR, params->m_ItemName, strlen(IDS_VENDOR)) == 0)
		{
			text2 = pDetailsView->file_Info.vendor;
		}
		else if(strncmp(IDS_FORWARDING, params->m_ItemName, strlen(IDS_FORWARDING)) == 0)
		{
			text2 = pDetailsView->file_Info.forwarding;
		}
		else if(strncmp(IDS_AVAILABLE_USES, params->m_ItemName, strlen(IDS_AVAILABLE_USES)) == 0)
		{
			text2 = pDetailsView->file_Info.available_uses;
		}
		else if(strncmp(IDS_TYPE, params->m_ItemName, strlen(IDS_TYPE)) == 0)
		{
			text2 = pDetailsView->file_Info.type;
		}
		else if(strncmp(IDS_VALIDITY, params->m_ItemName, strlen(IDS_VALIDITY)) == 0)
		{
			text2 = pDetailsView->file_Info.validity;
		}

		if (text2) {
			return elm_entry_utf8_to_markup(text2);
		} else {
			return elm_entry_utf8_to_markup(IDS_UNKNOWN);
		}
	 }

	else
	{
		return NULL;
	}

}

static void
_ivug_details_gl_del(void *data, Evas_Object *obj )
{
	ivug_ret_if(NULL == data);

	ivug_file_list_item *params = (ivug_file_list_item *)data;

	ivug_retm_if(params == NULL, "params is NULL");
	if(params)
	{
		free(params);
		params = NULL;
	}

	return;
}

static char*
_ivug_details_gl_label_get_title(void *data, Evas_Object *obj,const char *part )
{
	ivug_retv_if(NULL == data, NULL);

	if (!strcmp(part, "elm.text"))
	{
		return strdup(data);
	}

	return NULL;
}

static void _on_rename_view_response(ivug_name_response resp, const char *str, void *pClientData)
{
	Ivug_DetailsView *pDetailsView = (Ivug_DetailsView *)pClientData;

	pDetailsView->pAddTagView = NULL;	// Will removed in add tag view.

	if(resp != NAME_VIEW_RESPONSE_OK)
	{
		MSG_DETAIL_HIGH("rename is canceled");
		return;
	}

	Media_Data *mdata = pDetailsView->mdata;
	const char *old_fullpath = mdata->filepath;
	char *old_dir = ecore_file_dir_get(old_fullpath);
	char *ext = ivug_fileinfo_get_file_extension(old_fullpath);

	char new_fullpath[IVUG_MAX_FILE_PATH_LEN] = {0,};
	snprintf(new_fullpath, sizeof(new_fullpath),"%s/%s.%s", old_dir, str, ext);

	if(ivug_rename_file(old_fullpath, new_fullpath) == false)
	{
		MSG_DETAIL_ERROR("ivug_rename_file failed");
	}
	else
	{
		MSG_DETAIL_HIGH("Rename %s -> %s", old_fullpath, new_fullpath);
		free(mdata->filepath);
		mdata->filepath = strdup(new_fullpath);

		ivug_details_info_set_filename(&pDetailsView->file_Info, new_fullpath);

		elm_genlist_realized_items_update(pDetailsView->genlist);

		const char *name = ecore_file_file_get(mdata->filepath);

		evas_object_smart_callback_call(pDetailsView->layout, "renamed", (void *)name);
	}
}

static void _rename_button_clicked_cb(void *data, Evas_Object * obj, void *event_info)
{
	Ivug_DetailsView *pDetailsView = (Ivug_DetailsView *)data;
	Media_Data *mdata = pDetailsView->mdata;

	MSG_DETAIL_HIGH("clicked event on Button");

	pDetailsView->pAddTagView = ivug_name_view_create(pDetailsView->layout, IDS_CHANGE_NAME);

	const char *name = ecore_file_strip_ext(ecore_file_file_get(mdata->filepath));

	ivug_name_view_set_entry(pDetailsView->pAddTagView, name);

	ivug_name_view_set_response_callback(pDetailsView->pAddTagView, _on_rename_view_response, (void*)pDetailsView);
}

static Evas_Object *_ivug_details_gl_icon_get_title(void *data, Evas_Object *obj, const char *part)
{
	ivug_file_list_item *params = (ivug_file_list_item *)data;

	ivug_retvm_if(params == NULL, NULL, "params is NULL");

	Ivug_DetailsView *pDetailsView = (Ivug_DetailsView *)params->pDetailsView;
	ivug_retvm_if(pDetailsView == NULL, NULL, "pDetailsView is NULL");

	Evas_Object *btn;

	if (!strcmp(part, "elm.icon") || !strcmp(part, "elm.icon.1")) {
		btn = elm_button_add(pDetailsView->layout);
		elm_object_style_set(btn, "rename");
		evas_object_smart_callback_add(btn, "clicked", _rename_button_clicked_cb, (void *)pDetailsView);
	}

	return btn;
}

static Eina_Bool
_ivug_details_gl_state_get(void *data, Evas_Object *obj, const char *part )
{
	return EINA_FALSE;
}

static Evas_Object *
_ivug_details_view_genlist_create(Ivug_DetailsView *pDetailsView, Evas_Object *parent)
{
	IV_ASSERT(pDetailsView != NULL);

	Evas_Object *genlist = NULL;
	genlist = elm_genlist_add(parent);

	ivug_retvm_if(NULL == genlist, NULL, "Create Details genlist failed..");

	elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);

	elm_object_theme_set(genlist, gGetSystemTheme());

	memset(&pDetailsView->itc, 0, sizeof(Elm_Genlist_Item_Class) );

	pDetailsView->itc.version = ELM_GENLIST_ITEM_CLASS_VERSION;
	pDetailsView->itc.item_style = "ivug/2text.2";
	pDetailsView->itc.func.text_get = _ivug_details_gl_label_get;
	pDetailsView->itc.func.content_get = NULL;
	pDetailsView->itc.func.state_get = _ivug_details_gl_state_get;
	pDetailsView->itc.func.del = _ivug_details_gl_del;

	memset(&pDetailsView->title_itc, 0, sizeof(Elm_Genlist_Item_Class) );

	// Set item class for dialogue group title
	pDetailsView->title_itc.version = ELM_GENLIST_ITEM_CLASS_VERSION;
	pDetailsView->title_itc.item_style = "ivug/grouptitle";
	pDetailsView->title_itc.func.text_get = _ivug_details_gl_label_get_title;
	pDetailsView->title_itc.func.content_get = NULL;
	pDetailsView->title_itc.func.state_get = NULL;
	pDetailsView->title_itc.func.del = NULL;

	memset(&pDetailsView->multiline_icon_itc, 0, sizeof(Elm_Genlist_Item_Class) );

	// Set item class for dialogue group title with icon
	pDetailsView->multiline_icon_itc.version = ELM_GENLIST_ITEM_CLASS_VERSION;
	pDetailsView->multiline_icon_itc.item_style = "ivug/multiline/2text.1icon";
	pDetailsView->multiline_icon_itc.func.text_get = _ivug_details_gl_label_get;
	pDetailsView->multiline_icon_itc.func.content_get = _ivug_details_gl_icon_get_title;
	pDetailsView->multiline_icon_itc.func.state_get = NULL;
	pDetailsView->multiline_icon_itc.func.del = NULL;

	memset(&pDetailsView->multiline_itc, 0, sizeof(Elm_Genlist_Item_Class) );

	pDetailsView->multiline_itc.version = ELM_GENLIST_ITEM_CLASS_VERSION;
	pDetailsView->multiline_itc.item_style = "ivug/multiline/2text";
	pDetailsView->multiline_itc.func.text_get = _ivug_details_gl_label_get;
	pDetailsView->multiline_itc.func.content_get = NULL;
	pDetailsView->multiline_itc.func.state_get = NULL;
	pDetailsView->multiline_itc.func.del = _ivug_details_gl_del;

	return genlist;
}

static void
_ivug_detail_genlist_view_gps_create(Ivug_DetailsView *pDetailsView )
{
	IV_ASSERT(pDetailsView != NULL);

	Evas_Object *genlist = NULL;
	int index = 0;

	Elm_Object_Item *it = NULL;

	ivug_file_list_item *m_TempItem = NULL;

	char *m_ItemName[FILE_EXIF_INFO_NUM] = {0,};

	genlist = pDetailsView->genlist;

	m_ItemName[0] = IDS_LATITUDE;
	m_ItemName[1] = IDS_LONGITUDE;

	for (index = 0; index < FILE_EXIF_INFO_NUM; index++)
	{
		m_TempItem = (ivug_file_list_item *)malloc(sizeof(ivug_file_list_item));
		ivug_retm_if(NULL == m_TempItem, "m_TempItem calloc failed");

		m_TempItem->m_ItemName = strdup(m_ItemName[index]);
		m_TempItem->pDetailsView = pDetailsView;
		it = elm_genlist_item_append(genlist, &pDetailsView->multiline_itc, m_TempItem, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
		elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
	}

}

static void
_ivug_detail_genlist_view_file_view_create(Ivug_DetailsView *pDetailsView)
{
	IV_ASSERT(pDetailsView != NULL);

	Evas_Object *genlist = NULL;
	int index = 0;

	Elm_Object_Item *git = NULL;
	Elm_Object_Item *it = NULL;

	ivug_file_list_item *m_TempItem = NULL;

	genlist = pDetailsView->genlist;

	char *m_ItemName[FILE_DETILES_NUM] = {0,};

	m_ItemName[0] = IDS_NAME;
	m_ItemName[1] = IDS_FORMAT;
	m_ItemName[2] = IDS_DATE_CREATED;
	m_ItemName[3] = IDS_SIZE;
	m_ItemName[4] = IDS_RESOLUTION;
	m_ItemName[5] = IDS_FILE_LOCATION;

	git = elm_genlist_item_append(genlist, &pDetailsView->title_itc, strdup(IDS_DETAILS), NULL, ELM_GENLIST_ITEM_GROUP, NULL, NULL);
	elm_genlist_item_select_mode_set(git, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);

	for (index = 0; index < FILE_DETILES_NUM; index++)
	{
		if(m_ItemName[index] == NULL)
		{
			continue;
		}

		m_TempItem = (ivug_file_list_item *)malloc(sizeof(ivug_file_list_item));
		if(m_TempItem == NULL)
		{
			continue;
		}
		memset(m_TempItem, 0, sizeof(ivug_file_list_item));

		m_TempItem->m_ItemName = strdup(m_ItemName[index]);
		m_TempItem->pDetailsView = pDetailsView;

		if(index == 0)	// for rename icon
		{
			it = elm_genlist_item_append(genlist, &pDetailsView->multiline_icon_itc, m_TempItem, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
		}
		else
		{
			it = elm_genlist_item_append(genlist, &pDetailsView->multiline_itc, m_TempItem, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
		}
		elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
	}
}

static void
_ivug_detail_genlist_view_drm_create(Ivug_DetailsView *pDetailsView)
{
	IV_ASSERT(pDetailsView != NULL);

	Evas_Object *genlist = NULL;
	int index = 0;

	Elm_Object_Item *it = NULL;

	ivug_file_list_item *m_TempItem = NULL;
	char *m_ItemName[FILE_DETILES_NUM] = {0,};

	genlist = pDetailsView->genlist;

	m_ItemName[0] = IDS_VENDOR;
	m_ItemName[1] = IDS_FORWARDING;
	m_ItemName[2] = IDS_AVAILABLE_USES;
	m_ItemName[3] = IDS_TYPE;
	m_ItemName[4] = IDS_VALIDITY;

	for (index = 0; index < FILE_DETILES_NUM; index++)
	{
		if(m_ItemName[index] == NULL)
		{
			continue;
		}

		m_TempItem = (ivug_file_list_item *)malloc(sizeof(ivug_file_list_item));
		if(m_TempItem == NULL)
		{
			continue;
		}
		memset(m_TempItem, 0, sizeof(ivug_file_list_item));

		m_TempItem->m_ItemName = strdup(m_ItemName[index]);
		m_TempItem->pDetailsView = pDetailsView;

		it = elm_genlist_item_append(genlist, &pDetailsView->multiline_itc, m_TempItem, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
		elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
	}

}


Ivug_DetailsView *
ivug_details_view_screen_create(Evas_Object *parent, Media_Data *mdata, ivug_view_by view_by)
{
	ivug_retv_if(!parent, NULL);
	ivug_retv_if(!mdata, NULL);
	ivug_retv_if(!mdata->filepath, NULL);

	char *filepath = mdata->filepath;
	Media_Type stype = mdata->slide_type;

	Ivug_DetailsView *pDetailsView = (Ivug_DetailsView *)calloc(1, sizeof(Ivug_DetailsView));

	if ( pDetailsView == NULL )
	{
		MSG_DETAIL_FATAL("Cannot allocate memory");
		return NULL;
	}

	pDetailsView->mdata = mdata;

	ivug_details_info_set_file_information(&pDetailsView->file_Info, filepath);

	ivug_details_info_set_resolution(&pDetailsView->file_Info, filepath, stype);
	ivug_details_info_set_gps_info(&pDetailsView->file_Info, filepath);

	if(stype == SLIDE_TYPE_STREAMING )		// If remote file
	{
		/* Location: show url */
		ivug_details_info_set_filename(&pDetailsView->file_Info, mdata->fileurl);		// TODO : Check this. how to extract filename from URL????
		ivug_details_info_set_location(&pDetailsView->file_Info, mdata->fileurl);
	}
	else
	{
		ivug_details_info_set_filename(&pDetailsView->file_Info, filepath);
		ivug_details_info_set_location(&pDetailsView->file_Info, filepath);
	}

	if(mdata->bIsDRMContent)
	{
		ivug_details_info_set_drm_info(&pDetailsView->file_Info, filepath);
	}


// Creating GUI
	pDetailsView->evas = evas_object_evas_get(parent);

//layout
	pDetailsView->layout = elm_layout_add(parent);
	elm_layout_file_set(pDetailsView->layout, DETAILS_EDJ_FILE, "details_view");

	if(pDetailsView->layout == NULL)
	{
		free(pDetailsView);
		return NULL;
	}

#define IVUG_DETAILS_BG_ALPHA		200

	pDetailsView->bg = evas_object_rectangle_add(evas_object_evas_get(pDetailsView->layout));
	if (pDetailsView->bg)
	{
		evas_object_size_hint_expand_set(pDetailsView->bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
		evas_object_size_hint_fill_set(pDetailsView->bg, EVAS_HINT_FILL, EVAS_HINT_FILL);
		evas_object_color_set(pDetailsView->bg, IVUG_DEFAULT_BG_COLOR,
				 IVUG_DEFAULT_BG_COLOR, IVUG_DEFAULT_BG_COLOR, IVUG_DETAILS_BG_ALPHA);
		elm_object_part_content_set(pDetailsView->layout, "details_view.swallow.bg",
					   pDetailsView->bg);
	}

	//create genlist
	Evas_Object *genlist = NULL;

	genlist = _ivug_details_view_genlist_create(pDetailsView, pDetailsView->layout);
	pDetailsView->genlist = genlist;

	_ivug_detail_genlist_view_file_view_create(pDetailsView);

// TODO : Should check below routine. why DRM has no GPS info???
	if(mdata->bIsDRMContent == EINA_TRUE)
	{
		_ivug_detail_genlist_view_drm_create(pDetailsView);
	}
	else
	{
		_ivug_detail_genlist_view_gps_create(pDetailsView);
	}

	elm_object_part_content_set(pDetailsView->layout, "details_view.genlist" , pDetailsView->genlist );

	MSG_DETAIL_HIGH("Detail view(0x%08x) created for %s", pDetailsView, filepath);

	return pDetailsView;
}


Evas_Object *
ivug_details_view_object_get(Ivug_DetailsView *pDetailsView)
{
	IV_ASSERT(pDetailsView != NULL);

	return pDetailsView->layout;
}

void
ivug_details_view_destroy(Ivug_DetailsView *pDetailsView)
{
	IV_ASSERT(pDetailsView != NULL);
	MSG_DETAIL_HIGH("Removing Details VIew");

// Layout removed automatically when popping from navi item.
	if(pDetailsView->layout)
	{
		evas_object_del(pDetailsView->layout);
		pDetailsView->layout = NULL;
	}

	_ivug_details_free_file_info(&pDetailsView->file_Info);

	if(pDetailsView)
	{
		free(pDetailsView);
	}

	pDetailsView = NULL;
}