2
* Inkscape::XML::SimpleSession - simple session/logging implementation
4
* Copyright 2005 MenTaLguY <mental@rydia.net>
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
11
* See the file COPYING for details.
15
#ifndef SEEN_INKSCAPE_XML_SIMPLE_SESSION_H
16
#define SEEN_INKSCAPE_XML_SIMPLE_SESSION_H
18
#include "gc-managed.h"
19
#include "xml/session.h"
20
#include "xml/transaction-logger.h"
21
#include "xml/log-builder.h"
27
class SimpleSession : public GC::Managed<>,
29
public TransactionLogger
32
SimpleSession() : _in_transaction(false) {}
34
bool inTransaction() { return _in_transaction; }
36
void beginTransaction();
39
Inkscape::XML::Event *commitUndoable();
41
Node *createElementNode(char const *name);
42
Node *createTextNode(char const *content);
43
Node *createCommentNode(char const *content);
45
Session &session() { return *this; }
47
void notifyChildAdded(Inkscape::XML::Node &parent, Inkscape::XML::Node &child, Inkscape::XML::Node *prev);
49
void notifyChildRemoved(Inkscape::XML::Node &parent, Inkscape::XML::Node &child, Inkscape::XML::Node *prev);
51
void notifyChildOrderChanged(Inkscape::XML::Node &parent, Inkscape::XML::Node &child,
52
Inkscape::XML::Node *old_prev, Inkscape::XML::Node *new_prev);
54
void notifyContentChanged(Inkscape::XML::Node &node,
55
Util::SharedCStringPtr old_content,
56
Util::SharedCStringPtr new_content);
58
void notifyAttributeChanged(Inkscape::XML::Node &node, GQuark name,
59
Util::SharedCStringPtr old_value,
60
Util::SharedCStringPtr new_value);
63
SimpleSession(SimpleSession const &); // no copy
64
void operator=(SimpleSession const &); // no assign
67
LogBuilder _log_builder;
78
c-file-style:"stroustrup"
79
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
84
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :