-- file: TOCSelectionDefs.Mesa
-- last edited by Brotz, November 19, 1981 1:26 PM
-- last edited by Taft, May 21, 1983 3:06 PM

DIRECTORY
inD: FROM "InteractorDefs" USING [TOCTextNbrPtr],
vmD: FROM "VirtualMgrDefs" USING [TOCHandle, TOCIndex];

tsD: DEFINITIONS =

BEGIN
OPEN vmD;


AddRange: PROCEDURE [toc: TOCHandle, key: CARDINAL, low, high: TOCIndex];
-- Includes the new range [low .. high] in the toc selection.


RemoveRange: PROCEDURE [toc: TOCHandle, key: CARDINAL, low, high: TOCIndex];
-- Removes the range [low .. high] from the toc selection.


ResetTOCSelection: PROCEDURE [toc: TOCHandle, key: CARDINAL];
-- Resets the entire TOCSelection to be empty.


SetTOCSelection: PROCEDURE [toc: TOCHandle, key: CARDINAL, index: TOCIndex];
-- sets the TOC selection to the range [index..index+1).


IsSelected: PROCEDURE [toc: TOCHandle, key: CARDINAL, index: vmD.TOCIndex]
RETURNS [BOOLEAN];
-- Returns TRUE iff index is in the current TOCSelection.


TOCSelectionEmpty: PROCEDURE [toc: TOCHandle, key: CARDINAL]
RETURNS [BOOLEAN];
-- Returns TRUE iff the current TOCSelection is empty.


FirstSelectedEntry: PROCEDURE [toc: TOCHandle, key: CARDINAL]
RETURNS [TOCIndex];
-- Returns the lowest entry in the current TOCSelection. Returns 0 if the current
-- TOCSelection is empty.


LastSelectedEntry: PROCEDURE [toc: TOCHandle, key: CARDINAL]
RETURNS [TOCIndex];
-- Returns the highest entry in the current TOCSelection. Returns 0 if the current
-- TOCSelection is empty.


NextSelectedEntry: PROCEDURE [toc: TOCHandle, key: CARDINAL,
index: TOCIndex] RETURNS [TOCIndex];
-- Returns the next higher entry after index in the current TOCSelection. Returns 0 if no
-- higher selected entry exists.


PrevSelectedEntry: PROCEDURE [toc: TOCHandle, key: CARDINAL,
index: TOCIndex] RETURNS [TOCIndex];
-- Returns the next lower entry before index in the current TOCSelection. Returns 0 if no
-- lower selected entry exists.


FirstSelectedAndUndeletedEntry: PROCEDURE [toc: TOCHandle, key: CARDINAL]
RETURNS [TOCIndex];
-- Returns the lowest entry in the current TOCSelection which is not deleted.
-- Returns 0 if no such entry exists.


NextSelectedAndUndeletedEntry: PROCEDURE [toc: TOCHandle, key: CARDINAL,
index: TOCIndex] RETURNS [TOCIndex];
-- Returns the next higher entry after index in the current TOCSelection which is
-- not deleted. Returns 0 if no such entry exists.


ConsiderAll: PROCEDURE [tnp: inD.TOCTextNbrPtr, key: CARDINAL];
-- Marks (on screen) as selected all selected TOCEntries.


DeconsiderAll: PROCEDURE [tnp: inD.TOCTextNbrPtr, key: CARDINAL];
-- Unmarks (on screen) as selected all selected TOCEntries.


TOCTextTracker: PROCEDURE [tnp: inD.TOCTextNbrPtr];
-- Sets cursor shape for TOC Text subneighborhood. Watches for button up and down,
-- selects and restores selections in TOC according to the TOC selection protocol.


END. -- of TOCSelectionDefs --