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.
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.
68 * - It is not recommended to use the message port names that start with "http://tizen.org/messageport".
69 * @c E_INVALID_ARG may be returned because they are reserved by platform.
70 * - The specific error code can be accessed using the GetLastResult() method.
72 static LocalMessagePort* RequestLocalMessagePort(const Tizen::Base::String& localMessagePortName);
75 * Requests for a RemoteMessagePort instance with the specified remote application ID and message port name. @n
76 * This method returns the same %RemoteMessagePort instance if it has already been called with the same remote application ID
77 * and message port name.
81 * @return A pointer to the RemoteMessagePort instance, @n
82 * else @c null if it fails
83 * @param[in] remoteAppId The remote application ID
84 * @param[in] remoteMessagePortName The remote message port name
85 * @exception E_SUCCESS The method is successful.
86 * @exception E_INVALID_ARG The remote application ID or the remote message port name is empty.
87 * @exception E_OBJ_NOT_FOUND The message port of the target application is not found.
88 * @exception E_SYSTEM The method cannot proceed due to a severe system error.
89 * @remarks The specific error code can be accessed using the GetLastResult() method.
91 static RemoteMessagePort* RequestRemoteMessagePort(const Tizen::App::AppId& remoteAppId, const Tizen::Base::String& remoteMessagePortName);
94 * Requests for a trusted LocalMessagePort instance with the specified message port name. @n
95 * This method returns the same %LocalMessagePort instance if it has already been called with the same message port name. @n
96 * Communications over a trusted message port is allowed only if both the applications are signed with a certificate that is
97 * uniquely assigned to the developer.
101 * @return A pointer to the trusted LocalMessagePort instance, @n
102 * else @c null if it fails
103 * @param[in] localMessagePortName The name of a local message port
104 * @exception E_SUCCESS The method is successful.
105 * @exception E_INVALID_ARG The @c localMessagePortName is empty.
106 * @exception E_SYSTEM The method has failed due to a severe system error.
108 * - It is not recommended to use the message port names that start with "http://tizen.org/messageport".
109 * @c E_INVALID_ARG may be returned because they are reserved by platform.
110 * - The specific error code can be accessed using the GetLastResult() method.
112 static LocalMessagePort* RequestTrustedLocalMessagePort(const Tizen::Base::String& localMessagePortName);
115 * Requests for a trusted RemoteMessagePort instance with the specified message port name. @n
116 * This method returns the same %RemoteMessagePort instance if it has already been called with the same remote application ID
117 * and message port name. @n
118 * This message port allows communications only if the applications are signed with the same certificate which is uniquely
119 * assigned to the developer.
123 * @return A pointer to the trusted RemoteMessagePort instance, @n
124 * else @c null if it fails
125 * @param[in] remoteAppId The remote application ID
126 * @param[in] remoteMessagePortName The name of a remote message port
127 * @exception E_SUCCESS The method is successful.
128 * @exception E_INVALID_ARG Either @c remoteAppId or @c remoteMessagePortName is empty.
129 * @exception E_OBJ_NOT_FOUND The message port of the target application is not found.
130 * @exception E_CERTIFICATE_VERIFICATION_FAILED The target application is not signed with the same certificate.
131 * @exception E_SYSTEM The method has failed due to a severe system error.
132 * @remarks The specific error code can be accessed using the GetLastResult() method.
134 static RemoteMessagePort* RequestTrustedRemoteMessagePort(const Tizen::App::AppId& remoteAppId, const Tizen::Base::String& remoteMessagePortName);
138 * This default constructor is intentionally declared as private because this class cannot be constructed.
140 MessagePortManager(void);
143 * This destructor is intentionally declared as private because this class cannot be constructed.
145 virtual ~MessagePortManager(void);
148 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
150 MessagePortManager(const MessagePortManager& messagePortManager);
153 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
155 MessagePortManager& operator =(const MessagePortManager& messagePortManager);
157 }; // MessagePortManager
161 #endif //_FIO_MESSAGE_PORT_MANAGER_H_