Code

* Lots of documentation for the Inkscape::XML namespace
[inkscape.git] / src / xml / node-event-vector.h
1 /** @file
2  * @brief Deprecated structure for a set of callbacks for node state changes
3  */
4 /* Authors:
5  *   Lauris Kaplinski <lauris@kaplinski.com>
6  *   Frank Felfe <innerspace@iname.com>
7  *
8  * Copyright (C) 1999-2002 Lauris Kaplinski and Frank Felfe
9  * Copyright (C) 2000-2002 Ximian, Inc.
10  *
11  * Released under GNU GPL, read the file 'COPYING' for more information
12  */
14 #ifndef SEEN_INKSCAPE_XML_SP_REPR_EVENT_VECTOR
15 #define SEEN_INKSCAPE_XML_SP_REPR_EVENT_VECTOR
17 #include <glib/gtypes.h>
19 #include "xml/node.h"
21 namespace Inkscape {
22 namespace XML {
24 /**
25  * @brief Structure holding callbacks for node state changes
26  * @deprecated Derive an observer object from the NodeObserver class instead
27  */
28 struct NodeEventVector {
29         /* Immediate signals */
30         void (* child_added) (Node *repr, Node *child, Node *ref, void * data);
31         void (* child_removed) (Node *repr, Node *child, Node *ref, void * data);
32         void (* attr_changed) (Node *repr, const gchar *key, const gchar *oldval, const gchar *newval, bool is_interactive, void * data);
33         void (* content_changed) (Node *repr, const gchar *oldcontent, const gchar *newcontent, void * data);
34         void (* order_changed) (Node *repr, Node *child, Node *oldref, Node *newref, void * data);
35 };
37 }
38 }
40 /**
41  * @brief Generate events corresponding to the node's state
42  * @deprecated Use Node::synthesizeEvents(NodeObserver &) instead
43  */
44 inline void sp_repr_synthesize_events (Inkscape::XML::Node *repr, const Inkscape::XML::NodeEventVector *vector, void * data) {
45         repr->synthesizeEvents(vector, data);
46 }
47 /**
48  * @brief Add a set of callbacks for node state changes and its associated data
49  * @deprecated Use Node::addObserver() instead
50  */                                                                                
51 inline void sp_repr_add_listener (Inkscape::XML::Node *repr, const Inkscape::XML::NodeEventVector *vector, void * data) {
52         repr->addListener(vector, data);
53 }
54 /**
55  * @brief Remove a set of callbacks based on associated data
56  * @deprecated Use Node::removeObserver() instead
57  */
58 inline void sp_repr_remove_listener_by_data (Inkscape::XML::Node *repr, void * data) {
59         repr->removeListenerByData(data);
60 }
62 #endif