Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
sp-anchor.h
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
2#ifndef SEEN_SP_ANCHOR_H
3#define SEEN_SP_ANCHOR_H
4
5/*
6 * SVG <a> element implementation
7 *
8 * Author:
9 * Lauris Kaplinski <lauris@kaplinski.com>
10 *
11 * Copyright (C) 2001-2002 Lauris Kaplinski
12 * Copyright (C) 2001 Ximian, Inc.
13 *
14 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
15 */
16
17#include "sp-item-group.h"
18#include "uri-references.h"
19
20class SPAnchor final : public SPGroup
21{
22public:
23 int tag() const override { return tag_of<decltype(*this)>; }
24
25 char *href = nullptr;
26 char *type = nullptr;
27 char *title = nullptr;
28 SPDocument *page = nullptr;
29
31 void release() override;
32 void set(SPAttr key, char const* value) override;
33 virtual void updatePageAnchor();
34 Inkscape::XML::Node* write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, unsigned flags) override;
35 void getLinked(std::vector<SPObject *> &objects, LinkedObjectNature direction) const override;
36
37 const char* typeName() const override;
38 const char* displayName() const override;
39 char* description() const override;
40
41 std::unique_ptr<Inkscape::URIReference> local_link;
42};
43
44#endif
SPAttr
Definition attributes.h:27
constexpr int tag_of
Convenience function to retrieve the tag (class id) of a given type.
Definition cast.h:26
Interface for refcounted XML nodes.
Definition node.h:80
const char * typeName() const override
The item's type name, not node tag name.
void build(SPDocument *document, Inkscape::XML::Node *repr) override
Definition sp-anchor.cpp:28
void getLinked(std::vector< SPObject * > &objects, LinkedObjectNature direction) const override
Get objects which are linked to this object as either a source or a target.
char * description() const override
const char * displayName() const override
The item's type name as a translated human string.
void release() override
Definition sp-anchor.cpp:41
char * type
Definition sp-anchor.h:26
std::unique_ptr< Inkscape::URIReference > local_link
Definition sp-anchor.h:41
virtual void updatePageAnchor()
Definition sp-anchor.cpp:99
char * href
Definition sp-anchor.h:25
Inkscape::XML::Node * write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, unsigned flags) override
int tag() const override
Definition sp-anchor.h:23
char * title
Definition sp-anchor.h:27
SPDocument * page
Definition sp-anchor.h:28
Typed SVG document implementation.
Definition document.h:101
Inkscape::XML::Node * repr
Definition sp-object.h:193
SPDocument * document
Definition sp-object.h:188
LinkedObjectNature
Definition sp-object.h:168
static cairo_user_data_key_t key
Interface for XML documents.
Definition document.h:43