repository_infos: Enable automatic updates on the main Haiku repostiory.
[haiku.git] / src / apps / haikudepot / ui_generic / BitmapView.h
blobd2a706c9fbb2817938834e94bf331c0b3da94826
1 /*
2 * Copyright 2013, Stephan Aßmus <superstippi@gmx.de>.
3 * All rights reserved. Distributed under the terms of the MIT License.
4 */
5 #ifndef BITMAP_VIEW_H
6 #define BITMAP_VIEW_H
9 #include "SharedBitmap.h"
11 #include <View.h>
14 class BitmapView : public BView {
15 public:
16 BitmapView(const char* name);
18 virtual ~BitmapView();
20 virtual void AllAttached();
21 virtual void Draw(BRect updateRect);
23 virtual BSize MinSize();
24 virtual BSize PreferredSize();
25 virtual BSize MaxSize();
27 void SetBitmap(SharedBitmap* bitmap,
28 SharedBitmap::Size bitmapSize
29 = SharedBitmap::SIZE_ANY);
30 void UnsetBitmap();
31 void SetScaleBitmap(bool scaleBitmap);
33 protected:
34 virtual void DrawBackground(BRect& bounds,
35 BRect updateRect);
37 private:
38 BitmapRef fReference;
39 SharedBitmap::Size fBitmapSize;
40 const BBitmap* fBitmap;
41 bool fScaleBitmap;
45 #endif // BITMAP_VIEW_H