### Class

# PapersView UndoContext

#### Description [src]

    final class PapersView.UndoContext : GObject.Object
    {
      /* No available fields */
    }

This context singleton manages two stacks of `PpsUndoAction` that contain actions that may be undone or redone.

These actions may be added by a number of objects that implement PpsUndoHandler (e.g. the annotations context). Each handler provides a pointer to an opaque structure that contains data to undo the action.

The switch between the undo/redo stacks is done transparently: actions are added to the redo stack if and only if another action is being undone (i.e. `pps_undo_context_undo` is being called).

#### Ancestors

- GObject

#### Constructors

###### pps_undo_context_new

No description available.

#### Instance methods

###### pps_undo_context_add_action

This method adds a new action to the undo (or redo if it is used while undoing) stack. If it is undone in the future, `pps_undo_handler_undo` will be called on `handler` with `data`.

###### pps_undo_context_get_last_action

No description available.

###### pps_undo_context_get_last_handler

No description available.

###### pps_undo_context_redo

Similar to the undo method, but taking an action from the redo stack.

###### pps_undo_context_undo

This pops the last action on the undo stack and undoes it by calling the undo interface method of the `PpsUndoHandler` associated to the action. While undoing, the `PpsUndoHandler` should add a new action with `pps_undo_context_add_action` to redo what has just been undone, it will be added to the redo stack by the undo context.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### PapersView.UndoContext:document-model

No description available.

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct PapersViewUndoContextClass {
      GObjectClass parent_class;

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.