2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
19 * @brief This is the header file for the _Channel class.
21 * This file contains the declarations of _Channel.
25 #ifndef _FIO_INTERNAL_CHANNEL_H_
26 #define _FIO_INTERNAL_CHANNEL_H_
28 #include <FBaseResult.h>
29 #include <FBaseString.h>
30 #include <FBaseColArrayList.h>
31 #include <FBaseObject.h>
32 #include "FIo_IChannelServiceEventListener.h"
34 namespace Tizen { namespace Io
39 class _IChannelService;
40 class _IChannelRequestEventListener;
41 class _IChannelResponseEventListener;
45 * @brief This class provides methods to send a request or response to other application.
50 : public Tizen::Base::Object
51 , public Tizen::Io::_IChannelServiceEventListener
57 virtual ~_Channel(void);
59 result Construct(const Tizen::Base::String& channelId, _IChannelService& channelService);
61 result SendRequest(const Tizen::Base::String& channelId, const Tizen::Base::Collection::ArrayList& args, RequestId& reqId);
63 result SendNullRequest(const Tizen::Base::String& channelId, RequestId& reqId);
65 result SendResponse(const Tizen::Base::String& channelId, const Tizen::Base::Collection::ArrayList& args, RequestId reqId);
67 result SendNullResponse(const Tizen::Base::String& channelId, RequestId reqId);
69 virtual bool OnChannelRequestReceivedN(const Tizen::Base::String& src, const Tizen::Base::String& dest, int requestId, Tizen::Base::Collection::ArrayList* pArgs);
71 virtual bool OnChannelResponseReceivedN(const Tizen::Base::String& src, const Tizen::Base::String& dest, int requestId, Tizen::Base::Collection::ArrayList* pArgs);
73 void SetChannelRequestEventListener(const _IChannelRequestEventListener& listener);
75 void SetChannelResponseEventListener(const _IChannelResponseEventListener& listener);
78 int GetRequestId(void);
80 Tizen::Base::String __channelId;
81 _IChannelService* __pIChannelService;
82 _IChannelResponseEventListener* __pResponseEventListener;
83 _IChannelRequestEventListener* __pRequestEventListener;
89 #endif // _FIO_INTERNAL_CHANNEL_