Adapt the AIL filter used to new ones
[profile/ivi/ico-uxf-homescreen.git] / lib / system-controller / CicoSCVInfo.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   CicoSCVInfo.h
13  *
14  *  @brief  This file is definition of CicoSCVInfo class
15  */
16 //==========================================================================
17 #ifndef __CICO_SC_VINFO_H__
18 #define __CICO_SC_VINFO_H__
19
20 #include <ico_dbus_amb_efl.h>
21
22 //--------------------------------------------------------------------------
23 /**
24  *  @brief Enumerations of vehicle information property
25  */
26 //--------------------------------------------------------------------------
27 typedef enum _ico_vinfo_prop {
28     ICO_VINFO_VEHICLE_SPEED  = 1,   ///< vehicle speed
29     ICO_VINFO_SHIFT_POSITION,       ///< shift position
30     ICO_VINFO_LIGHT_LEFT,           ///< light left(Turn left)
31     ICO_VINFO_LIGHT_RIGHT,          ///< light right(Turn right)
32     ICO_VINFO_NIGHT_MODE,           ///< night mode
33     ICO_VINFO_DRIVING_MODE,         ///< driving mode
34
35     ICO_VINFO_MAX                   ///< maximum number of type
36 } ico_vinfo_prop_e;
37
38 //--------------------------------------------------------------------------
39 /**
40  *  @brief This class holds vehicle information
41  */
42 //--------------------------------------------------------------------------
43 class CicoSCVInfo
44 {
45 public:
46     // default constructor
47     CicoSCVInfo(int type, int prop, union dbus_value_variant value)
48         : m_type(type), m_prop(prop), m_value(value) {}
49
50     // destructor
51     virtual ~CicoSCVInfo() {}
52
53     // get value type
54     int getType(void) { return m_type; }
55
56     // get property
57     int getProperty(void) { return m_prop; }
58
59     // get boolean value
60     bool getBooleanValue(void) { return (m_value.bval != 0) ? true : false; }
61
62     // get int8_t value
63     int8_t getint8Value(void) { return m_value.yval; }
64
65     // get uint8_t value
66     uint8_t getUint8Value(void) { return m_value.yval; }
67
68     // get int16_t value
69     int16_t getInt16Value(void) { return m_value.i16val; }
70
71     // get uint16_t value
72     uint16_t getUint16Value(void) { return m_value.ui16val; }
73
74     // get int32_t value
75     int32_t getInt32Value(void) { return m_value.i32val; }
76
77     // get uint32_t value
78     uint32_t getUint32Value(void) { return m_value.ui32val; }
79
80     // get int64_t value
81     int64_t getInt64Value(void) { return m_value.i64val; }
82
83     // get uint64_t value
84     uint64_t getUint64Value(void) { return m_value.ui64val; }
85
86     // get double value
87     double getDoubleValue(void) { return m_value.dval; }
88
89     // get string value
90     const char* getStringValue(void) { return (const char*)m_value.sval; }
91
92 private:
93     // default constructor
94     CicoSCVInfo();
95
96     // assignment operator
97     CicoSCVInfo& operator=(const CicoSCVInfo &object);
98
99     // copy constructor
100     CicoSCVInfo(const CicoSCVInfo &object);
101
102 private:
103     // type of value
104     int m_type;
105
106     // property id of vehicle information
107     int m_prop;
108
109     // vehicle  information value
110     union dbus_value_variant m_value;
111 };
112 #endif  // __CICO_SC_VINFO_H__
113 // vim:set expandtab ts=4 sw=4: