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
22 #ifndef VCSSTATUSINFO_H
23 #define VCSSTATUSINFO_H
25 #include <QtCore/QVariant>
29 #include "vcsexport.h"
39 * Class that encapsulates status information
42 * The extendedState functions allow to transport
43 * extended status information
45 * Note for VCS implementations:
46 * If you want to use this class in queued signal/slot connections
47 * you should call qRegisterMetaType<KDevelop::VcsStatusInfo>()
48 * in the constructor of the plugin class
50 class KDEVPLATFORMVCS_EXPORT VcsStatusInfo
54 * Status of a local file
58 ItemUnknown
= 0 /**< No VCS information about a file is known (or file is not under VCS control). */,
59 ItemUpToDate
= 1 /**< Item was updated or it is already at up to date version. */,
60 ItemAdded
= 2 /**< Item was added to the repository but not committed. */,
61 ItemModified
= 3 /**< Item was modified locally. */,
62 ItemDeleted
= 4 /**< Item is scheduled to be deleted. */,
63 ItemAddedIndex
= 5 /**< Item is added to index (DVCS only). */,
64 ItemModifiedIndex
= 6 /**< Item's modifications are added to index (DVCS only) */,
65 ItemDeletedIndex
= 7 /**< Item was deleted from the index (DVCS only) */,
66 ItemHasConflicts
= 8 /**< Local version has conflicts that need to be resolved before commit. */,
67 ItemUserState
= 1000 /**< special states for individual vcs implementations should use this as base. */
71 virtual ~VcsStatusInfo();
72 VcsStatusInfo(const VcsStatusInfo
&);
75 * retrieves the url of this status information item
80 * Change the url of this status information item
83 void setUrl( const KUrl
& );
85 VcsStatusInfo::State
state() const;
86 void setState( VcsStatusInfo::State
);
88 int extendedState() const;
89 void setExtendedState( int );
91 VcsStatusInfo
& operator=( const VcsStatusInfo
& rhs
);
92 bool operator==( const KDevelop::VcsStatusInfo
& rhs
) const;
93 bool operator!=( const KDevelop::VcsStatusInfo
& rhs
) const;
96 class VcsStatusInfoPrivate
* d
;
101 Q_DECLARE_METATYPE( KDevelop::VcsStatusInfo
)