WalnutSendOps.mesa - public interface to Mail Sending operations
Copyright © 1984, 1985 by Xerox Corporation. All rights reserved.
Willie-Sue on December 6, 1984 1:58:25 pm PST
Donahue, September 2, 1983 9:39 am
Russ Atkinson (RRA) March 21, 1985 0:23:15 am PST
DIRECTORY
BasicTime USING [GMT, nullGMT],
GVBasics USING [ItemType],
IO USING [STREAM],
Menus USING [MenuProc],
Rope USING [ROPE],
ViewerClasses USING [Viewer],
ViewerTools USING [TiogaContents];
WalnutSendOps: CEDAR DEFINITIONS = BEGIN OPEN Rope, ViewerClasses, ViewerTools;
Form: TYPE = REF FormRec;
FormRec: TYPE = RECORD[formText: ViewerTools.TiogaContents, fields: LIST OF ROPENIL];
FormAttr: TYPE = RECORD[ name: ROPE, val: ROPE ];
defaultText: READONLY ViewerTools.TiogaContents;
answerText: READONLY ViewerTools.TiogaContents;
forwardText: READONLY ViewerTools.TiogaContents;
labelFont: READONLY ROPE;
***********************************************************
used by various Walnut procs
userRName: READONLY ROPE;
simpleUserName: READONLY ROPE;
defaultRegistry: ROPE;
TiogaCTRL: GVBasics.ItemType = LOOPHOLE[1013B];
***********************************************************
Sending messages & dealing with sender viewers [WalnutSendCommonImpl]
Send: PROC[v: ViewerClasses.Viewer, doClose: BOOLFALSE] RETURNS[sent: BOOL];
is given a text viewer set up for sending; does the sending
BuildSendViewer: PROC[paint, iconic: BOOL, form: Form ← NIL, who: Viewer ← NIL] RETURNS[v: Viewer];
builds sending viewer
Answer: PROC[msgHeaders: ROPE, who: Viewer← NIL] RETURNS [v: Viewer];
Forward: PROC[msg: Viewer, who: Viewer← NIL] RETURNS [v: Viewer];
this needs the whole viewer because it's doing a secondary selection on all of it
AppendHeaderLine: PROC[v: Viewer, line: ROPE, changeSelection: BOOLFALSE];
ClearSendViewer: PROC[v: Viewer];
fills in senderV with the default form
StuffForm: PROC[v: Viewer, contents: TiogaContents];
displays contents in senderV, grabs focus & selects first placeholder
RegisterReporter: PROC[strm: IO.STREAM];
allows Walnut to have WalnutSend use its reporting procedure
UnregisterReporter: PROC[strm: IO.STREAM];
AddToSenderProps: PROC[
key: ATOM, proc: PROC[v: Viewer, action: ATOM, ra: REF ANY], data: REF ANY];
does AddProp[sendViewer, key, REF RECORD[proc, data]] to subsequent senders
RemoveFromSenderProps: PROC[key: ATOM];
removes key from list of senderProps
AddToSendMenu: PROC[label: ROPE, proc: Menus.MenuProc];
adds a menu button to the sender's menu
RemoveFromSendMenu: PROC[name: ROPE];
removes the named button from the sender menu, if such a button exists; no errors
GetFieldBody: PROC[text, fieldName: ROPE] RETURNS[fieldBody: ROPE];
expects text to be the text of a message; parses the header fields looking for a field named fieldName and returns the value of the fieldBody, or NIL if no such fieldName is found.
GetRecipients: PROC[sender: Viewer] RETURNS[rList: LIST OF ROPE, parseError: BOOL];
expects sender to contain a message to be sent; will parse the headers and return a list of all the recipients of the message; if an error occurs while parsing the viewer, parseError=TRUE is returned, and the viewer will have the offending field underlined
***********************************************************
WalnutSendProc: PROC[fromExec: BOOL];
create a viewer for sending msgs
TiogaTextFromStrm: PROC[strm: IO.STREAM, startPos: INT← 0, len: INTLAST[INT]] RETURNS[contents: TiogaContents];
returns NIL IF EndOfStream encountered during read
RopeFromStream: PROC [strm: IO.STREAM, startPos: INT← 0, len: INTLAST[INT]] RETURNS [ROPE];
Reads len bytes from the given stream, starting at the given start position, although reading will be truncated at the end of stream. A client wishing to check for exactly len bytes being read should check the length of the returned rope. Any signals are passed up to the caller, since they should not really happen.
RFC822Date: PUBLIC PROC[gmt: BasicTime.GMT← BasicTime.nullGMT] RETURNS[date: ROPE];
generates arpa standard time, dd mmm yy hh:mm:ss zzz
END.