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