1 /* 2 * Copyright 2007, Ingo Weinhold <bonefish@cs.tu-berlin.de>. 3 * All rights reserved. Distributed under the terms of the MIT License. 4 */ 5 #ifndef WIDGET_LAYOUT_TEST_WRAPPER_VIEW_H 6 #define WIDGET_LAYOUT_TEST_WRAPPER_VIEW_H 7 8 9 #include "View.h" 10 11 12 class BView; 13 14 15 class WrapperView : public View { 16 public: 17 WrapperView(BView* view); 18 19 BView* GetView() const; 20 21 virtual BSize MinSize(); 22 virtual BSize MaxSize(); 23 virtual BSize PreferredSize(); 24 25 virtual void AddedToContainer(); 26 virtual void RemovingFromContainer(); 27 28 virtual void FrameChanged(BRect oldFrame, BRect newFrame); 29 30 private: 31 void _UpdateViewFrame(); 32 BRect _ViewFrame() const; 33 BRect _ViewFrameInContainer() const; 34 35 BSize _FromViewSize(BSize size) const; 36 37 private: 38 BView* fView; 39 BRect fInsets; 40 }; 41 42 43 #endif // WIDGET_LAYOUT_TEST_WRAPPER_VIEW_H 44