diff options
Diffstat (limited to 'src/components/qt_hmi/qml_model_qt5/views')
43 files changed, 5129 insertions, 0 deletions
diff --git a/src/components/qt_hmi/qml_model_qt5/views/AMPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/AMPlayerView.qml new file mode 100644 index 0000000000..ad0c9d1907 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/AMPlayerView.qml @@ -0,0 +1,48 @@ +/** + * @file AMPlayerView.qml + * @brief AM player screen view. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../hmi_api/Common.js" as Common + +GeneralView { + category: Common.DeactivateReason.AUDIO + RadioPlayer { + id: amRadioPlayer + anchors.fill: parent + radioType: "AM" + radioName: "AM Radio" + + playerState: dataContainer.amPlayerState + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/ApplicationListView.qml b/src/components/qt_hmi/qml_model_qt5/views/ApplicationListView.qml new file mode 100644 index 0000000000..38c5ab067e --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/ApplicationListView.qml @@ -0,0 +1,126 @@ +/** + * @file ApplicationListView.qml + * @brief Application list view + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../controls" +import "../models" +import "../hmi_api/Common.js" as Common +import "../models/Constants.js" as Constants +import "../models/Internal.js" as Internal + +GeneralView { + Column { + anchors.fill: parent + Item { + // top 1/4 of screen + width: parent.width + height: 1/4 * parent.height + + PagedFlickable { + anchors.verticalCenter: parent.verticalCenter + width: parent.width + elementWidth: Constants.ovalButtonWidth + snapTo: elementWidth + spacing + spacing: (width - 4 * elementWidth) / 3 + + OvalButton { + text: "Find New Apps" + } + + OvalButton { + text: "Change device" + onReleased: contentLoader.go("./views/ChangeDeviceView.qml") + } + + OvalButton { + text: "911 Assist" + } + + OvalButton { + text: "Vehicle Health Report" + } + + OvalButton { + text: "Install applications/Up" + } + } + } + + Item { + height: parent.height / 2 + width: parent.width + + ScrollableListView { + id: applicationListView + anchors.fill: parent + model: dataContainer.applicationList + + delegate: Item { + width: parent.width + height: Math.max(applicationName.height, appIcon.height) + Image { + id: appIcon + source: icon + height: Constants.appListIconSize + width: height + } + ClickableText { + id: applicationName + text: appName + defaultColor: Constants.primaryColor + pressedColor: Constants.primaryColorPressed + font.pixelSize: Constants.appListFontSize + anchors.verticalCenter: parent.verticalCenter + anchors.left: appIcon.right + anchors.leftMargin: Constants.margin + onClicked: { + settingsContainer.activateApp(appId) +// dataContainer.setCurrentApplication(appId) +// contentLoader.go( Internal.chooseAppStartScreen(dataContainer.currentApplication.appType, +// dataContainer.currentApplication.isMediaApplication), appId ) + } + } + } + } + } + + Item { + // bottom 1/4 of screen + width: parent.width + height: 1/4 * parent.height + + BackButton { anchors.centerIn: parent } + } + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/BTPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/BTPlayerView.qml new file mode 100644 index 0000000000..a1d8c43a39 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/BTPlayerView.qml @@ -0,0 +1,62 @@ +/** + * @file BTPlayerView.qml + * @brief FM player screen view. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +import QtQuick 2.0 +import "../hmi_api/Common.js" as Common +import "../models/Constants.js" as Constants +import "../controls" + +GeneralView { + category: Common.DeactivateReason.AUDIO + MediaPlayer { + id: btPlayer + playerName: "BT Audio" + anchors.fill: parent + + playerState: dataContainer.btPlayerState + image: playerState.albumImage + + buttons: [ + OvalButton { + text: btPlayer.playerName + onReleased: contentLoader.go("./views/MusicSourceView.qml") + fontSize: Constants.fontSize + }, + + OvalButton { + text: "Browse" + fontSize: Constants.fontSize + } + ] + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/CDPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/CDPlayerView.qml new file mode 100644 index 0000000000..8cf1c3f728 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/CDPlayerView.qml @@ -0,0 +1,63 @@ +/** + * @file CDPlayerView.qml + * @brief CD player screen view. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../hmi_api/Common.js" as Common +import "../models/Constants.js" as Constants +import "../controls" + + +GeneralView { + category: Common.DeactivateReason.AUDIO + MediaPlayer { + id: cdPlayer + playerName: "CD" + anchors.fill: parent + image: playerState.albumImage + playerState: dataContainer.cdPlayerState + + buttons: [ + OvalButton { + text: cdPlayer.playerName + onReleased: contentLoader.go("./views/MusicSourceView.qml") + fontSize: Constants.fontSize + }, + + OvalButton { + text: "Browse" + fontSize: Constants.fontSize + } + ] + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/CarMenuGridView.qml b/src/components/qt_hmi/qml_model_qt5/views/CarMenuGridView.qml new file mode 100644 index 0000000000..e61bac1d08 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/CarMenuGridView.qml @@ -0,0 +1,54 @@ +/** + * @file CarMenuGridView.qml + * @brief Car menu screen view. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +import QtQuick 2.0 +import "../models" +import "../controls" + +GridMenu { + id: menu + model: CarMenuModel { } + delegate: GridItem { + width: menu.width / menu.columnsOnPage + height: menu.height / menu.rows + ClickableImage { + anchors.centerIn: parent + source: icon + onClicked: { + if(qml !== "") { + contentLoader.go(qml) + } + } + } + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/ChangeDeviceView.qml b/src/components/qt_hmi/qml_model_qt5/views/ChangeDeviceView.qml new file mode 100644 index 0000000000..84a751efec --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/ChangeDeviceView.qml @@ -0,0 +1,102 @@ +/** + * @file ChangeDeviceView.qml + * @brief Screen view with list of available devices. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../controls" +import "../models" +import "../models/Constants.js" as Constants + +GeneralView { + Item { + anchors.fill: parent + + Item { + // 3/4 top screen + height: parent.height * 3/4 + width: parent.width + anchors.top: parent.top + anchors.left: parent.left + + Text { + id: searchDeviceText + anchors.left: parent.left + anchors.top: parent.top + height: 1/4 * parent.height + width: parent.width + color: Constants.primaryColor + font.pixelSize: Constants.titleFontSize + text: "Devices available:" + verticalAlignment: Text.AlignVCenter + } + + ListView { + id: changeDeviceListView + anchors.left: parent.left + anchors.top: searchDeviceText.bottom + model: dataContainer.deviceList + width:parent.width + height:parent.height - searchDeviceText.height + + delegate: Text { + MouseArea { + anchors.fill: parent + onClicked: { + sdlBasicCommunication.onDeviceChosen({ name: name, id: devid }); + sdlBasicCommunication.onFindApplications({ name: name, id: devid }) + contentLoader.go("./views/ApplicationListView.qml") + } + } + text: name + color: Constants.primaryColor + font.pixelSize: Constants.titleFontSize + } + } + } + Item { + // 1/4 bottom screen + anchors.bottom: parent.bottom + anchors.left: parent.left + width: parent.width + height: 1/4 * parent.height + + BackButton { anchors.centerIn: parent } + } + + Component.onCompleted: { + console.log("ChangeDeviceView Component.onCompleted enter"); + sdlBasicCommunication.onStartDeviceDiscovery(); + console.log("ChangeDeviceView Component.onCompleted exit"); + } + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/ClimateControlView.qml b/src/components/qt_hmi/qml_model_qt5/views/ClimateControlView.qml new file mode 100644 index 0000000000..41b0c32efa --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/ClimateControlView.qml @@ -0,0 +1,94 @@ +/** + * @file ClimateControlView.qml + * @brief Screen view of climat menu. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../controls" + +GeneralView { + Item { + id: climatMenu + anchors.fill: parent + + Item { + height: parent.height + width: parent.width + anchors.top: parent.top + anchors.left: parent.left + + Column { + id: leftItem + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.leftMargin: 1/4*parent.width - useThisToGetButtonSize.width + + Row { + ClimateControlBtn {name: "heated_seat"} + ClimateControlBtn {name: "heated_wheel"} + } + Row { + ClimateControlBtn {name: "AC"} + ClimateControlBtn {name: "headed_dash"} + } + } + + Column { + id: centralItem + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + + ClimateControlBtn {id: useThisToGetButtonSize; name: "defrost"; state: "on"} + ClimateControlBtn {name: "face"; state: "on"} + ClimateControlBtn {name: "feet"} + } + + Row { + id: rightItem + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + anchors.rightMargin: 1/4*parent.width - useThisToGetButtonSize.width + + ClimateControlBtn { + anchors.verticalCenter: parent.verticalCenter + txt: "Dual" + state: "on" + } + + Column { + ClimateControlBtn { name: "heated_seat" } + ClimateControlBtn { name: "AC" } + } + } + } + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/ContactsListView.qml b/src/components/qt_hmi/qml_model_qt5/views/ContactsListView.qml new file mode 100644 index 0000000000..90f817036d --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/ContactsListView.qml @@ -0,0 +1,118 @@ +/** + * @file ContactsListView.qml + * @brief Contact list screen view. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../controls" +import "../models" +import "../models/Constants.js" as Constants + +GeneralView { + function setCurrent(firstLetter){ + for(var i = 0; i < contactsListView.count; i ++) { + if (contactsListView.model.get(i).name[0].toUpperCase() === firstLetter) { + contactsListView.positionViewAtIndex(i, ListView.Beginning) + break; + } + } + } + Component.onCompleted: setCurrent(dataContainer.contactsFirstLetter) + + Item { + // 3/4 top screen + height: parent.height * 3/4 + width: parent.width + anchors.top: parent.top + anchors.left: parent.left + + ScrollableListView { + id: contactsListView + anchors.fill: parent + clip: true + spacing: 1/2 * Constants.fontSize + model: ContactsListModel { } + + section.property: "name" + section.criteria: ViewSection.FirstCharacter + section.delegate: Text { + color: Constants.primaryColor + font.pixelSize: Constants.fontSize + text: section.toUpperCase() + } + + delegate: Item { + anchors.left: parent.left + width: parent.width - Constants.scrollBarWidth + height: typeText.height + + Text { + id: contactName + anchors.left: parent.left + text: name + width: Constants.contactListNameFieldSize * parent.width + color: Constants.contactTextColor + font.pixelSize: Constants.fontSize + elide: Text.ElideRight + } + Text { + id: phoneText + anchors.left: contactName.right + width: Constants.contactListPhoneFieldSize * parent.width + text: phone + color: Constants.contactTextColor + font.pixelSize: Constants.fontSize + horizontalAlignment: Text.AlignHCenter + } + Text { + id: typeText + anchors.right: parent.right + width: Constants.contactListDescriptionFieldSize * parent.width + text: type + color: Constants.contactTextColor + font.pixelSize: Constants.fontSize + horizontalAlignment: Text.AlignHCenter + } + } + } + } + + Item { + // 1/4 bottom screen + anchors.bottom: parent.bottom + anchors.left: parent.left + width: parent.width + height: 1/4 * parent.height + + BackButton { anchors.centerIn: parent } + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/DeviceStateChangedView.qml b/src/components/qt_hmi/qml_model_qt5/views/DeviceStateChangedView.qml new file mode 100644 index 0000000000..5a0b5b7754 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/DeviceStateChangedView.qml @@ -0,0 +1,82 @@ +/** + * Copyright (c) 2014, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +import QtQuick 2.0 +import "../models" +import "../controls" +import "../hmi_api/Common.js" as Common +import "../models/Constants.js" as Constants + +GeneralView { + Item { + anchors.fill: parent + Text { + id: title + text: "Choose devices to be Unpaired:" + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + font.pixelSize: Constants.fontSize + color: Constants.primaryColor + height: Constants.fontSize + Constants.panelPadding + } + + ScrollableListView { + id: menu + model: dataContainer.deviceList + anchors.left: parent.left + anchors.right: parent.right + anchors.top: title.bottom + anchors.bottom: bottomPanel.top + delegate: OvalButton { + text: name + onClicked: { + sdlSDL.onDeviceStateChanged(Common.DeviceState.UNPAIRED, + "", {id: devid, name: name}); + } + anchors.left: parent.left + anchors.right: parent.right + fontSize: Constants.fontSize + } + } + + Item { + id: bottomPanel + // 1/4 bottom screen + anchors.bottom: parent.bottom + anchors.left: parent.left + height: 1/4 * parent.height + width: parent.width + + BackButton { anchors.centerIn: parent } + } + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/FMPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/FMPlayerView.qml new file mode 100644 index 0000000000..ae117ccd05 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/FMPlayerView.qml @@ -0,0 +1,121 @@ +/** + * @file FMPlayerView.qml + * @brief FM player screen view. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../controls" +import "../hmi_api/Common.js" as Common +import "../models/Constants.js" as Constants + +GeneralView { + category: Common.DeactivateReason.AUDIO + RadioPlayer { + id: fmRadioPlayer + anchors.fill: parent + radioType: "FM" + radioName: "FM Radio" + + playerState: dataContainer.fmPlayerState + + property int hdButtonValue: 1 + + buttonHD: [ + Image { + id: hdButton + anchors.bottom: parent.bottom + anchors.left: parent.left + source: "../res/buttons/long_oval_btn.png" + property string textColor: Constants.primaryColor + + Row { + anchors.centerIn: parent + spacing: (hdButton.width - hdLogo.width - one.width - two.width - three.width - four.width) / 10 + + Image { + id: hdLogo + anchors.verticalCenter: parent.verticalCenter + source:"../res/hd_logo_on.png" + } + + Text { + id: one + anchors.verticalCenter: parent.verticalCenter + text: "1" + color: fmRadioPlayer.hdButtonValue === 1 ? "white" : hdButton.textColor + font.pixelSize: Constants.fontSize + } + + Text { + id: two + anchors.verticalCenter: parent.verticalCenter + text: "2" + color: fmRadioPlayer.hdButtonValue === 2 ? "white" : hdButton.textColor + font.pixelSize: Constants.fontSize + } + + Text { + id: three + anchors.verticalCenter: parent.verticalCenter + text: "3" + color: fmRadioPlayer.hdButtonValue === 3 ? "white" : hdButton.textColor + font.pixelSize: Constants.fontSize + } + + Text { + id: four + anchors.verticalCenter: parent.verticalCenter + text: "4" + color: fmRadioPlayer.hdButtonValue === 4 ? "white" : hdButton.textColor + font.pixelSize: Constants.fontSize + } + } + + MouseArea { + anchors.fill: parent + onPressed: { + hdLogo.source = "../res/hd_logo_off.png" + hdButton.source = "../res/buttons/long_oval_pressed_btn.png" + hdButton.textColor = Constants.secondaryColor + + } + onReleased: { + hdLogo.source = "../res/hd_logo_on.png" + hdButton.source = "../res/buttons/long_oval_btn.png" + hdButton.textColor = Constants.primaryColor + fmRadioPlayer.hdButtonValue === 4 ? fmRadioPlayer.hdButtonValue = 1 : fmRadioPlayer.hdButtonValue++ + } + } + } + ] + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/GeneralView.qml b/src/components/qt_hmi/qml_model_qt5/views/GeneralView.qml new file mode 100644 index 0000000000..ca6eb12e8f --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/GeneralView.qml @@ -0,0 +1,48 @@ +/** + * @file GeneralView.qml + * @brief Base view class. Defines properties and behavior common for all views + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../hmi_api/Common.js" as Common + +Item { + /// HMI context view is related to + property int systemContext: Common.SystemContext.SYSCTXT_MAIN + /// True if view is in application context + property bool applicationContext: false + /// View category for AppDeactivated notification (reason) + property int category: Common.DeactivateReason.GENERAL + + signal enterScreen + signal leaveScreen +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/GridMenu.qml b/src/components/qt_hmi/qml_model_qt5/views/GridMenu.qml new file mode 100644 index 0000000000..f935b030c4 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/GridMenu.qml @@ -0,0 +1,86 @@ +/** + * @file GridMenu.qml + * @brief Parent class for main menu. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../controls" +import "../models/Constants.js" as Constants +import "../models/Internal.js" as Internal + +GeneralView { + id: main + property alias model: repeater.model + property alias delegate: repeater.delegate + property alias rows: grid.rows + property int columnsOnPage: Constants.menuColumnCount + + Flickable { + id: flicker + anchors.fill: parent + contentWidth: grid.width + flickableDirection: Flickable.HorizontalFlick + + Grid { + id: grid + anchors.centerIn: parent + rows: Constants.menuRowCount + columns: Math.ceil(model.count / rows) + flow: Grid.TopToBottom + Repeater { + id: repeater + } + } + + property int snapTo: width / parent.columnsOnPage + onMovementEnded: { + var rest = flicker.contentX % snapTo + var time = 0.25 + if (rest > flicker.snapTo / 2) { rest = rest - flicker.snapTo } + var vel = 2 * rest / time + flickDeceleration = Math.abs(vel) / time + flick(vel, 0) + flickDeceleration = 1500 + } + } + + Pager { + id: pager + space: 10 + anchors.horizontalCenter: parent.horizontalCenter + anchors.top: parent.top + anchors.topMargin: Constants.margin + + pages: Math.ceil(grid.columns / parent.columnsOnPage) + activePage: Internal.activePageChoose(flicker, pager.pages) + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/HardwareButtonsView.qml b/src/components/qt_hmi/qml_model_qt5/views/HardwareButtonsView.qml new file mode 100644 index 0000000000..1a162f2caa --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/HardwareButtonsView.qml @@ -0,0 +1,175 @@ +/** + * @file HardwareButtonsView.qml + * @brief Area of screen responsible for hardware buttons + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../controls" +import "../hmi_api/Common.js" as Common +import "../models/Constants.js" as Constants + +Rectangle { + height: row.height + row.anchors.margins + anchors.left: parent.left + anchors.right: parent.right + color: Constants.panelColor + + signal buttonDown(string name) + signal buttonUp(string name) + + function pressButton(name) { + buttonDown(name) + } + + function longPressButton(name) { + console.log("long press " + name) + } + + function releaseButton(name) { + buttonUp(name) + } + + Row { + id: row + spacing: Constants.panelPadding + anchors.centerIn: parent + anchors.margins: Constants.panelPadding + + PowerSwitchButton {anchors.verticalCenter: parent.verticalCenter} + + MaskedButton { + name: "vr" + anchors.verticalCenter: parent.verticalCenter + onReleased: { + console.debug("Clicked VR button"); + if (!dataContainer.activeVR) { + vrPopUp.activate(); + vrHelpPopup.show(); + } else { + vrPopUp.complete(); + vrHelpPopup.hide() + } + } + } + + ArrowKeys {anchors.verticalCenter: parent.verticalCenter} + + Grid { + columns: 5 + rows: 2 + spacing: 5 + anchors.verticalCenter: parent.verticalCenter + Repeater { + model: 10 + delegate : Rectangle { + width: 40 + height: 40 + radius: 5 + gradient: Gradient { + GradientStop + { + position: 0.0; + color: "#2c2c2c" + Behavior on position { + NumberAnimation { duration: 80 } + } + } + + GradientStop + { + position: 1.0; + color: "black" + Behavior on position { + NumberAnimation { duration: 80 } + } + } + } + + Text { + text: (1 + index) % 10 + font.pixelSize: 30 + color: Constants.panelTextColor + anchors.centerIn: parent + } + + Timer { + id: timer + interval: Constants.presetButtonTimer + repeat: false + triggeredOnStart: false + } + + MouseArea { + id: mouseArea + anchors.fill: parent + property bool clickProcessed + onPressed: { + parent.gradient.stops[0].position = 1.0 + parent.gradient.stops[1].position = 0.0 + clickProcessed = false + timer.start() + sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + index, Common.ButtonEventMode.BUTTONDOWN, undefined) + } + onReleased: { + parent.gradient.stops[0].position = 0.0 + parent.gradient.stops[1].position = 1.0 + sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + index, Common.ButtonEventMode.BUTTONUP, undefined) + timer.stop() + if (!clickProcessed) { + sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + index, Common.ButtonPressMode.SHORT, undefined) + } + } + Connections { + target: timer + onTriggered: { + if(!mouseArea.clickProcessed) { + sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + index, Common.ButtonPressMode.LONG, undefined) + mouseArea.clickProcessed = true + } + } + } + } + + Component.onCompleted: { + settingsContainer.buttonCapabilities.push( + { + name: Common.ButtonName.PRESET_0 + index, + upDownAvailable: true, + shortPressAvailable: true, + longPressAvailable: true + }); + } + } + } + } + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/IPodPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/IPodPlayerView.qml new file mode 100644 index 0000000000..65a667702b --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/IPodPlayerView.qml @@ -0,0 +1,61 @@ +/** + * @file IPodPlayerView.qml + * @brief IPod player screen view. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +import QtQuick 2.0 +import "../hmi_api/Common.js" as Common +import "../models/Constants.js" as Constants +import "../controls" + +GeneralView { + category: Common.DeactivateReason.AUDIO + MediaPlayer { + id: ipodPlayer + playerName: "iPod" + anchors.fill: parent + image: playerState.albumImage + playerState: dataContainer.ipodPlayerState + + buttons: [ + OvalButton { + text: ipodPlayer.playerName + onReleased: contentLoader.go("./views/MusicSourceView.qml") + fontSize: Constants.fontSize + }, + + OvalButton { + text: "Browse" + fontSize: Constants.fontSize + } + ] + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/LineInPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/LineInPlayerView.qml new file mode 100644 index 0000000000..70f3e04772 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/LineInPlayerView.qml @@ -0,0 +1,61 @@ +/** + * @file LineInPlayerView.qml + * @brief LineIn player screen view. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +import QtQuick 2.0 +import "../hmi_api/Common.js" as Common +import "../models/Constants.js" as Constants +import "../controls" + +GeneralView { + category: Common.DeactivateReason.AUDIO + MediaPlayer { + id: lineInPlayer + playerName: "LineIn" + anchors.fill: parent + image: playerState.albumImage + playerState: dataContainer.linePlayerState + + buttons: [ + OvalButton { + text: lineInPlayer.playerName + onReleased: contentLoader.go("./views/MusicSourceView.qml") + fontSize: Constants.fontSize + }, + + OvalButton { + text: "Browse" + fontSize: Constants.fontSize + } + ] + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/MainMenuView.qml b/src/components/qt_hmi/qml_model_qt5/views/MainMenuView.qml new file mode 100644 index 0000000000..7ed435b137 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/MainMenuView.qml @@ -0,0 +1,54 @@ +/** + * @file MainMenuView.qml + * @brief Main menu screen view. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +import QtQuick 2.0 +import "../models" +import "../controls" + +GridMenu { + id: menu + model: MainMenuListModel { } + delegate: GridItem { + width: menu.width / menu.columnsOnPage + height: menu.height / menu.rows + ClickableImage { + anchors.centerIn: parent + source: icon + onClicked: { + if(qml !== "") { + contentLoader.go(qml) + } + } + } + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/MediaClockView.qml b/src/components/qt_hmi/qml_model_qt5/views/MediaClockView.qml new file mode 100644 index 0000000000..5178d979cf --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/MediaClockView.qml @@ -0,0 +1,73 @@ +/** + * @file MediaClockView.qml + * @brief Media clock view + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../models/Constants.js" as Constants +import "../models/Internal.js" as Internal + +Item { + property alias time: timeText.text + Text { + id: timeText + anchors.left: parent.left + width: 1/10 * parent.width + anchors.verticalCenter: parent.verticalCenter + horizontalAlignment: Text.AlignRight + color: "white" + text: (mediaPlayerView.playerType === "SDL") ? Internal.hmsTimeToString(dataContainer.currentApplication.mediaClock.startTime) + : "02:36" //TODO {Aleshin}: get track time for all players except SDL + font.pixelSize: 18 + } + + Row { + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + height: parent.height + width: 2/3 * parent.width + + Rectangle { + anchors.verticalCenter: parent.verticalCenter + height: 2 + width: dataContainer.currentApplication.mediaClock.progress * parent.width + color: "white" + } + + Rectangle { + anchors.verticalCenter: parent.verticalCenter + height: 2 + width: (1 - dataContainer.currentApplication.mediaClock.progress) * parent.width + color: Constants.primaryColor + } + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/MediaPlayer.qml b/src/components/qt_hmi/qml_model_qt5/views/MediaPlayer.qml new file mode 100644 index 0000000000..ed4eda014e --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/MediaPlayer.qml @@ -0,0 +1,302 @@ +/** + * @file MediaPlayerView.qml + * @brief Parent for BT, IPod, CD players screen view. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../controls" +import "../models" +import "../hmi_api/Common.js" as Common +import "../models/Constants.js" as Constants +import "../models/Internal.js" as Internal + +Item { + id: mediaPlayerView + + property string playerName: "" + property string playerType: "" + + signal rewind + signal forward + signal play + signal pause + + // Holds players state(song name, play/pause state, track number etc). For all players except SDL. + property PlayerState playerState; + + property alias buttons: buttonsRow.content + property alias buttonsSpacing: buttonsRow.spacing + property alias image: image.source + + Item { + // row of oval buttons + id: ovalButtonsRow + width: parent.width + height: 1/5 * parent.height + anchors.left: parent.left + anchors.top: parent.top + + PagedFlickable { + id: buttonsRow + width: parent.width + spacing: (mediaPlayerView.playerType === "SDL") ? ((width - 4 * elementWidth) / 3) + : (width - 2 * elementWidth) + anchors.verticalCenter: parent.verticalCenter + snapTo: Constants.ovalButtonWidth + spacing + elementWidth: Constants.ovalButtonWidth + } + } + + Item { + id: spacingBetweenItems + width: parent.width + height: 1/10 * parent.height + anchors.left: parent.left + anchors.top: ovalButtonsRow.bottom + + Behavior on height { + NumberAnimation { + duration : Constants.animationDuration + } + } + } + + Column { + // Picture + text information + media clock + id: mediaContent + width: parent.width + height: 2/5 * parent.height + anchors.left: parent.left + anchors.top: spacingBetweenItems.bottom + + Row { + // picture + text info + width: parent.width + height: 3/4 * parent.height + spacing: Constants.margin + + Image { + id: image + height: parent.height + width: height + } + + Column { + // text info + id: textInfo + height: parent.height + width: parent.width - image.width - parent.spacing + spacing: (height - titleText.height - 3 * text.height) / 3 + + Text { + id: titleText + anchors.left: parent.left + anchors.right: parent.right + horizontalAlignment: dataContainer.currentApplication.hmiUITextAlignment + color: Constants.primaryColor + text: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.hmiUIText.mainField1 + : playerState.trackName + font.pixelSize: Constants.titleFontSize + font.bold: true + } + + Text { + id: text + anchors.left: parent.left + anchors.right: parent.right + horizontalAlignment: dataContainer.currentApplication.hmiUITextAlignment + color: Constants.primaryColor + text: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.hmiUIText.mainField2 + : playerState.albumName + font.pixelSize: Constants.fontSize + } + + Text { + anchors.left: parent.left + anchors.right: parent.right + horizontalAlignment: Text.AlignHCenter + color: Constants.primaryColor + text: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.hmiUIText.mediaTrack + : playerState.trackNumber + font.pixelSize: Constants.fontSize + } + } + } + + MediaClockView { + width: parent.width + height: parent.height * 1/4 + } + } + + Item { + id: spacingBetweenItems2 + width: parent.width + height: 1/10 * parent.height + anchors.left: parent.left + anchors.top: mediaContent.bottom + + Behavior on height { + NumberAnimation { + duration : Constants.animationDuration + } + } + } + + Row { + // Rewind, play, pause, forward buttons + id: playPauseRewindForward + width: parent.width + height: 1/5 * parent.height - statusBar.height + anchors.left: parent.left + anchors.leftMargin: (width - playPauseButton.width - prevButton.width - nextButton.width) / 2 + anchors.top: spacingBetweenItems2.bottom + + Image { + id: prevButton + anchors.verticalCenter: parent.verticalCenter + source: "../res/buttons/player_prev_btn.png" + MouseArea { + anchors.fill: parent + onPressed: { + prevButton.source = "../res/buttons/player_prev_pressed_btn.png" + } + onReleased: { + prevButton.source = "../res/buttons/player_prev_btn.png" + } + } + } + + PlayPauseButton { + id: playPauseButton + anchors.verticalCenter: parent.verticalCenter + state: (mediaPlayerView.playerType === "SDL") ? dataContainer.currentApplication.playPauseState : playerState.playPauseState + onClicked: { + (state == 'Play') ? play() : pause(); + var newState = state === "Play" ? "Pause" : "Play"; + (mediaPlayerView.playerType === "SDL") ? dataContainer.setApplicationProperties(dataContainer.currentApplication.appId, { playPauseState: newState } ) + : playerState.playPauseState = newState + } + } + + Image { + id: nextButton + anchors.verticalCenter: parent.verticalCenter + source: "../res/buttons/player_next_btn.png" + MouseArea { + anchors.fill: parent + onPressed: { + nextButton.source = "../res/buttons/player_next_pressed_btn.png" + } + onReleased: { + nextButton.source = "../res/buttons/player_next_btn.png" + } + } + } + } + + Item { + id: presetButtons + width: parent.width + height: 1/5 * parent.height + anchors.top: playPauseRewindForward.bottom + anchors.left: parent.left + + PresetRow { + id: presetsRow + anchors.top: parent.top + anchors.left: parent.left + presets: mediaPlayerView.playerType === "SDL" ? Internal.getArrayForPresetRow(dataContainer.currentApplication) : [] + width: parent.width + + onPresetButtonPressed: { + sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONDOWN, undefined) + } + + onPresetButtonReleased: { + sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONUP, undefined) + } + + onPresetButtonClicked: { + sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.SHORT, undefined) + } + + onPresetButtonHold: { + sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.LONG, undefined) + } + } + } + + StatusBar { + id: statusBar + anchors.left: parent.left + anchors.bottom: parent.bottom + } + + states: [ + State { + name: 'presetButtonsON' + when: (dataContainer.currentApplication.customPresets.count > 0) && (mediaPlayerView.playerType === "SDL") + PropertyChanges { + target: spacingBetweenItems + height: 1 + } + PropertyChanges { + target: spacingBetweenItems2 + height: 1 + } + PropertyChanges { + target: presetButtons + visible: true + enabled: true + } + }, + + State { + name: 'presetButtonsOFF' + when: (dataContainer.currentApplication.customPresets.count === 0) || (mediaPlayerView.playerType !== "SDL") + PropertyChanges { + target: spacingBetweenItems + height: 1/10 * mediaPlayerView.height + } + PropertyChanges { + target: spacingBetweenItems2 + height: 1/10 * mediaPlayerView.height + } + PropertyChanges { + target: presetButtons + visible: false + enabled: false + } + } + ] +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/MusicSourceView.qml b/src/components/qt_hmi/qml_model_qt5/views/MusicSourceView.qml new file mode 100644 index 0000000000..08f1d76b60 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/MusicSourceView.qml @@ -0,0 +1,75 @@ +/** + * @file MusicSourceView.qml + * @brief Music source screen view. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +import QtQuick 2.0 +import "../models" +import "../controls" +import "../models/Constants.js" as Constants + +GeneralView { + Item { + anchors.fill: parent + GridMenu { + id: menu + model: dataContainer.musicSourceModel + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + anchors.bottom: bottomPanel.top + delegate: GridItem { + width: menu.width / menu.columnsOnPage + height: menu.height / menu.rows + OvalButton { + text: title + onReleased: contentLoader.go(qml, appId) + anchors.centerIn: parent + fontSize: Constants.fontSize + } + } + } + + Item { + id: bottomPanel + // 1/4 bottom screen + anchors.bottom: parent.bottom + anchors.left: parent.left + height: 1/4 * parent.height + width: parent.width + + BackButton { anchors.centerIn: parent } + } + } +} + + + diff --git a/src/components/qt_hmi/qml_model_qt5/views/NavigationInRouteGridView.qml b/src/components/qt_hmi/qml_model_qt5/views/NavigationInRouteGridView.qml new file mode 100644 index 0000000000..99f1877a51 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/NavigationInRouteGridView.qml @@ -0,0 +1,250 @@ +/** + * @file NavigationInRouteGridView.qml + * @brief Navigation in route screen veiw. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../models/Constants.js" as Constants + + +GeneralView { + Item { + id: navInRoute + anchors.fill: parent + + Image { + // 3/4 top screen + id: map + height: parent.height * 3/4 + width: parent.width + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + source: "../res/nav/map.png" + + Image { + id: compas + anchors.bottom: parent.bottom + anchors.bottomMargin: 1/4 * compas.width + anchors.left: parent.left + anchors.leftMargin: 1/4 * compas.width + source: "../res/nav/compass.png" + } + + Column { + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: compas.horizontalCenter + spacing: 1/8 * parent.height + + // Zoom "+" button + Image { + id: zoomIn + source: "../res/buttons/zoom.png" + + Text { + id: zoomInBtn + anchors.centerIn: parent + text: "+" + color: Constants.releasedButtonTextColor + font.pixelSize: 30 + } + + MouseArea { + anchors.fill: parent + onPressed: { + parent.source = "../res/buttons/zoom_pressed.png" + zoomInBtn.color = Constants.pressedButtonTextColor + } + onReleased: { + parent.source = "../res/buttons/zoom.png" + zoomInBtn.color = Constants.releasedButtonTextColor + } + + onClicked: { + //Some behavior + } + } + } + + // Zoom "-" button + Image { + id: zoomOut + source: "../res/buttons/zoom.png" + + Text { + id: zoomOutBtn + anchors.centerIn: parent + text: "-" + color: "white" + font.pixelSize: 30 + } + + MouseArea { + anchors.fill: parent + onPressed: { + parent.source = "../res/buttons/zoom_pressed.png" + zoomOutBtn.color = Constants.pressedButtonTextColor + } + onReleased: { + parent.source = "../res/buttons/zoom.png" + zoomOutBtn.color = Constants.releasedButtonTextColor + } + + onClicked: { + //Some behavior + } + } + } + } // column + + // Options button + Image { + id: navOptions + anchors.top: parent.top + anchors.right: parent.right + source: "../res/nav/options.png" + + MouseArea { + anchors.fill: parent + onPressed: { + parent.source = "../res/nav/options_pressed.png" + } + onReleased: { + parent.source = "../res/nav/options.png" + } + onClicked: { + //Options screen + } + } + } + } //map + + Item { + // 1/4 bottom screen + anchors.bottom: parent.bottom + anchors.left: parent.left + width: parent.width + height: 1/4 * parent.height + + Image { + id: muteBtnImg + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.leftMargin: 1/4 * muteBtnImg.width + source: "../res/nav/mute_off.png" + MouseArea { + anchors.fill: parent + onClicked: if (muteBtnImg.state === "off") { + muteBtnImg.state = "on" + muteBtnImg.source = "../res/nav/mute_off.png" + } + else { + muteBtnImg.source = "../res/nav/mute_on.png" + muteBtnImg.state = "off" + } + } + } + + Image { + id: turnArrow + anchors.verticalCenter: parent.verticalCenter + anchors.left: muteBtnImg.right + anchors.leftMargin: 1/20 * contentLoader.width + source: "../res/nav/turnArrow.png" + } + + Text { + id: street + anchors.verticalCenter: cancel.verticalCenter + anchors.left: turnArrow.right + anchors.leftMargin: 1/20 * contentLoader.width + text: "0.2 mi on Cherry Hill Rd." + color: "White" + font.pixelSize: 20 + } + + Text { + id: timeToDest + anchors.verticalCenter: cancel.verticalCenter + anchors.right: cancel.left + anchors.rightMargin: 1/20 * contentLoader.width + text: "2 hrs 27 min" + color: "White" + font.pixelSize: 20 + } + + Image { + id: cancel + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + + source: "../res/buttons/long_oval_btn.png" + + Image { + id: destIcon + anchors.verticalCenter: parent.verticalCenter + anchors.left: cancel.left + anchors.leftMargin: Constants.fontSize + source: "../res/nav/dest_icon.png" + } + + Text { + id: cancelText + anchors.centerIn: parent + text: "Cancel" + color: Constants.primaryColor + font.pixelSize: 20 + } + + MouseArea { + anchors.fill: parent + + onPressed: { + cancel.source = "../res/buttons/long_oval_pressed_btn.png" + destIcon.source = "../res/nav/dest_icon_black.png" + cancelText.color = Constants.pressedButtonTextColor + } + + onReleased: { + cancel.source = "../res/buttons/long_oval_btn.png" + destIcon.source = "../res/nav/dest_icon.png" + cancelText.color = Constants.primaryColor + } + + onClicked: { + contentLoader.go("./views/NavigationNoRouteGridView.qml") + } + } + } + } + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/NavigationKeyboardView.qml b/src/components/qt_hmi/qml_model_qt5/views/NavigationKeyboardView.qml new file mode 100644 index 0000000000..f5d19e7626 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/NavigationKeyboardView.qml @@ -0,0 +1,221 @@ +/** + * @file NavigationKeyboardView.qml + * @brief Navigation keyboard screen view. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../controls" +import "../models/Constants.js" as Constants + +GeneralView { + Item { + id: navKeyboard + anchors.fill: parent + + Item { + // 3/4 top screen + height: parent.height * 3/4 + width: parent.width + anchors.top: parent.top + anchors.left: parent.left + + // Text line with input text + TextInput { + id: inputText + anchors.top:parent.top + anchors.left:parent.left + maximumLength: 30 + color: Constants.primaryColor + font.pixelSize: Constants.fontSize + text: dataContainer.routeText + } + + // Keyboard + Column { + anchors.centerIn: parent + Row { + id: upperRow + property string qWERTY : "QWERTYUIOP" + anchors.horizontalCenter: parent.horizontalCenter + + Repeater { + model: 10 + CircleButton { + imgOff: "../res/buttons/preset_btn.png" + imgOn: "../res/buttons/preset_pressed_btn.png" + text: upperRow.qWERTY.charAt(index) + pixelSize: Constants.fontSize + + onClicked: { + dataContainer.routeText += upperRow.qWERTY.charAt(index) + } + } + } + } + Row { + id: middleRow + property string aSDFGH : "ASDFGHJKL" + anchors.horizontalCenter: parent.horizontalCenter + + CircleButton { + imgOff: "../res/buttons/preset_btn.png" + imgOn: "../res/buttons/preset_pressed_btn.png" + text: "123" + pixelSize: 15 + } + //-------------- + Repeater { + model: 9 + CircleButton { + imgOff: "../res/buttons/preset_btn.png" + imgOn: "../res/buttons/preset_pressed_btn.png" + text: middleRow.aSDFGH.charAt(index) + pixelSize: Constants.fontSize + + onClicked: { + dataContainer.routeText += middleRow.aSDFGH.charAt(index) + } + } + } + //-------------- + CircleButton { + imgOff: "../res/buttons/preset_btn.png" + imgOn: "../res/buttons/preset_pressed_btn.png" + onIsPressedChanged: { + hoverImg.source = isPressed ? "../res/nav/delete_icon_black.png" : "../res/nav/delete_icon.png"; + } + Image { + id: hoverImg + anchors.centerIn: parent + source: "../res/nav/delete_icon.png" + } + + onClicked: { + dataContainer.routeText = dataContainer.routeText.substring(0,dataContainer.routeText.length - 1) + } + } + } + Row { + id: lowerRow + property string zXCVBN : "ZXCVBNM" + anchors.horizontalCenter: parent.horizontalCenter + + CircleButton { + imgOff: "../res/buttons/preset_btn.png" + imgOn: "../res/buttons/preset_pressed_btn.png" + text: "!@#" + pixelSize: 15 + } + //----------------- + Repeater { + model: 7 + CircleButton { + imgOff: "../res/buttons/preset_btn.png" + imgOn: "../res/buttons/preset_pressed_btn.png" + text: lowerRow.zXCVBN.charAt(index) + pixelSize: Constants.fontSize + + onClicked: { + dataContainer.routeText += lowerRow.zXCVBN.charAt(index) + } + } + } + //---------------- + CircleButton { + imgOff: "../res/buttons/preset_btn.png" + imgOn: "../res/buttons/preset_pressed_btn.png" + text: "Clear" + pixelSize: 12 + + onClicked: { + dataContainer.routeText = "" + } + } + //---------------- + CircleButton { + imgOff: "../res/buttons/preset_btn.png" + imgOn: "../res/buttons/preset_pressed_btn.png" + text: "Space" + pixelSize: 12 + + onClicked: { + dataContainer.routeText += " " + } + } + } + + } // column + + Image { + id: goBtn + anchors.right: parent.right + anchors.top: parent.top + source: "../res/buttons/short_oval_btn.png" + + Text { + id: goText + anchors.centerIn: parent + text: "Go" + color: Constants.primaryColor + font.pixelSize: Constants.fontSize + } + + MouseArea { + anchors.fill: parent + + onPressed: { + goBtn.source = "../res/buttons/short_oval_btn_pressed.png" + goText.color = Constants.pressedButtonTextColor + } + + onReleased: { + goBtn.source = "../res/buttons/short_oval_btn.png" + goText.color = Constants.primaryColor + } + + onClicked: { + contentLoader.go("./views/NavigationInRouteGridView.qml") + } + } + } + } // 3/4 top screen + + Item { + // 1/4 bottom screen + anchors.bottom: parent.bottom + anchors.left: parent.left + width: parent.width + height: 1/4 * parent.height + BackButton { anchors.centerIn: parent } + } + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/NavigationMenuView.qml b/src/components/qt_hmi/qml_model_qt5/views/NavigationMenuView.qml new file mode 100644 index 0000000000..8b8b7ef261 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/NavigationMenuView.qml @@ -0,0 +1,75 @@ +/** + * @file NavigationMenuView.qml + * @brief Navigation menu screen view. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../models" +import "../controls" +import "../models/Constants.js" as Constants + +GeneralView { + Item { + anchors.fill: parent + GridMenu { + id: menu + model: NavigationMenuModel {} + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + anchors.bottom: bottomPanel.top + delegate: GridItem { + width: menu.width / menu.columnsOnPage + height: menu.height / menu.rows + OvalButton { + text: title + onReleased: contentLoader.go(qml) + anchors.centerIn: parent + fontSize: Constants.fontSize + } + } + } + + Item { + id: bottomPanel + // 1/4 bottom screen + anchors.bottom: parent.bottom + anchors.left: parent.left + height: 1/4 * parent.height + width: parent.width + + BackButton { anchors.centerIn: parent } + } + } +} + + diff --git a/src/components/qt_hmi/qml_model_qt5/views/NavigationNoRouteGridView.qml b/src/components/qt_hmi/qml_model_qt5/views/NavigationNoRouteGridView.qml new file mode 100644 index 0000000000..d4fbb9f4ef --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/NavigationNoRouteGridView.qml @@ -0,0 +1,205 @@ +/** + * @file NavigationNoRouteGridView.qml + * @brief Navigation no route screen view. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../models/Constants.js" as Constants + +GeneralView { + Item { + id: navNoRoute + anchors.fill: parent + + Image { + // 3/4 top screen + id: map + height: parent.height * 3/4 + width: parent.width + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + source: "../res/nav/map.png" + + Image { + id: compas + anchors.bottom: parent.bottom + anchors.bottomMargin: 1/4 * compas.width + anchors.left: parent.left + anchors.leftMargin: 1/4 * compas.width + source: "../res/nav/compass.png" + } + + Column { + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: compas.horizontalCenter + spacing: 1/8 * parent.height + + // Zoom "+" button + Image { + id: zoomIn + source: "../res/buttons/zoom.png" + + Text { + id: zoomInBtn + anchors.centerIn: parent + text: "+" + color: "white" + font.pixelSize: Constants.fontSize + } + + MouseArea { + anchors.fill: parent + onPressed: { + parent.source = "../res/buttons/zoom_pressed.png" + zoomInBtn.color = Constants.pressedButtonTextColor + } + onReleased: { + parent.source = "../res/buttons/zoom.png" + zoomInBtn.color = Constants.releasedButtonTextColor + } + + onClicked: { + //Some behavior + } + } + } + + // Zoom "-" button + Image { + id: zoomOut + source: "../res/buttons/zoom.png" + + Text { + id: zoomOutBtn + anchors.centerIn: parent + text: "-" + color: "white" + font.pixelSize: Constants.fontSize + } + + MouseArea { + anchors.fill: parent + onPressed: { + parent.source = "../res/buttons/zoom_pressed.png" + zoomOutBtn.color = Constants.pressedButtonTextColor + } + onReleased: { + parent.source = "../res/buttons/zoom.png" + zoomOutBtn.color = Constants.releasedButtonTextColor + } + + onClicked: { + //Some behavior + } + } + } + } // column + + // Options button + Image { + id: navOptions + anchors.top: parent.top + anchors.right: parent.right + source: "../res/nav/options.png" + + MouseArea { + anchors.fill: parent + onPressed: { + parent.source = "../res/nav/options_pressed.png" + } + onReleased: { + parent.source = "../res/nav/options.png" + } + onClicked: { + //Options screen + } + } + } + } //map + + Item { + // 1/4 bottom screen + id: bottomPart + anchors.bottom: parent.bottom + anchors.left: parent.left + width: parent.width + height: 1/4 * parent.height + + // Destination search button + Image { + id: destSearch + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + source: "../res/buttons/longest_oval_btn.png" + + Image { + id: destIcon + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.leftMargin: 15 + source: "../res/nav/dest_icon.png" + } + + Text { + id: destText + anchors.verticalCenter: parent.verticalCenter + anchors.left: destIcon.right + anchors.leftMargin: 5 + text: "Destination" + color: Constants.primaryColor + font.pixelSize: 20 + } + + MouseArea { + anchors.fill: parent + + onPressed: { + destSearch.source = "../res/buttons/longest_oval_btn_pressed.png" + destIcon.source = "../res/nav/dest_icon_black.png" + destText.color = Constants.pressedButtonTextColor + } + + onReleased: { + destSearch.source = "../res/buttons/longest_oval_btn.png" + destIcon.source = "../res/nav/dest_icon.png" + destText.color = Constants.primaryColor + } + + onClicked: { + contentLoader.go("./views/NavigationMenuView.qml") + } + } + } + } + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/PhoneKeyboardView.qml b/src/components/qt_hmi/qml_model_qt5/views/PhoneKeyboardView.qml new file mode 100644 index 0000000000..4b217cf9f5 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/PhoneKeyboardView.qml @@ -0,0 +1,171 @@ +/** + * @file PhoneKeyboardView.qml + * @brief Phone keyboard screen view. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../controls" +import "../models" +import "../models/Constants.js" as Constants + +GeneralView{ + Component.onCompleted: phoneKeyboard.changeColorOfActiveButtons() + + Item { + function changeColorOfActiveButtons() { + for (var i = 0; i < contactsListModel.count; i++) { + activeButtons[contactsListModel.get(i).name[0].toUpperCase()] = true + } + } + + id: phoneKeyboard + anchors.fill: parent + + property var activeButtons: { + "A": false, "B": false, "C": false, "D": false, "E": false, + "F": false, "G": false, "H": false, "I": false, "J": false, + "K": false, "L": false, "M": false, "N": false, "O": false, + "P": false, "Q": false, "R": false, "S": false, "T": false, + "U": false, "V": false, "W": false, "X": false, "Y": false, "Z": false + } + + ContactsListModel { + id: contactsListModel + } + + Item { + // 3/4 top screen + height: parent.height * 3/4 + width: parent.width + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + Column { + anchors.centerIn: parent + + Row { + id: upperRow + property string contentLoader : "ABCDEFGHI" + anchors.horizontalCenter: parent.horizontalCenter + Repeater { + model: 9 + CircleButton { + imgOff: "../res/buttons/preset_btn.png" + imgOn: "../res/buttons/preset_pressed_btn.png" + textColorDefault: phoneKeyboard.activeButtons[upperRow.contentLoader.charAt(index)] + ? Constants.primaryColor : Constants.inactiveButtonTextColor + text: upperRow.contentLoader.charAt(index) + pixelSize: Constants.fontSize + onIsPressedChanged: { + if (!isPressed){ + if (phoneKeyboard.activeButtons[upperRow.contentLoader.charAt(index)]) { + dataContainer.contactsFirstLetter = text + contentLoader.go("./views/ContactsListView.qml") + } + } + } + } + } + } + + Row { + id: middleRow + property string contentLoader : "JKLMNOPQR" + anchors.horizontalCenter: parent.horizontalCenter + Repeater { + model: 9 + CircleButton { + imgOff: "../res/buttons/preset_btn.png" + imgOn: "../res/buttons/preset_pressed_btn.png" + textColorDefault: phoneKeyboard.activeButtons[middleRow.contentLoader.charAt(index)] + ? Constants.primaryColor : Constants.inactiveButtonTextColor + text: middleRow.contentLoader.charAt(index) + pixelSize: Constants.fontSize + onIsPressedChanged: { + if (!isPressed){ + if (phoneKeyboard.activeButtons[middleRow.contentLoader.charAt(index)]) { + dataContainer.contactsFirstLetter = text + contentLoader.go("./views/ContactsListView.qml") + } + } + } + } + } + } + + Row { + id: lowerRow + property string contentLoader : "STUVWXYZ" + anchors.horizontalCenter: parent.horizontalCenter + Repeater { + model: 8 + CircleButton { + imgOff: "../res/buttons/preset_btn.png" + imgOn: "../res/buttons/preset_pressed_btn.png" + textColorDefault: phoneKeyboard.activeButtons[lowerRow.contentLoader.charAt(index)] + ? Constants.primaryColor : Constants.inactiveButtonTextColor + text: lowerRow.contentLoader.charAt(index) + pixelSize: Constants.fontSize + onIsPressedChanged: { + if (!isPressed){ + if (phoneKeyboard.activeButtons[lowerRow.contentLoader.charAt(index)]) { + dataContainer.contactsFirstLetter = text + contentLoader.go("./views/ContactsListView.qml") + } + } + } + } + } + CircleButton { + imgOff: "../res/buttons/preset_btn.png" + imgOn: "../res/buttons/preset_pressed_btn.png" + text: "123" + pixelSize: 20 + } + } + } + } + + Item { + // 1/4 bottom screen + anchors.bottom: parent.bottom + anchors.left: parent.left + width: parent.width + height: 1/4 * parent.height + + BackButton { anchors.centerIn: parent} + } + } +} + + diff --git a/src/components/qt_hmi/qml_model_qt5/views/PhoneMenuGridView.qml b/src/components/qt_hmi/qml_model_qt5/views/PhoneMenuGridView.qml new file mode 100644 index 0000000000..5cfdc5a309 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/PhoneMenuGridView.qml @@ -0,0 +1,55 @@ +/** + * @file PhoneMenuGridView.qml + * @brief View for phone menu. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../models" +import "../controls" + +GridMenu { + id: menu + model: PhoneMenuModel {} + delegate: GridItem { + width: menu.width / menu.columnsOnPage + height: menu.height / menu.rows + ClickableImage { + anchors.centerIn: parent + source: icon + onClicked: { + if(qml !== "") { + contentLoader.go(qml) + } + } + } + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/PolicyAppListView.qml b/src/components/qt_hmi/qml_model_qt5/views/PolicyAppListView.qml new file mode 100644 index 0000000000..83a223a18a --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/PolicyAppListView.qml @@ -0,0 +1,98 @@ +/** + * @file SettingsSourceView.qml + * @brief Settings source screen view. + * Copyright (c) 2014, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +import QtQuick 2.0 +import "../models" +import "../controls" +import "../models/Constants.js" as Constants + +GeneralView { + Item { + anchors.fill: parent + Text { + id: title + text: "Permissions (choose application):" + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + font.pixelSize: Constants.fontSize + color: Constants.primaryColor + height: Constants.fontSize + Constants.panelPadding + } + ScrollableListView { + id: applicationList + anchors.top: title.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + model: dataContainer.applicationList + + delegate: Item { + width: parent.width + height: Math.max(applicationName.height, appIcon.height) + Image { + id: appIcon + source: icon + height: Constants.appListIconSize + width: height + } + ClickableText { + id: applicationName + text: appName + defaultColor: Constants.primaryColor + pressedColor: Constants.primaryColorPressed + font.pixelSize: Constants.appListFontSize + anchors.verticalCenter: parent.verticalCenter + anchors.left: appIcon.right + anchors.leftMargin: Constants.margin + onClicked: { + RequestToSDL.SDL_GetListOfPermissions(appId, function(params){ + settingsContainer.getListOfPermissions_Response(appId, params) + }); + } + } + } + } + + Item { + id: bottomPanel + // 1/4 bottom screen + anchors.bottom: parent.bottom + anchors.left: parent.left + height: 1/4 * parent.height + width: parent.width + + BackButton { anchors.centerIn: parent } + } + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/RadioPlayer.qml b/src/components/qt_hmi/qml_model_qt5/views/RadioPlayer.qml new file mode 100644 index 0000000000..f673327c68 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/RadioPlayer.qml @@ -0,0 +1,160 @@ +/** + * @file RadioPlayerView.qml + * @brief Parent for AM, FM, Sirius players screen view. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../controls" +import "../models" +import "../models/Constants.js" as Constants + +Item { + id: radioPlayerView + + property string radioType: "" + property string radioName: "" + property alias buttonHD: bot.children + + property PlayerState playerState + + Item { + // top 3/4 screen + id: upperContent + anchors.top: parent.top + anchors.left: parent.left + height: parent.height * 3/4 + width: parent.width + + Item { + // top part for buttons + id: top + anchors.top: parent.top + anchors.left: parent.left + width: parent.width + height: parent.height * 1/4 + + OvalButton { + text: radioName + onReleased: contentLoader.go("./views/MusicSourceView.qml") + fontSize: Constants.fontSize + } + + OvalButton { + anchors.right: parent.right + anchors.top: parent.top + text: "Tune" + fontSize: Constants.fontSize + } + } + + Item { + // mid part for information about song + id: mid + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + width: parent.width + height: parent.height / 2 + + Column { + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + + Row { + Text { + id: radioChannelNameText + color: Constants.primaryColor + text: playerState.presets[0] + font.pixelSize: 45 + } + Text { + anchors.bottom: radioChannelNameText.bottom + color: Constants.primaryColor + text: " " + radioType + font.pixelSize: 25 + } + } + + Text { + color: Constants.primaryColor + text: playerState.songName + font.pixelSize: 25 + font.bold: true + } + + Text { + color: Constants.primaryColor + text: playerState.albumName + font.pixelSize: 25 + } + } + } + + Item { + // bottom part for HD button (for FM radio) + id: bot + anchors.left: parent.left + anchors.bottom: parent. bottom + width: parent.width + height: parent.height * 1/4 + } + } + + Item { + // bottom 1/4 screen + id: lowerContent + anchors.bottom: parent.bottom + anchors.left: parent.left + width: parent.width + height: 1/4 * parent.height + + // Line that divide screen in two parts + Rectangle { + anchors.top: parent.top + anchors.left: parent.left + width: parent.width + height: 2 + color: Constants.primaryColor + } + + PresetRow { + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + presets: playerState.presets + width: parent.width + onSelectedIndexChanged: { + radioChannelNameText.text = presets[selectedIndex]; + } + } + } +} + + diff --git a/src/components/qt_hmi/qml_model_qt5/views/SDLFunctionalityView.qml b/src/components/qt_hmi/qml_model_qt5/views/SDLFunctionalityView.qml new file mode 100644 index 0000000000..8ac6e6d9b8 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/SDLFunctionalityView.qml @@ -0,0 +1,117 @@ +/** + * Copyright (c) 2014, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +import QtQuick 2.0 +import "../models" +import "../controls" +import "../models/Constants.js" as Constants + +GeneralView { + Item { + id: deviceList + property bool allowed: false + + function setAllowed(allowed) { + console.debug("Set allowed", allowed, deviceList.allowed); + deviceList.allowed = allowed; + for (var i = 0; i < dataContainer.deviceList.count; ++i) { + menu.model.get(i).allowed = allowed; + } + } + + anchors.fill: parent + Text { + id: title + text: "Choose devices to be allowed for SDL functionality:" + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + font.pixelSize: Constants.fontSize + color: Constants.primaryColor + height: Constants.fontSize + Constants.panelPadding + } + + OvalButton { + id: allDevice + text: "All devices Not Allowed" + onClicked: { + if (parent.allowed) { + parent.setAllowed(false); + text = "All devices Not Allowed"; + } else { + parent.setAllowed(true); + text = "All devices Allowed"; + } + settingsContainer.allowSDLFunctionality(parent.allowed, undefined); + } + anchors.top: title.bottom + anchors.left: parent.left + anchors.right: parent.right + fontSize: Constants.fontSize + } + + ScrollableListView { + id: menu + model: dataContainer.deviceList + anchors.left: parent.left + anchors.right: parent.right + anchors.top: allDevice.bottom + anchors.bottom: bottomPanel.top + delegate: OvalButton { + text: (allowed) ? name + " - Allowed" : + name + " - Not allowed" + onClicked: { + var item = menu.model.get(index); + allDevice.text = "All devices manual Configuration"; + item.allowed = !item.allowed; + settingsContainer.allowSDLFunctionality(item.allowed, + {id: item.devid, + name: item.name}); + deviceList.allowed = null; + } + anchors.left: parent.left + anchors.right: parent.right + fontSize: Constants.fontSize + } + } + + Item { + id: bottomPanel + // 1/4 bottom screen + anchors.bottom: parent.bottom + anchors.left: parent.left + height: 1/4 * parent.height + width: parent.width + + BackButton { anchors.centerIn: parent } + } + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/SDLNavi.qml b/src/components/qt_hmi/qml_model_qt5/views/SDLNavi.qml new file mode 100644 index 0000000000..ef98ffb10d --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/SDLNavi.qml @@ -0,0 +1,223 @@ +/** + * @file SDLNavi.qml + * @brief SDL navigation screen view. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import QtMultimedia 5.0 +import "../controls" +import "../models/Constants.js" as Constants +import "../hmi_api/Common.js" as Common + +GeneralView { + applicationContext: true + + MultiTouchArea { + anchors.fill: parent + id: wholeWindow + + Row { + // Top items + id: topItems + anchors.top: parent.top + anchors.left: parent.left + width: parent.width + height: 1/6 * parent.height + spacing: Constants.sdlNaviSpacing + + Rectangle { + anchors.top: parent.top + width: 1/5 * parent.width + height: 4/5 * parent.height + color: Constants.sdlNaviTransparentItemColor + radius: 5 + + Text { + text: dataContainer.currentApplication.hmiUIText.mainField1 + anchors.fill: parent + font.pixelSize: Constants.fontSize + color: "white" + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } + } + Rectangle { + anchors.top: parent.top + width: 3/5 * parent.width - 2 * parent.spacing + height: parent.height + color: Constants.sdlNaviTransparentItemColor + radius: 5 + + Text { + text: dataContainer.currentApplication.hmiUIText.mainField2 + anchors.fill: parent + font.pixelSize: Constants.fontSize + color: "white" + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } + } + Rectangle { + id: rightRectOfTopItems + anchors.top: parent.top + width: 1/5 * parent.width + height: 4/5 * parent.height + color: Constants.sdlNaviTransparentItemColor + radius: 5 + Text { + text: dataContainer.currentApplication.hmiUIText.mainField3 ? dataContainer.currentApplication.hmiUIText.mainField3 : "field3" + anchors.fill: parent + font.pixelSize: Constants.fontSize + color: "white" + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } + } + } + + Column { + // "+", "-" button at left + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + width: 1/12 * parent.width + height: 2/10 * parent.height + spacing + spacing: Constants.sdlNaviSpacing + + GradientRectangle { + width: parent.width + height: 1/10 * wholeWindow.height + text: "+" + isCustomButton: true + customButtonID: 3 + } + GradientRectangle { + width: parent.width + height: 1/10 * wholeWindow.height + text: "-" + isCustomButton: true + customButtonID: 4 + } + } + + Column { + anchors.right: parent.right + anchors.top: topItems.bottom + width: 1/6 * parent.width + height: 2/10 * parent.height + spacing + spacing: Constants.sdlNaviSpacing + + Rectangle { + width: parent.width + height: 1/10 * wholeWindow.height + color: Constants.sdlNaviTransparentItemColor + radius: 5 + Text { + text: "" + anchors.fill: parent + font.pixelSize: Constants.fontSize + color: "white" + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } + } + Rectangle { + width: parent.width + height: 1/10 * wholeWindow.height + color: Constants.sdlNaviTransparentItemColor + radius: 5 + Text { + text: dataContainer.currentApplication.hmiUIText.mainField4 ? dataContainer.currentApplication.hmiUIText.mainField4 : "mainField4" + anchors.fill: parent + font.pixelSize: Constants.fontSize + color: "white" + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } + } + } + + Row { + // bottom items + id: bottomItems + anchors.bottom: parent.bottom + anchors.left: parent.left + width: parent.width + height: 1/6 * parent.height + spacing: Constants.sdlNaviSpacing + + GradientRectangle { + anchors.bottom: parent.bottom + width: 1/3 * parent.width + height: parent.height + text: "Menu" + isCustomButton: true + customButtonID: 1 + } + Rectangle { + anchors.bottom: parent.bottom + width: 1/3 * parent.width - 2 * parent.spacing + height: parent.height + color: Constants.sdlNaviTransparentItemColor + radius: 5 + Text { + text: "mainField5" + anchors.fill: parent + font.pixelSize: Constants.fontSize + color: "white" + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + } + } + GradientRectangle { + anchors.bottom: parent.bottom + width: 1/3 * parent.width + height: parent.height + text: "Custom Button" + isCustomButton: true + customButtonID: 2 + } + } + + GradientRectangle { + anchors.right: parent.right + anchors.bottom: bottomItems.top + anchors.bottomMargin: Constants.sdlNaviSpacing + width: 1/6 * parent.width + height: 1/10 * parent.height + text: "Options" + fontSize: Constants.fontSize + onReleased: { + contentLoader.go("./views/SDLPlayerOptionsListView.qml", dataContainer.currentApplication.appId) + } + } + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/SDLNonMediaView.qml b/src/components/qt_hmi/qml_model_qt5/views/SDLNonMediaView.qml new file mode 100644 index 0000000000..231ab03135 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/SDLNonMediaView.qml @@ -0,0 +1,179 @@ +/** + * @file SDLNonMediaView.qml + * @brief SDL non media screen view. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + + +import QtQuick 2.0 +import "../models" +import "../controls" +import "../models/Constants.js" as Constants +import "../models/Internal.js" as Internal +import "../hmi_api/Common.js" as Common + +GeneralView { + applicationContext: true + + Item { + id: upperContent + height: parent.height * 3/4 + width: parent.width + anchors.top: parent.top + anchors.left: parent.left + + Item { + id: topButtonRow + // top 1/4 of screen + width: parent.width + height: 1/4 * parent.height + + PagedFlickable { + anchors.verticalCenter: parent.verticalCenter + width: parent.width + elementWidth: Constants.ovalButtonWidth + spacing: (width - 4 * elementWidth) / 3 + snapTo: elementWidth + spacing + + OvalButton { + text: "Options" + onClicked: { contentLoader.go("./views/SDLPlayerOptionsListView.qml") } + } + + Repeater { + model: dataContainer.currentApplication.softButtons ? + dataContainer.currentApplication.softButtons.count : + 0 + delegate: + SoftButton { + appId: dataContainer.currentApplication.appId + button: dataContainer.currentApplication.softButtons.get(index) + } + } + } + } + + Column { + id: midContent + height: parent.height * 3/4 + width: parent.width + anchors.top: topButtonRow.bottom + anchors.left: parent.left + + Text { + id: deviceName + width: parent.width + height: 1/5 * parent.height + text: "Device: " + dataContainer.currentApplication.deviceName + verticalAlignment: Text.AlignVCenter + font.pixelSize: Constants.fontSize + color: Constants.primaryColor + } + + Row { + width: parent.width + height: 4/5 * parent.height + spacing: Constants.margin + + Image { + id: image + height: parent.height + width: height + source: dataContainer.currentApplication.hmiUIText.image + } + + Column { + height: parent.height + width: parent.width - image.width - parent.spacing + spacing: Constants.margin + + Text { + id: text1 + width: parent.width + verticalAlignment: Text.AlignVCenter + horizontalAlignment: dataContainer.currentApplication.hmiUITextAlignment + text: dataContainer.currentApplication.hmiUIText.mainField1 + font.pixelSize: Constants.fontSize + color: Constants.primaryColor + } + + Text { + width: parent.width + verticalAlignment: Text.AlignVCenter + horizontalAlignment: dataContainer.currentApplication.hmiUITextAlignment + text: dataContainer.currentApplication.hmiUIText.mainField2 + font.pixelSize: Constants.fontSize + color: Constants.primaryColor + } + } + } + } + } + + Item { + // bottom 1/4 screen + id: lowerContent + anchors.bottom: parent.bottom + anchors.left: parent.left + width: parent.width + height: parent.height * 1/4 + + PresetRow { + id: presetsRow + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + presets: Internal.getArrayForPresetRow(dataContainer.currentApplication) + width: parent.width + property bool clickProcessed + + onPresetButtonPressed: { + sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONDOWN, undefined) + } + + onPresetButtonReleased: { + sdlButtons.onButtonEvent(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonEventMode.BUTTONUP, undefined) + } + + onPresetButtonClicked: { + sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.SHORT, undefined) + } + + onPresetButtonHold: { + sdlButtons.onButtonPress(Common.ButtonName.PRESET_0 + selectedIndex, Common.ButtonPressMode.LONG, undefined) + } + } + } + + StatusBar { + anchors.left: parent.left + anchors.bottom: parent.bottom + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerOptionsListView.qml b/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerOptionsListView.qml new file mode 100644 index 0000000000..8f3a0a17b6 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerOptionsListView.qml @@ -0,0 +1,120 @@ +/** + * @file SDLPlayerOptionsListView.qml + * @brief SDL player options screen view. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../controls" +import "../hmi_api/Common.js" as Common +import "../models/Constants.js" as Constants +import "../models/Internal.js" as Internal + +GeneralView { + applicationContext: true + systemContext: Common.SystemContext.SYSCTXT_MENU + Item { + // 3/4 top screen + height: parent.height * 3/4 + width: parent.width + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + ListView { + id: sdlPlayerOptionsListView + anchors.horizontalCenter: parent.horizontalCenter + width:parent.width + height:parent.height + + model: dataContainer.currentApplication.currentSubMenu + + delegate: Row { + spacing: Constants.iconItemListSpacing + Icon { + source: model.icon + width: Constants.iconItemListSize + height: Constants.iconItemListSize + + MouseArea { + anchors.fill: parent + enabled: model.icon.value !== undefined + + onPressed: text.press() + onReleased: text.release() + onCanceled: text.release() + onClicked: text.click() + } + } + + ClickableText { + id: text + text: name + (type === Internal.MenuItemType.MI_SUBMENU ? " >" : "") + width: sdlPlayerOptionsListView.width - x + elide: Text.ElideRight + defaultColor: type === Internal.MenuItemType.MI_PARENT ? + Constants.inactiveButtonTextColor : + Constants.primaryColor + pressedColor: type === Internal.MenuItemType.MI_PARENT ? + Constants.inactiveButtonTextColorPressed : + Constants.primaryColorPressed + font.pixelSize: Constants.titleFontSize + + function click() { + console.debug("enter") + switch (type) { + case Internal.MenuItemType.MI_NODE: + sdlUI.onCommand(model.id, dataContainer.currentApplication.appId) + contentLoader.back() + break; + case Internal.MenuItemType.MI_SUBMENU: + case Internal.MenuItemType.MI_PARENT: + dataContainer.currentApplication.currentSubMenu = subMenu + break; + } + console.debug("exit") + } + onClicked: click() + } + } + } + } + + Item { + // 1/4 bottom screen + anchors.bottom: parent.bottom + anchors.left: parent.left + width: parent.width + height: 1/4 * parent.height + + BackButton { anchors.centerIn: parent } + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerView.qml new file mode 100644 index 0000000000..4fff5aa826 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/SDLPlayerView.qml @@ -0,0 +1,79 @@ +/** + * @file SDLPlayerView.qml + * @brief SDL player screen view. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../controls" +import "../hmi_api/Common.js" as Common +import "../models/Constants.js" as Constants + +GeneralView { + applicationContext: true + MediaPlayer { + id: mediaPlayer + onPlay: { sdlButtons.onButtonPress(Common.ButtonName.OK, Common.ButtonPressMode.SHORT, undefined) } + onPause: { sdlButtons.onButtonPress(Common.ButtonName.OK, Common.ButtonPressMode.SHORT, undefined) } + playerName: "SDL music" + playerType: "SDL" + image: dataContainer.currentApplication.hmiUIText.image + anchors.fill: parent + + buttons: [ + OvalButton { + text: dataContainer.currentApplication.appName + onReleased: { contentLoader.go("./views/MusicSourceView.qml") } + }, + + OvalButton { + text: "SDL Menu" + onReleased: { contentLoader.go("./views/ApplicationListView.qml") } + }, + + OvalButton { + text: "Options" + onReleased: { contentLoader.go("./views/SDLPlayerOptionsListView.qml") } + }, + + Repeater { + model: dataContainer.currentApplication.softButtons ? + dataContainer.currentApplication.softButtons.count : + 0 + + delegate: SoftButton { + appId: dataContainer.currentApplication.appId + button: dataContainer.currentApplication.softButtons.get(index) + } + } + ] + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/ScrollableMessageView.qml b/src/components/qt_hmi/qml_model_qt5/views/ScrollableMessageView.qml new file mode 100644 index 0000000000..ec9731d1c4 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/ScrollableMessageView.qml @@ -0,0 +1,176 @@ +/** + * @file ScrollableMessageView.qml + * @brief Scrollable Message View. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../controls" +import "../hmi_api/Common.js" as Common +import "../hmi_api/Async.js" as Async +import "../models/Constants.js" as Constants +import "../models" +import "../popups" + +GeneralView { + applicationContext: true + onLeaveScreen: { + timer.stop() + dataContainer.scrollableMessageModel.running = false + DBus.sendReply(dataContainer.scrollableMessageModel.async, { __retCode: dataContainer.scrollableMessageModel.result }) + } + Component.onCompleted: { + dataContainer.scrollableMessageModel.result = Common.Result.ABORTED + dataContainer.scrollableMessageModel.running = true + timer.start() + } + + Timer { + id: timer + interval: dataContainer.scrollableMessageModel.timeout + onTriggered: { + dataContainer.scrollableMessageModel.result = Common.Result.SUCCESS + contentLoader.back() + } + } + + Rectangle { + anchors.fill: parent + color: Constants.secondaryColor + + Item { + // top 1/5 of screen + id: top + anchors.top: parent.top + anchors.left: parent.left + width: parent.width + height: dataContainer.scrollableMessageModel.softButtons.count > 0 ? parent.height * 1/5 : 1 + + PagedFlickable { + id: flickRow + width: top.width + spacing: (width - elementWidth * 4) / 3 + snapTo: Constants.ovalButtonWidth + spacing + elementWidth: Constants.ovalButtonWidth + Repeater { + model: dataContainer.scrollableMessageModel.softButtons ? + dataContainer.scrollableMessageModel.softButtons.count : + 0 + delegate: + SoftButton { + appId: dataContainer.scrollableMessageModel.appId + button: dataContainer.scrollableMessageModel.softButtons.get(index) + onKeepContext: { timer.restart() } + onDefaultAction: { + dataContainer.scrollableMessageModel.result = Common.Result.ABORTED + contentLoader.back() + } + } + } + } + } + + Item { + id: middle + anchors.top: top.bottom + anchors.left: parent.left + anchors.bottom: bottom.top + width: parent.width + clip: true + + Flickable { + id:flickable + anchors.fill: middle + flickableDirection: Flickable.VerticalFlick + contentWidth: longMessageText.width + contentHeight: longMessageText.height + clip: true + + Text { + id: longMessageText + wrapMode: Text.Wrap + width: middle.width + text: dataContainer.scrollableMessageModel.longMessageText + color: Constants.scrollableMessageTextColor + font.pixelSize: Constants.fontSize + } + } + Rectangle { + id: scrollbar + anchors.right: flickable.right + y: flickable.visibleArea.yPosition * flickable.height + width: Constants.scrollableMessageScrollBarWidth + height: flickable.visibleArea.heightRatio * flickable.height + visible: !(flickable.visibleArea.heightRatio > 1) + color: Constants.scrollableMessageScrollBarColor + } + } + Item { + // 1/5 bottom screen + id: bottom + anchors.bottom: parent.bottom + anchors.left: parent.left + width: parent.width + height: 1/5 * parent.height + OvalButton { + anchors.centerIn: parent + text: "Close" + onClicked: { + dataContainer.scrollableMessageModel.result = Common.Result.ABORTED + contentLoader.back() + } + } + } + } + /** + * Test Support Section + * + */ + function getTimer(){ + return timer + } + function getSoftButtonsListView(){ + return softButtons + } + function getScrollbar(){ + return scrollbar + } + function getTextArea(){ + return middle + } + function getBackButton(){ + return backButton + } + + /** + * Test Support Section End + */ +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/SettingsSourceView.qml b/src/components/qt_hmi/qml_model_qt5/views/SettingsSourceView.qml new file mode 100644 index 0000000000..fa0bfbc821 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/SettingsSourceView.qml @@ -0,0 +1,88 @@ +/** + * @file SettingsSourceView.qml + * @brief Settings source screen view. + * Copyright (c) 2014, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +import QtQuick 2.0 +import "../models" +import "../controls" +import "../models/Constants.js" as Constants + +GeneralView { + signal itemActivated(string item) + + onItemActivated: { + switch (item) { + case "update_sdl": RequestToSDL.SDL_UpdateSDL(settingsContainer.updateStatus); break; + case "get_status_update": RequestToSDL.SDL_GetStatusUpdate(settingsContainer.updateStatus); break; + case "get_urls": RequestToSDL.SDL_GetURLS(0, settingsContainer.startPTExchange); break; + } + } + + Item { + anchors.fill: parent + ScrollableListView { + id: menu + model: dataContainer.settingsSourceModel + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + anchors.bottom: bottomPanel.top + delegate: OvalButton { + text: title + onReleased: { + if (qml) { + contentLoader.go(qml, appId); + } else { + itemActivated(action); + } + } + anchors.left: parent.left + anchors.right: parent.right + fontSize: Constants.fontSize + } + } + + Item { + id: bottomPanel + // 1/4 bottom screen + anchors.bottom: parent.bottom + anchors.left: parent.left + height: 1/4 * parent.height + width: parent.width + + BackButton { anchors.centerIn: parent } + } + } +} + + + diff --git a/src/components/qt_hmi/qml_model_qt5/views/SimulationView.qml b/src/components/qt_hmi/qml_model_qt5/views/SimulationView.qml new file mode 100644 index 0000000000..b79cddf8cf --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/SimulationView.qml @@ -0,0 +1,293 @@ +/** + * @file SimulationView.qml + * @brief Area of screen responsible for simulation actions + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import QtQuick.Controls 1.0 +import QtQuick.Controls.Styles 1.0 +import "../controls" +import "../hmi_api/Common.js" as Common +import "../views" +import "../popups" +import "../models/Constants.js" as Constants + +Rectangle { + width: controlArea.width + controlArea.anchors.margins + anchors.top: parent.top + anchors.bottom: parent.bottom + color: Constants.panelColor + + Item { + id: showArea + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + height: parent.height - (controlArea.childrenRect.height + controlArea.anchors.margins) + + ExitAllApplicationsPopup { + id: exitAllApplicationsPopup + anchors.fill: parent + visible: false + } + + VehicleInfoPopUp { + id: viPopUp + anchors.fill: parent + } + + TBTClientStatePopUp { + id: tbtClientStatePopUp + anchors.fill: parent + visible: false + } + } + + Item { + id: controlArea + anchors.bottom: parent.bottom + anchors.margins: Constants.panelPadding + anchors.horizontalCenter: parent.horizontalCenter + width: table.width + + ListModel { + id: languagesList + + Component.onCompleted: { + for (var name in Common.Language) { + if (settingsContainer.sdlLanguagesList.indexOf(Common.Language[name]) != -1) { + append({name: name.replace('_', '-')}); + } + } + } + } + + Text { + id: label + text: "Languages" + color: Constants.panelTextColor + anchors.bottom: table.top + anchors.horizontalCenter: parent.horizontalCenter + } + + Grid { + id: table + spacing: 5 + columns: 2 + anchors.horizontalCenter: parent.horizontalCenter + anchors.bottom: globalProperties.top + + Text { + text: "HMI UI" + color: Constants.panelTextColor + } + + Text { + text: "HMI TTS + VR" + color: Constants.panelTextColor + } + + ComboBox { + width: table.width / table.columns - table.spacing + model: languagesList + onCurrentIndexChanged: { + dataContainer.hmiUILanguage = settingsContainer.sdlLanguagesList[currentIndex]; + sdlUI.onLanguageChange(dataContainer.hmiUILanguage); + } + z: 1000 + } + + ComboBox { + width: table.width / table.columns - table.spacing + model: languagesList + onCurrentIndexChanged: { + dataContainer.hmiTTSVRLanguage = settingsContainer.sdlLanguagesList[currentIndex]; + sdlTTS.onLanguageChange(dataContainer.hmiTTSVRLanguage); + sdlVR.onLanguageChange(dataContainer.hmiTTSVRLanguage); + } + z: 1000 + } + + Text { + text: "Application UI" + color: Constants.panelTextColor + } + + Text { + text: "Application TTS + VR" + color: Constants.panelTextColor + } + + Text { + id: uiLanguageLabel + color: Constants.panelTextColor + text: " " + Connections { + target: dataContainer + onCurrentApplicationChanged: { + for (var s in Common.Language) { + if (Common.Language[s] === dataContainer.currentApplication.hmiDisplayLanguageDesired) { + uiLanguageLabel.text = s; + } + } + } + } + } + + Text { + id: ttsLanguageLabel + color: Constants.panelTextColor + text: " " + Connections { + target: dataContainer + onCurrentApplicationChanged: { + for (var s in Common.Language) { + if (Common.Language[s] === dataContainer.currentApplication.languageTTSVR) { + ttsLanguageLabel.text = s; + } + } + } + } + } + + PushButton { + id: vehicleInfo + label: "Vehicle info" + toggleMode: true + onPressed: { + viPopUp.show(); + } + onUnpressed: { + viPopUp.hide(); + } + } + + PushButton { + id: tbtClientState + label: "TBT Client state" + toggleMode: true + onPressed: { + tbtClientStatePopUp.show(); + } + onUnpressed: { + tbtClientStatePopUp.hide(); + } + } + + PushButton { + label: "Exit application" + onClicked: { + if (dataContainer.applicationContext) { + sdlBasicCommunication.onExitApplication(dataContainer.currentApplication.appId) + } + } + } + + PushButton { + id: exitAllAppsButton + label: "Exit all apps" + toggleMode: true + onPressed: { + exitAllApplicationsPopup.show() + + } + onUnpressed: { + exitAllApplicationsPopup.hide() + } + Connections { + target: exitAllApplicationsPopup + onVisibleChanged: { + if (!exitAllApplicationsPopup.visible) { + exitAllAppsButton.state = "unpressed" + } + } + } + } + + CheckBox { + style: CheckBoxStyle { + label: Text { + color: Constants.panelTextColor + text: "Use URL" + } + } + } + + CheckBox { + style: CheckBoxStyle { + label: Text { + color: Constants.panelTextColor + text: "DD" + } + } + onClicked: { + if (checked) { + dataContainer.driverDistractionState = + Common.DriverDistractionState.DD_ON; + } else { + dataContainer.driverDistractionState = + Common.DriverDistractionState.DD_OFF; + } + } + } + } + + Rectangle { + id: globalProperties + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + height: listGlobalProperties.height + Constants.panelPadding + border.color: Constants.panelTextColor + border.width: 1 + color: Constants.panelColor + Column { + id: listGlobalProperties + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: Constants.panelPadding / 4 + Text { + text: "HELP_PROMPT: " + dataContainer.currentApplication.helpPrompt + color: Constants.panelTextColor + } + Text { + text: "TIMEOUT_PROMPT: " + dataContainer.currentApplication.timeoutPrompt + color: Constants.panelTextColor + } + Text { + text: "AUTOCOMPLETE_TEXT: " // TODO(ALeshin): Function didn' realized yet + color: Constants.panelTextColor + } + } + } + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/SiriusPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/SiriusPlayerView.qml new file mode 100644 index 0000000000..e5d2149542 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/SiriusPlayerView.qml @@ -0,0 +1,46 @@ +/** + * @file SiriusPlayerView.qml + * @brief Sirius player screen view. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +import QtQuick 2.0 +import "../controls" + +GeneralView { + RadioPlayer { + id: siriusRadioPlayer + anchors.fill: parent + radioType: "" + radioName: "Sirius" + + playerState: dataContainer.siriusPlayerState + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/StatisticsInfoView.qml b/src/components/qt_hmi/qml_model_qt5/views/StatisticsInfoView.qml new file mode 100644 index 0000000000..75f76249d5 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/StatisticsInfoView.qml @@ -0,0 +1,89 @@ +/** + * Copyright (c) 2014, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +import QtQuick 2.0 +import "../models" +import "../controls" +import "../hmi_api/Common.js" as Common +import "../models/Constants.js" as Constants + +GeneralView { + Item { + anchors.fill: parent + Text { + id: title + text: "Statistics Info:" + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + font.pixelSize: Constants.fontSize + color: Constants.primaryColor + height: Constants.fontSize + Constants.panelPadding + } + + ScrollableListView { + id: menu + model: statisticsTypeList + anchors.left: parent.left + anchors.right: parent.right + anchors.top: title.bottom + anchors.bottom: bottomPanel.top + delegate: OvalButton { + text: name + onClicked: sdlSDL.addStatisticsInfo(Common.StatisticsType[name]); + anchors.left: parent.left + anchors.right: parent.right + fontSize: Constants.fontSize + } + } + + ListModel { + id: statisticsTypeList + + Component.onCompleted: { + for (var name in Common.StatisticsType) { + append({name: name}); + } + } + } + + Item { + id: bottomPanel + // 1/4 bottom screen + anchors.bottom: parent.bottom + anchors.left: parent.left + height: 1/4 * parent.height + width: parent.width + + BackButton { anchors.centerIn: parent } + } + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/SystemErrorView.qml b/src/components/qt_hmi/qml_model_qt5/views/SystemErrorView.qml new file mode 100644 index 0000000000..058282ae00 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/SystemErrorView.qml @@ -0,0 +1,89 @@ +/** + * Copyright (c) 2014, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +import QtQuick 2.0 +import "../models" +import "../controls" +import "../hmi_api/Common.js" as Common +import "../models/Constants.js" as Constants + +GeneralView { + Item { + anchors.fill: parent + Text { + id: title + text: "System Error:" + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + font.pixelSize: Constants.fontSize + color: Constants.primaryColor + height: Constants.fontSize + Constants.panelPadding + } + + ScrollableListView { + id: menu + model: systemErrorList + anchors.left: parent.left + anchors.right: parent.right + anchors.top: title.bottom + anchors.bottom: bottomPanel.top + delegate: OvalButton { + text: name + onClicked: sdlSDL.onSystemError(Common.SystemError[name]); + anchors.left: parent.left + anchors.right: parent.right + fontSize: Constants.fontSize + } + } + + ListModel { + id: systemErrorList + + Component.onCompleted: { + for (var name in Common.SystemError) { + append({name: name}); + } + } + } + + Item { + id: bottomPanel + // 1/4 bottom screen + anchors.bottom: parent.bottom + anchors.left: parent.left + height: 1/4 * parent.height + width: parent.width + + BackButton { anchors.centerIn: parent } + } + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/SystemRequestView.qml b/src/components/qt_hmi/qml_model_qt5/views/SystemRequestView.qml new file mode 100644 index 0000000000..32a3987e74 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/SystemRequestView.qml @@ -0,0 +1,89 @@ +/** + * Copyright (c) 2014, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +import QtQuick 2.0 +import "../models" +import "../controls" +import "../hmi_api/Common.js" as Common +import "../models/Constants.js" as Constants + +GeneralView { + Item { + anchors.fill: parent + Text { + id: title + text: "System Request:" + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + font.pixelSize: Constants.fontSize + color: Constants.primaryColor + height: Constants.fontSize + Constants.panelPadding + } + + ScrollableListView { + id: menu + model: requestTypeList + anchors.left: parent.left + anchors.right: parent.right + anchors.top: title.bottom + anchors.bottom: bottomPanel.top + delegate: OvalButton { + text: name + onClicked: settingsContainer.systemRequest(Common.RequestType[name]); + anchors.left: parent.left + anchors.right: parent.right + fontSize: Constants.fontSize + } + } + + ListModel { + id: requestTypeList + + Component.onCompleted: { + for (var name in Common.RequestType) { + append({name: name}); + } + } + } + + Item { + id: bottomPanel + // 1/4 bottom screen + anchors.bottom: parent.bottom + anchors.left: parent.left + height: 1/4 * parent.height + width: parent.width + + BackButton { anchors.centerIn: parent } + } + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/TurnByTurnView.qml b/src/components/qt_hmi/qml_model_qt5/views/TurnByTurnView.qml new file mode 100644 index 0000000000..a69a86a40a --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/TurnByTurnView.qml @@ -0,0 +1,202 @@ +/** + * @file TurnByTurnView.qml + * @brief View for TurnByTurn. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../controls" +import "../hmi_api/Common.js" as Common +import "../models/Constants.js" as Constants +import "../models" + +GeneralView { + applicationContext: true + + Item { + id: turnByTurnView + anchors.fill: parent + + Item { + // top 3/4 of screen + anchors.top: parent.top + anchors.left: parent.left + width: parent.width + height: parent.height * 3/4 + + Item { + // row of oval buttons + id: ovalButtonsRow + anchors.top: parent.top + anchors.left: parent.left + width: parent.width + height: 1/4 * parent.height + + PagedFlickable { + id: buttonsRow + width: parent.width + spacing: (width - 4 * elementWidth) / 3 + anchors.verticalCenter: parent.verticalCenter + snapTo: Constants.ovalButtonWidth + spacing + elementWidth: Constants.ovalButtonWidth + + OvalButton { + id: turnListButton + text: "TurnList" + onClicked: { + console.log("Go to TurnListView"); + contentLoader.go("./views/TurnListView.qml"); + } + } + + Repeater { + model: dataContainer.currentApplication.navigationSoftButtons ? + dataContainer.currentApplication.navigationSoftButtons.count : + 0 + delegate: + SoftButton { + appId: dataContainer.currentApplication.appId + button: dataContainer.currentApplication.navigationSoftButtons.get(index) + } + } + } + } + + Column { + // Picture + text information + media clock + id: mediaContent + width: parent.width + height: 3/4 * parent.height + anchors.left: parent.left + anchors.top: ovalButtonsRow.bottom + + Row { + // picture + text info + width: parent.width + height: 3/4 * parent.height + spacing: Constants.margin + + Icon { + id: image + height: parent.height + width: height + source: dataContainer.currentApplication.navigationModel.turnIcon + } + + Column { + // text info + id: textInfo + height: parent.height + width: parent.width - image.width - parent.spacing + spacing: (height - 5 * navText1.height) / 4 + + Text { + id: navText1 + anchors.left: parent.left + anchors.right: parent.right + color: Constants.primaryColor + text: dataContainer.currentApplication.navigationModel.text1 + font.pixelSize: Constants.fontSize + visible: dataContainer.currentApplication.navigationModel.text1 + } + + Text { + anchors.left: parent.left + anchors.right: parent.right + color: Constants.primaryColor + text: dataContainer.currentApplication.navigationModel.text2 + font.pixelSize: Constants.fontSize + visible: dataContainer.currentApplication.navigationModel.text2 + } + + Text { + anchors.left: parent.left + anchors.right: parent.right + color: Constants.primaryColor + text: "Total distance: " + dataContainer.currentApplication.navigationModel.totalDistance + font.pixelSize: Constants.fontSize + visible: dataContainer.currentApplication.navigationModel.totalDistance + } + + Text { + anchors.left: parent.left + anchors.right: parent.right + color: Constants.primaryColor + text: "Time to destination: " + dataContainer.currentApplication.navigationModel.timeToDestination + font.pixelSize: Constants.fontSize + visible: dataContainer.currentApplication.navigationModel.timeToDestination + } + + Text { + anchors.left: parent.left + anchors.right: parent.right + color: Constants.primaryColor + text: "ETA: " + dataContainer.currentApplication.navigationModel.eta + font.pixelSize: Constants.fontSize + visible: dataContainer.currentApplication.navigationModel.eta + } + } + } + + Row { + anchors.horizontalCenter: parent.horizontalCenter + height: 1/4 * parent.height + width: 2/3 * parent.width + + Rectangle { + id: coveredDistance + anchors.verticalCenter: parent.verticalCenter + height: Constants.distanceBarHeight + width: dataContainer.currentApplication.navigationModel.distanceToManeuver / + dataContainer.currentApplication.navigationModel.distanceToManeuverScale * parent.width + color: "white" + } + + Rectangle { + anchors.verticalCenter: parent.verticalCenter + height: Constants.distanceBarHeight + width: parent.width - coveredDistance.width + color: Constants.primaryColor + } + } + } + } + } + + Item { + // 1/4 bottom screen + anchors.bottom: parent.bottom + anchors.left: parent.left + width: parent.width + height: 1/4 * parent.height + BackButton { anchors.centerIn: parent } + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/TurnListView.qml b/src/components/qt_hmi/qml_model_qt5/views/TurnListView.qml new file mode 100644 index 0000000000..bdd0b3d6cf --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/TurnListView.qml @@ -0,0 +1,103 @@ +/** + * @file TurnListView.qml + * @brief View for TurnByTurn list. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../controls" +import "../models/Constants.js" as Constants +import "../hmi_api/Common.js" as Common + +GeneralView { + applicationContext: true + + Item { + anchors.left: parent.left + anchors.top: parent.top + width: parent.width + height: 3/4 * parent.height + + Item { + id: sotfButtons + width: parent.width + height: 1/4 * parent.height + + PagedFlickable { + anchors.verticalCenter: parent.verticalCenter + width: parent.width + elementWidth: Constants.ovalButtonWidth + snapTo: elementWidth + spacing + spacing: (width - 4 * elementWidth) / 3 + + Repeater { + model: dataContainer.currentApplication.turnListSoftButtons ? + dataContainer.currentApplication.turnListSoftButtons.count : + 0 + delegate: + SoftButton { + appId: dataContainer.currentApplication.appId + button: dataContainer.currentApplication.turnListSoftButtons.get(index) + } + } + } + } + + ScrollableListView { + id: scrollableList + anchors.top: sotfButtons.bottom + anchors.left: parent.left + width: parent.width + height: 3/4 * parent.height + + model: dataContainer.currentApplication.turnList + + delegate: + ListItem { + width: scrollableList.width + height: Constants.iconItemListSize + text: dataContainer.currentApplication.turnList.get(index).navigationText.fieldText + fontSize: Constants.fontSize + icon: dataContainer.currentApplication.turnList.get(index).turnIcon + } + } + } + + Item { + // 1/4 bottom screen + id: back + anchors.bottom: parent.bottom + anchors.left: parent.left + width: parent.width + height: 1/4 * parent.height + BackButton { anchors.centerIn: parent } + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/UsbPlayerView.qml b/src/components/qt_hmi/qml_model_qt5/views/UsbPlayerView.qml new file mode 100644 index 0000000000..f8a2d39806 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/UsbPlayerView.qml @@ -0,0 +1,61 @@ +/** + * @file UsbPlayerView.qml + * @brief USB player screen view. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ +import QtQuick 2.0 +import "../hmi_api/Common.js" as Common +import "../models/Constants.js" as Constants +import "../controls" + +GeneralView { + category: Common.DeactivateReason.AUDIO + MediaPlayer { + id: usbPlayer + playerName: "USB" + anchors.fill: parent + playerState: dataContainer.usbPlayerState + image: playerState.albumImage + + buttons: [ + OvalButton { + text: usbPlayer.playerName + onReleased: contentLoader.go("./views/MusicSourceView.qml") + fontSize: Constants.fontSize + }, + + OvalButton { + text: "Browse" + fontSize: Constants.fontSize + } + ] + } +} diff --git a/src/components/qt_hmi/qml_model_qt5/views/WarningInfo.qml b/src/components/qt_hmi/qml_model_qt5/views/WarningInfo.qml new file mode 100644 index 0000000000..6228b63c79 --- /dev/null +++ b/src/components/qt_hmi/qml_model_qt5/views/WarningInfo.qml @@ -0,0 +1,135 @@ +/** + * @file WarningInfo.qml + * @brief Screen with warning information. + * Copyright (c) 2013, Ford Motor Company + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * + * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following + * disclaimer in the documentation and/or other materials provided with the + * distribution. + * + * Neither the name of the Ford Motor Company nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import QtQuick 2.0 +import "../controls" +import "../models/Constants.js" as Constants + +Rectangle { + id: warningInfo + anchors.fill: parent + color: Constants.secondaryColor + Text { + anchors.top: parent.top + anchors.left: parent.left + height: 1/4 * parent.height + width: parent.width + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + + text: "WARNING!" + color: Constants.warningColor + font.pixelSize: Constants.titleFontSize + font.bold: true + style: Text.Raised + styleColor: "gray" + } + + Text { + anchors.verticalCenter: parent.verticalCenter + anchors.left: parent.left + anchors.right: parent.right + anchors.margins: Constants.margin + height: 1/2 * parent.height + width: parent.width + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + wrapMode: Text.WordWrap + + text: "This application is intended to be used as a demonstrative aid only, " + + "while the vehicle is parked. Don't use it while driving. <br /><br />" + + "Use extreme caution when using any device that takes your attention off the road. " + + "Ford recommends against the use of any hand-held device while driving and that you comply " + + "with all applicable laws. Your primary responsibility is the safe operation of the vehicle." + color: "white" + font.pixelSize: 25 + font.bold: true + } + + function showOkButton() { + okButtonAnimation.start() + } + + Item { + id: ok + anchors.bottom: parent.bottom + anchors.left: parent.left + width: parent.width + height: 1/4 * parent.height + opacity: 0 + + SequentialAnimation + { + id: okButtonAnimation + // Decrease this value while debugging + PauseAnimation { duration: Constants.warningScreenDuration } + NumberAnimation { + target: ok + duration: Constants.animationDuration + property: "opacity" + from: 0; to: 1; + } + } + + Image { + id: okButton + anchors.centerIn: parent + source: "../res/buttons/longest_oval_btn.png" + + Text { + id: text + anchors.centerIn: parent + text: "OK" + font.pixelSize: Constants.fontSize + color: Constants.primaryColor + } + + MouseArea { + anchors.fill: parent + onPressed: { + parent.source = "../res/buttons/longest_oval_btn_pressed.png" + text.color = Constants.secondaryColor + } + onReleased: { + parent.source = "../res/buttons/longest_oval_btn.png" + text.color = Constants.primaryColor + } + onClicked: { + console.log("WarningInfo OkButton - on clicked enter"); + warningInfo.visible = false + } + } + } + } +} |