1 /* 2 * Copyright 2006, Haiku. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Stephan Aßmus <superstippi@gmx.de> 7 */ 8 9 #ifndef ICON_VIEW_H 10 #define ICON_VIEW_H 11 12 #include <View.h> 13 14 #include "Icon.h" 15 16 class BBitmap; 17 class IconRenderer; 18 19 class IconView : public BView, 20 public IconListener { 21 public: 22 IconView(BRect frame, const char* name); 23 virtual ~IconView(); 24 25 // BView interface 26 virtual void AttachedToWindow(); 27 virtual void Draw(BRect updateRect); 28 29 // IconListener interface 30 virtual void AreaInvalidated(const BRect& area); 31 32 // IconView 33 void SetIcon(Icon* icon); 34 void SetIconBGColor(const rgb_color& color); 35 36 private: 37 BBitmap* fBitmap; 38 Icon* fIcon; 39 IconRenderer* fRenderer; 40 BRect fDirtyIconArea; 41 42 double fScale; 43 }; 44 45 #endif // ICON_VIEW_H 46