Emit error signal when login fails
[situare] / src / routing / location.h
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 #ifndef LOCATION_H
24 #define LOCATION_H
25
26 #include <QString>
27
28 #include "coordinates/geocoordinate.h"
29
30 /**
31  * @brief Container for a single location search result
32  *
33  * Contains all data for a single location search result item.
34  *
35  * @author Henri Lampela - henri.lampela@ixonos.com
36  * @author Sami Rämö - sami.ramo@ixonos.com
37  */
38 class Location
39 {
40 public:
41
42     /**
43     * @brief Constructor
44     *
45     * Constructs empty Location object.
46     */
47     Location();
48
49 /*******************************************************************************
50  * MEMBER FUNCTIONS AND SLOTS
51  ******************************************************************************/
52     /**
53     * @brief Gets the address components of the location
54     *
55     * @returns list of address components
56     */
57     QStringList addressComponents() const;
58
59     /**
60     * @brief Gets the coordinates of the location
61     *
62     * @returns coordinates of the location
63     */
64     const GeoCoordinate& coordinates() const;
65
66     /**
67     * @brief Gets the formatted address of the location
68     *        e.g. Oxford street 1, London W1, United kingdom
69     *
70     * @returns coordinates of the location
71     */
72     const QString& formattedAddress() const;
73
74     /**
75     * @brief Sets the coordinates of the location
76     *
77     * @param coordinate Coordinates of the location
78     */
79     void setCoordinates(const GeoCoordinate &coordinate);
80
81     /**
82     * @brief Sets the formatted address of the location
83     *
84     */
85     void setFormattedAddress(const QString &formattedAddress);
86
87     /**
88     * @brief Set recommended viewport corner coordinates
89     *
90     * @param southwest Coordinates of the southwest corner
91     * @param northeast Coordinates of the northeast corner
92     */
93     void setViewPort(const GeoCoordinate &southwest, const GeoCoordinate &northeast);
94
95     /**
96     * @brief Gets the coordinates of the recommended viewport of the location
97     *
98     * @param[out] southwest returns southwest corner coordinates of the recommended viewport
99     * @param[out] northeast returns northeast corner coordinates of the recommended viewport
100     */
101     void viewport(GeoCoordinate &southwest, GeoCoordinate &northeast) const;
102
103 /*******************************************************************************
104  * DATA MEMBERS
105  ******************************************************************************/
106 private:
107     QString m_formattedAddress;     ///< Placeholder for formatted address
108
109     GeoCoordinate m_coordinates;    ///< Placeholcer for coordinates
110     GeoCoordinate m_viewportNE;     ///< Placeholder for viewport northeast corner
111     GeoCoordinate m_viewportSW;     ///< Placeholder for viewport southwest corner
112 };
113
114 #endif // LOCATION_H