sync with tizen_2.0
[platform/framework/native/appfw.git] / inc / FIoIMessagePortListener.h
1 //
2 // Open Service Platform
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  * @file                FIoIMessagePortListener.h
19  * @brief               This is the header file for the %IMessagePortListener interface.
20  *
21  * This header file contains declarations of the %IMessagePortListener interface.
22  */
23
24 #ifndef _FIO_IMESSAGE_PORT_LISTENER_H_
25 #define _FIO_IMESSAGE_PORT_LISTENER_H_
26
27 #include <FBaseTypes.h>
28 #include <FBaseString.h>
29 #include <FBaseColIMap.h>
30 #include <FBaseRtIEventListener.h>
31
32 namespace Tizen { namespace Io
33 {
34
35 class RemoteMessagePort;
36
37 /**
38 * @interface IMessagePortListener
39 * @brief    This interface provides event handlers to receive messages from other applications.
40 *
41 * @since    2.0
42 *
43 * The %IMessagePortListener interface provides event handlers to receive messages from other applications.
44 */
45 class _OSP_EXPORT_ IMessagePortListener
46         : virtual public Tizen::Base::Runtime::IEventListener
47 {
48 public:
49         /**
50          * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
51          *
52          * @since   2.0
53          */
54         virtual ~IMessagePortListener(void) {}
55
56         /**
57          * Called when a message is received from a remote application. @n
58          * This method will be called only if the remote application uses bidirectional communication method - RemoteMessagePort::SendMessage(const LocalMessagePort* pLocalMessagePort, const Tizen::Base::Collection::IMap* pMessagee).
59          * The RemoteMessagePort instance can be used to send a response message to the message port of the remote application.
60          *
61          * @since        2.0
62          *
63          * @param[in] pRemoteMessagePort        The message port of a remote application which has sent this message
64          * @param[in] pMessage                          A pointer to an argument map of key (String) and value (String or ByteBuffer) pair
65          */
66         virtual void OnMessageReceivedN(RemoteMessagePort* pRemoteMessagePort, Tizen::Base::Collection::IMap* pMessage) {}
67
68         /**
69          * Called when a message is received from a remote application. @n
70          * This method will be called only if the remote application uses unidirectional communication method - RemoteMessagePort::SendMessage(const Tizen::Base::Collection::IMap* pMessage).
71          *
72          * @since        2.0
73          *
74          * @param[in] pMessage                          A pointer to an argument map of key (String) and value (String or ByteBuffer) pair
75          */
76         virtual void OnMessageReceivedN(Tizen::Base::Collection::IMap* pMessage) {}
77
78 protected:
79         //
80         // This method is for internal use only.
81         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
82         //
83         // This method is reserved and may change its name at any time without prior notice.
84         //
85         // @since           2.0
86         //
87         virtual void IMessagePortListener_Reserved1(void) {}
88
89         //
90         // This method is for internal use only.
91         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
92         //
93         // This method is reserved and may change its name at any time without prior notice.
94         //
95         // @since           2.0
96         //
97         virtual void IMessagePortListener_Reserved2(void) {}
98
99         //
100         // This method is for internal use only.
101         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
102         //
103         // This method is reserved and may change its name at any time without prior notice.
104         //
105         // @since           2.0
106         //
107         virtual void IMessagePortListener_Reserved3(void) {}
108
109         //
110         // This method is for internal use only.
111         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
112         //
113         // This method is reserved and may change its name at any time without prior notice.
114         //
115         // @since           2.0
116         //
117         virtual void IMessagePortListener_Reserved4(void) {}
118 }; // IMessagePortListener
119
120 } } // Tizen::Io
121
122 #endif // _FIO_IMESSAGE_PORT_LISTENER_H_