Apply string localization for web
[platform/framework/native/appfw.git] / src / system-server / setting / providers / FSys_SettingNetworkProvider.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 /**
18  * @file        FSys_SettingNetworkProvider.h
19  * @brief       This is the header file for the %_SettingNetworkProvider class.
20  *
21  * This header file contains the declarations of the %_SettingNetworkProvider class.
22  */
23
24 #ifndef _FSYS_SETTING_NETWORK_PROVIDER_H_
25 #define _FSYS_SETTING_NETWORK_PROVIDER_H_
26
27 #include <pthread.h>
28
29 #include <vconf.h>
30 #include <tethering.h>
31 #include <tapi_common.h>
32 #include <ITapiModem.h>
33 #include <runtime_info.h>
34 #include <bluetooth.h>
35 #include <wifi.h>
36 #include <wifi-direct.h>
37
38 #include <FBase.h>
39 #include <FSysISettingInfoSetValueAsyncResultListener.h>
40
41 #include "FSys_SettingInfo.h"
42 #include "FSys_ISettingProvider.h"
43
44 namespace Tizen { namespace System
45 {
46
47 class _SettingNetworkProvider
48         : _ISettingProvider
49 {
50 public:
51         _SettingNetworkProvider();
52         virtual ~_SettingNetworkProvider();
53
54 public:
55         result GetValue(const Tizen::Base::String& key, bool& value);
56         result SetValue(const Tizen::Base::String& key, const bool value);
57         result SetValueAsync(const Tizen::Base::String& key, bool value, ISettingInfoSetValueAsyncResultListener* listener);
58         result SetValueForPrivilegedKey(const Tizen::Base::String& key, bool value);
59         result SetValueAsyncForPrivilegedKey(const Tizen::Base::String& key, bool value, ISettingInfoSetValueAsyncResultListener* listener);
60
61         result GetValue(const Tizen::Base::String& key, Tizen::Base::String& value);
62         result SetValue(const Tizen::Base::String& key, const Tizen::Base::String value);
63
64         bool HasKey(const Tizen::Base::String& key);
65
66 private:
67         result FlightModeEnabler(void* data);
68         result WifiDummy(void* data);
69         result WifiDirectDummy(void* data);
70
71         static void SettingEventFlightMode(TapiHandle* handle, int res, void* data, void* user_data);
72         static void SettingEventRuntimeInfo(runtime_info_key_e key, void* userData);
73         static void SettingEventVConf(keynode_t* node, void* userData);
74         static void SettingEventTetheringEnabled(tethering_error_e tetheringErr, tethering_type_e deviceType, bool isRequested, void* data);
75         static void SettingEventTetheringDisabled(tethering_error_e tetheringErr, tethering_type_e deviceType, tethering_disabled_cause_e tetheringCause, void* data);
76         static void SettingEventBluetooth(int result, bt_adapter_state_e adapter_state, void* user_data);
77
78         static void SettingWifiActivateCallBack(wifi_error_e errorCode, void* data);
79         static void SettingWifiDirectStateChangedCallBack(wifi_direct_error_e errorCode, wifi_direct_device_state_e deviceState, void* data);
80
81 private:
82         TapiHandle*                     __tapiHandle;
83         void*                           __pWifiDllHandle;
84         void*                           __pBluetoothDllHandle;
85         tethering_h                     __tetheringHandle;
86
87         int                             __stateOfFlightMode;
88         int                             __stateOfWifi;
89         int                             __stateOfWifiDirect;
90         int                             __stateOfBluetooth;
91
92         bool                            __flightModeEnabled;
93         bool                            __networkBluetoothEnabled;
94
95         bool                            __wifiInit;
96         bool                            __wifiDirectInit;
97
98         ISettingInfoSetValueAsyncResultListener* __pWifiListener;
99         ISettingInfoSetValueAsyncResultListener* __pWifiDirectListener;
100         ISettingInfoSetValueAsyncResultListener* __pFlightModeListener;
101         ISettingInfoSetValueAsyncResultListener* __pBluetoothListener;
102 }; // _SettingNetworkProvider
103
104 }} // Tizen::System
105
106 #endif // _FSYS_ISETTING_NETWORK_PROVIDER_H_