tizen 2.3.1 release
[framework/web/mobile/wrt-plugins-tizen.git] / src / MessagePort / IRemoteMessagePort.h
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 /**
19  * @file        IRemoteMessagePort.h
20  * @version     0.1
21  * @brief
22  */
23
24 #ifndef _API_MESSAGE_PORT_IREMOTE_MESSAGE_PORT_H_
25 #define _API_MESSAGE_PORT_IREMOTE_MESSAGE_PORT_H_
26
27 #include <Commons/EventReceiver.h>
28 #include "EventRemoteMessagePortSendMessage.h"
29
30 namespace DeviceAPI {
31 namespace MessagePort {
32
33 class IRemoteMessagePort;
34 typedef std::shared_ptr<IRemoteMessagePort> RemoteMessagePortPtr;
35
36 class IRemoteMessagePort :
37         public WrtDeviceApis::Commons::EventRequestReceiver< EventRemoteMessagePortSendMessage >
38 {
39 public:
40     IRemoteMessagePort();
41     virtual ~IRemoteMessagePort();
42
43     virtual void sendMessage(const EventRemoteMessagePortSendMessagePtr &event);
44
45     virtual std::string getMessagePortName() const = 0;
46     virtual void        setMessagePortName(const std::string &value) = 0;
47     virtual std::string getAppId() const = 0;
48     virtual void        setAppId(const std::string &value) = 0;
49     virtual bool        getIsTrusted() const = 0;
50     virtual void        setIsTrusted(const bool &value) = 0;
51
52 protected:
53     virtual void    OnRequestReceived(const EventRemoteMessagePortSendMessagePtr &event) = 0;
54 };
55
56 } // MessagePort
57 } // DeviceAPI
58
59 #endif // _API_MESSAGE_PORT_IREMOTE_MESSAGE_PORT_H_