summaryrefslogtreecommitdiff
path: root/main/src/control/ivug-ext-ug.c
blob: e3c5398a4ee23d25c6988c7a283d3c5cb46d05a0 (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
/*
 * 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 "ivug-ext-ug.h"
#include "ivug-data.h"
#include "ivug-popup.h"

#include <ui-gadget.h>
#include <aul.h>
#include <appsvc.h>
#include <Ecore_X.h>		// UG_INIT_EFL

//define
#define VIDEOPLAYER_PKG_NAME 	"org.tizen.video-player"
#define BLUETOOTH_PKG_NAME 		"org.tizen.bluetooth"

#define MIME_TYPE_LEN			255

bool
ivug_ext_aul_launch(Evas_Object *parent,  enum IVUG_EXT_AUL_TYPE type, const char *filepath, void *data)
{
	if(!filepath)
	{
		MSG_UTIL_ERROR("file path is NULL");
		return false;
	}
	MSG_IMAGEVIEW_HIGH("Creating AUL. type=%d file path =%s", type, filepath);

	bundle* b = bundle_create();
	char mime_type[MIME_TYPE_LEN] = {0,};
	aul_get_mime_from_file(filepath, mime_type, sizeof(mime_type));
	MSG_IMAGEVIEW_HIGH("mime type=%s", mime_type);

	IV_ASSERT(b!= NULL);
	switch( type )
	{
		case IVUG_EXT_AUL_VIDEOPLAYER:
			bundle_add( b, "path", filepath);
			bundle_add( b, "launching_application", "image_viewer");
			aul_launch_app(VIDEOPLAYER_PKG_NAME, b);
		break;

		case IVUG_EXT_AUL_SIMPLE_VIDEOPLAYER:
			bundle_add( b, "path", filepath);
			bundle_add( b, "launching_application", "light_play_view");
// Camera -> Image Viewer -> Video player, In this case, launching_application bundle's value should be "light_play_view"

			aul_launch_app(VIDEOPLAYER_PKG_NAME, b);
		break;

		default:
			bundle_free(b);
			return false;
	}

	bundle_free(b);

	return true;
}