1 /* 2 * Copyright 2006, Haiku. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stephan Aßmus <superstippi@gmx.de> 7 */ 8 9 #ifndef EXPORTER_H 10 #define EXPORTER_H 11 12 #include <Entry.h> 13 #include <OS.h> 14 15 class BPositionIO; 16 class Document; 17 class Icon; 18 19 class Exporter { 20 public: 21 Exporter(); 22 virtual ~Exporter(); 23 24 status_t Export(Document* document, 25 const entry_ref& ref); 26 27 virtual status_t Export(const Icon* icon, 28 BPositionIO* stream) = 0; 29 30 virtual const char* MIMEType() = 0; 31 32 void SetSelfDestroy(bool selfDestroy); 33 34 private: 35 static int32 _ExportThreadEntry(void* cookie); 36 int32 _ExportThread(); 37 status_t _Export(const Icon* icon, 38 const entry_ref* docRef); 39 40 Document* fDocument; 41 Icon* fClonedIcon; 42 entry_ref fRef; 43 thread_id fExportThread; 44 bool fSelfDestroy; 45 }; 46 47 #endif // EXPORTER_H 48