xref: /haiku/src/apps/haikudepot/ui_generic/BitmapView.h (revision 909af08f4328301fbdef1ffb41f566c3b5bec0c7)
1 /*
2  * Copyright 2013, Stephan Aßmus <superstippi@gmx.de>.
3  * Copyright 2020-2024, Andrew Lindesay <apl@lindesay.co.nz>.
4  * All rights reserved. Distributed under the terms of the MIT License.
5  */
6 #ifndef BITMAP_VIEW_H
7 #define BITMAP_VIEW_H
8 
9 
10 #include "BitmapHolder.h"
11 
12 #include <View.h>
13 
14 
15 class BitmapView : public BView {
16 public:
17 								BitmapView(const char* name);
18 
19 	virtual						~BitmapView();
20 
21 	virtual	void				Draw(BRect updateRect);
22 
23 	virtual	BSize				MinSize();
24 	virtual	BSize				PreferredSize();
25 	virtual	BSize				MaxSize();
26 
27 			void				SetBitmap(BitmapHolderRef bitmapHolderRef);
28 			void				UnsetBitmap();
29 			void				SetScaleBitmap(bool scaleBitmap);
30 
31 private:
32 			BitmapHolderRef		fBitmapHolderRef;
33 			bool				fScaleBitmap;
34 };
35 
36 
37 #endif // BITMAP_VIEW_H
38