Tuning the ListItemContextButtonBar look
[situare] / src / routing / location.cpp
1 /*
2    Situare - A location system for Facebook
3    Copyright (C) 2010  Ixonos Plc. Authors:
4
5       Henri Lampela - henri.lampela@ixonos.com
6       Sami Rämö - sami.ramo@ixonos.com
7
8    Situare is free software; you can redistribute it and/or
9    modify it under the terms of the GNU General Public License
10    version 2 as published by the Free Software Foundation.
11
12    Situare is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with Situare; if not, write to the Free Software
19    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
20    USA.
21 */
22
23 #include <QDebug>
24 #include <QStringList>
25
26 #include "routingcommon.h"
27
28 #include "location.h"
29
30 Location::Location()
31 {
32     qDebug() << __PRETTY_FUNCTION__;
33 }
34
35 QStringList Location::addressComponents() const
36 {
37     qDebug() << __PRETTY_FUNCTION__;
38
39     QStringList list = m_formattedAddress.split(",");
40     QStringList trimmedList;
41
42     foreach(QString str, list) {
43         trimmedList.append(str.trimmed());
44     }
45
46     return trimmedList;
47 }
48
49 const GeoCoordinate& Location::coordinates() const
50 {
51     qDebug() << __PRETTY_FUNCTION__;
52
53     return m_coordinates;
54 }
55
56 const QString& Location::formattedAddress() const
57 {
58     qDebug() << __PRETTY_FUNCTION__;
59
60     return m_formattedAddress;
61 }
62
63 void Location::setCoordinates(const GeoCoordinate &coordinate)
64 {
65     qDebug() << __PRETTY_FUNCTION__;
66
67     m_coordinates = coordinate;
68 }
69
70 void Location::setFormattedAddress(const QString &formattedAddress)
71 {
72     qDebug() << __PRETTY_FUNCTION__;
73
74     m_formattedAddress = formattedAddress;
75 }
76
77 void Location::setViewPort(const GeoCoordinate &southwest, const GeoCoordinate &northeast)
78 {
79     qDebug() << __PRETTY_FUNCTION__;
80
81     m_viewportSW = southwest;
82     m_viewportNE = northeast;
83 }
84
85 void Location::viewport(GeoCoordinate &southwest, GeoCoordinate &northeast) const
86 {
87     qDebug() << __PRETTY_FUNCTION__;
88
89     southwest = m_viewportSW;
90     northeast = m_viewportNE;
91 }