1/* 2 * Copyright 2004-2020, Haiku. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Adrien Destugues, pulkomandy@pulkomandy.tk 7 * Michael Wilber 8 */ 9#ifndef ICONVIEW_H 10#define ICONVIEW_H 11 12 13#include <Bitmap.h> 14#include <Mime.h> 15#include <Path.h> 16#include <View.h> 17 18 19class IconView : public BView { 20public: 21 IconView(icon_size iconSize = B_LARGE_ICON); 22 23 ~IconView(); 24 25 status_t InitCheck() const; 26 virtual void Draw(BRect area); 27 28 void DrawIcon(bool draw); 29 status_t SetIcon(const BPath& path, 30 icon_size iconSize = B_LARGE_ICON); 31 status_t SetIcon(const uint8_t* hvifData, size_t size, 32 icon_size iconSize = B_LARGE_ICON); 33 status_t SetIcon(const BBitmap* icon); 34 35private: 36 void _SetSize(); 37 38 icon_size fIconSize; 39 BBitmap* fIconBitmap; 40 bool fDrawIcon; 41}; 42 43#endif // #ifndef ICONVIEW_H 44