1/****************************************************************************
2**
3** Copyright (C) 2017 The Qt Company Ltd.
4** Contact: https://www.qt.io/licensing/
5**
6** This file is part of the examples of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:BSD$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and The Qt Company. For licensing terms
14** and conditions see https://www.qt.io/terms-conditions. For further
15** information use the contact form at https://www.qt.io/contact-us.
16**
17** BSD License Usage
18** Alternatively, you may use this file under the terms of the BSD license
19** as follows:
20**
21** "Redistribution and use in source and binary forms, with or without
22** modification, are permitted provided that the following conditions are
23** met:
24**   * Redistributions of source code must retain the above copyright
25**     notice, this list of conditions and the following disclaimer.
26**   * Redistributions in binary form must reproduce the above copyright
27**     notice, this list of conditions and the following disclaimer in
28**     the documentation and/or other materials provided with the
29**     distribution.
30**   * Neither the name of The Qt Company Ltd nor the names of its
31**     contributors may be used to endorse or promote products derived
32**     from this software without specific prior written permission.
33**
34**
35** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
36** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
37** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
38** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
39** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
40** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
41** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
42** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
43** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
44** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
45** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
46**
47** $QT_END_LICENSE$
48**
49****************************************************************************/
50
51import QtQuick 2.5
52import QtQuick.Controls 1.4
53import QtQuick.Layouts 1.2
54import "../views"
55
56Item {
57    id: root
58    property alias placeName: placeName
59    property alias placeIcon: placeIcon
60    property alias distance: distance
61    property alias address: address
62    property alias categories: categories
63    property alias phone: phone
64    property alias fax: fax
65    property alias email: email
66    property alias website: website
67    property alias addInformation: addInformation
68    property alias editorialsButton: editorialsButton
69    property alias reviewsButton: reviewsButton
70    property alias imagesButton: imagesButton
71    property alias findSimilarButton: findSimilarButton
72    property alias ratingView: ratingView
73    width: parent.width
74    height: parent.height
75
76    ScrollView {
77        id:scrollView
78        flickableItem.interactive: true
79        anchors.fill: parent
80        anchors.margins: 15
81
82        GridLayout {
83            width: scrollView.width - 15
84            rows: 7
85            columns: 2
86
87            RowLayout {
88                Layout.columnSpan: 2
89                Layout.fillWidth: true
90
91                Image {
92                    id: placeIcon
93                    source: "../resources/marker.png"
94                    anchors.margins: 30
95                }
96
97                Label {
98                    id: placeName
99                    text: qsTr("PlaceName")
100                    font.bold: true
101                }
102
103                Item {
104                    Layout.fillWidth: true
105                }
106            }
107
108            RatingView {
109                id: ratingView
110                size: placeName.height * 2
111                Layout.columnSpan: 2
112            }
113
114            Rectangle {
115                anchors.left: parent.left
116                anchors.right: parent.right
117                Layout.columnSpan: 2
118                height: 1
119                color: "#46a2da"
120                visible: addressBox.visible
121            }
122
123            GroupBox {
124                id: addressBox
125                Layout.fillWidth: true
126                Layout.columnSpan: 2
127                flat: true
128                title: qsTr("Address")
129
130                GridLayout {
131                    id: gridLayout3
132                    rowSpacing: 10
133                    rows: 1
134                    columns: 2
135                    anchors.fill: parent
136
137                    Label {
138                        text: qsTr("Distance:")
139                    }
140
141                    Label {
142                        id: distance
143                        Layout.fillWidth: true
144                        text: qsTr("1000 km")
145                    }
146
147                    Label {
148                        id: address
149                        Layout.columnSpan: 2
150                        text: qsTr("Street Number<br/>xxxxx City<br/>Country")
151                    }
152                }
153            }
154
155            Rectangle {
156                anchors.left: parent.left
157                anchors.right: parent.right
158                Layout.columnSpan: 2
159                height: 1
160                color: "#46a2da"
161                visible: categoriesBox.visible
162            }
163
164            GroupBox {
165                id: categoriesBox
166                Layout.fillWidth: true
167                Layout.columnSpan: 2
168                flat: true
169                title: qsTr("Categories")
170
171                Label {
172                    id: categories
173                    anchors.fill: parent
174                    text: qsTr("category1, category2 ,category3")
175                }
176            }
177
178            Rectangle {
179                anchors.left: parent.left
180                anchors.right: parent.right
181                height: 1
182                color: "#46a2da"
183                visible: contactDetailsBox.visible
184            }
185
186            GroupBox {
187                id: contactDetailsBox
188                Layout.fillWidth: true
189                Layout.columnSpan: 2
190                flat: true
191                title: qsTr("Contact details")
192                GridLayout {
193                    id: gridLayout4
194                    rowSpacing: 10
195                    rows: 1
196                    columns: 2
197                    anchors.fill: parent
198
199                    Label {
200                        text: qsTr("Phone: ")
201                    }
202
203                    Label {
204                        id: phone
205                        Layout.fillWidth: true
206                        text: qsTr("000-000-000")
207                    }
208
209                    Label {
210                        text: qsTr("Fax: ")
211                    }
212
213                    Label {
214                        id: fax
215                        Layout.fillWidth: true
216                        text: qsTr("000-000-000")
217                    }
218
219                    Label {
220                        text: qsTr("Email: ")
221                    }
222
223                    Label {
224                        id: email
225                        Layout.fillWidth: true
226                        text: qsTr("name@company.com")
227                    }
228
229                    Label {
230                        text: qsTr("Website: ")
231                    }
232
233                    Label {
234                        id: website
235                        Layout.fillWidth: true
236                        text: qsTr("http:://company.com")
237                    }
238                }
239            }
240
241            Rectangle {
242                Layout.columnSpan: 2
243                anchors.left: parent.left
244                anchors.right: parent.right
245                height: 1
246                color: "#46a2da"
247                visible: informationBox.visible
248            }
249
250            GroupBox {
251                id: informationBox
252                Layout.fillWidth: true
253                Layout.columnSpan: 2
254                flat: true
255                title: qsTr("Additional information")
256                ColumnLayout {
257                    Label {
258                        id: addInformation
259                        text: qsTr("AdditionalInformation1<br/>AdditionalInformation2<br/>AdditionalInformation3")
260                    }
261                }
262            }
263
264            RowLayout {
265                Layout.columnSpan: 2
266                Layout.alignment: Qt.AlignHCenter
267
268                Button {
269                    id: editorialsButton
270                    text: qsTr("Editorials")
271                    enabled: false
272                }
273
274                Button {
275                    id: reviewsButton
276                    text: qsTr("Reviews")
277                    enabled: false
278                }
279
280                Button {
281                    id: imagesButton
282                    text: qsTr("Images")
283                    enabled: false
284                }
285
286                Button {
287                    id: findSimilarButton
288                    text: qsTr("Find similar")
289                    enabled: false
290                }
291            }
292        }
293    }
294}
295
296