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.
20 * @brief This is the header file for the _Channel class.
22 * This file contains the declarations of _Channel.
26 #ifndef _FIO_INTERNAL_CHANNEL_H_
27 #define _FIO_INTERNAL_CHANNEL_H_
29 #include <FBaseResult.h>
30 #include <FBaseString.h>
31 #include <FBaseColArrayList.h>
32 #include <FBaseObject.h>
33 #include "FIo_IChannelServiceEventListener.h"
35 namespace Tizen { namespace Io
40 class _IChannelService;
41 class _IChannelRequestEventListener;
42 class _IChannelResponseEventListener;
46 * @brief This class provides methods to send a request or response to other application.
51 : public Tizen::Base::Object
52 , public Tizen::Io::_IChannelServiceEventListener
58 virtual ~_Channel(void);
60 result Construct(const Tizen::Base::String& channelId, _IChannelService& channelService);
62 result SendRequest(const Tizen::Base::String& channelId, const Tizen::Base::Collection::ArrayList& args, RequestId& reqId);
64 result SendNullRequest(const Tizen::Base::String& channelId, RequestId& reqId);
66 result SendResponse(const Tizen::Base::String& channelId, const Tizen::Base::Collection::ArrayList& args, RequestId reqId);
68 result SendNullResponse(const Tizen::Base::String& channelId, RequestId reqId);
70 virtual bool OnChannelRequestReceivedN(const Tizen::Base::String& src, const Tizen::Base::String& dest, int requestId, Tizen::Base::Collection::ArrayList* pArgs);
72 virtual bool OnChannelResponseReceivedN(const Tizen::Base::String& src, const Tizen::Base::String& dest, int requestId, Tizen::Base::Collection::ArrayList* pArgs);
74 void SetChannelRequestEventListener(const _IChannelRequestEventListener& listener);
76 void SetChannelResponseEventListener(const _IChannelResponseEventListener& listener);
79 int GetRequestId(void);
81 Tizen::Base::String __channelId;
82 _IChannelService* __pIChannelService;
83 _IChannelResponseEventListener* __pResponseEventListener;
84 _IChannelRequestEventListener* __pRequestEventListener;
90 #endif // _FIO_INTERNAL_CHANNEL_