Initial import of the CDE 2.1.30 sources from the Open Group.
[oweals/cde.git] / cde / programs / dtpdm / MainWindow.h
1 /* $XConsortium: MainWindow.h /main/4 1996/08/12 18:42:19 cde-hp $ */
2 /*
3  * dtpdm/MainWindow.h
4  */
5 /*
6  * (c) Copyright 1996 Digital Equipment Corporation.
7  * (c) Copyright 1996 Hewlett-Packard Company.
8  * (c) Copyright 1996 International Business Machines Corp.
9  * (c) Copyright 1996 Sun Microsystems, Inc.
10  * (c) Copyright 1996 Novell, Inc. 
11  * (c) Copyright 1996 FUJITSU LIMITED.
12  * (c) Copyright 1996 Hitachi.
13  */
14 #ifndef _pdmMainWin_h
15 #define _pdmMainWin_h
16
17 #include "PdmXp.h"
18
19 /*
20  * return codes for a PdmBoxVerifyAttrProc
21  */
22 typedef enum { PDM_SUCCESS, PDM_FAILURE } PdmStatus;
23
24 /*
25  * callback procedure types for setup box children of the PDM main window
26  */
27 typedef struct _PdmSetupBox* (*PdmBoxNewProc) (void);
28 typedef void (*PdmBoxDeleteProc)(struct _PdmSetupBox* me);
29 typedef void (*PdmBoxCreateProc)(struct _PdmSetupBox* me, Widget parent);
30 typedef PdmStatus (*PdmBoxVerifyAttrProc)(struct _PdmSetupBox* me,
31                                           PdmXp* pdm_xp);
32 typedef void (*PdmBoxGetAttrProc)(struct _PdmSetupBox* me, PdmXp* pdm_xp);
33 typedef void (*PdmBoxSetAttrProc)(struct _PdmSetupBox* me, PdmXp* pdm_xp);
34
35 /*
36  * instance structure for setup box children of the PDM main window
37  */
38 typedef struct _PdmSetupBox
39 {
40     /*
41      * define common setup box functions
42      */
43     PdmBoxDeleteProc delete_proc;
44     PdmBoxCreateProc create_proc;
45     PdmBoxVerifyAttrProc verify_attr_proc;
46     PdmBoxGetAttrProc get_attr_proc;
47     PdmBoxSetAttrProc set_attr_proc;
48     /*
49      * the setup box child's widget ID
50      */
51     Widget widget;
52     /*
53      * the setup box provides its own fallback resources and the
54      * notebook tab widget instance name
55      */
56     const String* fallback_resources;
57     int fallback_resources_count;
58     const char* tab_name;
59     /*
60      * allow child setup box-specific data
61      */
62     void* subclass_data;
63     
64 } PdmSetupBox;
65
66 /*
67  * node structure for the list of setup box children managed by the PDM
68  * main window
69  */
70 typedef struct _PdmBoxNode
71 {
72     PdmSetupBox* box;
73     Widget tab;
74     struct _PdmBoxNode* next;
75 } PdmBoxNode, *PdmBoxList;
76
77 /*
78  * PDM main window instance structure
79  */
80 typedef struct _PdmMainWin
81 {
82     /*
83      * widget IDs
84      */
85     Widget widget;
86     Widget notebook;
87     /*
88      * printer information
89      */
90     char* print_display_spec;
91     
92     const char* printer_descriptor;
93     const char* printer_name;
94     /*
95      * linked list of setup boxes
96      */
97     PdmBoxList box_list_head;
98     PdmBoxList box_list_tail;
99     /*
100      * Xp interface
101      */
102     PdmXp* pdm_xp;
103     /*
104      * online help
105      */
106     Widget help_dialog;
107
108 } PdmMainWin;
109
110 /*
111  * public PdmMainWin methods
112  */
113 PdmMainWin* PdmMainWinNew(void);
114 PdmMainWin* PdmMainWinCreate(
115                              PdmMainWin* me,
116                              Widget parent,
117                              String print_display_spec,
118                              String print_context_str);
119 void PdmMainWinDelete(PdmMainWin* me);
120 PdmSetupBox* PdmMainWinAddSetupBox(PdmMainWin* me, PdmSetupBox* box);
121 String* PdmMainWinMergeFallbacks(PdmMainWin* me,
122                                  const String* app_fallbacks,
123                                  int count);
124
125 #endif /* _pdmMainWin_h */
126
127