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.
18 * @file FIo_MessagePortProxy.h
19 * @brief This is the header file for the _MessagePortProxy class.
21 * This file contains the declarations of _MessagePortProxy.
25 #ifndef _FIO_INTERNAL_MESSAGE_PORT_PROXY_H_
26 #define _FIO_INTERNAL_MESSAGE_PORT_PROXY_H_
30 #include <FBaseResult.h>
31 #include <FBaseObject.h>
32 #include <FBaseString.h>
33 #include <FBaseColHashMap.h>
34 #include <FBaseColHashMapT.h>
35 #include <FAppTypes.h>
37 #include "FIo_IMessagePortListener.h"
39 namespace Tizen { namespace Io
42 class _MessagePortProxy
43 : public Tizen::Base::Object
46 _MessagePortProxy(void);
48 virtual ~_MessagePortProxy(void);
50 virtual result Construct(void);
52 virtual result RegisterMessagePort(const Tizen::Base::String& localPort,
54 const _IMessagePortListener& listener);
56 virtual result RequestRemotePort(const Tizen::App::AppId& remoteAppId,
57 const Tizen::Base::String& remotePort,
60 virtual result SendMessage(const Tizen::App::AppId& remoteAppId,
61 const Tizen::Base::String& remotePort,
63 const Tizen::Base::Collection::HashMap* pMap);
65 virtual result SendMessage(const Tizen::Base::String& localPort,
67 const Tizen::App::AppId& remoteAppId,
68 const Tizen::Base::String& remotePort,
70 const Tizen::Base::Collection::HashMap* pMap);
72 static _MessagePortProxy* GetProxy(void);
74 bundle* ConvertMapToBundleN(const Tizen::Base::Collection::HashMap* pMap, int* pSize);
77 result ConvertToResult(int error);
79 class _StringHashProvider
80 : public Tizen::Base::Collection::IHashCodeProviderT<Tizen::Base::String>
83 virtual int GetHashCode(const Tizen::Base::String& value) const
85 return value.GetHashCode();
90 : public Tizen::Base::Collection::IComparerT<Tizen::Base::String>
93 virtual result Compare(const Tizen::Base::String& string1, const Tizen::Base::String& string2, int& cmp) const
95 cmp = string1.CompareTo(string2);
101 Tizen::App::AppId __appId;
103 Tizen::Base::Collection::HashMapT <Tizen::Base::String, _IMessagePortListener*> __listeners;
104 Tizen::Base::Collection::HashMapT <Tizen::Base::String, _IMessagePortListener*> __trustedListeners;
105 Tizen::Base::Collection::HashMapT <Tizen::Base::String, int> __ids;
106 Tizen::Base::Collection::HashMapT <Tizen::Base::String, int> __trustedIds;
107 }; // _MessagePortProxy
112 #endif // _FIO_INTERNAL_MESSAGE_PORT_PROXY_H_