Merge "Revert "Fix N_SE-46938 for tz list."" into devel_3.0_main
[platform/framework/native/appfw.git] / src / io / inc / FIo_Channel.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 //
16
17 /**
18  * @file        FIo_Channel.h
19  * @brief       This is the header file for the _Channel class.
20  *
21  * This file contains the declarations of _Channel.
22  */
23
24
25 #ifndef _FIO_INTERNAL_CHANNEL_H_
26 #define _FIO_INTERNAL_CHANNEL_H_
27
28 #include <FBaseResult.h>
29 #include <FBaseString.h>
30 #include <FBaseColArrayList.h>
31 #include <FBaseObject.h>
32 #include "FIo_IChannelServiceEventListener.h"
33
34 namespace Tizen { namespace Io
35 {
36
37 class _ClientChannel;
38 class _ServerChannel;
39 class _IChannelService;
40 class _IChannelRequestEventListener;
41 class _IChannelResponseEventListener;
42
43 /**
44 * @class    _Channel
45 * @brief    This class provides methods to send a request or response to other application.
46 * @since 2.1
47 *
48 */
49 class _Channel
50         : public Tizen::Base::Object
51         , public Tizen::Io::_IChannelServiceEventListener
52 {
53 public:
54
55         _Channel(void);
56
57         virtual ~_Channel(void);
58
59         result Construct(const Tizen::Base::String& channelId, _IChannelService& channelService);
60
61         result SendRequest(const Tizen::Base::String& channelId, const Tizen::Base::Collection::ArrayList& args, RequestId& reqId);
62
63         result SendNullRequest(const Tizen::Base::String& channelId, RequestId& reqId);
64
65         result SendResponse(const Tizen::Base::String& channelId, const Tizen::Base::Collection::ArrayList& args, RequestId reqId);
66
67         result SendNullResponse(const Tizen::Base::String& channelId, RequestId reqId);
68
69         virtual bool OnChannelRequestReceivedN(const Tizen::Base::String& src, const Tizen::Base::String& dest, int requestId, Tizen::Base::Collection::ArrayList* pArgs);
70
71         virtual bool OnChannelResponseReceivedN(const Tizen::Base::String& src, const Tizen::Base::String& dest, int requestId, Tizen::Base::Collection::ArrayList* pArgs);
72
73         void SetChannelRequestEventListener(const _IChannelRequestEventListener& listener);
74
75         void SetChannelResponseEventListener(const _IChannelResponseEventListener& listener);
76
77 private:
78         int GetRequestId(void);
79
80         Tizen::Base::String __channelId;
81         _IChannelService* __pIChannelService;
82         _IChannelResponseEventListener* __pResponseEventListener;
83         _IChannelRequestEventListener* __pRequestEventListener;
84 }; // _Channel
85
86
87 } } // Tizen::Io
88
89 #endif // _FIO_INTERNAL_CHANNEL_