File indexing completed on 2024-06-02 05:51:44

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 "libkommit_export.h"
0009 #include <QList>
0010 
0011 namespace Git
0012 {
0013 
0014 namespace Impl
0015 {
0016 struct LanesFactory;
0017 }
0018 
0019 class LIBKOMMIT_EXPORT GraphLane
0020 {
0021 public:
0022     enum Type { None, Start, Pipe, Node, End, Transparent, Test };
0023     GraphLane();
0024     GraphLane(Type type);
0025 
0026     Q_REQUIRED_RESULT Type type() const;
0027     const QList<int> &bottomJoins() const;
0028     const QList<int> &upJoins() const;
0029     void setType(Type newType);
0030 
0031 private:
0032     void generateRandomColor();
0033 
0034     Type mType{None};
0035     QList<int> mBottomJoins;
0036     QList<int> mUpJoins;
0037 
0038     friend class LogList;
0039     friend struct LanesFactory;
0040     friend struct Impl::LanesFactory;
0041 };
0042 bool operator==(const GraphLane &, const GraphLane &);
0043 
0044 }