Rename the class Json to avoid symbol conflicts with Jsoncpp
[platform/core/context/context-provider.git] / src / battery-stats / BatteryMonitor.h
index c6c10a8..07b5549 100644 (file)
 #define _CONTEXT_BATTERY_MONITOR_H_
 
 #include <device/callback.h>
+#include <vconf.h>
 #include <DatabaseManager.h>
 #include "BatteryUsageAnalyzer.h"
+#include "HeartDbReader.h"
 
 namespace ctx {
 
@@ -35,26 +37,30 @@ namespace ctx {
                int start();
                int stop();
                int getLastFullTime();
+               void prepareData();
 
        private:
                bool __loadLastInfo();
                bool __updateLastInfo();
 
                bool __processBatteryUsage();
-               bool __insertBatteryUsageLog(std::vector<Json>& usage);
+               bool __insertBatteryUsageLog(std::vector<CtxJson1>& usage);
                bool __updateLastCpuUsageLog(CpuUsageMap& usage);
                bool __getLastCpuUsageTable(CpuUsageMap* lastCpuUsage);
+               void __removeExpiredLog();
+               void __modifyLastCpuUsage(int timeDiff);
 
                static void __chargerChangeCb(device_callback_e type, void* value, void* userData);
+               static void __timeChangeCb(keynode_t* node, void* userData);
                static int __timeoutCb(void* data);
 
                static BatteryMonitor* __instance;
-               int __bootingTime;
                int __lastFullTime;
                int __lastHeartAccessTime;
 
                DatabaseManager __dbMgr;
                BatteryUsageAnalyzer __analyzer;
+               HeartDbReader *__heartReader;
        };
 
 }      /* namespace ctx */