File indexing completed on 2024-04-28 05:42:09
0001 /*************************************************************************** 0002 * Copyright (C) 2008-2009 by Rajko Albrecht ral@alwins-world.de * 0003 * https://kde.org/applications/development/org.kde.kdesvn * 0004 * * 0005 * This program is free software; you can redistribute it and/or * 0006 * modify it under the terms of the GNU Lesser General Public * 0007 * License as published by the Free Software Foundation; either * 0008 * version 2.1 of the License, or (at your option) any later version. * 0009 * * 0010 * This program is distributed in the hope that it will be useful, * 0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 0013 * Lesser General Public License for more details. * 0014 * * 0015 * You should have received a copy of the GNU Lesser General Public * 0016 * License along with this program (in the file LGPL.txt); if not, * 0017 * write to the Free Software Foundation, Inc., 51 Franklin St, * 0018 * Fifth Floor, Boston, MA 02110-1301 USA * 0019 * * 0020 * This software consists of voluntary contributions made by many * 0021 * individuals. For exact contribution history, see the revision * 0022 * history and logs, available at https://commits.kde.org/kdesvn. * 0023 ***************************************************************************/ 0024 #ifndef SVNCONFLICTDESCRIPTION_H 0025 #define SVNCONFLICTDESCRIPTION_H 0026 0027 struct svn_wc_conflict_description_t; 0028 struct svn_wc_conflict_description2_t; 0029 0030 #include <svn_types.h> 0031 #include <svnqt/pool.h> 0032 #include <svnqt/svnqt_defines.h> 0033 0034 #include <QSharedPointer> 0035 #include <QString> 0036 #include <QVector> 0037 0038 namespace svn 0039 { 0040 0041 /** Wrapper for svn_wc_conflict_description_t 0042 * does nothing when build against subversion prior 1.5 0043 * @since subversion 1.5 0044 * @author Rajko Albrecht (ral@alwins-world.de) 0045 */ 0046 class SVNQT_EXPORT ConflictDescription 0047 { 0048 public: 0049 enum class ConflictType { Text, Property, Tree }; 0050 enum class ConflictReason { Edited, Obstructed, Deleted, Missing, Unversioned, Added, Replaced, MovedAway, MovedHere }; 0051 enum class ConflictAction { Edit, Add, Delete, Replace }; 0052 explicit ConflictDescription(const svn_wc_conflict_description_t *); 0053 explicit ConflictDescription(const svn_wc_conflict_description2_t *); 0054 ~ConflictDescription(); 0055 0056 ConflictAction action() const; 0057 ConflictType Type() const; 0058 ConflictReason reason() const; 0059 svn_node_kind_t nodeKind() const; 0060 bool binary() const; 0061 const QString &baseFile() const; 0062 const QString &theirFile() const; 0063 const QString &propertyName() const; 0064 const QString &Path() const; 0065 const QString &myFile() const; 0066 const QString &mimeType() const; 0067 const QString &mergedFile() const; 0068 0069 //! don't use it. 0070 ConflictDescription(const ConflictDescription &) = delete; 0071 ConflictDescription &operator=(const ConflictDescription &) = delete; 0072 0073 protected: 0074 void init(); 0075 0076 protected: 0077 Pool m_pool; 0078 bool m_binary; 0079 ConflictAction m_action; 0080 ConflictType m_Type; 0081 ConflictReason m_reason; 0082 QString m_baseFile; 0083 QString m_mergedFile; 0084 QString m_mimeType; 0085 QString m_myFile; 0086 QString m_Path; 0087 QString m_propertyName; 0088 QString m_theirFile; 0089 svn_node_kind_t m_nodeKind; 0090 }; 0091 0092 typedef QSharedPointer<ConflictDescription> ConflictDescriptionP; 0093 typedef QVector<ConflictDescriptionP> ConflictDescriptionList; 0094 0095 } 0096 0097 #endif