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.
17 * @file FIoMessagePortManager.h
18 * @brief This is the header file for the %MessagePortManager class.
20 * This header file contains declarations of the %MessagePortManager class.
22 #ifndef _FIO_MESSAGE_PORT_MANAGER_H_
23 #define _FIO_MESSAGE_PORT_MANAGER_H_
25 #include <FBaseResult.h>
26 #include <FBaseObject.h>
27 #include <FBaseDataType.h>
28 #include <FIoLocalMessagePort.h>
29 #include <FIoRemoteMessagePort.h>
30 #include <FAppTypes.h>
32 namespace Tizen { namespace Io
36 * @class MessagePortManager
37 * @brief This class provides methods for managing message ports.
41 * @final This class is not intended for extension.
43 * The %MessagePortManager class provides methods for managing message ports.
45 * For more information on the class features,
46 * see <a href="../org.tizen.native.appprogramming/html/guide/io/messageport.htm">Message Port Communication</a>.
48 * @see Tizen::Io::LocalMessagePort
49 * @see Tizen::Io::RemoteMessagePort
52 class _OSP_EXPORT_ MessagePortManager
56 * Requests for a LocalMessagePort instance with the specified message port name. @n
57 * This method returns the same %LocalMessagePort instance if it has already been called with the same message port name. @n
61 * @return A pointer to the LocalMessagePort instance, @n
62 * else @c null if it fails
63 * @param[in] localMessagePortName The name of a local message port
64 * @exception E_SUCCESS The method is successful.
65 * @exception E_INVALID_ARG The @c localMessagePortName is empty.
66 * @exception E_SYSTEM The method has failed due to a severe system error.
67 * @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.
68 * @remarks The specific error code can be accessed using the GetLastResult() method.
70 static LocalMessagePort* RequestLocalMessagePort(const Tizen::Base::String& localMessagePortName);
73 * Requests the RemoteMessagePort instance with the specified remote application ID and message port name. @n
74 * This method returns the same %RemoteMessagePort instance if it has already been called with the same remote application ID and message port name.
78 * @return A pointer to the RemoteMessagePort instance, @n
79 * else @c null if it fails
80 * @param[in] remoteAppId The remote application ID
81 * @param[in] remoteMessagePortName The remote message port name
82 * @exception E_SUCCESS The method is successful.
83 * @exception E_INVALID_ARG The remote application ID or the remote message port name is empty.
84 * @exception E_OBJ_NOT_FOUND The message port of the target application is not found.
85 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
86 * @remarks The specific error code can be accessed using the GetLastResult() method.
88 static RemoteMessagePort* RequestRemoteMessagePort(const Tizen::App::AppId& remoteAppId, const Tizen::Base::String& remoteMessagePortName);
91 * Requests for a trusted LocalMessagePort instance with the specified message port name. @n
92 * This method returns the same %LocalMessagePort instance if it has already been called with the same message port name. @n
93 * 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.
97 * @return A pointer to the trusted LocalMessagePort instance, @n
98 * else @c null if it fails
99 * @param[in] localMessagePortName The name of a local message port
100 * @exception E_SUCCESS The method is successful.
101 * @exception E_INVALID_ARG The @c localMessagePortName is empty.
102 * @exception E_SYSTEM The method has failed due to a severe system error.
103 * @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.
104 * @remarks The specific error code can be accessed using the GetLastResult() method.
106 static LocalMessagePort* RequestTrustedLocalMessagePort(const Tizen::Base::String& localMessagePortName);
109 * Requests the trusted RemoteMessagePort instance with the specified message port name. @n
110 * This method returns the same %RemoteMessagePort instance if it has already been called with the same remote application ID and message port name. @n
111 * This message port allows communications only if the applications are signed with the same certificate which is uniquely assigned to the developer.
115 * @return A pointer to the trusted RemoteMessagePort instance, @n
116 * else @c null if it fails
117 * @param[in] remoteAppId The remote application ID
118 * @param[in] remoteMessagePortName The name of a remote message port
119 * @exception E_SUCCESS The method is successful.
120 * @exception E_INVALID_ARG Either @c remoteAppId or @c remoteMessagePortName is empty.
121 * @exception E_OBJ_NOT_FOUND The message port of the target application is not found.
122 * @exception E_CERTIFICATE_VERIFICATION_FAILED The target application is not signed with the same certificate.
123 * @exception E_SYSTEM The method has failed due to a severe system error.
124 * @remarks The specific error code can be accessed using the GetLastResult() method.
126 static RemoteMessagePort* RequestTrustedRemoteMessagePort(const Tizen::App::AppId& remoteAppId, const Tizen::Base::String& remoteMessagePortName);
130 * This default constructor is intentionally declared as private because this class cannot be constructed.
132 MessagePortManager(void);
135 * This destructor is intentionally declared as private because this class cannot be constructed.
137 virtual ~MessagePortManager(void);
140 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
142 MessagePortManager(const MessagePortManager& messagePortManager);
145 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
147 MessagePortManager& operator =(const MessagePortManager& messagePortManager);
149 }; // MessagePortManager
153 #endif //_FIO_MESSAGE_PORT_MANAGER_H_