2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0
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.
19 * @file FIo_ChannelCAppStub.h
20 * @brief This is the header file for the _ChannelCAppStub class.
22 * This file contains the declarations of _ChannelCAppStub.
25 #ifndef _FIO_INTERNAL_CHANNEL_CAPP_STUB_H_
26 #define _FIO_INTERNAL_CHANNEL_CAPP_STUB_H_
33 #include <FOspConfig.h>
34 #include <FBaseObject.h>
35 #include <FBaseString.h>
36 #include <FBaseResult.h>
37 #include <FBaseColArrayList.h>
38 #include <FIo_ChannelService.h>
40 namespace Tizen { namespace Base { namespace Runtime
42 class _EventDispatcher;
45 namespace Tizen { namespace Io
48 class _IIpcServerEventListener;
49 class _ChannelServiceStub;
52 * @class _ChannelCAppStub
53 * @brief This class provides methods to handle c-application request messages.
57 class _OSP_EXPORT_ _ChannelCAppStub
58 : public Tizen::Base::Object
62 * This is the default constructor for this class.
65 _ChannelCAppStub(void);
68 * This is the destructor for this class.
71 virtual ~_ChannelCAppStub(void);
73 result Construct(void);
75 void SetChannelService(_ChannelService& service);
77 static bool SendResponse(int requestId, void* pGIOChannel, const Tizen::Base::Collection::ArrayList& args);
80 _ChannelCAppStub(const _ChannelCAppStub& rhs);
82 _ChannelCAppStub& operator =(const _ChannelCAppStub& rhs);
84 static gboolean OnConnectionRequest(GIOChannel* source, GIOCondition condition, gpointer data);
86 static gboolean OnReadMessage(GIOChannel* source, GIOCondition condition, gpointer data);
88 gboolean HandleReceivedMessage(GIOChannel* source, GIOCondition condition, gpointer data);
90 _ChannelService* __pChannelService;
99 struct _ClientInfo* pClientInfo;
100 GIOChannel* pGIOChannel;
110 int clientId; /**< the client id */
111 _ChannelCAppStub* pChannelStub; /**< the pointer to an _ChannelCAppStub */
112 std::vector <struct _ChannelInfo*> channels; /**< the set of channels associated with a client */
113 Tizen::Base::String appId;
114 //Tizen::Base::String appExecutableName;
117 GMainContext* __pGMainContext;
119 GSource* __pConnectGSource;
121 std::map <int, _ClientInfo*> __clients; // pid of client is used for key
123 }; // _ChannelCAppStub
127 #endif // _FIO_INTERNAL_CHANNEL_CAPP_STUB_H_