fixed Doxygen warning
[platform/framework/native/appfw.git] / inc / FIoMessagePortManager.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 //
16 /**
17  * @file                FIoMessagePortManager.h
18  * @brief               This is the header file for the %MessagePortManager class.
19  *
20  * This header file contains declarations of the %MessagePortManager class.
21  */
22 #ifndef _FIO_MESSAGE_PORT_MANAGER_H_
23 #define _FIO_MESSAGE_PORT_MANAGER_H_
24
25 #include <FBaseResult.h>
26 #include <FBaseObject.h>
27 #include <FBaseDataType.h>
28 #include <FIoLocalMessagePort.h>
29 #include <FIoRemoteMessagePort.h>
30 #include <FAppTypes.h>
31
32 namespace Tizen { namespace Io
33 {
34
35 /**
36 * @class    MessagePortManager
37 * @brief    This class provides methods for managing message ports.
38 *
39 * @since    2.0
40 *
41 * @final        This class is not intended for extension.
42 *
43 * The %MessagePortManager class provides methods for managing message ports.
44 *
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>.
47 *
48 * @see Tizen::Io::LocalMessagePort
49 * @see Tizen::Io::RemoteMessagePort
50 */
51
52 class _OSP_EXPORT_ MessagePortManager
53 {
54 public:
55         /**
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.
58         *
59         * @since    2.0
60         *
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
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.
71         */
72         static LocalMessagePort* RequestLocalMessagePort(const Tizen::Base::String& localMessagePortName);
73
74         /**
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.
78         *
79         * @since    2.0
80         *
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.
90         */
91         static RemoteMessagePort* RequestRemoteMessagePort(const Tizen::App::AppId& remoteAppId, const Tizen::Base::String& remoteMessagePortName);
92
93         /**
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.
98         *
99         * @since    2.0
100         *
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.
107         * @remarks
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.
111         */
112         static LocalMessagePort* RequestTrustedLocalMessagePort(const Tizen::Base::String& localMessagePortName);
113
114         /**
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.
120         *
121         * @since    2.0
122         *
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.
133         */
134         static RemoteMessagePort* RequestTrustedRemoteMessagePort(const Tizen::App::AppId& remoteAppId, const Tizen::Base::String& remoteMessagePortName);
135
136 private:
137         /**
138         * This default constructor is intentionally declared as private because this class cannot be constructed.
139         */
140         MessagePortManager(void);
141
142         /**
143         * This destructor is intentionally declared as private because this class cannot be constructed.
144         */
145         virtual ~MessagePortManager(void);
146
147         /**
148         * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
149         */
150         MessagePortManager(const MessagePortManager& messagePortManager);
151
152         /**
153         * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
154         */
155         MessagePortManager& operator =(const MessagePortManager& messagePortManager);
156
157 }; // MessagePortManager
158
159 } } // Tizen::Io
160
161 #endif //_FIO_MESSAGE_PORT_MANAGER_H_