MvcCore/views/docviewevents.h

Go to the documentation of this file.
00001 /*  -*- c++ -*-  (for Emacs)
00002  *
00003  *  docviewevents.h
00004  *  Digest
00005  * 
00006  *  Imported into Digest by Aidan Lane on Thu Jun 9 2005.
00007  *  Modifications Copyright (c) 2005 Optimisation and Constraint Solving Group,
00008  *  Monash University. All rights reserved.
00009  *
00010  *  Nodal file:
00011  *
00012  *    projectviewevents.h
00013  *    Nodal
00014  *
00015  *    Imported into Nodal by Aidan Lane on Thu Feb 24 2005.
00016  *    Modifications Copyright (c) 2005 CEMA, Monash University. All rights reserved.
00017  *
00018  *    Original file:
00019  *
00020  *      projectevent.h
00021  *      EverGreen
00022  *
00023  *      Created by Aidan Lane on Sun Aug 01 2004.
00024  *      Copyright (c) 2004 Aidan Lane. All rights reserved.
00025  *
00026  *  This program is free software; you can redistribute it and/or modify
00027  *  it under the terms of the GNU General Public License as published by
00028  *  the Free Software Foundation; either version 2 of the License, or
00029  *  (at your option) any later version.
00030  *
00031  *  This program is distributed in the hope that it will be useful,
00032  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00033  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00034  *  GNU General Public License for more details.
00035  *
00036  *  You should have received a copy of the GNU General Public License
00037  *  along with this program; if not, write to the Free Software
00038  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00039  */
00040  
00041 #ifndef DOCVIEWEVENTS_H
00042 #define DOCVIEWEVENTS_H
00043 
00044 
00045 #include "viewevents.h"
00046 #include "genericcontainers.h"
00047 
00048 
00049 class VDocEvent : public VEvent {
00050 public:
00051   enum Type { 
00052     Renamed               = VEvent::User,
00053     FilenameChanged,
00054     ModifiedStateChanged,
00055     User                  = VEvent::User + 1000
00056   };
00057 protected:
00058   VDocEvent( Type type, MvcBase* sender )
00059     : VEvent((VEvent::Type)type, sender) {}
00060 };
00061 
00062 
00063 class VRenamedEvent : public VDocEvent, public NameContainer {
00064 public:
00065   VRenamedEvent( const QString& name, MvcBase* sender )
00066     : VDocEvent(Renamed, sender),
00067       NameContainer(name) {}
00068 };
00069 
00070 class VFilenameChangedEvent : public VDocEvent, public FilenameContainer {
00071 public:
00072   VFilenameChangedEvent( const QString& filename, MvcBase* sender )
00073     : VDocEvent(FilenameChanged, sender),
00074       FilenameContainer(filename) {}
00075 };
00076 
00077 class VModifiedStateChangedEvent : public VDocEvent {
00078 public:
00079   VModifiedStateChangedEvent( bool documentModified, MvcBase* sender )
00080     : VDocEvent(ModifiedStateChanged, sender),
00081       m_documentModified(documentModified) {}
00082 
00083   bool documentModified() const { return m_documentModified; }
00084 private:
00085   const bool m_documentModified;
00086 };
00087 
00088 
00089 #endif //  ! DOCVIEWEVENTS_H

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