# synfigapp::Action::System Class Reference

`#include <action_system.h>`

Inheritance diagram for synfigapp::Action::System:

List of all members.

## Public Member Functions

| System ()
| ~System ()
const etl::handle< Action::Base > & | get_most_recent_action ()
bool | get_clear_redo_stack_on_new_action () const
void | set_clear_redo_stack_on_new_action (bool x)
bool | perform_action (etl::handle< Action::Base > action)
bool | set_action_status (etl::handle< Action::Undoable > action, bool x)
const Stack & | undo_action_stack () const
const Stack & | redo_action_stack () const
bool | undo ()
| Undoes the last action.
bool | redo ()
| Redoes the last undone action.
void | clear_undo_stack ()
| Clears the undo stack.
void | clear_redo_stack ()
| Clears the redo stack.
void | inc_action_count () const
| Increments the action counter.
void | dec_action_count () const
| Decrements the action counter.
void | reset_action_count () const
| Resets the action counter.
int | get_action_count () const
| Returns the number of actions performed since last save.
void | set_ui_interface (const etl::handle< UIInterface > &uim)
void | unset_ui_interface ()
const etl::handle< UIInterface > & | get_ui_interface ()
sigc::signal< void, bool > & | signal_unsaved_status_changed ()
sigc::signal< void, bool > & | signal_undo_status ()
sigc::signal< void, bool > & | signal_redo_status ()
sigc::signal< void > & | signal_undo_stack_cleared ()
sigc::signal< void > & | signal_redo_stack_cleared ()
sigc::signal< void > & | signal_undo ()
sigc::signal< void > & | signal_redo ()
sigc::signal< void, etl::handle< Action::Undoable > > & | signal_new_action ()
| Called whenever an undoable action is processed and added to the stack.
sigc::signal< void, etl::handle< Action::Undoable > > & | signal_action_status_changed ()

## Friends

class | PassiveGrouper

## Constructor & Destructor Documentation

Action::System::System | ( |  | ) |

References unset_ui_interface().

Action::System::~System | ( |  | ) |

## Member Function Documentation

const etl::handle<Action::Base>& synfigapp::Action::System::get_most_recent_action | ( |  | ) | `[inline]`

bool synfigapp::Action::System::get_clear_redo_stack_on_new_action | ( |  | ) | const`[inline]`

void synfigapp::Action::System::set_clear_redo_stack_on_new_action | ( | bool | x | ) | `[inline]`

bool Action::System::perform_action | ( | etl::handle< Action::Base > | action | ) |

References _, clear_redo_stack(), clear_undo_stack(), synfigapp::Action::CanvasSpecific::get_canvas(), synfigapp::Action::CanvasSpecific::get_canvas_interface(), synfigapp::Action::Error::get_desc(), synfigapp::Action::Error::get_type(), get_ui_interface(), inc_action_count(), synfigapp::Action::CanvasSpecific::is_dirty(), synfigapp::UIInterface::RESPONSE_NO, signal_new_action(), and synfigapp::Action::Error::TYPE_UNABLE.

Referenced by studio::Instance::process_action().

bool Action::System::set_action_status | ( | etl::handle< Action::Undoable > | action,
|  | bool | x |
| ) |  |  |

References synfigapp::Action::CanvasSpecific::get_canvas(), get_ui_interface(), and synfigapp::Action::CanvasSpecific::is_dirty().

const Stack& synfigapp::Action::System::undo_action_stack | ( |  | ) | const`[inline]`

Referenced by undo().

const Stack& synfigapp::Action::System::redo_action_stack | ( |  | ) | const`[inline]`

Referenced by redo().

bool synfigapp::Action::System::undo | ( |  | ) |

Undoes the last action.

Todo:
  This function is not exception safe!

References _, synfigapp::Action::CanvasSpecific::get_canvas(), synfigapp::Action::CanvasSpecific::get_canvas_interface(), get_ui_interface(), synfigapp::Action::CanvasSpecific::is_dirty(), and undo_action_stack().

bool Action::System::redo | ( |  | ) |

Redoes the last undone action.

Todo:
  This function is not exception safe!

References _, synfigapp::Action::CanvasSpecific::get_canvas(), synfigapp::Action::CanvasSpecific::get_canvas_interface(), get_ui_interface(), synfigapp::Action::CanvasSpecific::is_dirty(), and redo_action_stack().

void Action::System::clear_undo_stack | ( |  | ) |

Clears the undo stack.

Referenced by perform_action().

void Action::System::clear_redo_stack | ( |  | ) |

Clears the redo stack.

Referenced by perform_action().

void Action::System::inc_action_count | ( |  | ) | const

Increments the action counter.

Note:
  You should not have to call this under normal circumstances.

See also:
  dec_action_count(), reset_action_count(), get_action_count()

Referenced by perform_action().

void Action::System::dec_action_count | ( |  | ) | const

Decrements the action counter.

Note:
  You should not have to call this under normal circumstances.

See also:
  inc_action_count(), reset_action_count(), get_action_count()

void Action::System::reset_action_count | ( |  | ) | const

Resets the action counter.

Note:
  You should not have to call this under normal circumstances.

See also:
  inc_action_count(), dec_action_count(), get_action_count()

Referenced by synfigapp::Instance::save(), and synfigapp::Instance::save_as().

int synfigapp::Action::System::get_action_count | ( |  | ) | const`[inline]`

Returns the number of actions performed since last save.

See also:
  inc_action_count(), dec_action_count(), reset_action_count()

Referenced by studio::Instance::dialog_cvs_commit(), studio::Instance::dialog_cvs_update(), studio::Instance::safe_close(), and studio::Instance::safe_revert().

void synfigapp::Action::System::set_ui_interface | ( | const etl::handle< UIInterface > & | uim | ) | `[inline]`

References ui_interface_.

void synfigapp::Action::System::unset_ui_interface | ( |  | ) | `[inline]`

References ui_interface_.

Referenced by System().

const etl::handle<UIInterface>& synfigapp::Action::System::get_ui_interface | ( |  | ) | `[inline]`

References ui_interface_.

Referenced by perform_action(), redo(), set_action_status(), and undo().

sigc::signal<void,bool>& synfigapp::Action::System::signal_unsaved_status_changed | ( |  | ) | `[inline]`

Referenced by studio::Instance::Instance().

sigc::signal<void,bool>& synfigapp::Action::System::signal_undo_status | ( |  | ) | `[inline]`

Referenced by studio::Instance::Instance().

sigc::signal<void,bool>& synfigapp::Action::System::signal_redo_status | ( |  | ) | `[inline]`

Referenced by studio::Instance::Instance().

sigc::signal<void>& synfigapp::Action::System::signal_undo_stack_cleared | ( |  | ) | `[inline]`

sigc::signal<void>& synfigapp::Action::System::signal_redo_stack_cleared | ( |  | ) | `[inline]`

sigc::signal<void>& synfigapp::Action::System::signal_undo | ( |  | ) | `[inline]`

sigc::signal<void>& synfigapp::Action::System::signal_redo | ( |  | ) | `[inline]`

sigc::signal<void,etl::handle<Action::Undoable> >& synfigapp::Action::System::signal_new_action | ( |  | ) | `[inline]`

Called whenever an undoable action is processed and added to the stack.

Referenced by perform_action().

sigc::signal<void,etl::handle<Action::Undoable> >& synfigapp::Action::System::signal_action_status_changed | ( |  | ) | `[inline]`

## Friends And Related Function Documentation

friend class PassiveGrouper `[friend]`

Reimplemented in synfigapp::Instance.

The documentation for this class was generated from the following files:

- action_system.h
- action_system.cpp