[Systeminfo] Fixed behaviour of Network property
[platform/core/api/webapi-plugins.git] / src / systeminfo / systeminfo-utils.h
1 /*
2  * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
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 #ifndef WEBAPI_PLUGINS_SYSTEMINFO_SYSTEMINFO_UTILS_H__
18 #define WEBAPI_PLUGINS_SYSTEMINFO_SYSTEMINFO_UTILS_H__
19
20 #include <ITapiSim.h>
21 #include <TelNetwork.h>
22 #include <system_settings.h>
23 #include <vconf-internal-keys.h>
24 #include <vconf.h>
25 #include <string>
26 #include "common/picojson.h"
27 #include "common/platform_result.h"
28 #include "systeminfo/systeminfo_device_capability.h"
29
30 namespace extension {
31 namespace systeminfo {
32
33 struct CpuInfo {
34   long long usr;
35   long long nice;
36   long long system;
37   long long idle;
38   double load;
39 };
40
41 class SysteminfoUtils {
42  public:
43   static common::PlatformResult GetVconfInt(const char *key, int *value);
44   static common::PlatformResult GetRuntimeInfoString(system_settings_key_e key,
45                                                      std::string *platform_string);
46   static common::PlatformResult CheckTelephonySupport();
47   static common::PlatformResult CheckWifiSupport();
48   static common::PlatformResult CheckCameraFlashSupport();
49   static common::PlatformResult CheckIfEthernetNetworkSupported();
50   static common::PlatformResult GetTotalMemory(long long *result);
51   static common::PlatformResult GetAvailableMemory(long long *result);
52   static common::PlatformResult RegisterVconfCallback(const char *in_key, vconf_callback_fn cb,
53                                                       void *event_ptr);
54   static common::PlatformResult UnregisterVconfCallback(const char *in_key, vconf_callback_fn cb);
55   static common::PlatformResult RegisterTapiChangeCallback(TapiHandle *handle, const char *noti_id,
56                                                            tapi_notification_cb callback,
57                                                            void *user_data);
58   static common::PlatformResult UnregisterTapiChangeCallback(TapiHandle *handle,
59                                                              const char *noti_id);
60 };
61
62 typedef unsigned char byte;
63
64 }  // namespace systeminfo
65 }  // namespace webapi
66
67 #endif  // WEBAPI_PLUGINS_SYSTEMINFO_SYSTEMINFO_UTILS_H__