1 /* 2 * Copyright (C) 2008 Stephan Aßmus <superstippi@gmx.de> 3 * All rights reserved. Distributed under the terms of the MIT license. 4 */ 5 #ifndef TEST_WINDOW_H 6 #define TEST_WINDOW_H 7 8 #include <Messenger.h> 9 #include <View.h> 10 #include <Window.h> 11 12 13 enum { 14 MSG_TEST_FINISHED = 'tstf', 15 MSG_TEST_CANCELED = 'tstc' 16 }; 17 18 19 class Test; 20 21 // TestView 22 class TestView : public BView { 23 public: 24 TestView(BRect frame, Test* test, 25 drawing_mode mode, 26 const BMessenger& target); 27 28 virtual void AttachedToWindow(); 29 virtual void Draw(BRect updateRect); 30 31 private: 32 Test* fTest; 33 BMessenger fTarget; 34 }; 35 36 // TestWindow 37 class TestWindow : public BWindow { 38 public: 39 TestWindow(BRect fame, Test* test, 40 drawing_mode mode, 41 const BMessenger& target); 42 43 virtual bool QuitRequested(); 44 45 void SetAllowedToQuit(bool allowed); 46 private: 47 BMessenger fTarget; 48 bool fAllowedToQuit; 49 }; 50 51 #endif // TEST_WINDOW_H 52