Fix the boiler plate codes
[platform/framework/native/appfw.git] / src / io / FIo_SerialPortImpl.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://floralicense.org/license/
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 /**
18  * @file        FIo_SerialPortImpl.h
19  * @brief       This is the header file for the %_SerialPortImpl class.
20  *
21  * This header file contains the declarations of the %_SerialPortImpl class.
22  */
23
24 #ifndef _FIO_INTERNAL_SERIALPORT_IMPL_H_
25 #define _FIO_INTERNAL_SERIALPORT_IMPL_H_
26
27 #include <FBaseRtEvent.h>
28 #include <FIo.h>
29 #include <FIoISerialPortEventListener.h>
30 #include <FIo_IIpcClientEventListener.h>
31 #include <FSys_ICommunicationDispatcherListener.h>
32
33 namespace Tizen { namespace Base { namespace Collection {
34 class ArrayList;
35 }}}
36
37 namespace Tizen { namespace Io
38 {
39
40 class _SerialPortImpl
41         : public Tizen::System::_ICommunicationDispatcherListener
42 {
43 private:
44         _SerialPortImpl();
45         virtual ~_SerialPortImpl(void);
46 public:
47         result SerialOpen(void);
48         result SerialClose(void);
49         bool IsOpended(void);
50
51         result SetSerialPortEventListener(ISerialPortEventListener& listener);
52         result Write(const Tizen::Base::ByteBuffer &byteBuffer);
53         int GetWriteBufferSize(void) const;
54         void OnDataReceived(const Tizen::Base::Collection::ArrayList& data);
55
56         static _SerialPortImpl* GetInstance(void);
57
58 private:
59         _IpcClient*                     __pIpcClient;
60         Tizen::Base::Runtime::Event*    __pEvent;
61         bool                            __isOpended;
62
63         _SerialPortImpl(_SerialPortImpl& serialPortImpl);
64
65         _SerialPortImpl& operator =(const _SerialPortImpl& serialPortImpl);
66
67         static _SerialPortImpl* __pSerialPortImpl;
68 };
69
70 }} //Tizen::Io
71
72 #endif // _FIO_INTERNAL_SERIALPORT_IMPL_H_