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