2002-11-26 23:03:14 +00:00
|
|
|
/*
|
|
|
|
* PrinterCap.h
|
|
|
|
* Copyright 1999-2000 Y.Takagi. All Rights Reserved.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __PRINTERCAP_H
|
|
|
|
#define __PRINTERCAP_H
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <Rect.h>
|
|
|
|
#include "JobData.h"
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
2004-01-30 17:10:36 +00:00
|
|
|
enum {
|
|
|
|
kUnknownPrinter = 0
|
|
|
|
};
|
2002-11-26 23:03:14 +00:00
|
|
|
|
|
|
|
struct BaseCap {
|
2010-10-25 11:34:31 +00:00
|
|
|
BaseCap(const string &label, bool isDefault);
|
|
|
|
|
|
|
|
string fLabel;
|
|
|
|
bool fIsDefault;
|
2002-11-26 23:03:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct PaperCap : public BaseCap {
|
2010-10-25 11:34:31 +00:00
|
|
|
PaperCap(const string &label, bool isDefault,
|
|
|
|
JobData::Paper paper, const BRect &paperRect,
|
|
|
|
const BRect &physicalRect);
|
|
|
|
|
|
|
|
JobData::Paper fPaper;
|
|
|
|
BRect fPaperRect;
|
|
|
|
BRect fPhysicalRect;
|
2002-11-26 23:03:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct PaperSourceCap : public BaseCap {
|
2010-10-25 11:34:31 +00:00
|
|
|
PaperSourceCap(const string &label, bool isDefault,
|
|
|
|
JobData::PaperSource paperSource);
|
|
|
|
|
|
|
|
JobData::PaperSource fPaperSource;
|
2002-11-26 23:03:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct ResolutionCap : public BaseCap {
|
2010-10-25 11:34:31 +00:00
|
|
|
ResolutionCap(const string &label, bool isDefault,
|
|
|
|
int xResolution, int yResolution);
|
|
|
|
|
|
|
|
int fXResolution;
|
|
|
|
int fYResolution;
|
2002-11-26 23:03:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct OrientationCap : public BaseCap {
|
2010-10-25 11:34:31 +00:00
|
|
|
OrientationCap(const string &label, bool isDefault,
|
|
|
|
JobData::Orientation orientation);
|
|
|
|
|
|
|
|
JobData::Orientation fOrientation;
|
2002-11-26 23:03:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct PrintStyleCap : public BaseCap {
|
2010-10-25 11:34:31 +00:00
|
|
|
PrintStyleCap(const string &label, bool isDefault,
|
|
|
|
JobData::PrintStyle printStyle);
|
|
|
|
|
|
|
|
JobData::PrintStyle fPrintStyle;
|
2002-11-26 23:03:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct BindingLocationCap : public BaseCap {
|
2010-10-25 11:34:31 +00:00
|
|
|
BindingLocationCap(const string &label,
|
|
|
|
bool isDefault,
|
|
|
|
JobData::BindingLocation bindingLocation);
|
|
|
|
|
|
|
|
JobData::BindingLocation fBindingLocation;
|
2002-11-26 23:03:14 +00:00
|
|
|
};
|
|
|
|
|
2004-01-27 21:22:16 +00:00
|
|
|
struct ColorCap : public BaseCap {
|
2010-10-25 11:34:31 +00:00
|
|
|
ColorCap(const string &label, bool isDefault,
|
|
|
|
JobData::Color color);
|
|
|
|
|
|
|
|
JobData::Color fColor;
|
2004-01-27 21:22:16 +00:00
|
|
|
};
|
|
|
|
|
2005-02-06 18:22:40 +00:00
|
|
|
struct ProtocolClassCap : public BaseCap {
|
2010-10-25 11:34:31 +00:00
|
|
|
ProtocolClassCap(const string &label,
|
|
|
|
bool isDefault, int protocolClass,
|
|
|
|
const string &description);
|
|
|
|
|
|
|
|
int fProtocolClass;
|
|
|
|
string fDescription;
|
2005-02-06 18:22:40 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2002-11-26 23:03:14 +00:00
|
|
|
class PrinterData;
|
|
|
|
|
|
|
|
class PrinterCap {
|
|
|
|
public:
|
2010-10-25 11:34:31 +00:00
|
|
|
PrinterCap(const PrinterData *printer_data);
|
|
|
|
virtual ~PrinterCap();
|
2005-02-06 18:22:40 +00:00
|
|
|
|
2004-01-30 17:10:36 +00:00
|
|
|
enum CapID {
|
|
|
|
kPaper,
|
|
|
|
kPaperSource,
|
|
|
|
kResolution,
|
|
|
|
kOrientation,
|
|
|
|
kPrintStyle,
|
|
|
|
kBindingLocation,
|
2004-03-27 07:08:38 +00:00
|
|
|
kColor,
|
2005-02-06 18:22:40 +00:00
|
|
|
kProtocolClass,
|
2004-03-27 07:08:38 +00:00
|
|
|
// Static boolean settings follow.
|
|
|
|
// For them isSupport() has to be implemented only.
|
2005-01-22 14:26:52 +00:00
|
|
|
kCopyCommand, // supports printer page copy command?
|
2002-11-26 23:03:14 +00:00
|
|
|
};
|
|
|
|
|
2010-10-25 11:34:31 +00:00
|
|
|
virtual int countCap(CapID) const = 0;
|
|
|
|
virtual bool isSupport(CapID) const = 0;
|
|
|
|
virtual const BaseCap** enumCap(CapID) const = 0;
|
|
|
|
const BaseCap* getDefaultCap(CapID) const;
|
|
|
|
int getPrinterId() const;
|
|
|
|
int getProtocolClass() const;
|
2002-11-26 23:03:14 +00:00
|
|
|
|
|
|
|
protected:
|
2010-10-25 11:34:31 +00:00
|
|
|
PrinterCap(const PrinterCap &);
|
|
|
|
PrinterCap& operator=(const PrinterCap &);
|
|
|
|
|
|
|
|
const PrinterData* getPrinterData() const;
|
|
|
|
void setPrinterId(int id);
|
2002-11-26 23:03:14 +00:00
|
|
|
|
|
|
|
private:
|
2010-10-25 11:34:31 +00:00
|
|
|
const PrinterData* fPrinterData;
|
|
|
|
int fPrinterID;
|
2002-11-26 23:03:14 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* __PRINTERCAP_H */
|