1/*
2 * Copyright 2008 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
4 *
5 * Authors:
6 *		Julun, <host.haiku@gmx.de
7 */
8#ifndef _JOB_SETUP_PANEL_H_
9#define _JOB_SETUP_PANEL_H_
10
11
12#include <PrintPanel.h>
13
14
15class BButton;
16class BCheckBox;
17class BMenuField;
18class BPopUpMenu;
19class BRadioButton;
20class BStringView;
21class BTextControl;
22class BTextView;
23
24
25namespace BPrivate {
26	namespace Print {
27
28
29class BPrinter;
30class BPrinterRoster;
31
32
33enum print_range {
34	B_ALL_PAGES		= 0,
35	B_SELECTION		= 1,
36	B_PAGE_RANGE	= 2
37};
38
39
40const uint32 B_NO_OPTIONS			= 0x00000000;
41const uint32 B_PRINT_TO_FILE		= 0x00000001;
42const uint32 B_PRINT_SELECTION		= 0x00000002;
43const uint32 B_PRINT_PAGE_RANGE		= 0x00000004;
44const uint32 B_PRINT_COLLATE_COPIES	= 0x00000008;
45
46
47
48class BJobSetupPanel : public BPrintPanel {
49public:
50								BJobSetupPanel(BPrinter* printer);
51								BJobSetupPanel(BPrinter* printer, uint32 flags);
52	virtual						~BJobSetupPanel();
53
54								BJobSetupPanel(BMessage* data);
55	static	BArchivable*		Instantiate(BMessage* data);
56	virtual	status_t			Archive(BMessage* data, bool deep = true) const;
57	virtual	void				MessageReceived(BMessage* message);
58
59	virtual	status_t			Go();
60
61			BPrinter*			Printer() const;
62			void				SetPrinter(BPrinter* printer, bool keepSettings);
63
64			print_range			PrintRange() const;
65			void				SetPrintRange(print_range range);
66
67			int32				FirstPage() const;
68			int32				LastPage() const;
69			void				SetPageRange(int32 firstPage, int32 lastPage);
70
71			uint32				OptionFlags() const;
72			void				SetOptionFlags(uint32 flags);
73
74private:
75			void				_InitObject();
76			void				_SetupInterface();
77			void				_DisallowChar(BTextView* textView);
78
79private:
80			BPrinter*			fPrinter;
81			BPrinterRoster*		fPrinterRoster;
82
83			print_range			fPrintRange;
84			uint32				fJobPanelFlags;
85
86			BPopUpMenu*			fPrinterPopUp;
87			BMenuField*			fPrinterMenuField;
88			BButton*			fProperties;
89			BStringView*		fPrinterInfo;
90			BCheckBox*			fPrintToFile;
91			BRadioButton*		fPrintAll;
92			BRadioButton*		fPagesFrom;
93			BTextControl*		fFirstPage;
94			BTextControl*		fLastPage;
95			BRadioButton*		fSelection;
96			BTextControl*		fNumberOfCopies;
97			BCheckBox*			fCollate;
98			BCheckBox*			fReverse;
99			BCheckBox*			fColor;
100			BCheckBox*			fDuplex;
101};
102
103
104	}	// namespace Print
105}	// namespace BPrivate
106
107
108#endif	// _JOB_SETUP_PANEL_H_
109