vcs
vcsrevision.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef VCSREVISION_H
00023 #define VCSREVISION_H
00024
00025 #include "vcsexport.h"
00026 #include <QtCore/QVariant>
00027 class QStringList;
00028 class QString;
00029
00030 namespace KDevelop
00031 {
00032
00065 class KDEVPLATFORMVCS_EXPORT VcsRevision
00066 {
00067 public:
00068
00075 enum RevisionType
00076 {
00077 Special = 0 ,
00078 GlobalNumber = 1 ,
00079 FileNumber = 2 ,
00080 Date = 3,
00081 Invalid = 4 ,
00082 UserType = 1000
00083 };
00084 enum RevisionSpecialType
00085 {
00086 Head = 0 ,
00087 Working = 1 ,
00088 Base = 2 ,
00089 Previous = 3 ,
00090 Start = 4,
00091 UserSpecialType = 1000
00092 };
00093
00094 VcsRevision();
00095 virtual ~VcsRevision();
00096
00097 VcsRevision( const VcsRevision& );
00098
00099 VcsRevision& operator=( const VcsRevision& );
00100
00104 void setRevisionValue( const QVariant& rev, RevisionType type );
00105
00109 RevisionType revisionType() const;
00110
00121 QVariant revisionValue() const;
00122
00129 QString prettyValue() const;
00130
00131 bool operator==( const KDevelop::VcsRevision&) const;
00132
00136 static VcsRevision createSpecialRevision( VcsRevision::RevisionSpecialType type );
00137 protected:
00141 QStringList keys() const;
00146 QVariant getValue( const QString& key ) const;
00150 void setValue( const QString& key, const QVariant& value );
00151
00155 void setType( RevisionType t);
00156 void setSpecialType( RevisionSpecialType t);
00157 void setValue( const QVariant& );
00158
00159
00160 private:
00161 class VcsRevisionPrivate* const d;
00162 };
00163
00164 KDEVPLATFORMVCS_EXPORT uint qHash( const KDevelop::VcsRevision& rev);
00165
00166 }
00167
00168 Q_DECLARE_METATYPE(KDevelop::VcsRevision)
00169 Q_DECLARE_METATYPE(KDevelop::VcsRevision::RevisionSpecialType)
00170
00171
00172
00173 #endif
00174