Source: xxe/editor/DocumentMarksChangedEvent.js

export const CHANGE_NODE_MARK_ADDED       = 0;
export const CHANGE_NODE_MARK_MOVED       = 1;
export const CHANGE_NODE_MARK_REMOVED     = 2;
export const CHANGE_TEXT_LOCATION_ADDED   = 3;
export const CHANGE_TEXT_LOCATION_MOVED   = 4;
export const CHANGE_TEXT_LOCATION_REMOVED = 5;

/**
 * {@link XMLEditorEvent} sent after some documents are changed 
 * on the server side.
 */
export class DocumentMarksChangedEvent extends XMLEditorEvent {
    constructor(xmlEditor, data) {
        super(xmlEditor, data, "documentMarksChanged");
    }

    /**
     * Get the <code>changes</code> property of this event.
     *
     * @type {array}
     */
    get changes() {
        return this._changes;
    }
    
    /**
     * Get the <code>reason</code> property of this event.
     *
     * @type {string}
     */
    get reason() {
        // Return null rather than undefined.
        return !this._reason? null : this._reason;
    }
    
    /**
     * Get the <code>dragging</code> property of this event.
     *
     * @type {boolean}
     */
    get dragging() {
        return (this._reason === "dragging");
    }
    
    /**
     * Get the <code>showing</code> property of this event.
     *
     * @type {boolean}
     */
    get showing() {
        return (this._reason === "showing");
    }
}