* rewrote header file
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24684 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,25 +1,19 @@
|
|||||||
/*******************************************************************************
|
/*
|
||||||
/
|
* Copyright 2008, Haiku Inc.
|
||||||
/ File: PrintJob.h
|
* Distributed under the terms of the MIT License.
|
||||||
/
|
*/
|
||||||
/ Description: BPrintJob runs a printing session.
|
|
||||||
/
|
|
||||||
/ Copyright 1996-98, Be Incorporated, All Rights Reserved
|
|
||||||
/
|
|
||||||
*******************************************************************************/
|
|
||||||
|
|
||||||
#ifndef _PRINTSESSION_H
|
#ifndef _PRINTSESSION_H
|
||||||
#define _PRINTSESSION_H
|
#define _PRINTSESSION_H
|
||||||
|
|
||||||
|
|
||||||
#include <BeBuild.h>
|
#include <BeBuild.h>
|
||||||
#include <Picture.h> /* For convenience */
|
#include <Picture.h>
|
||||||
#include <Rect.h>
|
#include <Rect.h>
|
||||||
|
|
||||||
|
|
||||||
class BFile;
|
class BFile;
|
||||||
class BView;
|
class BView;
|
||||||
|
|
||||||
/*----------------------------------------------------------------*/
|
|
||||||
/*----- BPrintJob related structures -----------------------------*/
|
|
||||||
|
|
||||||
struct print_file_header {
|
struct print_file_header {
|
||||||
int32 version;
|
int32 version;
|
||||||
@@ -30,95 +24,91 @@ struct print_file_header {
|
|||||||
int32 _reserved_5_;
|
int32 _reserved_5_;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct _page_header_;
|
struct _page_header_;
|
||||||
|
|
||||||
/*----------------------------------------------------------------*/
|
|
||||||
/*----- BPrintJob class ------------------------------------------*/
|
|
||||||
|
|
||||||
class BPrintJob {
|
class BPrintJob {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
enum // These values are returned by PrinterType()
|
enum {
|
||||||
{
|
B_BW_PRINTER = 0,
|
||||||
B_BW_PRINTER = 0,
|
B_COLOR_PRINTER
|
||||||
B_COLOR_PRINTER
|
};
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
BPrintJob(const char *job_name);
|
BPrintJob(const char *job_name);
|
||||||
virtual ~BPrintJob();
|
virtual ~BPrintJob();
|
||||||
|
|
||||||
void BeginJob();
|
void BeginJob();
|
||||||
void CommitJob();
|
void CommitJob();
|
||||||
status_t ConfigJob();
|
status_t ConfigJob();
|
||||||
void CancelJob();
|
void CancelJob();
|
||||||
|
|
||||||
status_t ConfigPage();
|
status_t ConfigPage();
|
||||||
void SpoolPage();
|
void SpoolPage();
|
||||||
|
|
||||||
bool CanContinue();
|
bool CanContinue();
|
||||||
|
|
||||||
virtual void DrawView(BView *a_view, BRect a_rect, BPoint where);
|
virtual void DrawView(BView *a_view, BRect a_rect, BPoint where);
|
||||||
|
|
||||||
BMessage *Settings() /* const */ ;
|
BMessage * Settings() /* const */ ;
|
||||||
void SetSettings(BMessage *a_msg);
|
void SetSettings(BMessage *a_msg);
|
||||||
bool IsSettingsMessageValid(BMessage *a_msg) const;
|
bool IsSettingsMessageValid(BMessage *a_msg) const;
|
||||||
|
|
||||||
BRect PaperRect();
|
BRect PaperRect();
|
||||||
BRect PrintableRect();
|
BRect PrintableRect();
|
||||||
void GetResolution(int32 *xdpi, int32 *ydpi);
|
void GetResolution(int32 *xdpi, int32 *ydpi);
|
||||||
|
|
||||||
|
int32 FirstPage() /* const */ ;
|
||||||
|
int32 LastPage() /* const */ ;
|
||||||
|
int32 PrinterType(void * = NULL) const;
|
||||||
|
|
||||||
int32 FirstPage() /* const */ ;
|
|
||||||
int32 LastPage() /* const */ ;
|
|
||||||
int32 PrinterType(void * = NULL) const;
|
|
||||||
|
|
||||||
|
|
||||||
/*----- Private or reserved -----------------------------------------*/
|
|
||||||
private:
|
private:
|
||||||
|
virtual void _ReservedPrintJob1();
|
||||||
|
virtual void _ReservedPrintJob2();
|
||||||
|
virtual void _ReservedPrintJob3();
|
||||||
|
virtual void _ReservedPrintJob4();
|
||||||
|
|
||||||
virtual void _ReservedPrintJob1();
|
BPrintJob(const BPrintJob &);
|
||||||
virtual void _ReservedPrintJob2();
|
BPrintJob &operator=(const BPrintJob &);
|
||||||
virtual void _ReservedPrintJob3();
|
|
||||||
virtual void _ReservedPrintJob4();
|
|
||||||
|
|
||||||
BPrintJob(const BPrintJob &);
|
void _RecurseView(BView *view, BPoint origin,
|
||||||
BPrintJob &operator=(const BPrintJob &);
|
BPicture *picture, BRect r);
|
||||||
|
void _GetMangledName(char *buffer, size_t bufferSize) const;
|
||||||
|
void _HandlePageSetup(BMessage *setup);
|
||||||
|
bool _HandlePrintSetup(BMessage *setup);
|
||||||
|
|
||||||
void _RecurseView(BView *view, BPoint origin, BPicture *p, BRect r);
|
void _NewPage();
|
||||||
void _GetMangledName(char *buffer, size_t bufferSize) const;
|
void _EndLastPage();
|
||||||
void _HandlePageSetup(BMessage *setup);
|
|
||||||
bool _HandlePrintSetup(BMessage *setup);
|
|
||||||
|
|
||||||
void _NewPage();
|
void _AddSetupSpec();
|
||||||
void _EndLastPage();
|
void _AddPicture(BPicture &picture, BRect &rect, BPoint &where);
|
||||||
|
|
||||||
void _AddSetupSpec();
|
char * _GetCurrentPrinterName() const;
|
||||||
void _AddPicture(BPicture &picture, BRect &rect, BPoint &where);
|
void _LoadDefaultSettings();
|
||||||
|
|
||||||
char* _GetCurrentPrinterName() const;
|
private:
|
||||||
void _LoadDefaultSettings();
|
char * fPrintJobName;
|
||||||
|
int32 fPageNumber;
|
||||||
char * fPrintJobName;
|
BFile * fSpoolFile;
|
||||||
int32 fPageNumber;
|
print_file_header fCurrentHeader;
|
||||||
BFile * fSpoolFile;
|
BRect fPaperSize;
|
||||||
print_file_header fCurrentHeader;
|
BRect fUsableSize;
|
||||||
BRect fPaperSize;
|
status_t fError;
|
||||||
BRect fUsableSize;
|
char fSpoolFileName[256];
|
||||||
status_t fError;
|
BMessage * fSetupMessage;
|
||||||
char fSpoolFileName[256];
|
BMessage * fDefaultSetupMessage;
|
||||||
BMessage *fSetupMessage;
|
char fAbort;
|
||||||
BMessage *fDefaultSetupMessage;
|
int32 fFirstPage;
|
||||||
char fAbort;
|
int32 fLastPage;
|
||||||
int32 fFirstPage;
|
short fXResolution;
|
||||||
int32 fLastPage;
|
short fYResolution;
|
||||||
short fXResolution;
|
_page_header_ * fCurrentPageHeader;
|
||||||
short fYResolution;
|
off_t fCurrentPageHeaderOffset;
|
||||||
_page_header_ * fCurrentPageHeader;
|
uint32 _reserved[2];
|
||||||
off_t fCurrentPageHeaderOffset;
|
|
||||||
uint32 _reserved[2];
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*-------------------------------------------------------------*/
|
|
||||||
/*-------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#endif /* _PRINTSESSION_H */
|
|
||||||
|
#endif // _PRINTSESSION_H
|
||||||
|
|||||||
Reference in New Issue
Block a user