1 #ifndef SEEN_SP_USE_REFERENCE_H
2 #define SEEN_SP_USE_REFERENCE_H
4 /*
5 * The reference corresponding to href of <use> element.
6 *
7 * Copyright (C) 2004 Bulia Byak
8 *
9 * Released under GNU GPL, read the file 'COPYING' for more information.
10 */
12 #include <forward.h>
13 #include "sp-item.h"
14 #include <uri-references.h>
15 #include <sigc++/sigc++.h>
17 class Path;
19 namespace Inkscape {
20 namespace XML {
21 struct Node;
22 }
23 }
26 class SPUseReference : public Inkscape::URIReference {
27 public:
28 SPUseReference(SPObject *owner) : URIReference(owner) {}
30 SPItem *getObject() const {
31 return (SPItem *)URIReference::getObject();
32 }
34 protected:
35 virtual bool _acceptObject(SPObject * const obj) const;
37 };
40 class SPUsePath : public SPUseReference {
41 public:
42 Path *originalPath;
43 bool sourceDirty;
45 SPObject *owner;
46 gchar *sourceHref;
47 Inkscape::XML::Node *sourceRepr;
48 SPObject *sourceObject;
50 sigc::connection _modified_connection;
51 sigc::connection _delete_connection;
52 sigc::connection _changed_connection;
53 sigc::connection _transformed_connection;
55 SPUsePath(SPObject* i_owner);
56 ~SPUsePath(void);
58 void link(char* to);
59 void unlink(void);
60 void start_listening(SPObject* to);
61 void quit_listening(void);
62 void refresh_source(void);
64 void (*user_unlink) (SPObject *user);
65 };
67 #endif /* !SEEN_SP_USE_REFERENCE_H */
69 /*
70 Local Variables:
71 mode:c++
72 c-file-style:"stroustrup"
73 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
74 indent-tabs-mode:nil
75 fill-column:99
76 End:
77 */
78 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :