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 13enum { 14 MSG_TEST_FINISHED = 'tstf', 15 MSG_TEST_CANCELED = 'tstc' 16}; 17 18 19class Test; 20 21// TestView 22class TestView : public BView { 23public: 24 TestView(BRect frame, Test* test, 25 drawing_mode mode, bool useClipping, 26 const BMessenger& target); 27 28 virtual void AttachedToWindow(); 29 virtual void Draw(BRect updateRect); 30 31private: 32 Test* fTest; 33 BMessenger fTarget; 34 bool fUseClipping; 35}; 36 37// TestWindow 38class TestWindow : public BWindow { 39public: 40 TestWindow(BRect fame, Test* test, 41 drawing_mode mode, bool useClipping, 42 const BMessenger& target); 43 44 virtual bool QuitRequested(); 45 46 void SetAllowedToQuit(bool allowed); 47 BView* View() const { return fTestView; } 48private: 49 BMessenger fTarget; 50 bool fAllowedToQuit; 51 TestView* fTestView; 52}; 53 54#endif // TEST_WINDOW_H 55