haiku/headers/libs/print/libprint/JobSetupDlg.h
Michael Pfeiffer ae83b2f10a * Use check box to enable "Print preview" instead of a button.
The button did make sense in BeOS where there was no printer
  selection dialog. The dialog is enabled in Haiku per default
  and clicking the "Preview" button closes the job setup dialog
  and returns to the printer selection dialog.
  The preview is shown after the printer selection dialog is
  closed clicking on the "OK" button.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39192 a95241bf-73f2-0310-859d-f6bbb57e9c96
2010-10-30 07:06:55 +00:00

106 lines
2.8 KiB
C++

/*
* JobSetupDlg.cpp
* Copyright 1999-2000 Y.Takagi. All Rights Reserved.
*/
#ifndef __JOBSETUPDLG_H
#define __JOBSETUPDLG_H
#include <View.h>
#include <map>
#include "DialogWindow.h"
#include "JobData.h"
#include "Halftone.h"
#include "JSDSlider.h"
#include "PrinterCap.h"
class BCheckBox;
class BGridLayout;
class BPopUpMenu;
class BRadioButton;
class BTextControl;
class BTextView;
class HalftoneView;
class JobData;
class PagesView;
class PrinterCap;
class PrinterData;
class JobSetupView : public BView {
public:
JobSetupView(JobData* jobData, PrinterData* printerData,
const PrinterCap* printerCap);
virtual void AttachedToWindow();
virtual void MessageReceived(BMessage* message);
bool UpdateJobData();
private:
void UpdateButtonEnabledState();
bool IsHalftoneConfigurationNeeded();
void CreateHalftoneConfigurationUI();
void AddDriverSpecificSettings(BGridLayout* gridLayout, int row);
string GetDriverSpecificValue(PrinterCap::CapID category,
const char* key);
template<typename Predicate>
void FillCapabilityMenu(BPopUpMenu* menu, uint32 message,
const BaseCap** capabilities, int count,
Predicate& predicate);
void FillCapabilityMenu(BPopUpMenu* menu, uint32 message,
PrinterCap::CapID category, int id);
void FillCapabilityMenu(BPopUpMenu* menu, uint32 message,
const BaseCap** capabilities, int count, int id);
int GetID(const BaseCap** capabilities, int count,
const char* label, int defaultValue);
BRadioButton* CreatePageSelectionItem(const char* name,
const char* label,
JobData::PageSelection pageSelection);
void AllowOnlyDigits(BTextView* textView, int maxDigits);
void UpdateHalftonePreview();
JobData::Color Color();
Halftone::DitherType DitherType();
float Gamma();
float InkDensity();
JobData::PaperSource PaperSource();
BTextControl* fCopies;
BTextControl* fFromPage;
BTextControl* fToPage;
JobData* fJobData;
PrinterData* fPrinterData;
const PrinterCap* fPrinterCap;
BPopUpMenu* fColorType;
BPopUpMenu* fDitherType;
BMenuField* fDitherMenuField;
JSDSlider* fGamma;
JSDSlider* fInkDensity;
HalftoneView* fHalftone;
BBox* fHalftoneBox;
BRadioButton* fAll;
BCheckBox* fCollate;
BCheckBox* fReverse;
PagesView* fPages;
BPopUpMenu* fPaperFeed;
BCheckBox* fDuplex;
BPopUpMenu* fNup;
BRadioButton* fAllPages;
BRadioButton* fOddNumberedPages;
BRadioButton* fEvenNumberedPages;
std::map<PrinterCap::CapID, BPopUpMenu*> fDriverSpecificLists;
BCheckBox* fPreview;
};
class JobSetupDlg : public DialogWindow {
public:
JobSetupDlg(JobData* jobData, PrinterData* printerData,
const PrinterCap* printerCap);
virtual void MessageReceived(BMessage* message);
private:
JobSetupView* fJobSetup;
};
#endif /* __JOBSETUPDLG_H */