MvcDigestDb/controllers/digestdbcontroller.h

Go to the documentation of this file.
00001 /*  -*- c++ -*-  (for Emacs)
00002  *
00003  *  digestdbcontroller.h
00004  *  Digest
00005  * 
00006  *  Created by Aidan Lane on Fri Aug 12 2005.
00007  *  Copyright (c) 2005-2006 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 DIGESTDBCONTROLLER_H
00026 #define DIGESTDBCONTROLLER_H
00027 
00028 
00029 #include "MvcCore/abstractcontroller.h"
00030 
00031 #include <QPointer>
00032 
00033 #include "digestdbcontrollerevents.h"
00034 
00035 class DigestDbModel;
00036 
00037 
00052 class DigestDbController : public QObject, public AbstractController {
00053 
00054   Q_OBJECT
00055 
00056  public:
00057   DigestDbController( QObject* parent = 0 );
00058   DigestDbController( DigestDbModel* model, QObject* parent = 0 );
00059 
00060   DigestDbModel* digestDbModel() const;
00061 
00063   inline static MvcModuleId_t classModuleId() { return MvcDigestDb::id(); }
00065   virtual MvcModuleId_t moduleId() const { return classModuleId(); }
00066 
00067 
00068  protected:
00069   inline virtual void customEvent( QEvent* e ) {
00070     CEvent* ce = dynamic_cast<CEvent*>(e);
00071     if ( ce != 0 ) dispatchEvent(ce);
00072   }
00073   virtual void dispatchEvent( CEvent* );
00074 
00075   virtual void changeModelEvent( CChangeModelEvent* );
00076 
00077   virtual void classAddEvent( CClassAddEvent* );
00078   virtual void classUpdateEvent( CClassUpdateEvent* );
00079   virtual void classesRemoveEvent( CClassesRemoveEvent* );
00080 
00081   virtual void collectionAddEvent( CCollectionAddEvent* );
00082   virtual void collectionUpdateEvent( CCollectionUpdateEvent* );
00083   virtual void collectionsRemoveEvent( CCollectionsRemoveEvent* );
00084 
00085   virtual void experimentAddEvent( CExperimentAddEvent* );
00086   virtual void experimentUpdateEvent( CExperimentUpdateEvent* );
00087   virtual void experimentsRemoveEvent( CExperimentsRemoveEvent* );
00088 
00089   virtual void gestureAddEvent( CGestureAddEvent* );
00090   virtual void gestureUpdateEvent( CGestureUpdateEvent* );
00091   virtual void gesturesChangeClassesEvent( CGesturesChangeClassesEvent* );
00092   virtual void gesturesChangeCollectionsEvent( CGesturesChangeCollectionsEvent* );
00093   virtual void gesturesRemoveEvent( CGesturesRemoveEvent* );
00094 
00095   virtual void trainedRecogAddEvent( CTrainedRecogAddEvent* );
00096   virtual void trainedRecogUpdateEvent( CTrainedRecogUpdateEvent* );
00097   virtual void trainedRecogsRemoveEvent( CTrainedRecogsRemoveEvent* );
00098 
00099 
00100  private:
00101   // Temporary caches:
00102   QPointer<DigestDbModel> c_digestDbModel;
00103 };
00104 
00105 
00106 #endif // ! DIGESTDBCONTROLLER_H

Generated on Mon Jul 30 09:46:50 2007 for Digest by  doxygen 1.5.2