MvcCore/controllers/elementdoccontrollerevents.h

Go to the documentation of this file.
00001 /*  -*- c++ -*-  (for Emacs)
00002  *
00003  *  elementdoccontrollerevents.h
00004  *
00005  *  Imported into Nodal by Aidan Lane on Thu Feb 24 2005.
00006  *  Modifications Copyright (c) 2005-2006 CEMA, Monash University.
00007  *  All rights reserved.
00008  *
00009  *  Original file:
00010  *
00011  *    projectevent.h
00012  *    EverGreen
00013  *
00014  *    Created by Aidan Lane on Sun Aug 01 2004.
00015  *    Copyright (c) 2004 Aidan Lane. All rights reserved.
00016  *
00017  *  This program is free software; you can redistribute it and/or modify
00018  *  it under the terms of the GNU General Public License as published by
00019  *  the Free Software Foundation; either version 2 of the License, or
00020  *  (at your option) any later version.
00021  *
00022  *  This program is distributed in the hope that it will be useful,
00023  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00024  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00025  *  GNU General Public License for more details.
00026  *
00027  *  You should have received a copy of the GNU General Public License
00028  *  along with this program; if not, write to the Free Software
00029  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00030  */
00031  
00032 #ifndef ELEMENTDOCCONTROLLEREVENTS_H
00033 #define ELEMENTDOCCONTROLLEREVENTS_H
00034 
00035 
00036 #include "attributedoccontrollerevents.h"
00037 #include "elementdoccontainers.h"
00038 
00039 class AbstractElementDocView;
00040 
00041 
00042 class CElementDocEvent : public CAttributeDocEvent {
00043 public:
00044   enum Type {
00045     ElementAdd                  = CAttributeDocEvent::User,
00046     ElementRemove,
00047     ElementAttributeAdd,
00048     ElementAttributeRemove,
00049     ElementAttributeChangeData,
00050     ElementSetChangeOrder,
00051     User                        = CAttributeDocEvent::User + 1000
00052   };
00053 
00054   CElementDocEvent( Type type,
00055                     QObject* sender = 0, Flags flags = NoFlags )
00056     : CAttributeDocEvent((CAttributeDocEvent::Type)type, sender, flags) {}
00057 };
00058 
00059 
00060 class CElementEvent : public CElementDocEvent,
00061                       public AbstractElementContainer {
00062 public:
00063   CElementEvent( Type type,
00064                  AbstractElement* element,
00065                  QObject* sender = 0,
00066                  Flags flags = NoFlags )
00067     : CElementDocEvent(type, sender, flags),
00068       AbstractElementContainer(element) {}
00069 };
00070 
00071 
00072 class CElementSetEvent : public CElementDocEvent,
00073                          public AbstractElementSetContainer {
00074 public:
00075   CElementSetEvent( Type type,
00076                     const AbstractElementSet& elements,
00077                     QObject* sender = 0,
00078                     Flags flags = NoFlags )
00079     : CElementDocEvent(type, sender, flags),
00080       AbstractElementSetContainer(elements) {}
00081 };
00082 
00083 
00085 class CElementAddEvent : public CElementEvent {
00086 public:
00087   CElementAddEvent( AbstractElement* element,
00088                     QObject* sender = 0,
00089                     Flags flags = NoFlags )
00090     : CElementEvent(ElementAdd, element, sender, flags) {}
00091 };
00092 
00094 class CElementRemoveEvent : public CElementEvent {
00095 public:
00096   CElementRemoveEvent( AbstractElement* element,
00097                        QObject* sender = 0,
00098                        Flags flags = NoFlags )
00099     : CElementEvent(ElementRemove, element, sender, flags) {}
00100 };
00101 
00102 
00103 class CElementAttributeEvent : public CElementEvent,
00104                                public AbstractElementAttributeContainer {
00105 public:
00106   CElementAttributeEvent( Type type,
00107                           AbstractElement* element,
00108                           AbstractElementAttribute* attribute,
00109                           QObject* sender = 0,
00110                           Flags flags = NoFlags )
00111     : CElementEvent(type, element, sender, flags),
00112       AbstractElementAttributeContainer(attribute) {}
00113 };
00114 
00116 class CElementAttributeAddEvent : public CElementAttributeEvent {
00117 public:
00118   CElementAttributeAddEvent( AbstractElement* element,
00119                              AbstractElementAttribute* attribute,
00120                              QObject* sender = 0,
00121                              Flags flags = NoFlags )
00122     : CElementAttributeEvent(ElementAttributeAdd, element,
00123                              attribute, sender, flags) {}
00124 };
00125 
00127 class CElementAttributeRemoveEvent : public CElementAttributeEvent {
00128 public:
00129   CElementAttributeRemoveEvent( AbstractElement* element,
00130                                 AbstractElementAttribute* attribute,
00131                                 QObject* sender = 0,
00132                                 Flags flags = NoFlags )
00133     : CElementAttributeEvent(ElementAttributeRemove, element,
00134                              attribute, sender, flags) {}
00135 };
00136 
00137 class CElementAttributeChangeDataEvent : public CElementAttributeEvent,
00138                                          public DataContainer {
00139 public:
00140   CElementAttributeChangeDataEvent( AbstractElement* element,
00141                                     AbstractElementAttribute* attribute,
00142                                     const QVariant& data,
00143                                     QObject* sender = 0,
00144                                     Flags flags = NoFlags )
00145     : CElementAttributeEvent(ElementAttributeChangeData, element,
00146                              attribute, sender, flags),
00147       DataContainer(data) {}
00148 };
00149 
00150 
00151 class CElementSetChangeOrderEvent : public CElementSetEvent,
00152                                     public ElementOrderActionContainer {
00153 public:
00154   CElementSetChangeOrderEvent( const AbstractElementSet& elements,
00155                                Action action,
00156                                QObject* sender = 0,
00157                                Flags flags = NoFlags )
00158     : CElementSetEvent(ElementSetChangeOrder, elements, sender, flags),
00159       ElementOrderActionContainer(action) {}
00160 };
00161 
00162 
00163 #endif // ! ELEMENTDOCCONTROLLEREVENTS_H

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