File indexing completed on 2024-05-19 05:45:02
0001 /*************************************************************************** 0002 * Copyright (C) 2005-2009 by Rajko Albrecht * 0003 * ral@alwins-world.de * 0004 * * 0005 * This program is free software; you can redistribute it and/or modify * 0006 * it under the terms of the GNU General Public License as published by * 0007 * the Free Software Foundation; either version 2 of the License, or * 0008 * (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 * 0013 * GNU General Public License for more details. * 0014 * * 0015 * You should have received a copy of the GNU General Public License * 0016 * along with this program; if not, write to the * 0017 * Free Software Foundation, Inc., * 0018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 0019 ***************************************************************************/ 0020 0021 #ifndef COMMITMODELHELPER_H 0022 #define COMMITMODELHELPER_H 0023 0024 #include "svnqt/svnqttypes.h" 0025 0026 #include <QString> 0027 0028 class CommitActionEntry 0029 { 0030 public: 0031 enum ACTION_TYPE { 0032 COMMIT = 1, 0033 ADD_COMMIT = 2, 0034 DELETE = 4, 0035 MISSING_DELETE = 8, 0036 0037 ALL = COMMIT | ADD_COMMIT | DELETE | MISSING_DELETE, 0038 }; 0039 Q_FLAGS(ACTION_TYPE) 0040 Q_DECLARE_FLAGS(ActionTypes, ACTION_TYPE) 0041 0042 CommitActionEntry() = default; 0043 CommitActionEntry(const QString &name, const QString &actiondesc, ACTION_TYPE kind = COMMIT) 0044 : _name(name) 0045 , _actionDesc(actiondesc) 0046 , _kind(kind) 0047 { 0048 } 0049 0050 QString action() const 0051 { 0052 return _actionDesc; 0053 } 0054 QString name() const 0055 { 0056 return _name; 0057 } 0058 ACTION_TYPE type() const 0059 { 0060 return _kind; 0061 } 0062 0063 protected: 0064 QString _name; 0065 QString _actionDesc; 0066 ACTION_TYPE _kind = COMMIT; 0067 }; 0068 0069 class CommitModelNode 0070 { 0071 public: 0072 explicit CommitModelNode(const svn::CommitItem &); 0073 explicit CommitModelNode(const CommitActionEntry &, bool checked); 0074 0075 ~CommitModelNode(); 0076 0077 void setCheckable(bool how) 0078 { 0079 m_Checkable = how; 0080 } 0081 bool checkable() const 0082 { 0083 return m_Checkable; 0084 } 0085 0086 void setChecked(bool how) 0087 { 0088 m_Checked = how; 0089 } 0090 bool checked() const 0091 { 0092 return m_Checked; 0093 } 0094 0095 const CommitActionEntry &actionEntry() const 0096 { 0097 return m_Content; 0098 } 0099 0100 protected: 0101 CommitActionEntry m_Content; 0102 bool m_Checkable; 0103 bool m_Checked; 0104 }; 0105 0106 #endif