Beta merge 2
[profile/ivi/wrt-plugins-tizen.git] / src / platform / Tizen / Mediacontent / MediacontentManager.cpp
1 /*
2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
3 *
4 * Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
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
18 #include <algorithm>
19 #include <dpl/log/log.h>
20 #include <CommonsJavaScript/Converter.h>
21
22 #include <vector>
23 #include "MediacontentManager.h"
24
25
26 using namespace TizenApis::Api::Mediacontent;
27 using namespace WrtDeviceApis::Commons;
28
29
30 namespace TizenApis {
31 namespace Platform {
32 namespace Mediacontent {
33
34
35 MediacontentManager::MediacontentManager()
36 {
37     LogDebug("entered");
38 }
39
40 MediacontentManager::~MediacontentManager()
41 {
42
43 }
44
45 void MediacontentManager::OnRequestReceived(const IEventGetMediacontentPtr &event)
46 {
47         LogDebug( "OnRequestReceived::entered");
48     IMediacontentPtr newMediacontent(new Mediacontent());
49     Try
50     {
51                 LogDebug( "got Mediacontent \n");
52         event->setMediacontent(newMediacontent);
53                 event->setResult(true);
54     }
55     Catch(Exception)
56     {
57         LogError("error occuered during obtaining data");
58         event->setResult(false);
59     }
60     event->setCancelAllowed(true);
61 }
62
63 }
64 }
65 }