1
/****************************************************************************
3
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4
** All rights reserved.
5
** Contact: Nokia Corporation (qt-info@nokia.com)
7
** This file is part of the Qt Mobility Components.
9
** $QT_BEGIN_LICENSE:LGPL$
11
** Licensees holding valid Qt Commercial licenses may use this file in
12
** accordance with the Qt Commercial License Agreement provided with
13
** the Software or, alternatively, in accordance with the terms
14
** contained in a written agreement between you and Nokia.
16
** GNU Lesser General Public License Usage
17
** Alternatively, this file may be used under the terms of the GNU Lesser
18
** General Public License version 2.1 as published by the Free Software
19
** Foundation and appearing in the file LICENSE.LGPL included in the
20
** packaging of this file. Please review the following information to
21
** ensure the GNU Lesser General Public License version 2.1 requirements
22
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24
** In addition, as a special exception, Nokia gives you certain additional
25
** rights. These rights are described in the Nokia Qt LGPL Exception
26
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28
** GNU General Public License Usage
29
** Alternatively, this file may be used under the terms of the GNU
30
** General Public License version 3.0 as published by the Free Software
31
** Foundation and appearing in the file LICENSE.GPL included in the
32
** packaging of this file. Please review the following information to
33
** ensure the GNU General Public License version 3.0 requirements will be
34
** met: http://www.gnu.org/copyleft/gpl.html.
36
** If you are unsure which license is appropriate for your use, please
37
** contact the sales department at qt-sales@nokia.com.
40
***************************************************************************/
42
#include "qdeclarativegeoaddress_p.h"
47
\qmlclass Address QDeclarativeGeoAddress
48
\brief The Address element presents an address.
51
The Address element presents an address of a location.
52
This element is part of the \bold{QtMobility.location 1.1} module.
54
\sa Landmark, Place, {QGeoAddress}
57
QDeclarativeGeoAddress::QDeclarativeGeoAddress(QObject* parent) :
62
QDeclarativeGeoAddress::QDeclarativeGeoAddress(const QGeoAddress& address, QObject* parent) :
63
QObject(parent), m_address(address)
67
QGeoAddress QDeclarativeGeoAddress::address() const
72
void QDeclarativeGeoAddress::setAddress(const QGeoAddress& address)
74
// Elaborate but takes care of emiting needed signals
75
setCountry(address.country());
76
setCountryCode(address.countryCode());
77
setState(address.state());
78
setCounty(address.county());
79
setCity(address.city());
80
setDistrict(address.district());
81
setStreet(address.street());
82
setPostcode(address.postcode());
86
QString QDeclarativeGeoAddress::country() const
88
return m_address.country();
92
\qmlproperty string Address::country
94
This property holds the country of the address.
98
void QDeclarativeGeoAddress::setCountry(const QString& country)
100
if (m_address.country() == country)
102
m_address.setCountry(country);
103
emit countryChanged();
106
QString QDeclarativeGeoAddress::countryCode() const
108
return m_address.countryCode();
112
\qmlproperty string Address::countryCode
114
This property holds the country code of the address.
118
void QDeclarativeGeoAddress::setCountryCode(const QString& countryCode)
120
if (m_address.countryCode() == countryCode)
122
m_address.setCountryCode(countryCode);
123
emit countryCodeChanged();
126
QString QDeclarativeGeoAddress::state() const
128
return m_address.state();
132
\qmlproperty string Address::state
134
This property holds the state of the address.
138
void QDeclarativeGeoAddress::setState(const QString& state)
140
if (m_address.state() == state)
142
m_address.setState(state);
146
QString QDeclarativeGeoAddress::county() const
148
return m_address.county();
152
\qmlproperty string Address::county
154
This property holds the county of the address.
158
void QDeclarativeGeoAddress::setCounty(const QString& county)
160
if (m_address.county() == county)
162
m_address.setCounty(county);
163
emit countyChanged();
166
QString QDeclarativeGeoAddress::city() const
168
return m_address.city();
172
\qmlproperty string Address::city
174
This property holds the city of the address.
178
void QDeclarativeGeoAddress::setCity(const QString& city)
180
if (m_address.city() == city)
182
m_address.setCity(city);
186
QString QDeclarativeGeoAddress::district() const
188
return m_address.district();
192
\qmlproperty string Address::district
194
This property holds the district of the address.
198
void QDeclarativeGeoAddress::setDistrict(const QString& district)
200
if (m_address.district() == district)
202
m_address.setDistrict(district);
203
emit districtChanged();
206
QString QDeclarativeGeoAddress::street() const
208
return m_address.street();
212
\qmlproperty string Address::street
214
This property holds the street of the address.
218
void QDeclarativeGeoAddress::setStreet(const QString& street)
220
if (m_address.street() == street)
222
m_address.setStreet(street);
223
emit streetChanged();
226
QString QDeclarativeGeoAddress::postcode() const
228
return m_address.postcode();
232
\qmlproperty string Address::postcode
234
This property holds the post code of the address.
238
void QDeclarativeGeoAddress::setPostcode(const QString& postcode)
240
if (m_address.postcode() == postcode)
242
m_address.setPostcode(postcode);
243
emit postcodeChanged();
246
#include "moc_qdeclarativegeoaddress_p.cpp"