1 /* 2 * Copyright 2013-2014, Stephan Aßmus <superstippi@gmx.de>. 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 #ifndef RATING_VIEW_H 6 #define RATING_VIEW_H 7 8 9 #include <View.h> 10 11 #include "SharedBitmap.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 private: 30 SharedBitmap fStarBitmap; 31 float fRating; 32 }; 33 34 35 #endif // RATING_VIEW_H 36