6.8 File-Edit.rsl


(****
  *
  * The following is the objects and operations for the File and Edit commands located on    
  * the menu bar of the eClass program.
  *
*)

operation FileNew is
   inputs: ;
   outputs: ViewWindow;
   description: (* FileNew provides a blank set of windows with no lecture loaded *)
end FileNew;

operation FileOpen is
   inputs: LectureFileName;
   outputs: MainView;
   description: (* FileOpen will let use chose the lecture file they want to open and then the lecture will open into the main lecture view window *);
   precondition: (* Valid file name is chosen by the user *);
   postcondition: (* Lecture file is open in main view and contains all parts of the file including private notes *);
end FileOpen;

object LectureFileName is string;
(* This is the name of a lecture file, which is just a string of characters *);
end LectureFileName;

operation FileSave is
   inputs: LectureFileName;
   outputs: Lecture;
   description: (* FileSave saves the lecture chosen and allows the user to choose the name of the file *);
   precondition: (* Valid string for file name is chosen *);
   postcondition: (* Lecture is saved in the designated area chosen by the user *);
end FileSave;

operation FileSaveAs is
   inputs: LectureFileName;
   outputs: Lecture;
   description: (* FileSaveAs saves the lecture chosen and allows the user to choose the name of the file *);
   precondition: (* Valid string for file name is chosen *);
   postcondition: (* Lecture is saved in the designated area chosen by the user *);	
end FileSaveAs;

operation FilePrint is
   inputs: Lecture;
   outputs: Lecture;
   description: (* FilePrint prints the lecture file in the format chosen by the user *);
   precondition: (* There is a lecture loaded into the eClass program *);
   postcondition: (* The lecture prints to the chosen printer, nothing about the lecture file is changed *);
end FilePrint;

operation FileQuit is
   inputs: MainView;
   outputs: ;
   description: (* FileQuit closes the program without saving any current open files *);
   precondition: (* The eClass MainView is open *);
   postcondition: (* The eClass program is closed *);
end FileQuit;

operation EditUndo is
   inputs: Drawing;
   outputs: ;
   description: (* EditUndo undoes the last mark made by the user, leaving no image behind
*);
end EditUndo;

operation EditRedo is
   inputs: DrawSurface;
   outputs: Drawing;
   description: (* EditRedo places the last undone image back onto the screen *);
end EditRedo;

operation EditCut is
   inputs: Drawing;
   outputs: ;
   description: (*
      EditCut cuts the image from the page and saves it so that user can use Paste option. No image is left behind *);
end EditCut;

operation EditCopy is
   inputs: Drawing;
   outputs: Drawing;
   description: (* EditCopy copies the drawing but leaves the current draing in same place
   *);
end EditCopy;

operation EditPaste is
   inputs: Drawing;
   outputs: DrawSurface;
   description: (* EditPaste pastes the drawing that is saved from Cut or Copy and puts it on the screen *);
end EditPaste;

operation EditDelete is
   inputs: Drawing;
   outputs: ;
   description: (*  EditDelete deletes the highlighted drawing and deletes it from screen.  Nothing is saved *);
end EditPaste;

operation EditSelectAll is
   inputs: LectureView;
   outputs: LectureView;
   description: (* EditSelectAll highlights the entire lecture view on the screen *);
end EditSelectAll;

operation EditFind is
   inputs: Lecture, SearchWord;
   outputs: FoundWord;
   description: (* EditFind takes a search word from users and searches file for a matching word *);
end EditFind;

object SearchWord is string;
(* The search word is a string of characters of the word the user is searching for *);
end SearchWord;

object FoundWord is boolean;
(* Value of FoundWord is true if search word was found in the lecture file *);
end FoundWord;