1 /* 2 * Copyright 2006-2007, 2023, Haiku. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stephan Aßmus <superstippi@gmx.de> 7 * Zardshard 8 */ 9 #ifndef REFERENCE_IMAGE_H 10 #define REFERENCE_IMAGE_H 11 12 #ifdef ICON_O_MATIC 13 14 #include "IconObject.h" 15 #include "Observer.h" 16 #include "IconBuild.h" 17 #include "PathContainer.h" 18 #include "PathSource.h" 19 #include "Shape.h" 20 #include "Transformable.h" 21 #include "VectorPath.h" 22 23 #include <List.h> 24 #include <Rect.h> 25 26 27 _BEGIN_ICON_NAMESPACE 28 29 30 class Style; 31 32 class ReferenceImage : public _ICON_NAMESPACE Shape { 33 public: 34 enum { 35 archive_code = 'shri' 36 }; 37 38 ReferenceImage(BBitmap* image); 39 // transfers ownership of image 40 ReferenceImage(const ReferenceImage& other); 41 ReferenceImage(BMessage* archive); 42 virtual ~ReferenceImage(); 43 44 // IconObject interface 45 virtual status_t Unarchive(BMessage* archive); 46 virtual status_t Archive(BMessage* into, 47 bool deep = true) const; 48 49 virtual PropertyObject* MakePropertyObject() const; 50 virtual bool SetToPropertyObject( 51 const PropertyObject* object); 52 // Shape 53 virtual status_t InitCheck() const; 54 virtual Shape* Clone() const 55 { return new ReferenceImage(*this); } 56 57 virtual void SetImage(BBitmap* image); 58 // transfers ownership of image 59 60 virtual bool Visible(float scale) const 61 { return true; } 62 private: 63 VectorPath* fPath; 64 }; 65 66 67 _END_ICON_NAMESPACE 68 69 70 #endif // ICON_O_MATIC 71 #endif // REFERENCE_IMAGE_H 72