PageRenderTime 35ms CodeModel.GetById 12ms app.highlight 20ms RepoModel.GetById 1ms app.codeStats 0ms

/components/printers/qt/qtprinters_h.inc

http://github.com/graemeg/lazarus
Pascal | 67 lines | 55 code | 10 blank | 2 comment | 0 complexity | ecff9449bfcf07217dc1b47113f26f8c MD5 | raw file
 1{%MainUnit ../osprinters.pas}
 2uses
 3  Classes, SysUtils, Printers, qt4, qtobjects,
 4  LCLType, LCLProc;
 5
 6type
 7  { TQtPrinters }
 8  TQtPrinters = class(TPrinter)
 9  private
10    FPagesEnum: TStrings;
11    FPrinterHandle: TQtPrinter;
12
13    procedure CreatePrintSettings;
14    procedure BeginPage;
15    procedure EndPage;
16    
17    procedure EnumQPrinters(Lst: TStrings);
18    procedure EnumQPapers(Lst: TStrings);
19    function GetColorMode: QPrinterColorMode;
20    function GetFullPage: Boolean;
21    function GetPageOrder: QPrinterPageOrder;
22    procedure SetColorMode(const AValue: QPrinterColorMode);
23    procedure SetFullPage(const AValue: Boolean);
24    procedure SetPageOrder(const AValue: QPrinterPageOrder);
25  protected
26    procedure DoBeginDoc; override;
27    procedure DoNewPage; override;
28    procedure DoEndDoc(aAborded : Boolean); override;
29    procedure DoAbort; override;
30
31    procedure DoEnumPrinters(Lst : TStrings); override;
32    procedure DoResetPrintersList; override;
33
34    procedure DoEnumPapers(Lst : TStrings); override;
35    function DoGetPaperName: string; override;
36    function DoGetDefaultPaperName: string; override;
37    procedure DoSetPaperName(aName : string); override;
38    function DoGetPaperRect(aName : string; Var aPaperRc : TPaperRect) : Integer; override;
39
40    function DoSetPrinter(aName : string): Integer; override;
41
42    function DoGetCopies : Integer; override;
43    procedure DoSetCopies(aValue : Integer); override;
44    function DoGetOrientation: TPrinterOrientation; override;
45    procedure DoSetOrientation(aValue : TPrinterOrientation); override;
46
47    function GetXDPI: Integer; override;
48    function GetYDPI: Integer; override;
49    function GetPrinterType: TPrinterType;override;
50    function DoGetPrinterState: TPrinterState;override;
51    function GetCanPrint: Boolean;override;
52    function GetCanRenderCopies : Boolean;override;
53    procedure RawModeChanging; override;
54    procedure DoDestroy; override;
55  public
56    procedure Validate;
57    function GetPaperSize(Const Str: String): QPrinterPageSize;
58  public
59    constructor Create; override;
60    function Write(const {%H-}Buffer; {%H-}Count:Integer; var {%H-}Written: Integer): Boolean; override;
61
62    property ColorMode: QPrinterColorMode read GetColorMode write SetColorMode;
63    property FullPage: Boolean read GetFullPage write SetFullPage;
64    property Handle: TQtPrinter read FPrinterHandle;
65    property PageOrder: QPrinterPageOrder read GetPageOrder write SetPageOrder;
66  end;
67