File indexing completed on 2025-01-19 04:22:45
0001 /* 0002 SPDX-FileCopyrightText: 2021 Hamed Masafi <hamed.masfi@gmail.com> 0003 0004 SPDX-License-Identifier: GPL-3.0-or-later 0005 */ 0006 0007 #pragma once 0008 #include "gitgraphlane.h" 0009 #include "libkommit_export.h" 0010 #include <QDateTime> 0011 #include <QString> 0012 #include <QVector> 0013 0014 namespace Git 0015 { 0016 0017 class LIBKOMMIT_EXPORT Log 0018 { 0019 public: 0020 enum CommitType { NormalCommit, InitialCommit, ForkCommit, MergeCommit }; 0021 0022 Log(); 0023 Log(QString authorName, 0024 QString authorEmail, 0025 QDateTime authDate, 0026 QString committerName, 0027 QString committerEmail, 0028 QDateTime commitDate, 0029 QString message, 0030 QString subject, 0031 QString body, 0032 QString commitHash, 0033 QStringList parentHash); 0034 ~Log(); 0035 0036 Q_REQUIRED_RESULT const QString &authorName() const; 0037 Q_REQUIRED_RESULT const QString &authorEmail() const; 0038 Q_REQUIRED_RESULT const QDateTime &authDate() const; 0039 Q_REQUIRED_RESULT const QString &committerName() const; 0040 Q_REQUIRED_RESULT const QString &committerEmail() const; 0041 Q_REQUIRED_RESULT const QDateTime &commitDate() const; 0042 Q_REQUIRED_RESULT const QString &message() const; 0043 Q_REQUIRED_RESULT const QString &subject() const; 0044 Q_REQUIRED_RESULT const QString &body() const; 0045 Q_REQUIRED_RESULT const QString &commitHash() const; 0046 Q_REQUIRED_RESULT const QStringList &parents() const; 0047 Q_REQUIRED_RESULT const QString &refLog() const; 0048 Q_REQUIRED_RESULT const QString &branch() const; 0049 Q_REQUIRED_RESULT const QString &extraData() const; 0050 Q_REQUIRED_RESULT CommitType type() const; 0051 const QVector<GraphLane> &lanes() const; 0052 0053 Q_REQUIRED_RESULT const QStringList &childs() const; 0054 0055 Q_REQUIRED_RESULT const QString &commitShortHash() const; 0056 0057 private: 0058 QString mAuthorName; 0059 QString mAuthorEmail; 0060 QDateTime mAuthDate; 0061 QString mCommitterName; 0062 QString mCommitterEmail; 0063 QDateTime mCommitDate; 0064 QString mMessage; 0065 QString mSubject; 0066 QString mBody; 0067 QString mCommitHash; 0068 QString mCommitShortHash; 0069 QStringList mParentHash; 0070 QString mRefLog; 0071 QString mBranch; 0072 QString mExtraData; 0073 CommitType mType; 0074 QVector<GraphLane> mLanes; 0075 QStringList mChilds; 0076 0077 friend class LogList; 0078 friend class GitManager; 0079 friend class LogsModel; 0080 }; 0081 0082 }