2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
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)
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
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
23 /* $XConsortium: DtMainW.h /main/3 1995/11/06 09:35:41 rswiston $ */
25 * (c) Copyright 1993, 1994 Hewlett-Packard Company *
26 * (c) Copyright 1993, 1994 International Business Machines Corp. *
27 * (c) Copyright 1993, 1994 Sun Microsystems, Inc. *
28 * (c) Copyright 1993, 1994 Novell, Inc. *
34 #include "MainWindow.h"
37 #include "DtActions.h"
38 #include "DtSetPref.h"
39 #include "DtPrinterIcon.h"
49 typedef void (*OpenCallback) (void *callback_data, BaseUI *object);
53 ActionCallback actionCallback;
55 char *actionReferenceName;
58 class DtMenu : public Menu
62 DtMenu(MenuBar *parent, char *name, char *mnemonic, char *help_location_id) :
63 Menu(parent, name, mnemonic)
65 location_id = help_location_id;
67 boolean HandleHelpRequest();
70 class DtMainW : public MainWindow
73 friend void SetPrefCB(void *data);
74 friend void ExitCB(void *data);
75 friend void ActionCB(void *data);
76 friend void HelpCB(void *data);
77 friend void ReferenceCB(void *data);
78 friend void UsingHelpCB(void *data);
79 friend void TasksCB(void *data);
80 friend void AboutCB(void *data);
84 OpenCallback _openClose;
85 PreferenceCallback _prefCB;
86 ContainerType _container_type;
87 SelectionType _select_type;
88 void *_openCallbackData;
89 void *_prefCallbackData;
91 char *_fileMenuMnemonic;
92 ActionData **action_data;
95 PrinterApplicationMode app_mode;
97 static void SetPrefCB(void *data);
98 static void ExitCB(void *data);
99 static void ActionCB(void *data);
100 static void OnItemCB(void *data);
101 static void HelpCB(void *data);
102 static void ReferenceCB(void *data);
103 static void UsingHelpCB(void *data);
104 static void TasksCB(void *data);
105 static void AboutCB(void *data);
107 boolean HandleHelpRequest();
111 DtFindD * findD; // Find dialog
112 DtSetPref * setPrefD; // Set preferences dialog
113 DtSetModList *setModList; // Set printer list dialog
114 DtWorkArea * container; // Work Area
115 MenuBar * mbar; // Menu Bar
116 HelpSystem * helpSystem;
117 DtFindSet * findSetD;
119 // Pulldown menu structure
124 DtActions *actionsMenu;
126 Button *introduction;
127 // ------------------- Separator
131 // ------------------- Separator
133 // ------------------- Separator
136 LabelObj *status_line;
139 DtMainW(char *category,
142 ContainerType container_type = SCROLLED_WORK_AREA,
143 SelectionType select_type = SINGLE_SELECT,
144 OpenCallback openCB = NULL,
145 void *openCallbackData = NULL,
146 PreferenceCallback prefCB = NULL,
147 void *prefCallbackData = NULL,
148 char *fileMenuName = NULL,
149 char *fileMenuMnemonic = NULL,
150 PrinterApplicationMode app_mode = SINGLE_PRINTER);
152 void DtAddAction(char *name, char *category,
153 char *actionReferenceName, ActionCallback callback,
154 void *callback_data, char *mnemonic = NULL,
155 char *acceleratorText = NULL, char *accelerator = NULL);
157 void WorkingCursor(boolean);
158 PrinterApplicationMode PrinterAppMode() { return app_mode; }
159 void DisplayHelp(char *location_id, char *volume = "Printmgr");
160 void DtAddSep(char *category);
162 void OpenClose(BaseUI *obj);
166 #endif /* DTMAINW_H */