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 15 class BButton; 16 class BCheckBox; 17 class BMenuField; 18 class BPopUpMenu; 19 class BRadioButton; 20 class BStringView; 21 class BTextControl; 22 class BTextView; 23 24 25 namespace BPrivate { 26 namespace Print { 27 28 29 class BPrinter; 30 class BPrinterRoster; 31 32 33 enum print_range { 34 B_ALL_PAGES = 0, 35 B_SELECTION = 1, 36 B_PAGE_RANGE = 2 37 }; 38 39 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; 45 46 47 48 class BJobSetupPanel : public BPrintPanel { 49 public: 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 74 private: 75 void _InitObject(); 76 void _SetupInterface(); 77 void _DisallowChar(BTextView* textView); 78 79 private: 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