2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef TIZENAPIS_API_EVENT_LAUNCH_SERVICE_H_
18 #define TIZENAPIS_API_EVENT_LAUNCH_SERVICE_H_
22 #include <Commons/IEvent.h>
23 #include <dpl/shared_ptr.h>
24 #include "ApplicationService.h"
25 //#include "ApplicationServiceReply.h"
26 #include "ApplicationServiceData.h"
27 #include <dpl/log/log.h>
31 namespace Application {
33 class EventLaunchService: public WrtDeviceApis::Commons::IEvent<EventLaunchService> {
36 ApplicationServicePtr m_service;
42 static const int APPLICATION_SERVICE_UNKNOWN = 0;
43 static const int APPLICATION_SERVICE_CALLBACK = 1;
44 static const int APPLICATION_SERVICE_REPLY_SUCCESS_CALLBACK = 2;
45 static const int APPLICATION_SERVICE_REPLY_FAIL_CALLBACK = 3;
47 static const int APPLICATION_SERVICE_LAUNCH = 4;
48 static const int APPLICATION_SERVICE_GET_REQUEST = 5;
51 void addServiceData(std::string &key, std::vector<std::string> &value) {
53 ApplicationServiceDataPtr serviceData(new ApplicationServiceData());
54 serviceData->setKey(key);
55 serviceData->setValue(value);
57 m_service->addServiceData(serviceData);
60 LogError("===[WS] create servicedata array");
61 std::vector<ApplicationServiceDataPtr> resultValue;
62 resultValue.push_back(serviceData);
63 LogError("===[WS] set service data array to event.");
64 LogError("===[WS] m_service:"<<m_service);
65 m_service->setServiceDataArray(resultValue);
69 ApplicationServiceReplyPtr reply(new ApplicationServiceReply());
71 //ApplicationServiceDataPtr extraDataArray(new ApplicationServiceData());
72 reply->setServiceDataArray(extraData);
75 //m_reply->addExtraData(extraData);
79 void setService(ApplicationServicePtr &appservice){
80 m_service = appservice;
83 ApplicationServicePtr getService() const{
87 void setCallbackType(int callbacktype){
88 callbackType = callbacktype;
91 int getCallbackType() const{
95 void setEventType(int type){
108 typedef DPL::SharedPtr<EventLaunchService> EventLaunchServicePtr;