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