sync with tizen_2.0
[platform/framework/native/appfw.git] / src / io / inc / FIo_DataRouter.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        FIo_DataRouter.h
20  * @brief       This is the header file for the %_DataRouter class.
21  *
22  * This header file contains the declarations of the %_DataRouter class.
23  */
24
25 #ifndef _FIO_INTERNAL_DATA_ROUTER_H_
26 #define _FIO_INTERNAL_DATA_ROUTER_H_
27
28 #include <FBaseObject.h>
29 #include <FOspConfig.h>
30
31 namespace Tizen {namespace Io {
32
33 class _IDataRouterEventListener; //Data Receiver
34
35 enum _DataRouterState
36 {
37         _DATA_ROUTER_STATE_OPENED = 0,
38         _DATA_ROUTER_STATE_CLOSED
39 };
40 /**
41  * This class provides communication feature on a datarouter module. The datarouter is a tizen module for USB connection management such as Kies, Debugging, MTP, Internet sharing.
42  */
43 class _OSP_EXPORT_ _DataRouter
44         : public Tizen::Base::Object
45 {
46
47 public:
48         result Construct(_IDataRouterEventListener& listener);
49         result Write(const char* data, int length);
50         void DataReceived(const char* data, int length);
51         void StateChanged(_DataRouterState state);
52
53         static _DataRouter* GetInstance(void);
54         static void ReleaseInstance(void);
55
56 private:
57         _DataRouter();
58         ~_DataRouter();
59
60         _IDataRouterEventListener*      __pDataRouterEventListener;
61         bool    __initialized;
62 }; // _DataRouter
63
64 }} // Tizen::Io
65
66 #endif // _FIO_INTERNAL_DATA_ROUTER_H_
67