File indexing completed on 2024-05-12 17:16:22

0001 /***************************************************************************
0002  *   Copyright (C) 2008-2009 by Rajko Albrecht  ral@alwins-world.de        *
0003  *   http://kdesvn.alwins-world.de/                                        *
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 http://kdesvn.alwins-world.de.           *
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 <svnqt/pool.h>
0031 #include <svnqt/svnqt_defines.h>
0032 #include <svn_types.h>
0033 
0034 #include <QString>
0035 #include <QSharedPointer>
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 {
0050         Text,
0051         Property,
0052         Tree
0053     };
0054     enum class ConflictReason {
0055         Edited,
0056         Obstructed,
0057         Deleted,
0058         Missing,
0059         Unversioned,
0060         Added,
0061         Replaced,
0062         MovedAway,
0063         MovedHere
0064     };
0065     enum class ConflictAction {
0066         Edit,
0067         Add,
0068         Delete,
0069         Replace
0070     };
0071     explicit ConflictDescription(const svn_wc_conflict_description_t *);
0072     explicit ConflictDescription(const svn_wc_conflict_description2_t *);
0073     ~ConflictDescription();
0074 
0075     ConflictAction action() const;
0076     ConflictType Type() const;
0077     ConflictReason reason() const;
0078     svn_node_kind_t nodeKind() const;
0079     bool binary() const;
0080     const QString &baseFile() const;
0081     const QString &theirFile() const;
0082     const QString &propertyName() const;
0083     const QString &Path() const;
0084     const QString &myFile() const;
0085     const QString &mimeType() const;
0086     const QString &mergedFile() const;
0087 
0088     //! don't use it.
0089     ConflictDescription(const ConflictDescription &) = delete;
0090     ConflictDescription &operator=(const ConflictDescription &) = delete;
0091 protected:
0092     void init();
0093 protected:
0094     Pool m_pool;
0095     bool m_binary;
0096     ConflictAction m_action;
0097     ConflictType m_Type;
0098     ConflictReason m_reason;
0099     QString m_baseFile;
0100     QString m_mergedFile;
0101     QString m_mimeType;
0102     QString m_myFile;
0103     QString m_Path;
0104     QString m_propertyName;
0105     QString m_theirFile;
0106     svn_node_kind_t m_nodeKind;
0107 };
0108 
0109 typedef QSharedPointer<ConflictDescription> ConflictDescriptionP;
0110 typedef QVector<ConflictDescriptionP> ConflictDescriptionList;
0111 
0112 }
0113 
0114 #endif