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.
18 * @file FIoMessagePortManager.h
19 * @brief This is the header file for the %MessagePortManager class.
21 * This header file contains declarations of the %MessagePortManager class.
23 #ifndef _FIO_MESSAGE_PORT_MANAGER_H_
24 #define _FIO_MESSAGE_PORT_MANAGER_H_
26 #include <FBaseResult.h>
27 #include <FBaseObject.h>
28 #include <FBaseDataType.h>
29 #include <FIoLocalMessagePort.h>
30 #include <FIoRemoteMessagePort.h>
31 #include <FAppTypes.h>
33 namespace Tizen { namespace Io
37 * @class MessagePortManager
38 * @brief This class provides methods for managing message ports.
42 * @final This class is not intended for extension.
44 * The %MessagePortManager class provides methods for managing message ports.
46 * For more information on the class features,
47 * see <a href="../org.tizen.native.appprogramming/html/guide/io/messageport.htm">Message Port Communication</a>.
49 * @see Tizen::Io::LocalMessagePort
50 * @see Tizen::Io::RemoteMessagePort
53 class _OSP_EXPORT_ MessagePortManager
57 * Requests for a LocalMessagePort instance with the specified message port name. @n
58 * This method returns the same %LocalMessagePort instance if it has already been called with the same message port name. @n
62 * @return A pointer to the LocalMessagePort instance, @n
63 * else @c null if it fails
64 * @param[in] localMessagePortName The name of a local message port
65 * @exception E_SUCCESS The method is successful.
66 * @exception E_INVALID_ARG The @c localMessagePortName is empty.
67 * @exception E_SYSTEM The method has failed due to a severe system error.
68 * @remarks It is not recommended to use the message port names that start with "http://tizen.org/messageport". @c E_INVALID_ARG may be returned because they are reserved by platform.
69 * @remarks The specific error code can be accessed using the GetLastResult() method.
71 static LocalMessagePort* RequestLocalMessagePort(const Tizen::Base::String& localMessagePortName);
74 * Requests the RemoteMessagePort instance with the specified remote application ID and message port name. @n
75 * This method returns the same %RemoteMessagePort instance if it has already been called with the same remote application ID and message port name.
79 * @return A pointer to the RemoteMessagePort instance, @n
80 * else @c null if it fails
81 * @param[in] remoteAppId The remote application ID
82 * @param[in] remoteMessagePortName The remote message port name
83 * @exception E_SUCCESS The method is successful.
84 * @exception E_INVALID_ARG The remote application ID or the remote message port name is empty.
85 * @exception E_OBJ_NOT_FOUND The message port of the target application is not found.
86 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
87 * @remarks The specific error code can be accessed using the GetLastResult() method.
89 static RemoteMessagePort* RequestRemoteMessagePort(const Tizen::App::AppId& remoteAppId, const Tizen::Base::String& remoteMessagePortName);
92 * Requests for a trusted LocalMessagePort instance with the specified message port name. @n
93 * This method returns the same %LocalMessagePort instance if it has already been called with the same message port name. @n
94 * Communications over a trusted message port is allowed only if both the applications are signed with a certificate that is uniquely assigned to the developer.
98 * @return A pointer to the trusted LocalMessagePort instance, @n
99 * else @c null if it fails
100 * @param[in] localMessagePortName The name of a local message port
101 * @exception E_SUCCESS The method is successful.
102 * @exception E_INVALID_ARG The @c localMessagePortName is empty.
103 * @exception E_SYSTEM The method has failed due to a severe system error.
104 * @remarks It is not recommended to use the message port names that start with "http://tizen.org/messageport". @c E_INVALID_ARG may be returned because they are reserved by platform.
105 * @remarks The specific error code can be accessed using the GetLastResult() method.
107 static LocalMessagePort* RequestTrustedLocalMessagePort(const Tizen::Base::String& localMessagePortName);
110 * Requests the trusted RemoteMessagePort instance with the specified message port name. @n
111 * This method returns the same %RemoteMessagePort instance if it has already been called with the same remote application ID and message port name. @n
112 * This message port allows communications only if the applications are signed with the same certificate which is uniquely assigned to the developer.
116 * @return A pointer to the trusted RemoteMessagePort instance, @n
117 * else @c null if it fails
118 * @param[in] remoteAppId The remote application ID
119 * @param[in] remoteMessagePortName The name of a remote message port
120 * @exception E_SUCCESS The method is successful.
121 * @exception E_INVALID_ARG Either @c remoteAppId or @c remoteMessagePortName is empty.
122 * @exception E_OBJ_NOT_FOUND The message port of the target application is not found.
123 * @exception E_CERTIFICATE_VERIFICATION_FAILED The target application is not signed with the same certificate.
124 * @exception E_SYSTEM The method has failed due to a severe system error.
125 * @remarks The specific error code can be accessed using the GetLastResult() method.
127 static RemoteMessagePort* RequestTrustedRemoteMessagePort(const Tizen::App::AppId& remoteAppId, const Tizen::Base::String& remoteMessagePortName);
131 * This default constructor is intentionally declared as private because this class cannot be constructed.
133 MessagePortManager(void);
136 * This destructor is intentionally declared as private because this class cannot be constructed.
138 virtual ~MessagePortManager(void);
141 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
143 MessagePortManager(const MessagePortManager& messagePortManager);
146 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
148 MessagePortManager& operator =(const MessagePortManager& messagePortManager);
150 }; // MessagePortManager
154 #endif //_FIO_MESSAGE_PORT_MANAGER_H_