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 "PathSource.h" 18 #include "Shape.h" 19 #include "Transformable.h" 20 #include "VectorPath.h" 21 22 #include <List.h> 23 #include <Rect.h> 24 25 26 _BEGIN_ICON_NAMESPACE 27 28 29 class Style; 30 31 class ReferenceImage : public _ICON_NAMESPACE Shape { 32 public: 33 enum { 34 archive_code = 'shri' 35 }; 36 37 ReferenceImage(BBitmap* image); 38 // transfers ownership of image 39 ReferenceImage(const ReferenceImage& other); 40 ReferenceImage(BMessage* archive); 41 virtual ~ReferenceImage(); 42 43 // IconObject interface 44 virtual status_t Unarchive(BMessage* archive); 45 virtual status_t Archive(BMessage* into, 46 bool deep = true) const; 47 48 virtual PropertyObject* MakePropertyObject() const; 49 virtual bool SetToPropertyObject( 50 const PropertyObject* object); 51 // Shape 52 virtual status_t InitCheck() const; 53 virtual Shape* Clone() const 54 { return new ReferenceImage(*this); } 55 56 virtual void SetImage(BBitmap* image); 57 // transfers ownership of image 58 59 virtual bool Visible(float scale) const 60 { return true; } 61 private: 62 VectorPath* fPath; 63 }; 64 65 66 _END_ICON_NAMESPACE 67 68 69 #endif // ICON_O_MATIC 70 #endif // REFERENCE_IMAGE_H 71