summaryrefslogtreecommitdiff
path: root/src/ivivehiclefunctions/doc/src/qtivivehiclefunctions.qdoc
blob: 80f44095e45975acc85a2487c6a860e1239f976d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/****************************************************************************
**
** Copyright (C) 2016 Pelagicore AG
** Contact: https://www.qt.io/licensing/
**
** This file is part of the documentation of the QtIvi module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL-QTAS$
** Commercial License Usage
** Licensees holding valid commercial Qt Automotive Suite licenses may use
** this file in accordance with the commercial license agreement provided
** with the Software or, alternatively, in accordance with the terms
** contained in a written agreement between you and The Qt Company.  For
** licensing terms and conditions see https://www.qt.io/terms-conditions.
** For further information use the contact form at https://www.qt.io/contact-us.
**
** GNU Free Documentation License Usage
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
    \module QtIviVehicleFunctions
    \title Qt IVI Vehicle Functions C++ Classes
    \ingroup modules
    \ingroup qtivi_modules
    \qtvariable ivivehiclefunctions

    \brief C++ classes for the Qt IVI Vehicle Functions API.

    Qt IVI Vehicle Functions provides C++ API.

    \section1 Getting Started

    To link against the Qt IVI Vehicle Feature module, add this line to your
    \c qmake project file:

    \snippet doc_src_ivivehiclefunctions.pro 0

    To use Qt IVI Vehicle Functions C++ classes in your application, use the
    following include statement:

    \snippet doc_src_qtivivehiclefunctions.cpp 0

    \note If you are only using a few classes from this module, it's
    recommended to include only those specific classes instead of the
    whole module.

    To use feature elements, simply include the header file and instantiate
    the element:

   \code
   #include <QtIviVehicleFunctions/QIviClimateControl>
   ...
   QIviClimateControl* m_climateControl;
   m_climateControl = new QIviClimateControl(this);
   \endcode

   In order to trigger the auto discovery mechanism, call the startAutoDiscovery method. This will
   load the appropriate backend and set a service object for the feature element. Please notice
   that calling this method sets the autoDiscovery property to true. To use dynamic services,
   simply do not call this method.

   \code
   m_climateControl->startAutoDiscovery();
   \endcode

   After the startAutoDiscovery method has been called, the isValid property can be used to
   determine if a backend was found or not.

   \code
   if (!m_climateControl->isValid())
       QMessageBox::critical( ... ); // Take action here
   \endcode

   Climate general values can be get and set directly by the feature instance:
   \code
   if (!m_climateControl->airConditioningEnabled());
       m_climateControl->setAirConditioningEnabled(true);
   \endcode

   Some features, like climate control, are divided into several climate zones. The names
   of the available zones can be checked using QIviAbstractZonedFeature::availableZones():

   \code
   QStringList zones = m_climateControl->availableZones();
   \endcode

   You can use QIviAbstractZonedFeature::zoneAt() to access zone functions:

   \code
   m_climateControl->zoneAt("FrontSeat")->setSeatHeater(false);
   \endcode

   Looping zones is done with QIviAbstractZonedFeature::zones():

   \code
    const auto zones = m_climateControl->zones();
    for (QClimateControl *z : zones)
        if (z->zone() == "FrontSeat")
            z->setSeatHeater(true);
   \endcode
*/

/*!
    \qmlmodule QtIvi.VehicleFunctions 1.0
    \title Qt IVI Vehicle Functions QML Types
    \ingroup qmlmodules
    \ingroup qtivi_qmlmodules

    \brief QML types for the Qt IVI Vehicle Functions API.

    The Qt IVI Vehicle Functions QML API provides a simple way to use vehicle
    features in QML applications.

    \section1 Getting Started

    The QML application relies on the QML plugin loading capabilities of the Qt QML runtime.
    This means that an installed Qt IVI module is found automatically.

    To import the Qt IVI Vehicle Functions QML types, add the following import
    statement to your \c .qml file:

    \snippet doc_src_qmlivivehiclefunctions.cpp 0

   Then instantiate the feature element. For most elements, autoDiscovery is set to true when
   applicable, but in this example we set it explicitly.

   \code
   ClimateControl {
       id: climateControl
       autoDiscovery: true
   }
   \endcode

   When the top-level component has been completed, the isValid property of the feature elements
   can be used to determine if any of the backends are missing. In some situations this is expected
   behavior; the isValid property can be used to enable or disable parts of the user
   interface.

   \code
   Component.onCompleted: {
       if (!climateControl.isValid)
           ; // Take action here
   }
   \endcode

   Some features, like climate control, are divided into zones. The names of the available zones
   can be fetched with AbstractZonedFeature::availableZones. Zones are available only
   when the feature is valid.
   \code
   ComboBox {
       model: climateControl.availableZones
   }
   \endcode

   With the AbstractZonedFeature::zoneAt property you can access the climate control zone-specific functions.
   \code
   climateControl.zoneAt.FrontSeat.seatheater = true
   \endcode

   An example of how to use the AbstractZonedFeature::zones property:
   \code
   Repeater {
       model: climateControl.zones
       Text { text: modelData.zone + " seat heater level: " + modelData.seatHeater}
   }
   \endcode

   Interactions with the feature element are described in the feature documentation. It is possible
   to bind properties, call methods, and listen to signals.

   \section1 QML Types
*/

/*!
    \group qtivivehiclefunctions_examples
    \ingroup all-examples
    \title Qt IVI Examples

    \brief Examples for the Qt IVI Vehicle Functions.

    \section1 Examples
*/