1c9e2be55Smrg/* $XConsortium: tocintrnl.h,v 2.18 91/07/14 18:53:37 converse Exp $ */
2c9e2be55Smrg/* $XdotOrg$ */
3c9e2be55Smrg/*
4c9e2be55Smrg *			  COPYRIGHT 1987
5c9e2be55Smrg *		   DIGITAL EQUIPMENT CORPORATION
6c9e2be55Smrg *		       MAYNARD, MASSACHUSETTS
7c9e2be55Smrg *			ALL RIGHTS RESERVED.
8c9e2be55Smrg *
9c9e2be55Smrg * THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE AND
10c9e2be55Smrg * SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
11c9e2be55Smrg * DIGITAL MAKES NO REPRESENTATIONS ABOUT THE SUITABILITY OF THIS SOFTWARE FOR
12c9e2be55Smrg * ANY PURPOSE.  IT IS SUPPLIED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY.
13c9e2be55Smrg *
14c9e2be55Smrg * IF THE SOFTWARE IS MODIFIED IN A MANNER CREATING DERIVATIVE COPYRIGHT
15c9e2be55Smrg * RIGHTS, APPROPRIATE LEGENDS MAY BE PLACED ON THE DERIVATIVE WORK IN
16c9e2be55Smrg * ADDITION TO THAT SET FORTH ABOVE.
17c9e2be55Smrg *
18c9e2be55Smrg *
19c9e2be55Smrg * Permission to use, copy, modify, and distribute this software and its
20c9e2be55Smrg * documentation for any purpose and without fee is hereby granted, provided
21c9e2be55Smrg * that the above copyright notice appear in all copies and that both that
22c9e2be55Smrg * copyright notice and this permission notice appear in supporting
23c9e2be55Smrg * documentation, and that the name of Digital Equipment Corporation not be
24c9e2be55Smrg * used in advertising or publicity pertaining to distribution of the software
25c9e2be55Smrg * without specific, written prior permission.
26c9e2be55Smrg */
27c9e2be55Smrg
28c9e2be55Smrg/* $XFree86$ */
29c9e2be55Smrg
30c9e2be55Smrg/* Includes for modules implementing toc stuff. */
31c9e2be55Smrg
32c9e2be55Smrg#ifndef _tocinternal_h
33c9e2be55Smrg#define _tocinternal_h
34c9e2be55Smrg
35c9e2be55Smrg#include "xmh.h"
36c9e2be55Smrg#include <X11/IntrinsicP.h>	/* %%% */
37c9e2be55Smrg#include "tsource.h"
38c9e2be55Smrg
39c9e2be55Smrgtypedef enum {
40c9e2be55Smrg    unknown, valid, invalid
41c9e2be55Smrg} ValidType;
42c9e2be55Smrg
43c9e2be55Smrg/* silly IBM compiler, but it's probably just as silly to use bitfields. */
44c9e2be55Smrg#ifdef AIXV5 /* probably want !gcc too */
45c9e2be55Smrg#define FateType int
46c9e2be55Smrg#endif
47c9e2be55Smrg
48c9e2be55Smrgtypedef struct _MsgRec {
49c9e2be55Smrg    Toc		toc;		/* Which toc this message is in. */
50c9e2be55Smrg    Toc		desttoc;	/* Folder to copy or move to (NULL if none) */
51c9e2be55Smrg    Scrn	*scrn;		/* Scrns showing this message (if any) */
52c9e2be55Smrg    Widget      source;		/* Source (if any) containing this msg. */
53c9e2be55Smrg    XawTextPosition position;	/* Position in the scanfile for this msg. */
54c9e2be55Smrg    XawTextPosition startPos;	/* Where to start the insertion point. */
55c9e2be55Smrg    char	*buf;		/* The scanline for this message. */
56c9e2be55Smrg    int		msgid;		/* Message id for this message. */
57c9e2be55Smrg    short	length;		/* #/chars for this msg's entry in scanfile */
58c9e2be55Smrg    unsigned char num_scrns;	/* How many scrns are currently showing msg */
59c9e2be55Smrg    FateType	fate:2;		/* What will be done to this message */
60c9e2be55Smrg    unsigned	changed:1;	/* True iff this entry needs to be saved */
61c9e2be55Smrg    unsigned	visible:1;	/* Whether we should show this message */
62c9e2be55Smrg    unsigned	temporary:1;	/* Whether we should delete this message when
63c9e2be55Smrg				   it is no longer visible */
64c9e2be55Smrg    unsigned	reapable:1;	/* True iff we don't need to keep this
65c9e2be55Smrg				   composition around */
66c9e2be55Smrg    unsigned	unused:2;
67c9e2be55Smrg} MsgRec;
68c9e2be55Smrg
69c9e2be55Smrg#ifdef AIXV5 /* probably want !gcc too */
70c9e2be55Smrg#undef FateType
71c9e2be55Smrg#endif
72c9e2be55Smrg
73c9e2be55Smrgtypedef struct _TocRec {
74c9e2be55Smrg   Scrn		*scrn;		/* Scrns containing this table of contents. */
75c9e2be55Smrg   Cardinal	num_scrns;	/* How many scrns are currently showing toc. */
76c9e2be55Smrg   char 	*foldername;	/* Folder name for this toc */
77c9e2be55Smrg   char		*path;		/* Full path to folder's directory. */
78c9e2be55Smrg   char		*scanfile;	/* Full path to file containing scan. */
79c9e2be55Smrg   Msg		curmsg;		/* Current msgid for this toc. */
80c9e2be55Smrg   int		nummsgs;	/* How many info entries we currently have. */
81c9e2be55Smrg   Msg		*msgs;		/* Array of pointers to info about each msg. */
82c9e2be55Smrg   int		numsequences;	/* #/sequences defined for this folder. */
83c9e2be55Smrg   Sequence	*seqlist;	/* Array of pointers to sequences. */
84c9e2be55Smrg   Sequence 	viewedseq;	/* Seq currently shown (NULL == all msgs) */
85c9e2be55Smrg   Sequence	selectseq;	/* The most recently selected sequence */
86c9e2be55Smrg   Widget       source;		/* Source for the file containing info. */
87c9e2be55Smrg   Boolean	hasselection;	/* Whether we own the selection. */
88c9e2be55Smrg   XawTextPosition left, right;	/* Left and right extents of selection. */
89c9e2be55Smrg   int		length;		/* #/chars in the scanfile. */
90c9e2be55Smrg   int		origlength;	/* Original #/chars in the scanfile. */
91c9e2be55Smrg   int		lastPos;	/* Last legal position */
92c9e2be55Smrg   ValidType	validity;	/* Whether the scan file for this toc is */
93c9e2be55Smrg				/* up to date. */
94c9e2be55Smrg   Boolean	needsrepaint;	/* TRUE if we should repaint this toc. */
95c9e2be55Smrg   Boolean	needscachesave;	/* TRUE if the cache needs saving. */
96c9e2be55Smrg   Boolean	needslabelupdate;/* TRUE if the toclabel needs repainting. */
97c9e2be55Smrg   Boolean	stopupdate;	/* Zero if refreshing; nonzero if refreshing is
98c9e2be55Smrg				   currently inhibited. */
99c9e2be55Smrg   Boolean	haschanged;	/* Whether it's changed in the process of */
100c9e2be55Smrg				/* the current commit. */
101c9e2be55Smrg   Boolean	delete_pending;	/* Is a delete folder operation pending? */
102c9e2be55Smrg   Boolean	force_reset;	/* temporary bug work-around for sequences */
103c9e2be55Smrg   char		*incfile;	/* Which file to incorporate from (if any). */
104c9e2be55Smrg   int		mailpending;	/* True if we're currently displaying
105c9e2be55Smrg				   mail pending true for this folder */
106c9e2be55Smrg   long		lastreaddate;	/* Last time we read or wrote the cache. */
107c9e2be55Smrg   Stack	sequence_stack;	/* Stack of sequence names. */
108c9e2be55Smrg} TocRec;
109c9e2be55Smrg
110c9e2be55Smrg#endif /* _tocinternal_h */
111