Adapt the AIL filter used to new ones
[profile/ivi/ico-uxf-homescreen.git] / lib / system-controller / CicoSCVInfoManager.h
1 /*
2  * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
3  *
4  * This program is licensed under the terms and conditions of the
5  * Apache License, version 2.0.  The full text of the Apache License is at
6  * http://www.apache.org/licenses/LICENSE-2.0
7  *
8  */
9
10 //==========================================================================
11 /**
12  *  @file   CicoSCVInfoManager.h
13  *
14  *  @brief  This file is definition of CicoSCVInfoManager class
15  */
16 //==========================================================================
17 #ifndef __CICO_SC_VINFO_MANAGER_H__
18 #define __CICO_SC_VINFO_MANAGER_H__
19
20 #include <string>
21 #include <map>
22
23 #include <ico_dbus_amb_efl.h>
24 #include "CicoCommonDef.h"
25
26 //==========================================================================
27 //  Forward declaration
28 //==========================================================================
29
30 //==========================================================================
31 /*
32  *  @brief  This class manage vehicle information
33  */
34 //==========================================================================
35 class CicoSCVInfoManager
36 {
37 public:
38     // get CicoSCVInfoManager instance
39     static CicoSCVInfoManager* getInstance(void);
40
41     // startup communication of vehicle information
42     bool startup(void);
43
44     // teardown communication of vehicle information
45     bool teardown(void);
46
47     // get ecore event type
48     int getEcoreEvType(void);
49
50     // get vehicle information
51     bool getVehicleInfo(int property);
52
53 private:
54     // default constructor
55     CicoSCVInfoManager();
56
57     // destructor
58     ~CicoSCVInfoManager();
59
60     // assignment operator
61     CicoSCVInfoManager& operator=(const CicoSCVInfoManager &object);
62
63     // copy constructor
64     CicoSCVInfoManager(const CicoSCVInfoManager &object);
65
66     // start vehicle information monitoring
67     void startMonitoring(void);
68
69     // stop vehicle information monitoring
70     void stopMonitoring(void);
71
72     // callback find vehicle information
73     static void dbusAMBFindCB(const char *objectname,
74                               const char *property,
75                               dbus_type  type,
76                               void *user_data,
77                               ico_dbus_error_t *error);
78
79     // callback get vehicle information
80     static void dbusAMBGetCB(const char *objectname,
81                              const char *property,
82                              dbus_type  type,
83                              union dbus_value_variant value,
84                              void *user_data);
85
86     // callback notify vehicle information
87     static void dbusAMBNotifyCB(const char *objectname,
88                                 const char *property,
89                                 dbus_type type,
90                                 union dbus_value_variant value,
91                                 int sequence,
92                                 struct timeval tv,
93                                 void *user_data);
94
95     // callback function of Ecore_End_Cb
96     static void evVInfoFree(void* user_data, void* func_data);
97
98     // callback function of ecore timer
99     static Eina_Bool ecoreRetryFindPropCB(void *data);
100
101 private:
102     // CicoSCVInfoManager instannce
103     static CicoSCVInfoManager* ms_myInstance;
104
105     // ecore event type
106     static int ms_ecoreEvType;
107
108     // dbus_type table
109     static dbus_type ms_dbusTypes[ICO_TYPE_MAX];
110
111     static int ms_retryCnt;
112
113     // initialized flag
114     bool m_initialized;
115 };
116 #endif  // __CICO_SC_VINFO_MANAGER_H__
117 // vim:set expandtab ts=4 sw=4: