src/qvcore/qvpropertycontainerchange.h

Go to the documentation of this file.
00001 /*
00002  *      Copyright (C) 2007, 2008. PARP Research Group.
00003  *      <http://perception.inf.um.es>
00004  *      University of Murcia, Spain.
00005  *
00006  *      This file is part of the QVision library.
00007  *
00008  *      QVision is free software: you can redistribute it and/or modify
00009  *      it under the terms of the GNU Lesser General Public License as
00010  *      published by the Free Software Foundation, version 3 of the License.
00011  *
00012  *      QVision is distributed in the hope that it will be useful,
00013  *      but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *      GNU Lesser General Public License for more details.
00016  *
00017  *      You should have received a copy of the GNU Lesser General Public
00018  *      License along with QVision. If not, see <http://www.gnu.org/licenses/>.
00019  */
00020 
00024 
00025 #ifndef QVPROPERTYCONTAINERCHANGE_H
00026 #define QVPROPERTYCONTAINERCHANGE_H
00027 
00028 #include <QObject>
00029 class QVPropertyContainer;
00030 
00041 class QVPropertyContainerChange : public QObject
00042 {
00043 Q_OBJECT
00044 
00045 public:
00059         typedef enum {None, Name, /*ContainerAdd, */ContainerDel, PropertyAdd, PropertyDel, PropertyValue, LinkAdd, LinkDel, All} ChangeType;
00060 
00063         QVPropertyContainerChange():
00064                         QObject(), sourceName(""), origName(""), destName(""), changeType(None), propName(""), destPropName(""), sinchronous(FALSE)
00065                 { }
00066 
00070         QVPropertyContainerChange(const QVPropertyContainerChange &other):
00071                         QObject(), sourceName(other.sourceName), origName(other.origName), destName(other.destName), changeType(other.changeType),
00072                         propName(other.propName), destPropName(other.destPropName), sinchronous(other.sinchronous)
00073                 { }
00074 
00083         QVPropertyContainerChange(const QVPropertyContainer * container, const ChangeType type, const QString prop = QString());
00084 
00096         QVPropertyContainerChange(      const QVPropertyContainer * container,
00097                                                                 const ChangeType type,
00098                                                                 const QString contOrig,
00099                                                                 const QString propOrig,
00100                                                                 const QString contDest,
00101                                                                 const QString propDest,
00102                                                                 const bool sinc = FALSE);
00103 
00104 
00107         const QVPropertyContainer * getSource() const { return source; }
00108 
00111         const QString getSourceName() const { return sourceName; }
00112 
00115         const QString getOrigName() const { return origName; }
00116 
00119         const QString getDestName() const { return destName; }
00120 
00123         const ChangeType getChangeType() const { return changeType; }
00124 
00127         const QString getPropName() const { return propName; }
00128 
00131         const QString getOrigProp() const { return propName; }
00132 
00135         const QString getDestProp() const { return destPropName; }
00136 
00139         const bool isSinc() const { return sinchronous; }
00140 
00143         QString toString() const;
00144 
00145 
00146 private:
00147         const QVPropertyContainer *source;
00148         QString sourceName, origName, destName;
00149         const ChangeType changeType;
00150         const QString propName, destPropName;
00151         const bool sinchronous;
00152 
00153 };
00154 #endif
00155