xref: /haiku/src/add-ons/print/drivers/gutenprint/GPBinding.h (revision 89f1fd6512c10854013d231a85289797e47c7543)
19295cd64SMichael Pfeiffer /*
29295cd64SMichael Pfeiffer * Copyright 2010, Haiku. All rights reserved.
39295cd64SMichael Pfeiffer * Distributed under the terms of the MIT License.
49295cd64SMichael Pfeiffer *
59295cd64SMichael Pfeiffer * Authors:
69295cd64SMichael Pfeiffer *		Michael Pfeiffer
79295cd64SMichael Pfeiffer */
89295cd64SMichael Pfeiffer #ifndef GP_BINDING_H
99295cd64SMichael Pfeiffer #define GP_BINDING_H
109295cd64SMichael Pfeiffer 
119295cd64SMichael Pfeiffer 
129295cd64SMichael Pfeiffer #include <Bitmap.h>
139295cd64SMichael Pfeiffer #include <Message.h>
149295cd64SMichael Pfeiffer 
159295cd64SMichael Pfeiffer #include <list>
169295cd64SMichael Pfeiffer 
179295cd64SMichael Pfeiffer #include "GPBand.h"
189295cd64SMichael Pfeiffer #include "GPJob.h"
199295cd64SMichael Pfeiffer #include "GPJobConfiguration.h"
209295cd64SMichael Pfeiffer #include "OutputStream.h"
219295cd64SMichael Pfeiffer #include "ValidRect.h"
229295cd64SMichael Pfeiffer 
239295cd64SMichael Pfeiffer class GPCapabilities;
249295cd64SMichael Pfeiffer 
259295cd64SMichael Pfeiffer class GPBinding
269295cd64SMichael Pfeiffer {
279295cd64SMichael Pfeiffer public:
289295cd64SMichael Pfeiffer 				GPBinding();
299295cd64SMichael Pfeiffer 				~GPBinding();
309295cd64SMichael Pfeiffer 
319295cd64SMichael Pfeiffer 	status_t	GetPrinterManufacturers(BMessage& manufacturers);
329295cd64SMichael Pfeiffer 	bool		ExtractManufacturer(const BMessage& manufacturers, int32 index,
339295cd64SMichael Pfeiffer 		BString& id, BString& displayName);
349295cd64SMichael Pfeiffer 	void		AddManufacturer(BMessage& manufacturers, const char* id,
359295cd64SMichael Pfeiffer 		const char* name);
369295cd64SMichael Pfeiffer 
379295cd64SMichael Pfeiffer 	status_t	GetPrinterModels(const char* manufacturer, BMessage& models);
389295cd64SMichael Pfeiffer 	bool 		ExtractModel(const BMessage& models, int32 index,
399295cd64SMichael Pfeiffer 		BString& displayName, BString& driver);
409295cd64SMichael Pfeiffer 	void		AddModel(BMessage& models, const char* displayName,
419295cd64SMichael Pfeiffer 		const char* driver);
429295cd64SMichael Pfeiffer 
439295cd64SMichael Pfeiffer 	status_t	GetCapabilities(const char* driver,
449295cd64SMichael Pfeiffer 					GPCapabilities* capabilities);
459295cd64SMichael Pfeiffer 
469295cd64SMichael Pfeiffer 	status_t	BeginJob(GPJobConfiguration* configuration,
47*89f1fd65SJérôme Duval 		OutputStream* outputStream) /* throw(TransportException) */;
48*89f1fd65SJérôme Duval 	void		EndJob() /* throw(TransportException) */;
49*89f1fd65SJérôme Duval 	void		BeginPage() /* throw(TransportException) */;
50*89f1fd65SJérôme Duval 	void		EndPage() /* throw(TransportException) */;
51c0aa3379SMichael Pfeiffer 	status_t	AddBitmapToPage(BBitmap* bitmap, BRect validRect, BPoint where);
529295cd64SMichael Pfeiffer 
539295cd64SMichael Pfeiffer private:
549295cd64SMichael Pfeiffer 	void		InitGutenprint();
559295cd64SMichael Pfeiffer 	void		DeleteBands();
569295cd64SMichael Pfeiffer 
579295cd64SMichael Pfeiffer 	bool			fInitialized;
589295cd64SMichael Pfeiffer 	OutputStream*	fOutputStream;
599295cd64SMichael Pfeiffer 	list<GPBand*>	fBands;
609295cd64SMichael Pfeiffer 	GPJob 			fJob;
619295cd64SMichael Pfeiffer };
629295cd64SMichael Pfeiffer 
639295cd64SMichael Pfeiffer #endif
64