1 /* This file is part of KDevelop
3 * Copyright 2007 Andreas Pakulat <apaku@gmx.de>
4 * Copyright 2007 Matthew Woehlke <mw_triad@users.sourceforge.net>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 #include <QtCore/QVariant>
27 #include "vcsexport.h"
31 template <typename T
> class QList
;
38 * Small container class that contains information about a history event of a
39 * single repository item.
41 class KDEVPLATFORMVCS_EXPORT VcsItemEvent
45 * Class that tells you what happened to a given repository location in a
48 * Combinations of some of the flags are possible, for example Add|Modified,
49 * Copy|Modified or Merge|Modified, or when returned from VcsEvent::actions().
53 Added
= 1<<0 /**< Item was added. */,
54 Deleted
= 1<<1 /**< Item was deleted. */,
55 Modified
= 1<<2 /**< Item was modified, for example by editing. */,
56 Copied
= 1<<3 /**< Item was copied. */,
57 Merged
= 1<<4 /**< Item had changes merged into it. */,
58 ContentsModified
= 1<<5 /**< Directory was not changed (only contents changed). */,
59 Replaced
= 1<<6 /**< Item was replaced. */
61 Q_DECLARE_FLAGS( Actions
, Action
)
64 virtual ~VcsItemEvent();
65 VcsItemEvent(const VcsItemEvent
& );
67 QString
repositoryLocation() const;
68 QString
repositoryCopySourceLocation() const; // may be empty
69 VcsRevision
repositoryCopySourceRevision() const; // may be invalid, even if rCSL is not
70 VcsRevision
revision() const; // the FileNumber revision, may be the same as the GlobalNumber
71 Actions
actions() const;
73 void setRepositoryLocation( const QString
& );
74 void setRepositoryCopySourceLocation( const QString
& );
75 void setRevision( const KDevelop::VcsRevision
& );
76 void setRepositoryCopySourceRevision( const KDevelop::VcsRevision
& );
77 void setActions( Actions
);
79 VcsItemEvent
& operator=( const VcsItemEvent
& rhs
);
81 class VcsItemEventPrivate
* const d
;
85 * Small container class that contains information about a single revision.
87 * @note log() only returns information about the specific item that was asked
88 * about. When working with a VCS that supports atomic commits (i.e. where a
89 * revision might affect more than one item), use change() to retrieve
90 * information about all items affected by a particular revision.
92 class KDEVPLATFORMVCS_EXPORT VcsEvent
97 VcsEvent( const VcsEvent
& );
98 VcsRevision
revision();
102 VcsItemEvent::Actions
actions();
103 QList
<VcsItemEvent
> items();
105 void setRevision( const VcsRevision
& );
106 void setAuthor( const QString
& );
107 void setDate( const QDateTime
& );
108 void setMessage(const QString
& );
109 void setActions( VcsItemEvent::Actions
);
110 void setItems( const QList
<VcsItemEvent
>& );
111 VcsEvent
& operator=( const VcsEvent
& rhs
);
113 class VcsEventPrivate
* const d
;
118 Q_DECLARE_OPERATORS_FOR_FLAGS( KDevelop::VcsItemEvent::Actions
)
119 Q_DECLARE_METATYPE( KDevelop::VcsEvent
)
120 Q_DECLARE_METATYPE( KDevelop::VcsItemEvent
)