xref: /haiku/headers/libs/print/libprint/JobSetupDlg.h (revision f53abcbdf8bdc168d7a993c3582ae294f893b8cc)
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 #include "PrinterCap.h"
16 
17 class BTextControl;
18 class BTextView;
19 class BRadioButton;
20 class BCheckBox;
21 class BPopUpMenu;
22 class JobData;
23 class PrinterData;
24 class PrinterCap;
25 class HalftoneView;
26 class PagesView;
27 
28 class JobSetupView : public BView {
29 public:
30 	JobSetupView(JobData* job_data, PrinterData* printer_data,
31 		const PrinterCap* printer_cap);
32 	virtual void AttachedToWindow();
33 	virtual void MessageReceived(BMessage* msg);
34 	bool UpdateJobData(bool showPreview);
35 
36 private:
37 	void UpdateButtonEnabledState();
38 	void FillCapabilityMenu(BPopUpMenu* menu, uint32 message,
39 		PrinterCap::CapID category, int id);
40 	void FillCapabilityMenu(BPopUpMenu* menu, uint32 message,
41 		const BaseCap** capabilities, int count, int id);
42 	int	GetID(const BaseCap** capabilities, int count, const char* label,
43 		int defaultValue);
44 	BRadioButton* CreatePageSelectionItem(const char* name, const char* label,
45 		JobData::PageSelection pageSelection);
46 	void AllowOnlyDigits(BTextView* textView, int maxDigits);
47 	JobData::Color Color();
48 	Halftone::DitherType DitherType();
49 	float Gamma();
50 	float InkDensity();
51 	JobData::PaperSource PaperSource();
52 
53 	BTextControl     *fCopies;
54 	BTextControl     *fFromPage;
55 	BTextControl     *fToPage;
56 	JobData          *fJobData;
57 	PrinterData      *fPrinterData;
58 	const PrinterCap *fPrinterCap;
59 	BPopUpMenu       *fColorType;
60 	BPopUpMenu       *fDitherType;
61 	JSDSlider        *fGamma;
62 	JSDSlider        *fInkDensity;
63 	HalftoneView     *fHalftone;
64 	BRadioButton     *fAll;
65 	BCheckBox        *fCollate;
66 	BCheckBox        *fReverse;
67 	PagesView        *fPages;
68 	BPopUpMenu       *fPaperFeed;
69 	BCheckBox        *fDuplex;
70 	BPopUpMenu       *fNup;
71 	BRadioButton     *fAllPages;
72 	BRadioButton     *fOddNumberedPages;
73 	BRadioButton     *fEvenNumberedPages;
74 };
75 
76 class JobSetupDlg : public DialogWindow {
77 public:
78 	JobSetupDlg(JobData *job_data, PrinterData *printer_data, const PrinterCap *printer_cap);
79 	virtual	void MessageReceived(BMessage *message);
80 
81 private:
82 	JobSetupView *fJobSetup;
83 };
84 
85 #endif	/* __JOBSETUPDLG_H */
86