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.
19 * @file FIo_MessagePortProxy.h
20 * @brief This is the header file for the _MessagePortProxy class.
22 * This file contains the declarations of _MessagePortProxy.
26 #ifndef _FIO_INTERNAL_MESSAGE_PORT_PROXY_H_
27 #define _FIO_INTERNAL_MESSAGE_PORT_PROXY_H_
31 #include <FBaseResult.h>
32 #include <FBaseObject.h>
33 #include <FBaseString.h>
34 #include <FBaseColHashMap.h>
35 #include <FBaseColHashMapT.h>
36 #include <FAppTypes.h>
38 #include "FIo_IMessagePortListener.h"
40 namespace Tizen { namespace Io
43 class _MessagePortProxy
44 : public Tizen::Base::Object
47 _MessagePortProxy(void);
49 virtual ~_MessagePortProxy(void);
51 virtual result Construct(void);
53 virtual result RegisterMessagePort(const Tizen::Base::String& localPort,
55 const _IMessagePortListener& listener);
57 virtual result RequestRemotePort(const Tizen::App::AppId& remoteAppId,
58 const Tizen::Base::String& remotePort,
61 virtual result SendMessage(const Tizen::App::AppId& remoteAppId,
62 const Tizen::Base::String& remotePort,
64 const Tizen::Base::Collection::HashMap* pMap);
66 virtual result SendMessage(const Tizen::Base::String& localPort,
68 const Tizen::App::AppId& remoteAppId,
69 const Tizen::Base::String& remotePort,
71 const Tizen::Base::Collection::HashMap* pMap);
73 static _MessagePortProxy* GetProxy(void);
75 bundle* ConvertMapToBundleN(const Tizen::Base::Collection::HashMap* pMap, int* pSize);
78 result ConvertToResult(int error);
80 class _StringHashProvider
81 : public Tizen::Base::Collection::IHashCodeProviderT<Tizen::Base::String>
84 virtual int GetHashCode(const Tizen::Base::String& value) const
86 return value.GetHashCode();
91 : public Tizen::Base::Collection::IComparerT<Tizen::Base::String>
94 virtual result Compare(const Tizen::Base::String& string1, const Tizen::Base::String& string2, int& cmp) const
96 cmp = string1.CompareTo(string2);
102 Tizen::App::AppId __appId;
104 Tizen::Base::Collection::HashMapT <Tizen::Base::String, _IMessagePortListener*> __listeners;
105 Tizen::Base::Collection::HashMapT <Tizen::Base::String, _IMessagePortListener*> __trustedListeners;
106 Tizen::Base::Collection::HashMapT <Tizen::Base::String, int> __ids;
107 Tizen::Base::Collection::HashMapT <Tizen::Base::String, int> __trustedIds;
108 }; // _MessagePortProxy
113 #endif // _FIO_INTERNAL_MESSAGE_PORT_PROXY_H_