COMMENT @%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

	Copyright (c) Geoworks 1994 -- All Rights Reserved

PROJECT:	GEOS
MODULE:		Viewer Interface Library (VIL)
FILE:		viewer.def

AUTHOR:		Skarpi Hedinsson, Oct 18, 1994

MACROS:
	Name			Description
	----			-----------

REVISION HISTORY:
	Name	Date		Description
	----	----		-----------
	SH	10/18/94   	Initial revision


DESCRIPTION:
	This file contains the definitions for the library.  It is included
both by the library and by users of the library.  When included by the library,
the symbol "_DECLARER_" must be true.
		
	$Id: viewer.def,v 1.1 97/04/04 14:26:00 newdeal Exp $

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%@
SetDef __VIEWER

StartLibrary	viewer

UseLib	mailbox.def
include	Foam/faxOpts.def		; For FaxResolutionChoice

;---------------------------------------------------------------------------
;  Constants
;---------------------------------------------------------------------------
ViewerInterfaceError	etype	word, 1
	VIE_FILE_NOT_RECOGNIZED	enum ViewerInterfaceError
	; A file did not have a token (if GEOS file) or an DOS extension.

	VIE_NO_VIEWER_LIBRARY	enum ViewerInterfaceError
	; A viewer library for the given file was not found.  An application
	; can respond to the message by launching a default viewer library.

	VIE_SHARING_VIOLATION	enum ViewerInterfaceError
	; The file could not be opened.

ViewerLibraryRoutines	etype	word, 0, 1
	VLR_OPEN		enum	ViewerLibraryRoutines
	; Create viewer library UI and load the document to view.
	;
	; Pass:		ss:sp   - fptr to ViewerParams
	; Return: 	^ldx:ax - OD of created viewer UI

	VLR_DETACH		enum	ViewerLibraryRoutines
	; Called when application owning the viewer library needs to detach.
	; The viewer returns a handle to a block of state.  This state block
	; can be passed back to a viewer library in the ViewerParams struct.
	;
	; Pass:		^lss:sp - OD of viewer library UI to destroy.
	; Return:	ax	- State block handle (0 if none)

	VLR_CHANGE_DOCUMENT	enum	ViewerLibraryRoutines
	; Called when a new document needs to be viewed using a viewer
	; already on screen.
	;
	; Pass:		ss:sp	- fptr to ViewerChangeDoc
	; Return:	nothing

	VLR_CLOSE		enum	ViewerLibraryRoutines
	; Called when the application needs to close the viewer.  This could
	; be the case when a user presses ctrl-n to view the next file and
	; the next file is a different type and thus needs a different viewer.
	;
	; Pass:		^lss:sp - OD of viewer UI to destory.
	; Return:	nothing

ViewerAttributes	record
	VA_NEW_DOCUMENT:1
	; The document to open is new (just created.)

	VA_NO_UNDO:1
	; Undo shouldn't be allowed in the document.

	VA_NO_RENAME:1
	; We won't let the user rename the document while closing.

	:13
ViewerAttributes	end

;
; The type of the file being viewed: a text note, a faxfile, an SMS, or
; whatever.
;
; This is used by the fax send controller to determine if the document can
; handle a header-type coverpage or not.  The faxfile type also predefines the
; resolution of the fax being forwarded.
;
; The types so far:
ViewerFileType	etype	word, 0, 2
	VFT_NOTE	enum	ViewerFileType
		; Text note.  The file can be sent either standard or fine
		; resolution, and the viewer can handle a header-type
		; coverpage, a full coverpage, or no coverpage.
		;
	VFT_FAXFILE	enum	ViewerFileType
		; A faxfile.  This file can be forwarded in whatever resolution
		; it arrived.  This can handle either a full-page coverpage or
		; no coverpage at all.
		;
	VFT_GRAPHICS	enum	ViewerFileType	; Non-faxfile graphics file.
		; A graphics-type file.  This file can be sent either fine or
		; standard, and can be sent with either a full-page coverpage
		; or with no coverpage at all.
		;
	VFT_RESET_STATUS enum	ViewerFileType
		; Creative use (read hack) of this etype to allow the faxMAC
		; to receive status messages everytime a new faxfile is opened.
		; Previously, the same faxfile opened twice would not produce
		; a notifcation causing the faxMAC to provide erroneous values
		; for resolution and cover page type.
		;	





;
; This structure is used with the GAGCNLT_VIEWER_NOTIFICATIONS gcn list and 
; GWNT_VIEWER_DOCUMENT_CHANGE notification to allow the fax transport driver's
; mail address control to behave differently when viewing a faxnote or a
; received fax.
;
; Or whatever.
;
ViewerDocumentStatus	struct
	VDS_docInfo	DocumentInfo		; The document's name.
	VDS_type	ViewerFileType
	VDS_resolution	FaxSendResolutionChoice	; If a fax, we need to know
	VDS_pages	word			; If a forwarded fax, we want
						; to know this
ViewerDocumentStatus	ends

;
; The status of the document as returned from MSG_VIEWER_CLOSE.  This enum
; is also passed to the viewer close message (VP_closeMsg), so applications
; can determin what the status of the document was at the time the viewer
; was closed.
;
ViewerCloseStatus	etype	word, 0
	VCS_CLOSED		enum ViewerCloseStatus
	; Viewer closed.  This means the document was closed and the auto-save
	; timers have been turned off.

	VCS_DOCUMENT_DELETED	enum  ViewerCloseStatus
	; The viewer was closed and the document was deleted.

	VCS_NOT_CLOSED		enum ViewerCloseStatus
	; The viewer was not closed.  This happens when the user gets a
	; warning that he/she is about to close an empty document that will
	; be deleted and the user elects not to close the viewer.

	VCS_ERROR		enum ViewerCloseStatus
	; The viewer was closed but an error occured.  This can
	; only be returned with the viewer close message (VP_closeMsg).

;
; Maximum length of text moniker for button that lets user create
; new notes/message/faxes.
;
MAX_CREATE_NEW_MONIKER_LENGTH	equ	20

;---------------------------------------------------------------------------
;  Structures
;---------------------------------------------------------------------------

ViewerChangeDocumentStruct	struct
	VCD_documentInfo	DocumentInfo
	; Name of document to view.
	;
	VCD_viewerOD		optr
	; Optr of the viewer library ui.
	;
ViewerChangeDocumentStruct	ends

ViewerParams	struct
	VP_libraryName	FileLongName
	; Name of the library viewing VP_fileName.
	;
	VP_documentInfo	DocumentInfo
	; The full path and name of the file to view.
	;
	VP_app		GeodeToken
	; Specifies what application is loading the library.  This allows
        ; a viewer library to customize user interface.
	;
	VP_destination	optr
	; Process OD of the calling thread. Needed to unload the library
	;
	VP_closeMsg	word
	; Message sent to the destination passing the library handle when
	; the library should be unloaded.  The handler for this message the
	; calles ViewerUnloadLibrary.
	;
	; Pass:
	; 	cx	= handle of viewer library
	;	dx	= ViewerCloseStatus
	; Return:
	; 	nothing
	;
	VP_nextPrevMsg	word
	; Message sent to the destination when the user wants to see the
	; next or previous document.
	;
	VP_attr		ViewerAttributes
	; Special attributes that apply to the viewer or the document being
	; viewed.
	;
	VP_state	hptr
	; Handle of a state block if library is being restored from state.
	; Null if no state.
	;
ViewerParams	ends

ViewerLibNameStruct	struct
	VLNS_documentInfo	fptr.DocumentInfo
	; ptr to a FileNameInfo structure containing the file to view.
	VLNS_libraryName	fptr.FileLongName
	; ptr to a buffer that holds the library name
ViewerLibNameStruct	ends

ViewerControlState	struct
	VCS_documentInfo	DocumentInfo
	; Name and directory of the current document.
	VCS_textRange		VisTextRange
	; The text range (cursor/selection) of the current document.
ViewerControlState	ends

FileOpenControlRenameCopyStruct	struct
	FOCRCS_documentName	FileLongName
	; Name of document to rename/copy.
	FOCRCS_newName		FileLongName
	; New name for document.
	FOCRCS_documentDir	FDocumentDir
	; Document directory where the documents are located.
FileOpenControlRenameCopyStruct	ends

;---------------------------------------------------------------------------
;  FileOpenControlClass
;---------------------------------------------------------------------------
FileOpenControlClass	class	ComplexMonikerClass
	uses	GenControlClass

	FileOpenFeatures	record
		:7			; for future use
		FOF_MOVE:1		; new for lizzy
		FOF_CREATE_FOLDER:1	; new for lizzy
		FOF_COPY:1		; new for lizzy
		FOF_CLOSE:1
		FOF_OPEN:1
		FOF_CREATE_NEW:1
		FOF_DELETE:1
		FOF_RENAME_COPY:1
		FOF_RENAME:1
	FileOpenFeatures	end
	;
	; This record changed its size from 8bit to 16bit from Lizzy project
	; Please take a note of this.
	;

	FOF_DEFAULT_FEATURES	equ mask FOF_OPEN \
				 or mask FOF_CLOSE \
				 or mask FOF_CREATE_NEW

	FOF_FULL_MENU	equ	(mask FOF_MOVE or \
				mask FOF_CREATE_FOLDER or \
				mask FOF_COPY or \
				mask FOF_CREATE_NEW or \
				mask FOF_RENAME_COPY or \
				mask FOF_RENAME)


	MSG_FILE_OPEN_CONTROL_OPEN		message
	; Opens/displays the currently selected file by loading the
	; corrisponding viewer library.
	;
	; Pass: cx:dx - ptr to DocumentInfo
	; 	bp - ViewerAttributes
	; Return: nothing
	; Destroyed: ax, cx, dx, bp
	;

	MSG_FILE_OPEN_CONTROL_GET_VIEWER_LIBRARY_NAME	message
	; Returns the name of the viewer library used to view/edit the
	; selected file.  Applications can subclass this message to return
	; a different viewer library name.
	;
	; Pass: ss:bp	  - ViewerLibNameStruct
	; Return: ss:bp   - ViewerLibNameStruct w/ lib name.
	; Destroyed: nothing
	;

	MSG_FILE_OPEN_CONTROL_CREATE_NEW	message
	;
	; Creates a default new file and calls MSG_FILE_OPEN_CONTROL_OPEN on
	; it.  A application can subclass this message to create a different
	; file type.
	;
	; Pass: cx:dx - buffer for filename (DocumentInfo)
	; Return: cx:dx - buffer with filename
	;	  carry - set if error creating file.
	; Destroyed: ax, cx, dx, bp
	;

	MSG_FILE_OPEN_CONTROL_DELETE		message
	;
	; Deletes the currently selected file.
	;
	; Pass: nothing
	; Return: nothing
	; Destroyed: ax, cx, dx, bp
	;

	MSG_FILE_OPEN_CONTROL_RENAME_COPY	message
	;
	; Puts up the Rename/Copy dialog which allows the user to rename or
	; copy a selected file.
	;
	; * this message is no longer handled
	;
	; * obsoledated by MSG_FILE_OPEN_CONTROL_RENAME and
	;   MSG_FILE_OPEN_CONTROL_COPY.  Spec changes for lizzy gets rid of
	;   "Rename/Copy trigger" as well as "Rename/Copy dialog". Instead,
	;   now we have two separate dialogs for them.  So, we won't know
	;   which dialog to bring up when we receive this message.  There is
	;   no point in keeping this feature since this message contradicts
	;   the new spec.
	;
	; Pass: nothing
	; Return: nothing
	; Destroyed: ax, cx, dx, bp
	;

	MSG_FILE_OPEN_CONTROL_ITEM_SELECTED	message
	;
	; Message sent out when an item is selected in the file selector
	;
	; Pass: cx - entry # of selection
	;	bp - GenFileSelectorEntryFlags
	;
	; Return: nothing
	; Destroyed: ax, cx, dx, bp
	;
	
	MSG_FILE_OPEN_CONTROL_SET_DIRECTORY	message
	;
	; Sets the current directory for the file selector.
	;
	; Pass: cx - FDocumentDir
	; Return: nothing
	; Destroyed: ax, cx, dx, bp
	;

	MSG_FILE_OPEN_CONTROL_GET_DIRECTORY	message
	;
	; Gets the current directory of the file selector.
	;
	; Pass: nothing
	; Return: cx - FDocumentDir
	; Destroyed: nothing
	;

	MSG_FILE_OPEN_CONTROL_GET_FILTER_ROUTINE	message
	;
	; See MSG_GEN_FILE_SELECTOR_GET_FILTER_ROUTINE for details.
	;
	; NOTE: If you subclass this message, preferbally, do not call
	; superclass.
	;

	MSG_FILE_OPEN_CONTROL_SUB_DIR_OPEN		message
	;
	; Sent when a user opens a sub directory in the file selector.
	;
	; Pass: cx - FDocumentDir of directory opened.
	; Return: nothing
	; Destroyed: ax, cx, dx, bp
	;

	MSG_FILE_OPEN_CONTROL_SUB_DIR_CLOSE		message
	;
	; Sent when a user closes a sub directory in the file selector.
	;
	; Pass: cx - FDocumentDir of directory being closed.
	; Return: nothing
	; Destroyed: ax, cx, dx, bp
	;

	MSG_FILE_OPEN_CONTROL_RENAME_DOCUMENT	message
	;
	; Renames the selected document using FileRename.  Subclass this
	; message if you need to prepare the document before renaming.
	;
	; Pass: ss:bp - FileOpenControlRenameCopyStruct
	; Return: nothing
	; Destroyed: nothing
	;

	MSG_FILE_OPEN_CONTROL_COPY_DOCUMENT	message
	;
	; Copies the selected document using FileCopy.  Subclass this
	; message if you need to prepare the document before coping.
	;
	; Pass: ss:bp - FileOpenControlRenameCopyStruct
	; Return: nothing
	; Destroyed: nothing
	;

	MSG_FILE_OPEN_CONTROL_CHANGE_FEATURES	message
	;
	; Allows you to turn features on and off on the fly without forcing
	; a visual re-build of the controllers UI.  This will allow you to
	; remove/add the "rename/copy", "rename" and "delete" triggers in the
	; MSG_FILE_OPEN_CONTROL_SUB_DIR_OPEN/CLOSE method handlers.
	;
	; Note: From Lizzy project, FileOpenFeatures record changed from 8bit
	;       record to 16 bit record.  New applications should use:
	;       MSG_FILE_OPEN_CONTROL_CHANGE_FEATURES_16 defined later
	;
	; Pass: cl - FileOpenFeatures.low to set
	;	ch - FileOpenFeatures.low to clear
	;
	; Return: nothing
	; Destroyed: nothing
	; 

	MSG_FILE_OPEN_CONTROL_GET_FILE_SELECTOR_OPTR	message
	;
	; Returns the optr of the FileOpenControlClass's GenFileSelector.
	;
	; Pass: Nothing
	; Return: ^lcx:dx - optr of FFileSelector
	;

	;------------------------------------------------------------------
	; The following messages are internal and should not be subclassed.
	;------------------------------------------------------------------

	MSG_FOC_OPEN				message
	; Internal message sent when the user presses the "open" trigger.
	; The handler for this message calls MSG_FILE_OPEN_CONTROL_OPEN passing
	; the selected file name.
	;

	MSG_FOC_CLOSE				message
	; Internal message sent when the user presses the "close" trigger.
	; This closes the currently open folder.
	;

	MSG_FOC_CREATE_NEW			message
	; Internal message sent when the user presses the "create new" trigger.
	; The handler for this message calls MSG_FILE_OPEN_CONTROL_CREATE_NEW
	; to get the name of create file.
	;

	MSG_FOC_UNLOAD_VIEWER_LIBRARY		message
	; Internal message sent by a viewer library notifying the controller
	; that it should unload the viewer library.
	;
	; Pass:	cx - Library handle
	;

	MSG_FOC_NEXT_PREV_DOCUMENT		message
	; Internal message sent by a viewer library notifying the controller
	; that a new document should be opened.
	;
	; Pass:	cx - C_CTRL_P/C_CTRL_N
	;

	MSG_FOC_NEXT_PREV_GET_NEW_DOC		message
	;
	; Internal message send when the file selector has been updated
	; to show the next or previous document.  The handler for this
	; message tells the viewer to load a new document or changes
	; viewer libraries if that needs to be done
	;
	; Pass:	ss:bp - fptr to old document name (FileLongName)
	;

	MSG_FOC_RENAME_DOC			message
	;
	; Internal message sent when the user presses the "rename" trigger
	; to rename a selected file.  Calls
	; MSG_FILE_OPEN_CONTROL_RENAME_DOCUMENT which does the renaming.
	;

	MSG_FOC_COPY_DOC			message
	;
	; Internal message sent when the user presses the "copy" trigger
	; to copy a selected file.  The trigger is only enabled if the
	; current directory is "created texts". Calls
	; MSG_FILE_OPEN_CONTROL_COPY_DOCUMENT which does the coping.
	;

	MSG_FOC_CHECK_INCLUDE_EXCLUDE_DIR	message
	;
	; Internal message sent from our FileSelector object to check
	; if the specified file is in the INCLUDE_DIR or EXCLUDE_DIR list.
	;
	; Pass: ss:bp 	= FileLongName to check
	;	dx	= size FileLongName
	; Return: ax	= non zero to accept the file
	;

	MSG_FOC_CHECK_INCLUDE_EXCLUDE_FILE	message
	;
	; Internal message sent from our FileSelector object to check
	; if the specified file is in the INCLUDE_FILE or EXCLUDE_FILE list.
	;
	; Pass: cxdx	= TokenChars
	;	bp	= ManufacturerID
	; Return: ax	= non zero to accept the file
	;

	MSG_FOC_OPEN_FOLDER			message
	;
	; Internal message sent when a user opens a folder.  This message
	; sets up the FileOpenControl UI for a open folder.
	;
	; Pass: nothing
	; Return: nothing
	;

	MSG_FOC_SET_FILE_SELECTOR_SELECTION	message
	;
	; Sends a MSG_GEN_FILE_SELECTOR_SET_SELECTION to the file selector.
	; 
	; Pass: ss:bp - FileLongName
	; Return: nothing
	; Destoryed: ax, cx, dx, bp
	;

	MSG_FILE_OPEN_CONTROL_DELETE_CALLBACK	message
	;
	; Sent by FoamDisplayDeleteWarningNoBlock if the user wants to delete
	; the current document.  FileDelete is called on the selected document.
	; 
	; Pass: nothing
	; Return: ax - FileError, zero if no error. Carry set if error.
	; Destoryed: cx, dx, bp
	;

	;	MSG_META_NOTIFY
	;
	; If the NotificationType is GWNT_VIEWER_SHUTTING_DOWN/
	; MANUFACTURER_ID_GEOWORKS and ViewerCloseStatus is VCS_CLOSED,
	; FOI_viewerAttr is checked to see if VA_NEW_DOCUMENT is set.
	; If this is the case then FDD_CREATED_TEXTS folder is opened by
	; calling MSG_FFS_SET_PATH and MSG_FOC_OPEN_FOLDER is called after
	; that to set the open folder ui.
	;
	; In order for this to happen the FileOpenControl must be added to
	; the GAGCNLT_VIEWER_NOTIFICATIONS gcnlist.
	;
	; Pass: cx:dx - NotificationType
	;	bp - ViewerCloseStatus
	;

	MSG_FOC_MENU				message
	;
	; Open menu dialog in an open folder
	;
	; Pass: nothing
	;

	MSG_FOC_CREATE_FOLDER			message
	;
	; Sent when the user finished interacting with create folder ui,
	; and ok'ed to create folder
	;
	; Pass: nothing
	;

	MSG_FOC_COPY_DEST_READY			message
	;
	; The user is done interacting with destination dialog for copy
	; operation
	;
	; Pass: nothing
	;

	MSG_FOC_MOVE_DOC			message
	;
	; Sent when the user finished interacting with move document ui,
	; and ok'ed to move the document
	;
	; Pass: nothing
	;

	;------------------------------------------------------------------
	; From here on are not internal messages.  Don't move these up to
	; preserve message numbers.
	;------------------------------------------------------------------

	MSG_FILE_OPEN_CONTROL_CREATE_FOLDER	message
	;
	; This message will bring up create folder ui, so user can create
	; a new folder inside current folder.
	;
	; Pass: nothing
	;

	MSG_FILE_OPEN_CONTROL_RENAME		message
	;
	; This message will bring up file rename dialog.
	;
	; Pass: nothing
	;

	MSG_FILE_OPEN_CONTROL_COPY		message
	;
	; This message will bring up file copy dialog.
	;
	; Pass: nothing
	;

	MSG_FILE_OPEN_CONTROL_MOVE		message
	;
	; This message will bring up file move dialog
	;
	; Pass: nothing
	;

	MSG_FILE_OPEN_CONTROL_CHANGE_FEATURES_16	message
	;
	; This message will change features( see FileOpenFeatures ).
	; New applications should use this message instead of its 8bit
	; predecesor: MSG_FILE_OPEN_CONTROL_CHANGE_FEATURES
	;
	; Pass: cx	= FileOpenFeatures to set
	;	dx	= FileOpenFeatures to clear
	;

	MSG_FILE_OPEN_CONTROL_GET_UNREAD_DOCUMENT	message
	;
	; This message is sent out to ourselves when we want to get
	; the DocumentInfo of an unread document. The normal handler
	; will return the newest unread document in the passed directory.
	; Applications which subclass this message can return a
	; different document of their choosing. Do not call super
	; class if you do so.
	;
	; Pass:	  cx:dx	= fptr to DocumentInfo with DI_docDir filled
	; Return: DI_docName filled in buffer, 
	;		or empty string if no such file
	;

	MSG_FILE_OPEN_CONTROL_CLOSE_ALL_BUBBLES		message
	;
	; This is a utility message that can be used to close all the
	; bubbles (Menu, Destination, Rename, etc).
	;
	; Pass: nothing
	; Return: nothing
	; Destroyed: nothing
	;

	MSG_FILE_OPEN_CONTROL_LOAD_UNREAD_DOCUMENT	message
	; 
	; A utility message sent to ourselves when we get notification
	; that we should open the an unread document in a given
	; directory.
	;
	; Pass: cx = FDocumentDir or FoamPathHandle of the folder that
	;		contains the unread document.
	; Return: nothing
	; Destroyed: nothing
	;

	;------------------------------------------------------------------
	; Vardata
	;------------------------------------------------------------------

	ATTR_FILE_OPEN_DEFAULT_DIRECTORY	vardata	FDocumentDir
	; The directory to start off in

	ATTR_FILE_OPEN_DEFAULT_FILE_NAME_PREFIX	vardata lptr.TCHAR
	; Default prefix to file name when the conroller creates a new
	; file. (EX. FAX -> FAX 10.10.94)

	ATTR_FILE_OPEN_CREATE_TRIGGER_MONIKER vardata \
					      lptr.FileOpenCreateNewMoniker
	; The moniker of the create document trigger.  The
	; default trigger moniker for create new is "Create Document" but the
	; trigger moniker can customized using this vardata. Example:
	; "Create Message" or "Create Note".

	FileOpenCreateNewMoniker	struct
		FOCNM_topText		optr
		; Optr of chunk containing the top text of the moniker.
		FOCNM_iconBitmap	optr
		; Optr of chunk containing the icon bitmap of the moniker.
	FileOpenCreateNewMoniker	ends

	ATTR_FILE_OPEN_FILE_ATTR_INFO		vardata	FileAttrInfo
	; The FileAttrInfo to use when creating a new file.  The default
	; is to create a NOTE file but this can be changed by adding this
	; vardata entry.

	ATTR_FILE_OPEN_VIEWER_LIB_NAME		vardata FileLongName
	; Stores the name of the viewer library used to display the selected
	; file.  This is used when the controller is restarted from state and
	; needs to know what viewer library to load.

	ATTR_FILE_OPEN_FILTER_IS_C		vardata	word
	; Set this attribute if you file filter routine is written in C and
	; obeys the Pascal calling convention.

	ATTR_FILE_OPEN_FILTER			vardata	word
	; Set this attribute if you have a file filter routine

	ATTR_FILE_OPEN_INCLUDE_DIR		vardata	lptr
	; Set this to point to a list of FDocumentDir types, if you
	; DON'T have your own filter routine, but 
	; want the controller to exclusively list the specified
	; directories. See usage example below.

	ATTR_FILE_OPEN_EXCLUDE_DIR		vardata	lptr
	; Set this to point to a list of FDocumentDir types, if you
	; DON'T have your own filter routine, but 
	; want the controller to exclude the specified
	; directories.
	;
	; NOTE: ATTR_FILE_OPEN_INCLUDE_DIR has a higher priority than
	; ATTR_FILE_OPEN_EXCLUDE_DIR if both are used concurrently.
	;
	; Usage examples for ATTR_FILE_OPEN_[IN|EX]CLUDE_DIR:
	;
	;		......
	;		ATTR_FILE_OPEN_INCLUDE_DIR {
	;			lptr	IncludeList
	;		}
	;		......
	;	}
	; 	chunk IncludeList = data {
	;		word	FDD_CREATED_TEXTS
	;		word	FDD_RECEIVED_SM
	;		word	FDD_DOWNLOADED_FILES
	;	}
	;

	ATTR_FILE_OPEN_INCLUDE_FILE		vardata	lptr
	; Set this to point to a list of GeodeToken types, if you
	; DON'T have your own filter routine, but 
	; want the controller to exclusively list the specified
	; files. See usage example below.

	ATTR_FILE_OPEN_EXCLUDE_FILE		vardata	lptr
	; Set this to point to a list of GeodeToken types, if you
	; DON'T have your own filter routine, but 
	; want the controller to exclude the specified
	; files.
	;
	; NOTE: ATTR_FILE_OPEN_INCLUDE_FILE has a higher priority than
	; ATTR_FILE_OPEN_EXCLUDE_FILE if both are used concurrently.
	;
	; Usage examples for ATTR_FILE_OPEN_[IN|EX]CLUDE_FILE:
	;
	;		......
	;		ATTR_FILE_OPEN_INCLUDE_FILE {
	;			lptr	IncludeList
	;		}
	;		......
	;	}
	; 	chunk IncludeList = data {
	;		GeodeToken 	<"OUTB", MANUFACTURER_ID_GEOWORKS>
	;	}
	;
	; You can also use 'GeodeToken	<"", MANUFACTURER_ID_GEOWORKS>'
	; to imply non-Geos created files which don't have a
	; proper GeodeToken.
	;

	TEMP_FILE_OPEN_FILE_SELECTOR_INFO	vardata DocumentInfo
	; Temporary stores the path and selection of the file selector so it
	; can be reset when we are restoring from state.

	TEMP_FS_SELECTION			vardata FileLongName
	; Temporary stores the file selectors current selection when the
	; user presses CTRL_N or CTRL_P in a document viewer.

	HINT_FILE_OPEN_DONT_FILTER_DOCUMENT_SUB_DIRS	vardata
	; If present, will not perform file/directory filtering on
	; sub-directories of SP_DOCUMENT. Used in conjunction with
	; ATTR_FILE_OPEN_[IN|EX]CLUDE_FILE/DIR.

	TEMP_FILE_OPEN_CONTROL_LAST_UI		vardata	word
	; Internal use.  Stores the last UI state.

	TEMP_FILE_OPEN_CONTROL_DESTINATION_PATH	vardata	FoamPathHandle
	; Internal use.  Stores destination folder for copy/move operations

FocFilePath	struct
	FFP_path	PathName
	FFP_fileName	FileLongName
	FFP_disk	word		; disk handle or StandardPath
FocFilePath	ends

	TEMP_FOC_SELECTOR_INFO			vardata FocFilePath
	; This saves current path, and file name of file selector

	;------------------------------------------------------------------
	; Instance data
	;------------------------------------------------------------------

	FOI_viewerLibraryOpenCount	byte
	; Tells us if a viewer library is loaded or not.

	FOI_viewerLibraryHandle		hptr
	; Handle of the currently loaded viewer library.  The handle is need
	; to be able to unload the library.

	FOI_viewerLibraryUIOD		optr
	; OD of the UI created for the viewer library.  This OD is passed on
	; to ViewerDetatch which will destroy the UI and return a state block.

	FOI_viewerLibraryStateChunk	lptr
	; The chunk handle of the saved state block returned by a viewer
	; library during a detach. If this is zero there is no state chunk.

	FOI_folderTextChunk		word
	; Chunk handle of the current folder topText chunk in the child block.
	; Used when the the ComplexMoniker of FileOpenSelectorMoniker changes
	; to reflect the folder opened by the user. INTERNAL ONLY.

	FOI_viewerAttr			ViewerAttributes
	; ViewerAttributes passed to the current viewer in ViewerParams.
	; When the FileOpenControl restores from state these are the
	; ViewerAttributes passed to the viewer library.

FileOpenControlClass	endc

;---------------------------------------------------------------------------
;  ViewerControlClass
;
;  Notification type(s) responded to:
;  	- MANUFACTURER_ID_GEOWORKS.GWNT_FOAM_AUTO_SAVE: 
;
; GenApplication GCN lists subclasses have to be on:
;	- GAGCNLT_FOAM_NOTIFICATIONS
;
;---------------------------------------------------------------------------
ViewerControlClass	class	GenControlClass

	MSG_VIEWER_OPEN				message
	;
	; Displays the file specified in DocumentInfo.
	;
	; Pass: cx:dx - fptr to DocumentInfo
	; Return: ax - non-zero if open was successful
	; Destroyed: nothing
	;

	MSG_VIEWER_OPEN_DOCUMENT		message
	;
	; Opens the document in ATTR_DOCUMENT_INFO and returns the
	; DocumentHandle.  This message can be subclassed to add file
	; checking (procols and tokens).  Stores the document handle in
	; VCI_docHandle.
	;
	; Pass: cx - FDocAccess
	; Return: cx - DocumentHandle
	;	  ax - VMStatus if error (FALSE if no error)
	; Destroyed: nothing
	;

	MSG_VIEWER_CLOSE_DOCUMENT		message
	;
	; Stops the auto-save timer and closes the document specified in
	; ATTR_DOCUMENT_INFO and clears VCI_docHandle as a result.
	;
	; Pass: nothing
	; Return: nothing
	; Destoryed: ax, cx, dx, bp
	;

	MSG_VIEWER_ATTACH_UI			message
	;
	; Loads a text transfer item from an open document file into a
	; text object.
	;
	; Pass:	cx - DocumentHandle
	; Return: nothing
	; Destroyed: nothing
	;

	MSG_VIEWER_SET_TITLE		message
	;
	; Default behavior does nothing. Applications that want to display
	; the document name in a differant manner can subclass this message.
	;
	; Pass: cx:dx - fptr to title text (null-terminated).
	; Return: nothing
	; Destoryed: nothing
	;

	MSG_VIEWER_CLOSE			message
	;
	; Close the viewer, by closing the document, turning off the auto-save
	; feature.  Also empty documents will be deleted.
	;
	; Pass: nothing
	; Return: ax - ViewerCloseStatus
	; Destroyed: nothing
	;

	MSG_VIEWER_SAVE				message
	;
	; Saves the current text to a file.
	;
	; Pass: nothing
	; Return: FoamSaveAction
	;	  -1 is returned if document was not saved.  This can happen
	;	  when the document has not been modified.		
	; Destroyed: nothing
	;

	MSG_VIEWER_DELETE			message
	;
	; Deletes the current viewer document. Does not display a warning
	; dialog. 
	;
	; Pass: nothing
	; Return: nothing
	; Destroyed: nothing
	;

	MSG_VIEWER_GET_TEXT_OBJECT_OFFSET	message
	;
	; Internal message sent by the controller to itself requestion the
	; text object offset.  Controller subclassed of ViewerControlClass
	; should handle this message.
	;
	; Pass: nothing
	; Return: dx - text object chunk in child block
	; Destroyed: nothing
	;

	MSG_VIEWER_RETURN_STATE			message
	;
	; Returns a block of the current state of the viewer.  This
	; will include DocumentInfo and cursor position.
	;
	; Pass: nothing
	; Return: dx - hptr of ViewerControlState
	; Destoryed: nothing
	;

	MSG_VIEWER_OPEN_FROM_STATE		message
	;
	; Same as MSG_VIEWER_OPEN only this method takes a block handle
	; of ViewerControlState.  State block is freed after use.
	;
	; Pass: dx - hptr to ViewerControlState
	; Return: ax - non-zero if open was successful
	; Destoryed: nothing
	;
	
	MSG_VIEWER_AUTO_SAVE_START		message
	;
	; Starts the auto-save timer.  This interval is stored in the .ini
	; file.  The timer calls MSG_VIEWER_AUTO_SAVE when it's time to
	; save the document.
	;
	; Pass: nothing
	; Return: nothing
	; Destoryed: nothing
	;
	
	MSG_VIEWER_AUTO_SAVE			message
	;
	; Saves the text in the text object to document.
	;
	; Pass: nothing
	; Return: nothing
	; Destoryed: nothing
	;

	MSG_VIEWER_AUTO_SAVE_STOP		message
	;
	; Stops the auto-save timer.
	;
	; Pass: nothing
	; Return: nothing
	; Destoryed: nothing
	;

	MSG_VIEWER_OPEN_READ_ONLY		message
	;
	; Displays the file specified in DocumentInfo read-only.  The
	; user can not save the file and auto-save is disabled.
	;
	; Pass: cx:dx - fptr to DocumentInfo
	; Return: ax - non-zero if open was successful
	; Destroyed: nothing
	;

	MSG_VIEWER_GET_DOCUMENT_INFO		message
	;
	; Returns the DocumentInfo of the current document.
	;
	; Pass: cx:dx - fptr to DocumentInfo buffer
	; Return: DocumentInfo filled in.
	; Destroyed: nothing
	;

	MSG_VIEWER_GET_MESSAGE_FORMAT		message
	;
	; Returns the MailboxDataFormat for the document when registering
	; a message with the Mailbox library.
	;
	; Pass: nothing
	; Return: cxdx - MailboxDataFormat
	; Destroyed: nothing
	; 

	MSG_VIEWER_GET_ATTRIBUTES		message
	;
	; Returns the ViewerControlAttributes.
	;
	; Pass: nothing
	; Return: cx - ViewerControlAttributes
	; Destroyed: nothing
	;

	MSG_VIEWER_OPEN_TEXT_ONLY		message
	;
	; Open the viewer passing a buffer of text. This means there is no
	; document file associated with the viewer content - this means no
	; saving of any kind.
	;	
	; Pass: cx:dx - fptr to a buffer of text.
	; Return: nothing
	; Destroyed: nothing
	;

	MSG_VIEWER_GET_MESSAGE_TOKEN		message
	;
	; Returns the GeodeToken to use as the destination application
	; when creating a message for the Mailbox library. No need to call
	; superclass unless you don't understand the format. ViewerControlClass
	; returns 'SMSA',GEOWORKS for GMDFID_SHORT_MESSAGE, 'FAXA',GEOWORKS for
	; GMDFID_FAX_FILE, and 'NBOK',GEOWORKS for anything else.
	;
	; Pass: cxdx = MailboxDataFormat
	; Return: cxdxbp = GeodeToken
	; Destroyed: nothing
	; 

	MSG_VIEWER_GET_SM_TEXT			message
	;
	; Called when the viewer class is generating a short message to send.
	; Returns a block handle to a message body text block and the size
	; of that block.  The default behavior is to return the text in
	; the viewers text object as the text body.  Subclass this method if
	; you need to return anything other than the text in text object.
	;
	; Pass: nothing
	; Return: ax = size of text (not counting the null)
	;	  cx = block handle of block containing text (null-terminated)
	; Destroyed: nothing
	;

	MSG_VIEWER_SAVE_BEFORE_MAILBOX_SEND	message
	;
	; This message is sent when a document is about to be sent using the
	; mailbox library.  The default behavior is to save the document via
	; MSG_VIEWER_SAVE.  If for some reason you don't want this you can
	; subclass this message and not call superclass. 
	;
	; Pass: nothing
	; Return: nothing
	; Destroyed: nothing
	;

	MSG_VIEWER_NOTIFY_SEND_CONTROLS		message
	;
	; Notify any listening (now or future) MailboxSendControl objects
	; what the default message body is and in what formats we can
	; produce it.
	;
	; Pass: nothing
	; Return: nothing
	; Destroyed: nothing

	MSG_VIEWER_AUTO_SAVE_EXECUTE		message
	; 
	; Event sent when the autosave timer goes off.  MSG_VIEWER_AUTO_SAVE
	; send called and the autosave timer is restarted.
	;
	; Pass: nothing
	; Return: nothing
	; Destroyed: ax, cx, dx, bp

	MSG_VIEWER_APPEND_DOS_TEXT			message
	;
	; Internal message sent when loading a DOS document into the viewer.
	; The method will queue up additional MSG_VC_APPEND_DOS_TEXT until
	; the document is fully loaded.  This releaves the performance
	; bottleneck of loading a very large document in a static loop.
	;
	; Pass: cxdx - file position 
	; Return: carry - set when the last part of the file has been loaded.
	; Destroyed: ax, cx, dx, bp	
	;

	MSG_VIEWER_APPEND_TEXT_TR_ITEM		message
	; 
	; Internal message sent when loaded a FoamDocument into the viewer.
	; The FoamDocument can be saved as a vm chain of text transfer items,
	; in this case the method will queue up MSG_VC_APPEND_TEXT_TR_ITEM's
	; until the document is fully loaded.
	;
	; Pass: cx - text tranfer item vmblock.
	; Return: carry - set when last transfer item has been loaded.
	; Destroyed: ax, cx, dx, bp	
	;

	;-----------------------------------------------------------
	;	Records
	;-----------------------------------------------------------
	ViewerControlAttributes	record
		VCA_AUTO_SAVE:1
		; If this bit is set the viewer control will start an
		; auto-save timer to automaticly save the context of the
		; text object to the open document.

		; The following bits reflect temporary state of the document --
		; set by the viewer control.

		VCA_AUTO_SAVE_STOPPED:1
		; Auto-save has been stopped.

		VCA_DOCUMENT_READ_ONLY:1
		; The viewer document was opened read-only and can not be
		; saved.

		VCA_DOCUMENT_IS_NATIVE:1
		; The viewer document is a native (DOS) file.

		VCA_DOCUMENT_EMPTY_WHEN_OPENED:1
		; The viewer document was empty at the time it was opened.
		; This bit can be use full if you have to take action
		; if the user has deleted all the text from the document.

		VCA_NO_DOCUMENT:1
		; There is no document file associated with the viewer,
		; this attribute is set by MSG_VIEWER_OPEN_TEXT_ONLY.

		VCA_DOCUMENT_NOT_FULLY_LOADED:1
		; This bit is set if MSG_VC_APPEND_DOS_TEXT has not completed
		; loading the document.

		VCA_DOCUMENT_NAME_CHOSEN:1
		; This bit is set if the user has chosen the
		; document name when the document was being saved.

		:8
	ViewerControlAttributes end

	RegisterInfo	struct
		RI_docDisk	word
		; Handle of the document's disk.
		RI_docID	dword
		; Document ID of the open document. 
	RegisterInfo	ends

	;-----------------------------------------------------------
	;	Vardata
	;-----------------------------------------------------------
	TEMP_VIEWER_DOC_INFO	vardata	DocumentInfo
	; Name and FDocumentDir of the open document.

	ATTR_VIEWER_TEXT_OBJECT	vardata	word
	; Text object offset in the controller child block.

	TEMP_REGISTER_INFO	vardata RegisterInfo
	; Disk and file ID of the open document.

	ATTR_VIEWER_CONTROL_SHOW_SAVE_PROGRESS_DIALOG_THRESHOLD vardata dword
	;
	; (only usable in Communicator products  shipped in April 1997
	; or later) 
	;
	; The threshold of the text size (in bytes) we're trying to save
	; before a progress dialog appears.
	;
	; Note: This position used to be occupied by TEMP_VIEWER_UNUSED in
	; 	pre-April 1997 Communicator products.
	;
	
	TEMP_VIEWER_LOADING_METER vardata optr
	; Optr to loading meter.
	
	;-----------------------------------------------------------
	; Vardata only available in Communicator products shipped
	; after April 1997
	;-----------------------------------------------------------

	HINT_VIEWER_NO_DOCUMENT_RENAME	vardata
	; If present, will not put up the document name dialog which
	; allows the user to rename the new document when closing.
	;

	TEMP_VIEWER_ORIGINAL_TEXT	vardata	word
	; The HugeArray that contains a copy of the original contents
	; of the text object (in the clipboard file).
	; Used for making temporary changes to
	; the text while registering the document with mailbox.
	;

	;-----------------------------------------------------------
	;	Instance Data
	;-----------------------------------------------------------
	VCI_docHandle	hptr
	; Handle of the open document.

	VCI_attr	ViewerControlAttributes
	; Attributes the viewer control has.

	VCI_autoSaveHandle	hptr
	; Auto-save timer handle.

	VCI_autoSaveID		word
	; Auto-save timer ID.

ViewerControlClass		endc

;---------------------------------------------------------------------------
;  ViewerDialogClass
;---------------------------------------------------------------------------
ViewerDialogClass	class	GenInteractionClass

	MSG_VD_SET_VIEWER_PARAMS	message
	;
	; Copies the close message, next/prev message and destination to
	; instance data.
	; 
	; Pass:	cx:dx	- fptr to ViewerParams
	; Return: nothing
	; Destroyed: nothing
	;

	MSG_VD_CLOSE		message
	;
	; Sends the close message to the destination, and disconnects any send
	; controls attached to this viewer.
	;
	; Calls MSG_VD_RETURN_HEAPSPACE to return the heapspace reserved
	; using the token stored with MSG_VD_SET_HEAPSPACE_TOKEN
	; 
	; Pass:	cx 	- Viewer Library Handle (library to close)
	;	dx	- ViewerCloseStatus
	; Return: nothing
	; Destroyed: nothing
	;

	MSG_VD_SET_DIALOG_ATTR	message
	;
	; Set or clear ViewerDialogAttributes.
	; 
	; Pass:	cx - ViewerDialogAttributes to set
	;	dx - ViewerDialogAttributes to clear
	; Return: nothing
	; Destroyed: nothing
	;

	MSG_VD_SET_HEAPSPACE_TOKEN	message
	;
	; Store the heapspace token returned from GeodeRequestSpace.
	;
	; Pass:	cx - Heapspace token
	; Return: nothing
	; Destroyed: nothing
	;

	MSG_VD_RETURN_HEAPSPACE		message
	;
	; Return the heapspace reserved with GeodeRequestSpace.  It gets the
	; heapspace token that was saved using MSG_VD_SET_HEAPSPACE_TOKEN.
	;
	; Pass:	nothing
	; Return: cx - Heapspace token
	; Destroyed: nothing
	;
	
	;-----------------------------------------------------------
	; Instance data
	;-----------------------------------------------------------

	TEMP_HEAPSPACE_TOKEN		vardata	word
	; Used to stored the token set in MSG_VD_SET_HEAPSPACE_TOKEN.

	ViewerDialogAttributes	record
		VDA_ALLOW_NEXT_PREV_SHORTCUTS:1
		; Set this attribute if the viewer should accept the next
		; (ctrl-n) and previous (ctrl-p) shortcut keys.  If the bit
		; is set the VDI_nextPrevMsg will be sent to the destination
		; when the user presses ctrl-p or ctrl-n.
		:15
	ViewerDialogAttributes	end

	VDI_destination	optr
	; The destination for the action message.

	VDI_closeMsg	word
	; Close message to be sent to the destination when the library should
	; be unloaded.

	VDI_nextPrevMsg	word
	; Message to be sent to the destinaion when the user wants to view
	; the next or previous document.

	VDI_attr	ViewerAttributes
	; Viewer attributes passed to the viewer in ViewerParams.

	VDI_dialogAttr	ViewerDialogAttributes
	; Viewer dialog attributes.

ViewerDialogClass	endc

;---------------------------------------------------------------------------
;  ViewerSendControlClass
;---------------------------------------------------------------------------
ViewerSendControlClass	class	MailboxSendControlClass
	MSG_VSC_CONNECT		message
	;
	; Hooks up the ViewerSendControl's output to the passed optr,
	; and sets the output of all PrintControls mentioned in any
	; ATTR_MAILBOX_SEND_CONTROL_TRANSPORT_HINTs to the same.
	;
	; Also hooks up the ViewerSendControl to another passed optr with a
	; MSG_GEN_ADD_CHILD.
	; 
	; Pass:	cxdx	- optr to the new output
	;	cxbp	- optr to new parent of this send control
	;
	; Return: nothing
	; Destroyed: nothing
	;

	MSG_VSC_DISCONNECT	message
	;
	; Clears the ViewerSendControl's output, and does the same to the
	; output of all PrintControls mentioned in any
	; ATTR_MAILBOX_SEND_CONTROL_TRANSPORT_HINTs.
	;
	; Also disconnects the ViewerSendControl from the parent with a
	; MSG_GEN_REMOVE.  The VSC is set unusable by this, incidentally.
	; 
	; Pass:	cxdx	- optr to the old output
	;
	; Return: nothing
	; Destroyed: nothing
	;

	VSCReplyInfo	struct
		VSCRI_mscSetAddressesArgs	MSCSetAddressesArgs
		; MSCSAA_transAddrs should hold the offset of the
		; MailboxTransAddr array (within the same block), and the
		; entries in that array should hold offsets to their
		; data also in the same block. The segment portion of each
		; far pointer will be set by the ViewerSendControl method.
		VSCRI_mediumType		MediumType
		; MediumType
	VSCReplyInfo	ends

	MSG_VSC_SET_REPLY_ADDRESSES	message
	;
	; Sets up a Reply by setting the single transport, changing the moniker
	; and then sending a MSG_MAILBOX_SEND_CONTROL_SET_ADDRESSES.
	; 
	; Pass:	cx - Block containing VSCReplyInfo structure.
	; Return: Nothing
	; Destoryed: Nothing
	;

	MSG_VSC_CANCEL_REPLY		message
	;
	; Reverts MSG_VSC_SET_REPLY_ADDRESSES setting the single transport and
	; the complex moniker back to the original state.
	; 
	; Pass:	Nothing
	; Return: Nothing
	; Destoryed: Nothing
	;

	;-----------------------------------------------------------
	; Vardata data
	;-----------------------------------------------------------
	ATTR_VIEWER_SEND_CONTROL_REPLY_SEND_MONIKER	vardata \
					lptr.VSCReplySendMoniker
	; The moniker of the reply dialog send trigger.  The
	; default send trigger moniker for is "Send" but the 
	; trigger moniker can customized using this vardata. Example:
	; "Send Reply" or "START".

	TEMP_VIEWER_SEND_CONTROL_SINGLE_TRANSPORT vardata MailboxMediaTransport
	; Temporary storage for the MailboxMediaTransport

	TEMP_VIEWER_SEND_CONTROL_COMPLEX_MONIKER vardata GetComplexMoniker
	; Temporary storage for the text and iconBitmap chunk handles.

	TEMP_VIEWER_SEND_CONTROL_REPLY_IN_PROGRESS vardata
	; EC-only vardata that tells us if a reply is in progress.

	VSCReplySendMoniker	struct
		VSCRSM_text		dword
		; Moniker text optr or ComplexMonikerText constant
		VSCRSM_iconBitmap	dword
		; Icon bitmap optr or ComplexMonikerBitmap constant
	VSCReplySendMoniker	ends

ViewerSendControlClass	endc

;---------------------------------------------------------------------------
;  ViewerPrintControlClass
;---------------------------------------------------------------------------

;
; Flags for the ViewerPrintControl.
;
ViewerPrintControlFlags	record
	:6
	VPCF_ALWAYS_SCALE:1	; set when the document should be scaled
	VPCF_ALWAYS_TILE:1	; set when the document should be tiled
ViewerPrintControlFlags	end

ViewerPrintControlClass	class	PrintControlClass
	MSG_VPC_CHECK_FOR_FAX_FORWARDING		message
	;
	; Synopsis:	This method checks to see if the destination of a print
	;		job is a fax print driver or not.  It is recommended
	;		that this be called from the MSG_PRINT_START_PRINTING
	;		handler.
	;
	;		Also, pass the print mode of the fax being printed in
	;		cx.  If the destination is a fax print driver, the
	;		JobParameters' JP_printMode will be changed to whatever
	;		you pass.
	;
	; Pass:		cl - the print mode (resolution) of the current fax
	;
	; Return:	ax - TRUE if the destination is a fax print driver
	;		   - FALSE if the destination is not a fax print
	;		     driver, or if there is no way to tell.
	;

	MSG_VPC_ALWAYS_TILE	message
	;
	; Synopsis:	Call this to have the print control always tile the
	; 		document.
	;
	; Pass:		nothing
	;
	; Return:	nothing
	;

	MSG_VPC_ALWAYS_SCALE	message
	;
	; Synopsis:	Call this to have the print control always scale the
	; 		document.
	;
	; Pass:		nothing
	;
	; Return:	nothing
	;

protominor	LizzyPrintControlFaxCheck
	MSG_VPC_CHECK_FOR_FAXING		message
	;
	; Synopsis:	This method checks to see if the destination of a print
	;		job is a fax print driver or not.  It is recommended
	;		that this be called from the MSG_PRINT_START_PRINTING
	;		handler.
	;
	; Pass:		nothing
	;
	; Return:	ax - TRUE if the destination is a fax print driver
	;		   - FALSE if the destination is not a fax print
	;		     driver, or if there is no way to tell.
	;
protoreset

	;-----------------------------------------------------------
	; Instance data
	;-----------------------------------------------------------
	VPCI_flags	ViewerPrintControlFlags		0
	
	;
	; to prevent MSG_VPC_CHECK_FOR_FAX_FORWARDING from setting the
	; print mode pass this value in cl
	;
		VPC_JUST_CHECKING_FOR_FAXING	equ	-1

ViewerPrintControlClass	endc

;---------------------------------------------------------------------------
;  ViewerLoadingMeterClass
;---------------------------------------------------------------------------
ViewerLoadingMeterClass	class	GenControlClass
	MSG_VIEWER_LOADING_METER_SET_VALUE		message
	;
	; Synopsis:	This message sets the current value of the
	; 		loading meter to display.
	;
	; Pass:		dxcx	- value to set
	;
	; Return:	nothing
	;

	MSG_VIEWER_LOADING_METER_SET_MAXIMUM		message
	;
	; Synopsis:	Sets the maximum value of the meter.
	;
	; Pass:		dxcx	- maximum value
	;
	; Return:	nothing
	;

	MSG_VIEWER_LOADING_METER_SET_FOCUS_OBJECT	message
	;
	; Synopsis:	Sets object to receive focus when we next gain
	; 		the focus. Usually set before we are put up.
	;
	; Pass:		^lcx:dx	- object
	;
	; Return:	nothing
	;

	ViewerLoadingMeterFeatures	record
		VLM_UI:1
	ViewerLoadingMeterFeatures	end

	VLM_DEFAULT_FEATURES	equ mask VLM_UI


	;-----------------------------------------------------------
	; Instance data
	;-----------------------------------------------------------
	VLMI_focusObject	optr	; the object to forward
					; keystrokes received, or to
					; give focus to.

ViewerLoadingMeterClass	endc

;---------------------------------------------------------------------------
;  Exported functions
;---------------------------------------------------------------------------
global	ViewerGetLibrary:far
global	ViewerGetLibraryNameFromToken:far
global	ViewerAddLibrary:far
global	ViewerUnloadLibrary:far
global	ViewerGetFileToken:far
global	ViewerLibraryOpen:far
global	ViewerLibraryDetach:far
global  ViewerLibraryChangeDocument:far
global	ViewerLibraryClose:far
global	ViewerMarkFileRead:far
global	ViewerMarkFileUnread:far
global	ViewerAddSendControl:far
global	ViewerRemoveSendControl:far
global	ViewerSendDocumentNotification:far

;----------------------------------------------------------------------------
;  C Versions
;----------------------------------------------------------------------------
global	VIEWERGETLIBRARY:far
global  VIEWERGETLIBRARYNAMEFROMTOKEN:far
global	VIEWERADDLIBRARY:far
global	VIEWERUNLOADLIBRARY:far
global	VIEWERGETFILETOKEN:far
global	VIEWERLIBRARYOPEN:far
global	VIEWERLIBRARYDETACH:far
global	VIEWERLIBRARYCHANGEDOCUMENT:far
global	VIEWERLIBRARYCLOSE:far
global	VIEWERMARKFILEREAD:far
global	VIEWERMARKFILEUNREAD:far
global	VIEWERADDSENDCONTROL:far
global	VIEWERREMOVESENDCONTROL:far
global	VIEWERSENDDOCUMENTNOTIFICATION:far

EndLibrary	viewer
