Update the spec file
[platform/framework/native/channel-service.git] / inc / FIo_MessagePortStub.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_MessagePortStub.h
20  * @brief       This is the header file for the _MessagePortStub class.
21  *
22  * This file contains the declarations of _MessagePortStub.
23  */
24
25
26 #ifndef _FIO_INTERNAL_MESSAGE_PORT_STUB_H_
27 #define _FIO_INTERNAL_MESSAGE_PORT_STUB_H_
28
29 #include <message-port-data-types.h>
30
31 #include <FBaseResult.h>
32 #include <FBaseObject.h>
33 #include <FBaseColArrayList.h>
34 #include <FBaseColHashMap.h>
35 #include <FAppTypes.h>
36
37 #include "IpcServer.h"
38 #include "IIpcServerEventListener.h"
39
40 namespace IPC
41 {
42 class Message;
43 }
44
45 class _MessagePortService;
46
47 class _MessagePortStub
48         : public IIpcServerEventListener
49 {
50 public:
51         _MessagePortStub(void);
52         virtual ~_MessagePortStub(void);
53
54         virtual result Construct(void);
55
56         result SendMessage(int clientId, const BundleBuffer& buffer);
57
58         void SetMessagePortService(_MessagePortService& service);
59
60 private:
61         bool OnRegisterMessagePort(const BundleBuffer& buffer, int* pResult);
62
63         bool OnCheckRemotePort(const BundleBuffer& buffer, int* pResult);
64
65         bool OnSendMessage(const BundleBuffer& buffer, int* pResult);
66
67         virtual void OnIpcRequestReceived(IpcServer& server, const IPC::Message& message);
68
69         virtual void OnIpcServerStarted(const IpcServer& server);
70
71         virtual void OnIpcServerStopped(const IpcServer& server);
72
73         virtual void OnIpcClientConnected(const IpcServer& server, int clientId);
74
75         virtual void OnIpcClientDisconnected(const IpcServer& server, int clientId);
76
77         _MessagePortStub(const _MessagePortStub& value);
78         _MessagePortStub& operator = (const _MessagePortStub& value);
79
80 private:
81         IpcServer* __pIpcServer;
82         _MessagePortService* __pService;
83
84 }; // _MessagePortStub
85
86 //} } // Tizen::Io
87
88 #endif // _FIO_INTERNAL_MESSAGE_PORT_STUB_H_
89