00001 /* -*- c++ -*- (for Emacs) 00002 * 00003 * abstractmodel.h 00004 * Digest 00005 * 00006 * Created by Aidan Lane on Thu Jun 9 2005. 00007 * Copyright (c) 2005 Optimisation and Constraint Solving Group, 00008 * Monash University. All rights reserved. 00009 * 00010 * This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU General Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your option) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00018 * GNU General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program; if not, write to the Free Software 00022 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00023 */ 00024 00025 #ifndef ABSTRACTMODEL_H 00026 #define ABSTRACTMODEL_H 00027 00028 00029 #include "mvcbase.h" 00030 00031 #include <QPointer> 00032 00033 #include "modelevents.h" 00034 00035 class AbstractController; 00036 class CEvent; 00037 00038 00043 class AbstractModel : public MvcBase { 00044 00045 public: 00046 AbstractModel( QObject* objectPtr ); 00047 virtual ~AbstractModel(); 00048 00049 AbstractController* controller() const; 00050 00051 00052 protected: 00053 virtual void dispatchEvent( MEvent* ); 00054 00055 virtual void changeControllerEvent( MChangeControllerEvent* ); 00056 00057 void postControllerEvent( CEvent* event ); 00058 00059 00060 private: 00061 AbstractController* m_controller; // note: can't use QPointer 00062 QPointer<QObject> m_controllerObject; 00063 }; 00064 00065 00066 #endif // ! ABSTRACTMODEL_H
1.5.2