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 _BEGIN_ICON_NAMESPACE 20 class IconRenderer; 21 _END_ICON_NAMESPACE 22 23 _USING_ICON_NAMESPACE 24 25 class IconView : public BView, 26 public IconListener { 27 public: 28 IconView(BRect frame, const char* name); 29 virtual ~IconView(); 30 31 // BView interface 32 virtual void AttachedToWindow(); 33 virtual void Draw(BRect updateRect); 34 35 // IconListener interface 36 virtual void AreaInvalidated(const BRect& area); 37 38 // IconView 39 void SetIcon(Icon* icon); 40 void SetIconBGColor(const rgb_color& color); 41 42 private: 43 BBitmap* fBitmap; 44 Icon* fIcon; 45 IconRenderer* fRenderer; 46 BRect fDirtyIconArea; 47 48 double fScale; 49 }; 50 51 #endif // ICON_VIEW_H 52