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