Kgapi

staticmapmarker.h
1 /*
2  Copyright (C) 2012 Jan Grulich <[email protected]>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) version 3, or any
8  later version accepted by the membership of KDE e.V. (or its
9  successor approved by the membership of KDE e.V.), which shall
10  act as a proxy defined in Section 6 of version 3 of the license.
11 
12  This library 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 Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public
18  License along with this library. If not, see <https://www.gnu.org/licenses/>.
19 */
20 
21 
22 #ifndef LIBKGAPI2_STATICMAPMARKER_H
23 #define LIBKGAPI2_STATICMAPMARKER_H
24 
25 #include "kgapimaps_export.h"
26 
27 #include <QColor>
28 
29 #include <KContacts/Address>
30 #include <KContacts/Geo>
31 
32 namespace KGAPI2
33 {
34 
41 class KGAPIMAPS_EXPORT StaticMapMarker
42 {
43 
44  public:
45 
46  enum MarkerSize {
47  Tiny,
48  Small,
49  Middle,
50  Normal
51  };
52 
53  enum LocationType {
54  Undefined = -1,
55  String,
56  KABCAddress,
57  KABCGeo
58  };
59 
64 
74  explicit StaticMapMarker(const QString & address, const QChar & label = QChar(),
75  const MarkerSize size = Normal, const QColor & color = Qt::red);
76 
86  explicit StaticMapMarker(const KContacts::Address & address, QChar label = QChar(),
87  const MarkerSize size = Normal, const QColor & color = Qt::red);
88 
98  explicit StaticMapMarker(const KContacts::Geo & address, QChar label = QChar(),
99  const MarkerSize size = Normal, const QColor & color = Qt::red);
100 
110  explicit StaticMapMarker(const QStringList & locations, QChar label = QChar(),
111  const MarkerSize size = Normal, const QColor & color = Qt::red);
112 
122  explicit StaticMapMarker(const KContacts::Address::List &locations, QChar label = QChar(),
123  const MarkerSize size = Normal, const QColor & color = Qt::red);
124 
134  explicit StaticMapMarker(const QList<KContacts::Geo> & locations, QChar label = QChar(),
135  const MarkerSize size = Normal, const QColor & color = Qt::red);
136 
140  StaticMapMarker(const StaticMapMarker & other);
141 
145  ~StaticMapMarker();
146 
150  LocationType locationType() const;
151 
155  QColor color() const;
156 
162  void setColor(const QColor & color);
163 
167  bool isValid() const;
168 
172  QChar label() const;
173 
180  void setLabel(QChar label);
181 
185  QStringList locationsString() const;
186 
192  void setLocation(const QString & location);
193 
199  void setLocations(const QStringList & locations);
200 
204  KContacts::Address::List locationsAddress() const;
205 
211  void setLocation(const KContacts::Address & location);
212 
218  void setLocations(const KContacts::Address::List &locations);
219 
223  QList<KContacts::Geo> locationsGeo() const;
224 
230  void setLocation(const KContacts::Geo & location);
231 
237  void setLocations(const QList<KContacts::Geo> & locations);
238 
242  QString toString() const;
243 
247  MarkerSize size() const;
248 
254  void setSize(const MarkerSize size);
255 
259  StaticMapMarker& operator=(const StaticMapMarker &other);
260 
261  private:
262  class Private;
263  Private * const d;
264  friend class Private;
265 
266 };
267 
268 } // namespace KGAPI2
269 
270 
271 #endif // LIBKGAPI2_STATICMAPMARKER_H
Represents marker with defined label, color, size and markers.
A job to fetch a single map tile described by a StaticMapUrl.
Definition: blog.h:30
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 30 2020 22:38:44 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.