1 #   ifndef	TED_DOCUMENT_H
2 #   define	TED_DOCUMENT_H
3 
4 #   include	<textAttribute.h>
5 #   include	<docSelect.h>
6 #   include	<docSelectionGeometry.h>
7 #   include	<docSelectionDescription.h>
8 #   include	<utilIndexMapping.h>
9 #   include	<appFrame.h>
10 #   include	<docEditTrace.h>
11 #   include	<docRecalculateFields.h>
12 
13 struct TedDocument;
14 
15 #   define	RESIZE_BLOCK		10
16 
17 typedef enum ResizeHandle
18     {
19     RESIZE_BOTTOM_LEFT= 0,
20     RESIZE_BOTTOM_MIDDLE,
21     RESIZE_BOTTOM_RIGHT,
22 
23     RESIZE_MIDDLE_LEFT,
24     RESIZE_MIDDLE_RIGHT,
25 
26     RESIZE_TOP_LEFT,
27     RESIZE_TOP_MIDDLE,
28     RESIZE_TOP_RIGHT,
29 
30     RESIZE_COUNT
31     } ResizeHandle;
32 
33 /************************************************************************/
34 /*									*/
35 /*  Supported document formats.						*/
36 /*  Match the array with extensions in tedMain.c.			*/
37 /*									*/
38 /************************************************************************/
39 
40 typedef enum TedDocumentKind
41     {
42     TEDdockindRTF= 0,
43     TEDdockindTEXT_OPEN,
44     TEDdockindTEXT_SAVE_WIDE,
45     TEDdockindTEXT_SAVE_FOLDED,
46     TEDdockindHTML_FILES,
47     TEDdockindEML,
48     TEDdockindEPUB,
49     TEDdockindPS,
50     TEDdockindSVG,
51     TEDdockindPDF,
52     TEDdockindTRACE,
53     TEDdockindALL_FILES,
54 
55     TEDdockind_COUNT
56     } TedDocumentKind;
57 
58 /************************************************************************/
59 /*									*/
60 /*  Private data for a document.					*/
61 /*									*/
62 /************************************************************************/
63 
64 typedef struct TedDocument
65     {
66     struct BufferDocument *	tdDocument;
67 
68     unsigned char		tdTraced;
69     unsigned char		tdOverstrike;
70 				    /**
71 				     *  The name of the document that is
72 				     *  recovered. This is to smuggle the
73 				     *  original document name through the
74 				     *  generic interface.
75 				     */
76     MemoryBuffer		tdRecoveredName;
77 
78     DocumentSelection		tdSelection;
79     SelectionGeometry		tdSelectionGeometry;
80     SelectionDescription	tdSelectionDescription;
81     int				tdBodySectionNumber;
82 				    /**
83 				     *  The screen font number corresponding
84 				     *  to the text attribute in
85 				     *  tdSelectionDescription
86 				     */
87     int				tdCurrentScreenFont;
88 
89     IndexMapping		tdAttributeToScreenFont;
90 				    /**
91 				     *  The magnification factor of the
92 				     *  document. 1.0 means no magnification.
93 				     */
94     double			tdMagnification;
95 				    /**
96 				     *  The number of pixels per twip. The
97 				     *  magnification of the document is taken
98 				     *  into account.
99 				     */
100     double			tdPixelsPerTwip;
101 				    /**
102 				     *  The height of the gray strip between
103 				     *  pages.
104 				     */
105     int				tdPageGapTwips;
106     int				tdPageGapPixels;
107 
108     EditTrace			tdEditTrace;
109 
110     APP_WIDGET			tdFileOpenOption;
111     APP_WIDGET			tdFileSaveOption;
112     APP_WIDGET			tdFileSaveAsOption;
113     APP_WIDGET			tdFileUnlockOption;
114     APP_WIDGET			tdFileRecoverOption;
115     APP_WIDGET			tdFilePropertiesOption;
116     APP_WIDGET			tdFileCloseOption;
117     APP_WIDGET			tdFileQuitSeparator;
118     APP_WIDGET			tdFileQuitOption;
119 
120     APP_WIDGET			tdUndoOption;
121     APP_WIDGET			tdRepeatOption;
122 
123     APP_WIDGET			tdCopyOption;
124     APP_WIDGET			tdCutOption;
125     APP_WIDGET			tdPasteOption;
126 
127     APP_WIDGET			tdInsertMenu;
128     APP_WIDGET			tdInsertMenuButton;
129     APP_WIDGET			tdInsPictOption;
130     APP_WIDGET			tdInsFileOption;
131     APP_WIDGET			tdInsSymbolOption;
132     APP_WIDGET			tdInsHyperlinkOption;
133     APP_WIDGET			tdInsBookmarkOption;
134     APP_WIDGET			tdInsInsertFootnoteOption;
135     APP_WIDGET			tdInsInsertEndnoteOption;
136     APP_WIDGET			tdInsInsertChftnsepOption;
137     APP_WIDGET			tdInsInsertTableOption;
138     APP_WIDGET			tdInsInsertPageNumberOption;
139     APP_WIDGET			tdInsInsertLineBreakOption;
140     APP_WIDGET			tdInsInsertPageBreakOption;
141     APP_WIDGET			tdInsInsertColumnBreakOption;
142     APP_WIDGET			tdInsInsertSectBreakOption;
143 
144     APP_WIDGET			tdTableMenu;
145     APP_WIDGET			tdTableMenuButton;
146     APP_WIDGET			tdTabInsertTableOption;
147     APP_WIDGET			tdTabAddRowOption;
148     APP_WIDGET			tdTabAddColumnOption;
149     APP_WIDGET			tdTabInsertSeparator;
150 
151     APP_WIDGET			tdTabSelectTableOption;
152     APP_WIDGET			tdTabSelectRowOption;
153     APP_WIDGET			tdTabSelectColumnOption;
154     APP_WIDGET			tdTabSelectSeparator;
155 
156     APP_WIDGET			tdTabDeleteTableOption;
157     APP_WIDGET			tdTabDeleteRowOption;
158     APP_WIDGET			tdTabDeleteColumnOption;
159     APP_WIDGET			tdTabDeleteSeparator;
160 
161     APP_WIDGET			tdFormatMenu;
162     APP_WIDGET			tdFormatMenuButton;
163     APP_WIDGET			tdFormatOneParaOption;
164     APP_WIDGET			tdFormatOneParaSeparator;
165 
166     APP_WIDGET			tdFormatPasteRulerOption;
167     APP_WIDGET			tdFormatIncreaseIndentOption;
168     APP_WIDGET			tdFormatDecreaseIndentOption;
169     APP_WIDGET			tdFormatRulerSeparator;
170 
171     APP_WIDGET			tdFormatAlignLeftOption;
172     APP_WIDGET			tdFormatAlignRightOption;
173     APP_WIDGET			tdFormatAlignCenterOption;
174     APP_WIDGET			tdFormatAlignJustifyOption;
175     APP_WIDGET			tdFormatAlignSeparator;
176 
177     APP_WIDGET			tdDrawTableGridOption;
178 
179     APP_WIDGET			tdFontMenu;
180     APP_WIDGET			tdFontMenuButton;
181     APP_WIDGET			tdFontBoldOption;
182     APP_WIDGET			tdFontItalicOption;
183     APP_WIDGET			tdFontUnderlinedOption;
184     APP_WIDGET			tdFontSuperscriptOption;
185     APP_WIDGET			tdFontSubscriptOption;
186     APP_WIDGET			tdFontToggleSeparator;
187     APP_WIDGET			tdFontPasteOption;
188 
189     APP_WIDGET			tdToolsMenu;
190     APP_WIDGET			tdToolsMenuButton;
191     APP_WIDGET			tdToolsFormatToolOption;
192 
193     APP_WIDGET			tdToolsFontOption;
194     APP_WIDGET			tdToolsFindOption;
195     APP_WIDGET			tdToolsSpellingOption;
196     APP_WIDGET			tdToolsPageLayoutOption;
197     APP_WIDGET			tdToolsSymbolOption;
198 
199     RGB8Color			tdTableColor;
200     RGB8Color			tdSelColor;
201     RGB8Color			tdCopiedSelColor;
202 
203     int				tdVisibleSelectionCopied;
204     MemoryBuffer		tdCopiedSelection;
205     MemoryBuffer		tdCopiedFont;
206     MemoryBuffer		tdCopiedRuler;
207     RasterImage			tdCopiedImage;
208     int				tdOwnsPrimarySelection;
209 
210     void *			tdFindProg;
211 
212 #   ifdef USE_MOTIF
213     XtIntervalId		tdHideIBarId;
214     XtIntervalId		tdShowIBarId;
215 #   endif
216 
217 #   ifdef USE_GTK
218     guint			tdHideIBarId;
219     guint			tdShowIBarId;
220 #   endif
221 
222 #   ifdef USE_QT
223     int				tdHideIBarId;
224     int				tdShowIBarId;
225 #   endif
226 
227     APP_WINDOW			tdObjectWindow;
228     APP_WINDOW			tdObjectResizeWindows[RESIZE_COUNT];
229     int				tdObjectCornerMovedX;
230     int				tdObjectCornerMovedY;
231     int				tdScaleChangedX;
232     int				tdScaleChangedY;
233     int				tdObjectResizeCorner;
234 
235     int				tdDrawTableGrid;
236     int				tdDrawMonochrome;
237 
238     int				tdInProgrammaticChange;
239     } TedDocument;
240 
241 /************************************************************************/
242 
243 extern const char TedTraceExtension[];
244 
245 /************************************************************************/
246 /*									*/
247 /*  Routine Declarations.						*/
248 /*									*/
249 /************************************************************************/
250 
251 extern int tedFirstRecalculateFields(	RecalculateFields *	rf,
252 					DOC_CLOSE_OBJECT	closeObject,
253 					BufferDocument *	bd );
254 
255 #   endif	/*  TED_DOCUMENT_H	*/
256