Update a service name
[platform/framework/native/channel-service.git] / inc / FIo_ChannelServiceStub.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_ChannelServiceStub.h
20  * @brief       This is the header file for the _ChannelServiceStub class.
21  *
22  * This file contains the declarations of _ChannelServiceStub.
23  */
24
25
26 #ifndef _FIO_INTERNAL_CHANNEL_SERVICE_STUB_H_
27 #define _FIO_INTERNAL_CHANNEL_SERVICE_STUB_H_
28
29 #include <FOspConfig.h>
30 #include <FBaseResult.h>
31 #include <FBaseObject.h>
32 #include <FBaseColArrayList.h>
33 #include <FBaseRt_ITask.h>
34 #include "FIo_IIpcServerEventListener.h"
35 #include "FIo_IChannelServiceStub.h"
36
37 namespace IPC
38 {
39 class Message;
40 }
41
42 namespace Tizen { namespace Io
43 {
44
45 class _IpcServer;
46 class _ChannelService;
47
48 class _OSP_EXPORT_ _ChannelServiceStub
49         : public _IIpcServerEventListener
50         , public _IChannelServiceStub
51         , public Tizen::Base::Object
52 {
53 public:
54         _ChannelServiceStub(void);
55
56         virtual ~_ChannelServiceStub(void);
57
58         virtual result Construct(void);
59
60         // _IChannelServiceStub
61         virtual result SendRequest(int clientId, const Tizen::Base::String& src,
62                                                            const Tizen::Base::String& dest,
63                                                            const Tizen::Base::Collection::ArrayList& args,
64                                                            int requestId);
65
66         virtual result SendNullRequest(int clientId, const Tizen::Base::String& src,
67                                                            const Tizen::Base::String& dest,
68                                                            int requestId);
69
70         virtual result SendResponse(int clientId, const Tizen::Base::String& src,
71                                                                 const Tizen::Base::String& dest,
72                                                                 const Tizen::Base::Collection::ArrayList& args,
73                                                                 int requestId);
74
75         virtual result SendNullResponse(int clientId, const Tizen::Base::String& src,
76                                                                 const Tizen::Base::String& dest,
77                                                                 int requestId);
78
79         virtual void SetChannelService(_ChannelService& service);
80
81
82 private:
83         bool OnRegisterChannelMessage(const Tizen::Base::String& appId, int* pResult);
84
85         bool OnSendRequestMessage(const Tizen::Base::String& src,
86                                                           const Tizen::Base::String& dest,
87                                                           const Tizen::Base::Collection::ArrayList& args,
88                                                           int requestId,
89                                                           int* pResult);
90
91         bool OnSendNullRequestMessage(const Tizen::Base::String& src,
92                                                           const Tizen::Base::String& dest,
93                                                           int requestId,
94                                                           int* pResult);
95
96         bool OnSendResponseMessage(const Tizen::Base::String& src,
97                                                            const Tizen::Base::String& dest,
98                                                            const Tizen::Base::Collection::ArrayList& args,
99                                                            int requestId,
100                                                            int* pResult);
101
102         bool OnSendNullResponseMessage(const Tizen::Base::String& src,
103                                                            const Tizen::Base::String& dest,
104                                                            int requestId,
105                                                            int* pResult);
106
107         virtual void OnIpcRequestReceived(_IpcServer& server, const IPC::Message& message);
108
109         virtual void OnIpcServerStarted(const _IpcServer& server);
110
111         virtual void OnIpcServerStopped(const _IpcServer& server);
112
113         virtual void OnIpcClientConnected(const _IpcServer& server, int clientId);
114
115         virtual void OnIpcClientDisconnected(const _IpcServer& server, int clientId);
116
117         _ChannelServiceStub(const _ChannelServiceStub& value);
118         _ChannelServiceStub& operator = (const _ChannelServiceStub& value);
119 private:
120         _IpcServer* __pIpcServer;
121         _ChannelService* __pChannelService;
122
123 }; // _ChannelServiceStub
124
125 } } // Tizen::Io
126
127 #endif // _FIO_INTERNAL_CHANNEL_SERVICE_STUB_H_
128