Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / programs / dtprintinfo / UI / DtFindSet.h
1 /* $XConsortium: DtFindSet.h /main/3 1995/11/06 09:35:17 rswiston $ */
2 /*                                                                      *
3  * (c) Copyright 1993, 1994 Hewlett-Packard Company                     *
4  * (c) Copyright 1993, 1994 International Business Machines Corp.       *
5  * (c) Copyright 1993, 1994 Sun Microsystems, Inc.                      *
6  * (c) Copyright 1993, 1994 Novell, Inc.                                *
7  */
8
9 #ifndef DTFINDSET_H
10 #define DTFINDSET_H
11
12 #include "Dialog.h"
13 #include "Prompt.h"
14
15 class Button;
16 class DtMainW;
17 class LabelObj;
18 class Container;
19 class ComboBoxObj;
20 class FindSetIcon;
21 class HelpSystem;
22
23 typedef void (*CallerCallback)(BaseUI *caller, char *iconFile);
24
25 typedef struct
26 {
27    boolean read_it;
28    FindSetIcon **icons;
29    int n_icons;
30 } FileNamesStruct, *FileNames, **FileNamesList;
31
32 class DtFindSet : public Dialog {
33
34    friend void OkCB(void *data);
35    friend void ApplyCB(void *data);
36    friend void CancelCB(void *data);
37    friend void ResetCB(void *data);
38    friend void HelpCB(void *data);
39    friend void ComboBoxCB(ComboBoxObj *, char *, int);
40    friend void InitComboBox(BaseUI *, void *data);
41
42    static void OkCB(void *data);
43    static void ApplyCB(void *data);
44    static void CancelCB(void *data);
45    static void ResetCB(void *data);
46    static void HelpCB(void *data);
47    static void ComboBoxCB(ComboBoxObj *, char *, int);
48    static void InitComboBox(BaseUI *, void *data);
49
50  private:
51
52    DtMainW *mainw;
53    HelpSystem *helpSystem;
54
55    // dialog buttons
56    Button *ok;
57    Button *apply;
58    Button *cancel;
59    Button *reset;
60    Button *help;
61
62    char **dirs;
63    int n_dirs;
64    int last_position;
65    BaseUI *caller;
66    CallerCallback callback;
67    FileNamesList filenames;
68    ComboBoxObj *comboBox;
69    Container *icons;
70    LabelObj *empty;
71    LabelObj *icon_label;
72    boolean _has_been_posted;
73
74    void CloseCB();
75    boolean SetVisiblity(boolean);
76    boolean HandleHelpRequest();
77
78  public:
79
80    DtFindSet(DtMainW *, char *name, CallerCallback callback);
81    ~DtFindSet();
82    void Caller(BaseUI *obj) { caller = obj; }
83    void Apply();
84    void Reset();
85
86 };
87
88 #endif // DTFINDSET_H