Assorted whitespace cleanup and typo fixes.
[haiku.git] / src / libs / print / libprint / UIDriver.cpp
blobfb413c421c6375a61c46a4f612df129b42008c2d
1 /*
2 * UIDriver.cpp
3 * Copyright 1999-2000 Y.Takagi. All Rights Reserved.
4 */
6 #include <Message.h>
8 #include "UIDriver.h"
9 #include "JobData.h"
10 #include "PrinterData.h"
11 #include "JobSetupDlg.h"
12 #include "PageSetupDlg.h"
13 #include "DbgMsg.h"
16 UIDriver::UIDriver(BMessage* message, PrinterData *printerData,
17 const PrinterCap *printerCap)
19 fMsg(message),
20 fPrinterData(printerData),
21 fPrinterCap(printerCap)
26 UIDriver::~UIDriver()
31 BMessage*
32 UIDriver::ConfigPage()
34 BMessage *clonedMessage = new BMessage(*fMsg);
35 JobData *jobData = new JobData(clonedMessage, fPrinterCap,
36 JobData::kPageSettings);
38 if (PageSetup(jobData, fPrinterData, fPrinterCap) < 0) {
39 delete clonedMessage;
40 clonedMessage = NULL;
41 } else {
42 clonedMessage->what = 'okok';
45 delete jobData;
46 return clonedMessage;
50 BMessage*
51 UIDriver::ConfigJob()
53 BMessage *clonedMessage = new BMessage(*fMsg);
54 JobData *jobData = new JobData(clonedMessage, fPrinterCap,
55 JobData::kJobSettings);
57 if (JobSetup(jobData, fPrinterData, fPrinterCap) < 0) {
58 delete clonedMessage;
59 clonedMessage = NULL;
60 } else {
61 clonedMessage->what = 'okok';
64 delete jobData;
65 return clonedMessage;
69 long
70 UIDriver::PageSetup(JobData* jobData, PrinterData* printerData,
71 const PrinterCap* printerCap)
73 PageSetupDlg *dialog = new PageSetupDlg(jobData, printerData, printerCap);
74 return dialog->Go();
78 long
79 UIDriver::JobSetup(JobData *jobData, PrinterData *printerData,
80 const PrinterCap *printerCap)
82 JobSetupDlg *dialog = new JobSetupDlg(jobData, printerData, printerCap);
83 return dialog->Go();