1 /* 2 * Copyright 2013-2014, Stephan Aßmus <superstippi@gmx.de>. 3 * Copyright 2018-2024, Andrew Lindesay <apl@lindesay.co.nz>. 4 * All rights reserved. Distributed under the terms of the MIT License. 5 */ 6 #ifndef RATING_VIEW_H 7 #define RATING_VIEW_H 8 9 10 #include <Referenceable.h> 11 #include <View.h> 12 13 14 class RatingView : public BView { 15 public: 16 RatingView(const char* name); 17 virtual ~RatingView(); 18 19 virtual void AttachedToWindow(); 20 virtual void Draw(BRect updateRect); 21 22 virtual BSize MinSize(); 23 virtual BSize PreferredSize(); 24 virtual BSize MaxSize(); 25 26 void SetRating(float rating); 27 float Rating() const; 28 29 protected: 30 virtual const BBitmap* StarBitmap(); 31 32 private: 33 float fRating; 34 }; 35 36 37 #endif // RATING_VIEW_H 38