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