/usr/include/kml/dom/link.h is in libkml-dev 1.3.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 | // Copyright 2008, Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// 3. Neither the name of Google Inc. nor the names of its contributors may be
// used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// This file contains the declarations for the the classes for the Link, Icon,
// and Url elements.
#ifndef KML_DOM_LINK_H__
#define KML_DOM_LINK_H__
#include "kml/dom/kml22.h"
#include "kml/dom/object.h"
namespace kmldom {
class Visitor;
// OGC KML 2.2 Standard: 12.9 kml:Icon (kml:BasicLinkType)
// OGC KML 2.2 XSD: <complexType name="BasicLinkType"...
class BasicLink : public Object {
public:
virtual ~BasicLink();
virtual KmlDomType Type() const { return Type_BasicLink; }
virtual bool IsA(KmlDomType type) const {
return type == Type_BasicLink || Object::IsA(type);
}
// <href>
const string& get_href() const {
return href_;
}
bool has_href() const {
return has_href_;
}
void set_href(const string& href) {
href_ = href;
has_href_ = true;
}
void clear_href() {
href_.clear();
has_href_ = false;
}
// Visitor API methods, see visitor.h.
virtual void Accept(Visitor* visitor);
protected:
// Internal class, not for direct instantiation.
BasicLink();
virtual void AddElement(const ElementPtr& element);
virtual void Serialize(Serializer& serializer) const;
private:
string href_;
bool has_href_;
LIBKML_DISALLOW_EVIL_CONSTRUCTORS(BasicLink);
};
// This is LinkType in the KML 2.2 XSD. LinkType is the only XSD complexType
// instantiated as more than one element.
class AbstractLink : public BasicLink {
public:
virtual ~AbstractLink();
// <refreshMode>
int get_refreshmode() const {
return refreshmode_;
}
bool has_refreshmode() const {
return has_refreshmode_;
}
void set_refreshmode(const int refreshmode) {
refreshmode_ = refreshmode;
has_refreshmode_ = true;
}
void clear_refreshmode() {
refreshmode_ = REFRESHMODE_ONCHANGE;
has_refreshmode_ = false;
}
// <refreshInterval>
double get_refreshinterval() const {
return refreshinterval_;
}
bool has_refreshinterval() const {
return has_refreshinterval_;
}
void set_refreshinterval(const double refreshinterval) {
refreshinterval_ = refreshinterval;
has_refreshinterval_ = true;
}
void clear_refreshinterval() {
refreshinterval_ = 4.0;
has_refreshinterval_ = false;
}
// <viewRefreshMode>
int get_viewrefreshmode() const {
return viewrefreshmode_;
}
bool has_viewrefreshmode() const {
return has_viewrefreshmode_;
}
void set_viewrefreshmode(const int viewrefreshmode) {
viewrefreshmode_ = viewrefreshmode;
has_viewrefreshmode_ = true;
}
void clear_viewrefreshmode() {
viewrefreshmode_ = VIEWREFRESHMODE_NEVER;
has_viewrefreshmode_ = false;
}
// <viewRefreshTime>
double get_viewrefreshtime() const {
return viewrefreshtime_;
}
bool has_viewrefreshtime() const {
return has_viewrefreshtime_;
}
void set_viewrefreshtime(const double viewrefreshtime) {
viewrefreshtime_ = viewrefreshtime;
has_viewrefreshtime_ = true;
}
void clear_viewrefreshtime() {
viewrefreshtime_ = 4.0;
has_viewrefreshtime_ = false;
}
// <viewBoundScale>
double get_viewboundscale() const {
return viewboundscale_;
}
bool has_viewboundscale() const {
return has_viewboundscale_;
}
void set_viewboundscale(const double viewboundscale) {
viewboundscale_ = viewboundscale;
has_viewboundscale_ = true;
}
void clear_viewboundscale() {
viewboundscale_ = 1.0;
has_viewboundscale_ = false;
}
// <viewFormat>
const string& get_viewformat() const {
return viewformat_;
}
bool has_viewformat() const {
return has_viewformat_;
}
void set_viewformat(const string& viewformat) {
viewformat_ = viewformat;
has_viewformat_ = true;
}
void clear_viewformat() {
viewformat_.clear();
has_viewformat_ = false;
}
// <httpQuery>
const string& get_httpquery() const {
return httpquery_;
}
bool has_httpquery() const {
return has_httpquery_;
}
void set_httpquery(const string& httpquery) {
httpquery_ = httpquery;
has_httpquery_ = true;
}
void clear_httpquery() {
httpquery_.clear();
has_httpquery_ = false;
}
protected:
// Internal class, not for direct instantiation.
AbstractLink();
virtual void AddElement(const ElementPtr& element);
virtual void Serialize(Serializer& serializer) const;
private:
bool has_href_;
int refreshmode_;
bool has_refreshmode_;
double refreshinterval_;
bool has_refreshinterval_;
int viewrefreshmode_;
bool has_viewrefreshmode_;
double viewrefreshtime_;
bool has_viewrefreshtime_;
double viewboundscale_;
bool has_viewboundscale_;
string viewformat_;
bool has_viewformat_;
string httpquery_;
bool has_httpquery_;
LIBKML_DISALLOW_EVIL_CONSTRUCTORS(AbstractLink);
};
// <Link> in NetworkLink and Model
class Link : public AbstractLink {
public:
virtual ~Link();
virtual KmlDomType Type() const { return Type_Link; }
virtual bool IsA(KmlDomType type) const {
return type == Type_Link || AbstractLink::IsA(type);
}
// Visitor API methods, see visitor.h.
virtual void Accept(Visitor* visitor);
private:
friend class KmlFactory;
Link();
LIBKML_DISALLOW_EVIL_CONSTRUCTORS(Link);
};
// <Icon> in Overlay
class Icon : public AbstractLink {
public:
virtual ~Icon();
virtual KmlDomType Type() const { return Type_Icon; }
virtual bool IsA(KmlDomType type) const {
return type == Type_Icon || AbstractLink::IsA(type);
}
// Visitor API methods, see visitor.h.
virtual void Accept(Visitor* visitor);
private:
friend class KmlFactory;
Icon();
LIBKML_DISALLOW_EVIL_CONSTRUCTORS(Icon);
};
// <Url> in NetworkLink
class Url : public AbstractLink {
public:
virtual ~Url();
virtual KmlDomType Type() const { return Type_Url; }
virtual bool IsA(KmlDomType type) const {
return type == Type_Url || AbstractLink::IsA(type);
}
// Visitor API methods, see visitor.h.
virtual void Accept(Visitor* visitor);
private:
friend class KmlFactory;
Url();
LIBKML_DISALLOW_EVIL_CONSTRUCTORS(Url);
};
// <Icon> in <IconStyle>
// This is the only case in KML of a non-global element. The <Icon>
// of any Overlay is the same as <Link> with all refresh modes, etc.
// The <Icon> of <IconStyle> is just an <href> to an icon as the
// derivation from BasicLink suggests.
class IconStyleIcon : public BasicLink {
public:
virtual ~IconStyleIcon();
virtual KmlDomType Type() const { return Type_IconStyleIcon; }
virtual bool IsA(KmlDomType type) const {
return type == Type_IconStyleIcon || BasicLink::IsA(type);
}
// <gx:x>
double get_gx_x() const {
return gx_x_;
}
bool has_gx_x() const {
return has_gx_x_;
}
void set_gx_x(const double x) {
gx_x_ = x;
has_gx_x_= true;
}
void clear_gx_x() {
gx_x_= 0.0;
has_gx_x_ = false;
}
// <gx:y>
double get_gx_y() const {
return gx_y_;
}
bool has_gx_y() const {
return has_gx_y_;
}
void set_gx_y(const double y) {
gx_y_ = y;
has_gx_y_= true;
}
void clear_gx_y() {
gx_y_= 0.0;
has_gx_y_ = false;
}
// <gx:w>
double get_gx_w() const {
return gx_w_;
}
bool has_gx_w() const {
return has_gx_w_;
}
void set_gx_w(const double w) {
gx_w_ = w;
has_gx_w_= true;
}
void clear_gx_w() {
gx_w_= 0.0;
has_gx_w_ = false;
}
// <gx:h>
double get_gx_h() const {
return gx_h_;
}
bool has_gx_h() const {
return has_gx_h_;
}
void set_gx_h(const double h) {
gx_h_ = h;
has_gx_h_= true;
}
void clear_gx_h() {
gx_h_= 0.0;
has_gx_h_ = false;
}
virtual void AddElement(const ElementPtr& element);
// Visitor API methods, see visitor.h.
virtual void Accept(Visitor* visitor);
private:
friend class KmlFactory;
IconStyleIcon();
friend class Serializer;
virtual void Serialize(Serializer& serializer) const;
double gx_x_;
bool has_gx_x_;
double gx_y_;
bool has_gx_y_;
double gx_w_;
bool has_gx_w_;
double gx_h_;
bool has_gx_h_;
LIBKML_DISALLOW_EVIL_CONSTRUCTORS(IconStyleIcon);
};
} // end namespace kmldom
#endif // KML_DOM_LINK_H__
|