xref: /haiku/src/preferences/printers/AddPrinterDialog.h (revision dc90a8c5f96edd8e67ce8af2bec6455d9edd2152)
1 /*
2  * Copyright 2001-2007, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Philippe Houdoin
7  *		Michael Pfeiffer
8  */
9 #ifndef _ADD_PRINTER_DIALOG_H
10 #define _ADD_PRINTER_DIALOG_H
11 
12 
13 #include <Button.h>
14 #include <String.h>
15 #include <PopUpMenu.h>
16 #include <TextControl.h>
17 #include <Window.h>
18 
19 
20 class AddPrinterDialog : public BWindow {
21 		typedef BWindow Inherited;
22 public:
23 								AddPrinterDialog(BWindow *parent);
24 
25 			void				MessageReceived(BMessage *msg);
26 			bool				QuitRequested();
27 
28 private:
29 			enum MessageKind {
30 				kPrinterSelectedMsg = 'adlg',
31 				kTransportSelectedMsg,
32 				kNameChangedMsg,
33 			};
34 
35 
36 			void				_AddPrinter(BMessage *msg);
37 			void				_StorePrinter(BMessage *msg);
38 			void				_HandleChangedTransport(BMessage *msg);
39 
40 			void				_BuildGUI(int stage);
41 			void				_FillTransportMenu(BMenu *menu);
42 			void				_FillMenu(BMenu *menu, const char *path,
43 									uint32 what);
44 			void				_AddPortSubMenu(BMenu *menu,
45 									const char *transport, const char *port);
46 			void 				_Update();
47 
48 			BMessenger			fPrintersPrefletMessenger;
49 
50 			BTextControl*		fName;
51 			BPopUpMenu*			fPrinter;
52 			BPopUpMenu*			fTransport;
53 			BButton*			fOk;
54 
55 			BString 			fNameText;
56 			BString 			fPrinterText;
57 			BString 			fTransportText;
58 			BString 			fTransportPathText;
59 };
60 
61 #endif // _ADD_PRINTER_DIALOG_H
62