Merge "Revert "Fix N_SE-46938 for tz list."" into devel_3.0_main
[platform/framework/native/appfw.git] / src / io / inc / FIo_IIpcServerEventListener.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 /**
18  * @file        FIo_IIpcServerEventListener.h
19  * @brief       This is the header file for the _IIpcServerEventListener class.
20  *
21  * This file contains the declarations of _IIpcServerEventListener.
22  */
23
24 #include <FOspConfig.h>
25 #include <FBaseRtIEventListener.h>
26
27 #ifndef _FIO_INTERNAL_IIPC_SERVER_EVENT_LISTENER_H_
28 #define _FIO_INTERNAL_IIPC_SERVER_EVENT_LISTENER_H_
29
30 namespace IPC { class Message; }
31
32 namespace Tizen { namespace Io
33 {
34
35 class _IpcServer;
36 /**
37  * @interface _IIpcServerEventListener
38  * @brief     This interface provides listener method for the request event from an IPC client.
39  */
40 class _OSP_EXPORT_ _IIpcServerEventListener
41         : virtual Tizen::Base::Runtime::IEventListener
42 {
43 public:
44         /**
45          * This is the destructor for this class.
46          */
47         virtual ~_IIpcServerEventListener(void);
48
49         /**
50          * Called when an IPC server started.
51          *
52          * @param[in] server The IPC server
53          */
54         virtual void OnIpcServerStarted(const _IpcServer& server) = 0;
55
56         /**
57          * Called when an IPC server stopped.
58          *
59          * @param[in] server The IPC server
60          */
61         virtual void OnIpcServerStopped(const _IpcServer& server) = 0;
62
63         /**
64          * Called when an IPC client connected.
65          *
66          * @param[in] server The IPC server
67          */
68         virtual void OnIpcClientConnected(const _IpcServer& server, int clientId) = 0;
69
70         /**
71          * Called when an IPC client disconnected.
72          *
73          * @param[in] server The IPC server
74          * @param[in] clientId The id of the connected IPC client
75          */
76         virtual void OnIpcClientDisconnected(const _IpcServer& server, int clientId) = 0;
77
78         /**
79          * Called when an IPC request message received.
80          *
81          * @code
82          *
83          * bool
84          * CalculatorStub::OnSumRequested(int a, int b, int* pC)
85          * {
86          *    *pC = a + b;
87          *    return true;
88          * }
89          *
90          * bool
91          * CalculatorStub::OnMultiplyRequested(int a, int b, int* pC)
92          * {
93          *    *pC = a * b;
94          *    return true;
95          * }
96          *
97          * bool
98          * CalculatorStub::OnIpcRequestReceived(_IpcServer& server, const IPC::Message& message)
99          * {
100          *    IPC_BEGIN_MESSAGE_MAP(CalculatorStub, message)
101          *         IPC_MESSAGE_HANDLER(My_sum, OnSumRequested, &server)
102          *         IPC_MESSAGE_HANDLER(My_mul, OnMultiplyRequested, &server)
103          *    IPC_END_MESSAGE_MAP()
104          *
105          *    return true;
106          * }
107          *
108          * @endcode
109          * @param[in] server    The IPC server
110          * @param[in] message   The received message
111          */
112         virtual void OnIpcRequestReceived(_IpcServer& server, const IPC::Message& message) = 0;
113 }; // _IIpcServerEventListener
114
115
116 } } // Tizen::Io
117
118 #endif //_FIO_IIPCSERVEREVENTLISTENER_H_