1 /* 2 * Copyright 2003-2010 Haiku Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Fernando Francisco de Oliveira 7 * Michael Wilber 8 */ 9 #ifndef SHOW_IMAGE_STATUS_VIEW_H 10 #define SHOW_IMAGE_STATUS_VIEW_H 11 12 13 #include <Entry.h> 14 #include <String.h> 15 #include <View.h> 16 17 18 enum { 19 kFrameSizeCell, 20 kZoomCell, 21 kPagesCell, 22 kImageTypeCell, 23 kStatusCellCount 24 }; 25 26 27 class ShowImageStatusView : public BView { 28 public: 29 ShowImageStatusView(); 30 31 virtual void AttachedToWindow(); 32 virtual void GetPreferredSize(float* _width, float* _height); 33 virtual void ResizeToPreferred(); 34 virtual void Draw(BRect updateRect); 35 virtual void MouseDown(BPoint where); 36 37 void Update(const entry_ref& ref, 38 const BString& text, const BString& pages, 39 const BString& imageType, float zoom); 40 void SetZoom(float zoom); 41 private: 42 void _SetFrameText(const BString& text); 43 void _SetZoomText(float zoom); 44 void _SetPagesText(const BString& pages); 45 void _SetImageTypeText(const BString& imageType); 46 void _ValidatePreferredSize(); 47 BSize fPreferredSize; 48 BString fCellText[kStatusCellCount]; 49 float fCellWidth[kStatusCellCount]; 50 entry_ref fRef; 51 }; 52 53 54 #endif // SHOW_IMAGE_STATUS_VIEW_H 55