/** @file
* @brief Event object representing a change of the XML document
*/
/* Authors:
* Unknown author(s)
* Krzysztof KosiĆski <tweenk.pl@gmail.com> (documentation)
*
* Copyright 2008 Authors
*
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* See the file COPYING for details.
*/
typedef unsigned int GQuark;
#include <iterator>
#include "util/forward-pointer-iterator.h"
#include "inkgc/gc-managed.h"
/**
* @brief Enumeration of all XML event types
*/
enum EventType {
};
/**
* @brief Generic XML modification event
*
* This is the base class for all other modification events. It is actually a singly-linked
* list of events, called an event chain or an event log. Logs of events that happened
* in a transaction can be obtained from Document::commitUndoable(). Events can be replayed
* to a NodeObserver, or undone (which is equivalent to replaying opposite events in reverse
* order).
*
* Event logs are built by appending to the front, so by walking the list one iterates over
* the events in reverse chronological order.
*/
{
/**
* @brief Pointer to the next event in the event chain
*
* Note that the event this pointer points to actually happened before this event.
* This is because the event log is built by appending to the front.
*/
/**
* @brief Serial number of the event, not used at the moment
*/
int serial;
/**
* @brief Pointer to the node that was the object of the event
*
* Because the nodes are garbage-collected, this pointer guarantees that the node
* will stay in memory as long as the event does. This simplifies rolling back
* extensive deletions.
*/
struct IteratorStrategy {
}
};
/**
* @brief If possible, combine this event with the next to reduce memory use
* @return Pointer to the optimized event chain, which may have changed
*/
/**
* @brief Undo this event to an observer
*
* This method notifies the specified observer of an action opposite to the one that
* is described by this event.
*/
}
/**
* @brief Replay this event to an observer
*
* This method notifies the specified event of the same action that it describes.
*/
}
static int _next_serial;
};
/**
* @brief Object representing child addition
*/
/// The added child node
/// The node after which the child has been added, or NULL if it was added as first
Event *_optimizeOne();
};
/**
* @brief Object representing child removal
*/
/// The child node that was removed
/// The node after which the removed node was in the sibling order, or NULL if it was first
Event *_optimizeOne();
};
/**
* @brief Object representing attribute change
*/
/// GQuark corresponding to the changed attribute's name
/// Value of the attribute before the change
/// Value of the attribute after the change
Event *_optimizeOne();
};
/**
* @brief Object representing content change
*/
/// Content of the node before the change
/// Content of the node after the change
Event *_optimizeOne();
};
/**
* @brief Obect representing child order change
*/
/// The node that was relocated in sibling order
/// The node after which the relocated node was in the sibling order before the change, or NULL if it was first
/// The node after which the relocated node is after the change, or if it's first
Event *_optimizeOne();
};
}
}
#endif
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :