2020-04-28 22:43:21 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2004-2020, Haiku.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Adrien Destugues, pulkomandy@pulkomandy.tk
|
|
|
|
* Michael Wilber
|
|
|
|
*/
|
2004-11-07 19:56:58 +03:00
|
|
|
#ifndef ICONVIEW_H
|
|
|
|
#define ICONVIEW_H
|
|
|
|
|
2011-03-17 04:15:04 +03:00
|
|
|
|
2004-11-07 19:56:58 +03:00
|
|
|
#include <Bitmap.h>
|
2011-04-14 02:56:10 +04:00
|
|
|
#include <Mime.h>
|
2004-11-08 02:26:37 +03:00
|
|
|
#include <Path.h>
|
2011-03-17 04:15:04 +03:00
|
|
|
#include <View.h>
|
|
|
|
|
2004-11-07 19:56:58 +03:00
|
|
|
|
|
|
|
class IconView : public BView {
|
|
|
|
public:
|
2011-04-14 02:56:10 +04:00
|
|
|
IconView(icon_size iconSize = B_LARGE_ICON);
|
|
|
|
|
2011-03-17 04:15:04 +03:00
|
|
|
~IconView();
|
2011-04-14 02:56:10 +04:00
|
|
|
|
|
|
|
status_t InitCheck() const;
|
2011-03-17 04:15:04 +03:00
|
|
|
virtual void Draw(BRect area);
|
2011-04-14 02:56:10 +04:00
|
|
|
|
|
|
|
void DrawIcon(bool draw);
|
|
|
|
status_t SetIcon(const BPath& path,
|
|
|
|
icon_size iconSize = B_LARGE_ICON);
|
2020-04-28 22:43:21 +03:00
|
|
|
status_t SetIcon(const uint8_t* hvifData, size_t size,
|
|
|
|
icon_size iconSize = B_LARGE_ICON);
|
2004-11-07 19:56:58 +03:00
|
|
|
|
|
|
|
private:
|
2011-04-14 02:56:10 +04:00
|
|
|
void _SetSize();
|
|
|
|
|
|
|
|
icon_size fIconSize;
|
2011-03-17 04:15:04 +03:00
|
|
|
BBitmap* fIconBitmap;
|
|
|
|
bool fDrawIcon;
|
2004-11-07 19:56:58 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // #ifndef ICONVIEW_H
|