xref: /haiku/headers/libs/print/libprint/JobSetupDlg.h (revision 746cac055adc6ac3308c7bc2d29040fb95689cc9)
1 /*
2  * JobSetupDlg.cpp
3  * Copyright 1999-2000 Y.Takagi. All Rights Reserved.
4  */
5 
6 #ifndef __JOBSETUPDLG_H
7 #define __JOBSETUPDLG_H
8 
9 #include <View.h>
10 #include "DialogWindow.h"
11 
12 #include "JobData.h"
13 #include "Halftone.h"
14 #include "JSDSlider.h"
15 
16 class BTextControl;
17 class BTextView;
18 class BRadioButton;
19 class BCheckBox;
20 class BPopUpMenu;
21 class JobData;
22 class PrinterData;
23 class PrinterCap;
24 class HalftoneView;
25 class PagesView;
26 
27 class JobSetupView : public BView {
28 public:
29 	JobSetupView(BRect frame, JobData *job_data, PrinterData *printer_data, const PrinterCap *printer_cap);
30 	virtual void AttachedToWindow();
31 	virtual void MessageReceived(BMessage *msg);
32 	bool UpdateJobData(bool showPreview);
33 
34 private:
35 	void UpdateButtonEnabledState();
36 	BRadioButton* AddPageSelectionItem(BView* parent, BRect rect, const char* name, const char* label,
37 		JobData::PageSelection pageSelection);
38 	void AllowOnlyDigits(BTextView* textView, int maxDigits);
39 	JobData::Color getColor();
40 	Halftone::DitherType getDitherType();
41 	float getGamma();
42 	float getInkDensity();
43 
44 	BTextControl     *fCopies;
45 	BTextControl     *fFromPage;
46 	BTextControl     *fToPage;
47 	JobData          *fJobData;
48 	PrinterData      *fPrinterData;
49 	const PrinterCap *fPrinterCap;
50 	BPopUpMenu       *fColorType;
51 	BPopUpMenu       *fDitherType;
52 	JSDSlider        *fGamma;
53 	JSDSlider        *fInkDensity;
54 	HalftoneView     *fHalftone;
55 	BRadioButton     *fAll;
56 	BCheckBox        *fCollate;
57 	BCheckBox        *fReverse;
58 	PagesView        *fPages;
59 	BPopUpMenu       *fPaperFeed;
60 	BCheckBox        *fDuplex;
61 	BPopUpMenu       *fNup;
62 	BRadioButton     *fAllPages;
63 	BRadioButton     *fOddNumberedPages;
64 	BRadioButton     *fEvenNumberedPages;
65 };
66 
67 class JobSetupDlg : public DialogWindow {
68 public:
69 	JobSetupDlg(JobData *job_data, PrinterData *printer_data, const PrinterCap *printer_cap);
70 	virtual	void MessageReceived(BMessage *message);
71 
72 private:
73 	JobSetupView *fJobSetup;
74 };
75 
76 #endif	/* __JOBSETUPDLG_H */
77