vfs: check userland buffers before reading them.
[haiku.git] / headers / private / print / JobSetupPanel.h
blob31ed54f2f01063922c0aac767f77e52051aea406
1 /*
2 * Copyright 2008 Haiku Inc. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Julun, <host.haiku@gmx.de
7 */
8 #ifndef _JOB_SETUP_PANEL_H_
9 #define _JOB_SETUP_PANEL_H_
12 #include <PrintPanel.h>
15 class BButton;
16 class BCheckBox;
17 class BMenuField;
18 class BPopUpMenu;
19 class BRadioButton;
20 class BStringView;
21 class BTextControl;
22 class BTextView;
25 namespace BPrivate {
26 namespace Print {
29 class BPrinter;
30 class BPrinterRoster;
33 enum print_range {
34 B_ALL_PAGES = 0,
35 B_SELECTION = 1,
36 B_PAGE_RANGE = 2
40 const uint32 B_NO_OPTIONS = 0x00000000;
41 const uint32 B_PRINT_TO_FILE = 0x00000001;
42 const uint32 B_PRINT_SELECTION = 0x00000002;
43 const uint32 B_PRINT_PAGE_RANGE = 0x00000004;
44 const uint32 B_PRINT_COLLATE_COPIES = 0x00000008;
48 class BJobSetupPanel : public BPrintPanel {
49 public:
50 BJobSetupPanel(BPrinter* printer);
51 BJobSetupPanel(BPrinter* printer, uint32 flags);
52 virtual ~BJobSetupPanel();
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);
59 virtual status_t Go();
61 BPrinter* Printer() const;
62 void SetPrinter(BPrinter* printer, bool keepSettings);
64 print_range PrintRange() const;
65 void SetPrintRange(print_range range);
67 int32 FirstPage() const;
68 int32 LastPage() const;
69 void SetPageRange(int32 firstPage, int32 lastPage);
71 uint32 OptionFlags() const;
72 void SetOptionFlags(uint32 flags);
74 private:
75 void _InitObject();
76 void _SetupInterface();
77 void _DisallowChar(BTextView* textView);
79 private:
80 BPrinter* fPrinter;
81 BPrinterRoster* fPrinterRoster;
83 print_range fPrintRange;
84 uint32 fJobPanelFlags;
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;
104 } // namespace Print
105 } // namespace BPrivate
108 #endif // _JOB_SETUP_PANEL_H_