00001 /* 00002 Copyright 1996-2002 00003 Simon Whiteside, All Rights Reserved 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Lesser General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Lesser General Public License for more details. 00014 00015 You should have received a copy of the GNU Lesser General Public 00016 License along with this library; if not, write to the Free Software 00017 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 00019 Demo_Controller.h 00020 00021 This file defines the interface for the class which controls the demo's view. 00022 00023 $Id: ce_2Demo__Controller_8h-source.html,v 1.3 2003/01/23 15:31:03 simkin_cvs Exp $ 00024 */ 00025 #ifndef CONTROLLER_H 00026 #define CONTROLLER_H 00027 00028 #include "skScriptedExecutable.h" 00029 00030 #include "Demo_View.h" 00031 00032 class Controller : public skScriptedExecutable, public ViewCallback 00033 // deriving from skScriptedExecutable means we can be called from Simkin scripts 00034 // deriving from ViewCallback means we can get notified when 00035 // buttons are pressed on the view 00036 { 00037 public: 00038 Controller(skString fileName,skInterpreter * interp 00039 #ifndef EXCEPTIONS_DEFINED 00040 ,skScriptError& error 00041 #endif 00042 ); 00043 ~Controller(); 00044 void buttonPressed(int id); 00045 bool method(const skString& s,skRValueArray& args,skRValue& ret,skInterpreter * interp 00046 #ifndef EXCEPTIONS_DEFINED 00047 ,skScriptError& error 00048 #endif 00049 ); 00050 private: 00051 void init(skInterpreter * interp 00052 #ifndef EXCEPTIONS_DEFINED 00053 ,skScriptError& error 00054 #endif 00055 ); 00056 View * m_View; 00057 skString m_FileName; 00058 skInterpreter * m_Interpreter; 00059 }; 00060 00061 #endif