2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file EventLocalMessagePortListener.h
25 #ifndef _API_MESSAGE_PORT_EVENT_LOCAL_MESSAGE_PORT_LISTENER_H_
26 #define _API_MESSAGE_PORT_EVENT_LOCAL_MESSAGE_PORT_LISTENER_H_
29 #include <dpl/shared_ptr.h>
30 #include <Commons/IEvent.h>
31 #include <Commons/ListenerEvent.h>
32 #include <Commons/ListenerEventEmitter.h>
33 #include "IRemoteMessagePort.h"
34 #include "MessagePortDataItem.h"
37 namespace MessagePort {
39 class IRemoteMessagePort;
40 typedef DPL::SharedPtr<IRemoteMessagePort> RemoteMessagePortPtr;
42 class EventLocalMessagePortListener : public WrtDeviceApis::Commons::ListenerEvent<EventLocalMessagePortListener>
46 MessagePortDataItemMapPtr m_data;
47 RemoteMessagePortPtr m_remoteMessagePort;
50 bool m_remoteMessagePortIsSet;
53 EventLocalMessagePortListener() :
55 m_remoteMessagePortIsSet(false)
59 void setData(const MessagePortDataItemMapPtr &data)
65 MessagePortDataItemMapPtr getData() const
70 bool getDataIsSet() const
75 void setRemoteMessagePort(const RemoteMessagePortPtr &remoteMessagePort)
77 m_remoteMessagePort = remoteMessagePort;
78 m_remoteMessagePortIsSet = true;
81 RemoteMessagePortPtr getRemoteMessagePort() const
83 return m_remoteMessagePort;
86 bool getRemoteMessagePortIsSet() const
88 return m_remoteMessagePortIsSet;
91 typedef DPL::SharedPtr<EventLocalMessagePortListener> EventLocalMessagePortListenerPtr;
93 typedef WrtDeviceApis::Commons::ListenerEventEmitter<EventLocalMessagePortListener> EventLocalMessagePortListenerEmitter;
94 typedef DPL::SharedPtr<EventLocalMessagePortListenerEmitter> EventLocalMessagePortListenerEmitterPtr;
99 #endif // _API_MESSAGE_PORT_EVENT_LOCAL_MESSAGE_PORT_LISTENER_H_