1 /* 2 * Copyright 2010, Haiku. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Michael Pfeiffer 7 */ 8 #ifndef GP_BINDING_H 9 #define GP_BINDING_H 10 11 12 #include <Bitmap.h> 13 #include <Message.h> 14 15 #include <list> 16 17 #include "GPBand.h" 18 #include "GPJob.h" 19 #include "GPJobConfiguration.h" 20 #include "OutputStream.h" 21 #include "ValidRect.h" 22 23 class GPCapabilities; 24 25 class GPBinding 26 { 27 public: 28 GPBinding(); 29 ~GPBinding(); 30 31 status_t GetPrinterManufacturers(BMessage& manufacturers); 32 bool ExtractManufacturer(const BMessage& manufacturers, int32 index, 33 BString& id, BString& displayName); 34 void AddManufacturer(BMessage& manufacturers, const char* id, 35 const char* name); 36 37 status_t GetPrinterModels(const char* manufacturer, BMessage& models); 38 bool ExtractModel(const BMessage& models, int32 index, 39 BString& displayName, BString& driver); 40 void AddModel(BMessage& models, const char* displayName, 41 const char* driver); 42 43 status_t GetCapabilities(const char* driver, 44 GPCapabilities* capabilities); 45 46 status_t BeginJob(GPJobConfiguration* configuration, 47 OutputStream* outputStream) throw(TransportException); 48 void EndJob() throw(TransportException); 49 void BeginPage() throw(TransportException); 50 void EndPage() throw(TransportException); 51 status_t AddBitmapToPage(BBitmap* bitmap, BRect validRect, BPoint where); 52 53 private: 54 void InitGutenprint(); 55 void DeleteBands(); 56 57 bool fInitialized; 58 OutputStream* fOutputStream; 59 list<GPBand*> fBands; 60 GPJob fJob; 61 }; 62 63 #endif 64