Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / lib / DtHelp / HelpDialogP.h
1 /* $XConsortium: HelpDialogP.h /main/6 1996/04/13 11:55:10 ageorge $ */
2 /*************************************<+>*************************************
3  *****************************************************************************
4  **
5  **  File:   HelpDialogP.h
6  **
7  **  Project:  Cache Creek (Rivers) Project:
8  **
9  **  Description:  Privite Header file for HelpDialog.c 
10  **  -----------
11  **
12  **  (c) Copyright 1987, 1988, 1989, 1990, 1991, 1992 Hewlett-Packard Company
13  **
14  **  (c) Copyright 1993, 1994 Hewlett-Packard Company
15  **  (c) Copyright 1993, 1994 International Business Machines Corp.
16  **  (c) Copyright 1993, 1994 Sun Microsystems, Inc.
17  **  (c) Copyright 1993, 1994 Novell, Inc.
18  **
19  *******************************************************************
20  *************************************<+>*************************************/
21
22 #ifndef _DtHelpDialogP_h
23 #define _DtHelpDialogP_h
24
25 #include <Xm/BulletinBP.h>
26
27 #include <Dt/HelpDialog.h>
28
29 #include "FileListUtilsI.h"
30 #include "GlobSearchP.h"
31
32 #define XmDIALOG_SUFFIX            "_popup"
33 #define XmDIALOG_SUFFIX_SIZE       6
34
35
36 /* Defines for use in allocation geometry matrix. */
37 #define TB_MAX_WIDGETS_VERT     7
38 #define TB_MAX_NUM_WIDGETS      12
39
40
41 /****************************************************************
42  *
43  *  Topic List Info Structure Definition (History & Jump Back Lists)
44  *
45  ****************************************************************/
46 typedef struct _DtTopicListStruct {
47     char                         *locationId;
48     XmString                      topicTitleLbl;
49     char                         *helpVolume;
50     int                          topicType;
51     int                          pathLevel;
52     int                          scrollPosition;
53     struct _DtTopicListStruct   *pNext;
54     struct _DtTopicListStruct   *pPrevious;
55 } DtTopicListStruct;
56
57
58 /****************************************************************
59  *
60  *  Volume List Info: History Dialog only.
61  *
62  ****************************************************************/
63 typedef struct _DtHistoryListStruct {
64     XmString                    itemTitle;
65     int                         topicType;
66     int                         totalNodes;
67     struct _DtHistoryListStruct *pNext;
68     struct _DtTopicListStruct   *pTopicHead;
69     struct _DtTopicListStruct   *pTopicTale;
70 } DtHistoryListStruct;
71
72
73 /****************************************************************
74  *
75  *  Help Callback return structure
76  *
77  ****************************************************************/
78 typedef struct  _DtHelpListStruct {
79     char *                      locationId;
80     Widget                      widget;
81     struct _DtHelpCommonHelpStuff * help;
82     struct _DtHelpListStruct *  pNext;
83     struct _DtHelpListStruct *  pPrevious;
84 } DtHelpListStruct;
85
86
87
88 /****************************************************************
89  *
90  *  Kewword Search entry structure.
91  *
92  ****************************************************************/
93
94 typedef struct {
95    char * keyWord;
96    Boolean    matchesFindPattern;
97 } KeyEntry;
98
99
100
101
102 /* Class Part Structure Definition */
103
104 typedef struct
105 {
106         XtPointer               extension;      /* Pointer to extension record */
107 } DtHelpDialogWidgetClassPart;
108
109
110
111
112 /* Full class record declaration */
113
114 typedef struct _DtHelpDialogWidgetClassRec
115 {
116         CoreClassPart                   core_class;
117         CompositeClassPart              composite_class;
118         ConstraintClassPart             constraint_class;
119         XmManagerClassPart              manager_class;
120         XmBulletinBoardClassPart        bulletin_board_class;
121         DtHelpDialogWidgetClassPart     selection_box_class;
122 } DtHelpDialogWidgetClassRec;
123
124 externalref DtHelpDialogWidgetClassRec dtHelpDialogWidgetClassRec;
125
126
127 typedef struct _DtHelpDisplayWidgetStuff
128 {
129         short           textColumns;            /* Columns Resource Value resource */
130         short           textRows;               /* Rows Resource Value resource */
131         char *          locationId;             /* Current Topic String resource */
132         char *          helpVolume;             /* Current Project File resource */
133         char *          manPage;                /* man page resource */
134         char *          stringData;             /* string data resource */
135         char *          helpFile;               /* help file resource */
136         unsigned char   scrollBarPolicy;        /* Scrollbar policy resource */       
137         unsigned char   executionPolicy;        /* Link/script exec policy resource */        
138         XtCallbackList  hyperLinkCallback;      /* Hypertext Callback resource */
139         _DtHelpVolumeHdl volumeHandle;          /* handle of current volume */
140         unsigned char   helpType;               /* Current displayed file type resource */
141         char *          topicTitleStr;          /* title of topic */
142         int             count;                  /* Nonexistent topic title count */        
143         XmString        topicTitleLbl;          /* XmString title of topic */
144         Boolean         firstTimePopupFlag;     /* False, untel we map the widget */
145
146
147 } _DtHelpDisplayWidgetStuff;
148
149 typedef struct _DtHelpCommonHelpStuff
150 {
151         XtPointer       pDisplayArea;           /* Display widget handle */
152
153         /* for help on help */
154         char *          helpOnHelpVolume;       /* help on help volume resource */
155         DtHelpListStruct * pHelpListHead;       /* Help List Pointer */
156         Widget          onHelpDialog;           /* help on help dialog */
157
158         char *          sysVolumeSearchPath;    /* system search path */
159         char *          userVolumeSearchPath;   /* user search path */
160
161         char *          currentHelpFile;        /* Current help file */
162         int             topicOffset;            /* Offset into help file */
163         
164         char *          topLevelId;             /* Toplevel topic volume displayed */
165         int             topLevelTopicOffset;
166 } _DtHelpCommonHelpStuff;
167
168 typedef struct _DtHelpGeneralHelpStuff
169 {
170         char *          parentId;               /* used for "Up" menu */
171
172         Boolean         volumeFlag;             /* set when to process new vol */
173
174         Widget          definitionBox;
175         XtCallbackList  closeCallback;          /* Window Close Callback */
176
177         Dimension       marginHeight;
178         Dimension       marginWidth;
179 } _DtHelpGeneralHelpStuff;
180
181
182 typedef struct _DtHelpBrowserStuff 
183 {
184         int             visiblePathCount;       /* Number of path lines shown */
185         XtPointer       pTocArea;               /* Toc area handle */
186
187         Widget          volumeLabel;
188         Widget          panedWindow;  
189         Widget          pathArea;
190
191         Boolean         showTopLevelBtn;
192         Widget          btnBoxBackBtn;
193         Widget          btnBoxHistoryBtn;
194         Widget          btnBoxIndexBtn;
195         Widget          btnBoxTopLevelBtn;
196 } _DtHelpBrowserStuff;
197
198 typedef struct _DtHelpMenuStuff
199 {
200         Boolean         showDupBtn;
201
202         /* Help Dialog Widgets */
203         Widget          menuBar;
204
205         Widget          topBtn;
206         Widget          keyBtn;
207         Widget          backBtn;
208         Widget          historyBtn;
209         Widget          printBtn;
210         Widget          closeBtn;
211         Widget          helpBtn;
212         Widget          newWindowBtn;
213         Widget          copyBtn;
214  
215         Widget          popupMenu;
216         Widget          popupBackBtn;
217         Widget          popupTopBtn;
218 } _DtHelpMenuStuff;
219
220 typedef struct _DtHelpHistoryStuff
221 {
222         /* Path Area Variables */
223         DtTopicListStruct * pPathListHead;
224         DtTopicListStruct * pPathListTale;
225         int                 totalPathNodes;
226
227         /* History Dialog Widgets & variables */
228         Widget              volumeList;         /* Scrolled volume list */   
229         Widget              topicList;          /* Scrolled topic  list */   
230         Widget              historyWidget;      /* Top Level History Shell */
231         Widget              topicsListLabel;
232         DtHistoryListStruct * pHistoryListHead; /* Head pointer to history */
233 } _DtHelpHistoryStuff;
234
235 typedef struct _DtHelpBacktrackStuff
236 {
237         /* Jump List variables */
238         DtTopicListStruct  * pJumpListHead;
239         DtTopicListStruct  * pJumpListTale; 
240         int                  totalJumpNodes;
241         int                  scrollPosition;
242 } _DtHelpBacktrackStuff;
243
244 typedef struct _DtHelpGlobSearchStuff
245 {
246         /* search dialog resource (undocumented) */
247         char *            hitPrefixFont;        /* hit prefix mono-space font resource */
248
249         /* host application locale settings */
250         char *            iconv3Codeset;        /* iconv3-ok codeset of app */
251         _DtHelpCeIconvContext iconv3Context;     /* from vol to app locale */
252
253         /* File Selection Dialog font list */
254         XmFontList        volTitlesFontList;    /*font list req'd by font titles*/
255
256         /* Search Dialog Widgets & variables */
257         Widget            srchForm;
258         Widget            actionBtn;
259         Widget            curVolRadBtn;
260         Widget            allVolRadBtn;
261         Widget            selVolRadBtn;
262         Widget            selectBtn;
263         Widget            fullIndexRadBtn;
264         Widget            containsRadBtn;
265         Widget            wordField;
266         Widget            statusLabel;
267         Widget            resultList;
268         Widget            gotoBtn;
269         Widget            closeBtn;
270         Widget            helpBtn;
271         Widget            selectionDlg;         /* selectionBox (child of dlg) */
272         char *            curVolPath;           /* cur vol shown in btn label */
273         char *            rawWordStr;           /* word as taken from srchWord */
274         char *            normWordStr;          /* normalized word str */
275         char *            localeWordStr;        /* after iconv() of NormWordStr */
276         wchar_t           wordFieldFirstChar;
277         short             wordFieldLen;
278         short             statusLineUsage;
279         _DtHelpGlobSrchSources srchSources;     /* current state of radio but */
280         _DtHelpFileEntry  curSrchVol;           /* vol currently being searched */
281         unsigned int      hitsFontLoaded:1;     /* is font loaded? */
282         unsigned int      volScanDone:1;        /* is the volume list complete? */
283         unsigned int      fullIndex:1;          /* state of search */
284         unsigned int      readyToStart:1;       /* state of search */
285         unsigned int      hitsFound:1;          /* state of search */
286         unsigned int      searchInProgress:1;   /* state of search */
287         unsigned int      curVolRadBtnSens:1;   /* state of curVol sens */
288         short             volLeftCnt;           /* updated during search */
289         _DtHelpFileList   volListHead;          /* info on search topics found */
290         XtWorkProcId      workProcId;           /* ID of search proc */
291 } _DtHelpGlobSearchStuff;
292
293 typedef struct _DtHelpPrintStuff
294 {
295         /* printing resources */
296         char *          helpPrint;              /* help print command resource */
297         unsigned char   paperSize;              /* paper size resource */        
298         char *          printer;                /* printer destination resource */
299         char *          printVolume;            /* volume to print resource */
300
301         /* Print Dialog widgets & variables */
302         Widget          printForm;              /* Form inside top level print shell */
303         Widget          subject;                /* label for subject matter to print */
304         Widget          printerField;           /* text field for printer */
305         Widget          copiesField;            /* text field for copies */
306         Widget          letterBtn;              /* menu item for letter paper */
307         Widget          legalBtn;               /* menu item for legal paper */
308         Widget          execBtn;                /* menu item for executive paper */
309         Widget          a4Btn;                  /* menu item for A4 paper */
310         Widget          b5Btn;                  /* menu item for B5 paper */
311         Widget          paperSizeOptMenu;       /* menu item for A4 paper */
312         Widget          topicsFrame;            /* frame holding print topic selection */
313         Widget          curTopicBtn;            /* radio btn for cur topic */
314         Widget          subTopicsBtn;           /* radio btn for cur & sub topics */
315         Widget          tocBtn;                 /* radio btn for table of contents */
316         Widget          allTopicsBtn;           /* radio btn for all topics */
317         Widget          paperTopicsSeparator;   /* hidden sep btwn paper size & topic sel */
318         Widget          topicsBtnsSeparator;    /* sep between topic sel & btns */
319 } _DtHelpPrintStuff;
320
321
322 /* fields for the GeneralHelp widget record */
323 typedef struct
324 {
325       _DtHelpDisplayWidgetStuff display;
326       _DtHelpCommonHelpStuff    help;
327       _DtHelpGeneralHelpStuff   ghelp;
328       _DtHelpBrowserStuff       browser;
329       _DtHelpMenuStuff          menu;
330       _DtHelpHistoryStuff       history;
331       _DtHelpBacktrackStuff     backtr;
332       _DtHelpGlobSearchStuff    srch;
333       _DtHelpPrintStuff         print;
334 } DtHelpDialogWidgetPart;
335
336
337 /****************************************************************
338  *
339  * Full instance record declaration
340  *
341  ****************************************************************/
342
343 typedef struct _DtHelpDialogWidgetRec
344 {
345         CorePart                core;
346         CompositePart           composite;
347         ConstraintPart          constraint;
348         XmManagerPart           manager;
349         XmBulletinBoardPart     bulletin_board;
350         DtHelpDialogWidgetPart  help_dialog;
351 } DtHelpDialogWidgetRec;
352
353
354
355 /********    Private Function Declarations    ********/
356
357 extern XmGeoMatrix _DtHelpDialogWidgetGeoMatrixCreate( 
358                         Widget wid,
359                         Widget instigator,
360                         XtWidgetGeometry *desired) ;
361 extern Boolean _DtHelpDialogWidgetNoGeoRequest( 
362                         XmGeoMatrix geoSpec) ;
363
364 /********    End Private Function Declarations    ********/
365
366
367
368 #endif /* _XmTemplateBP_h */
369 /* DON'T ADD ANYTHING AFTER THIS #endif */
370