package edit;


/**
 * Class Edit is derived from Menu expansions in Section 2.6.1 of the
 * requirements, more specifically the commands in the Edit menu. In this
 * simple initial model, all of the generic editing functionality is modeled as
 * operations.
 */
abstract class Edit {

    /**
    * Undo undoes the most recently completed editing action.

    pre:
       // There user has taken at least one action prior to this state.
       (exists(action))
    */
    abstract void undo();

    /**
     * Redo will redo the most recently executed undo action.

    pre:
       // There user has taken at least one action prior to this state.
       (exists(action))
     */
    abstract void redo();

    /**
     * Cut removes and copies the selected data in the current view.

    pre:
       // Some data is selected.
       (selected(data))
     */
    abstract void cut(String data);

    /**
     * Copy copies the selected data in the current view.

    pre:
       // Some data is selected.
       (selected(data))
     */
    abstract void copy(String data);

    /**
     * Paste inserts the most recently cut or copied data into the seleciton in
     * the current view.

    pre:
       // The user has selected an index to paste content to.
       (selected(location))
       // There exists data to paste
       (selected(data))
     */
    abstract void paste(String data);

    /**
     * Delete removes the selected data in the current view.

    pre:
       // Some data is selected.
       (selected(data))
     */
    abstract void delete();

    /**
     * SelectAll selects all the editable data in the current view.
     */
    abstract void selectAll();

    /**
     * Find performs a search for the given string in the current view.
     */
    abstract void find();
}