sync with tizen_2.0
[platform/framework/native/appfw.git] / inc / FIoISerialPortEventListener.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 /**
19  * @file        FIoISerialPortEventListener.h
20  * @brief       This is the header file for the %ISerialPortEventListener interface.
21  *
22  * This header file contains the declarations of the %ISerialPortEventListener interface.
23  */
24
25 #ifndef _FIO_SERIAL_PORT_EVENT_LISTENER_H_
26 #define _FIO_SERIAL_PORT_EVENT_LISTENER_H_
27
28 #include <FBaseResult.h>
29 #include <FBaseRtIEventListener.h>
30 #include <FIoSerialPort.h>
31
32 namespace Tizen { namespace Io
33 {
34
35 /**
36  * @interface ISerialPortEventListener
37  * @brief This interface provides event handlers to receive serial port events synchronously.
38  *
39  * @since       2.0
40  *
41  * The %ISerialPortEventListener interface provides event handlers to receive serial port events synchronously. @n
42  *
43  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/io/serial_port_comm.htm">Serial Port Communication</a>.
44  *
45  */
46
47 class _OSP_EXPORT_ ISerialPortEventListener
48         : virtual public Tizen::Base::Runtime::IEventListener
49 {
50
51 public:
52         /**
53         * Called when the data is received on the serial port.
54         *
55         * @since                2.0
56         *
57         * @param[in]    byteBuffer              A byte buffer that contains the received data
58         * @remarks                      The ByteBuffer instance needs to be deleted by the application.
59         */
60         virtual void OnSerialPortDataReceivedN(Tizen::Base::ByteBuffer& byteBuffer) = 0;
61
62         /**
63         * Called when an error occurs on the serial port.
64         *
65         * @since                2.0
66         *
67         * @param[in]    r       The error code
68         * @exception    E_INVALID_DATA  The data is invalid.
69         * @exception    E_SYSTEM                                A system error has occurred.
70         */
71         virtual void OnSerialPortErrorOccured(result r) = 0;
72
73 protected:
74         //
75         // This method is for internal use only.
76         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
77         //
78         // This method is reserved and may change its name at any time without prior notice.
79         //
80         // @since       2.0
81         //
82         virtual void ISerialPortEventListener_Reserved1(void) {}
83
84         //
85         // This method is for internal use only.
86         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
87         //
88         // This method is reserved and may change its name at any time without prior notice.
89         //
90         // @since       2.0
91         //
92         virtual void ISerialPortEventListener_Reserved2(void) {}
93
94         //
95         // This method is for internal use only.
96         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
97         //
98         // This method is reserved and may change its name at any time without prior notice.
99         //
100         // @since       2.0
101         //
102         virtual void ISerialPortEventListener_Reserved3(void) {}
103
104 }; // ISerialPortEventListener
105
106 }} // Tizen::Io
107
108 #endif // _FIO_SERIAL_PORT_EVENT_LISTENER_H_
109