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 "ApplicationServiceRequest.h"
25 #include "ApplicationServiceReply.h"
26 #include "ApplicationServiceExtraData.h"
30 namespace Application {
32 class EventLaunchService: public WrtDeviceApis::Commons::IEvent<EventLaunchService> {
35 ApplicationServiceRequestPtr m_request;
36 ApplicationServiceReplyPtr m_reply;
41 static const int APPLICATION_SERVICE_UNKNOWN = 0;
42 static const int APPLICATION_SERVICE_CALLBACK = 1;
43 static const int APPLICATION_SERVICE_REPLY_SUCCESS_CALLBACK = 2;
44 static const int APPLICATION_SERVICE_REPLY_FAIL_CALLBACK = 3;
45 static const int APPLICATION_SERVICE_REPLY_CANCEL_CALLBACK = 4;
47 void addExtraDataToReply(std::string &key, std::string &value){
49 ApplicationServiceExtraDataPtr extraData(new ApplicationServiceExtraData());
50 extraData->setKey(key);
51 extraData->setValue(value);
54 ApplicationServiceReplyPtr reply(new ApplicationServiceReply());
56 ApplicationServiceExtraDataArrayPtr extraDataArray(new ApplicationServiceExtraDataArray());
57 reply->setExtraDataArray(extraDataArray);
58 setServiceReply(reply);
60 m_reply->addExtraData(extraData);
64 void setServiceRequest(ApplicationServiceRequestPtr &appservice){
65 m_request = appservice;
68 ApplicationServiceRequestPtr getServiceRequest() const{
72 void setServiceReply(ApplicationServiceReplyPtr &serviceReply){
73 m_reply = serviceReply;
75 ApplicationServiceReplyPtr getServiceReply() const{
78 void setCallbackType(int callbacktype){
79 callbackType = callbacktype;
81 int getCallbackType() const{
89 typedef DPL::SharedPtr<EventLaunchService> EventLaunchServicePtr;