Mercurial > hg > easyhg
comparison src/connectionitem.h @ 370:b9c153e00e84
Move source files to src/
author | Chris Cannam |
---|---|
date | Thu, 24 Mar 2011 10:27:51 +0000 |
parents | connectionitem.h@8fd71f570884 |
children | 2981d2defa61 |
comparison
equal
deleted
inserted
replaced
369:19cce6d2c470 | 370:b9c153e00e84 |
---|---|
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ | |
2 | |
3 /* | |
4 EasyMercurial | |
5 | |
6 Based on HgExplorer by Jari Korhonen | |
7 Copyright (c) 2010 Jari Korhonen | |
8 Copyright (c) 2011 Chris Cannam | |
9 Copyright (c) 2011 Queen Mary, University of London | |
10 | |
11 This program is free software; you can redistribute it and/or | |
12 modify it under the terms of the GNU General Public License as | |
13 published by the Free Software Foundation; either version 2 of the | |
14 License, or (at your option) any later version. See the file | |
15 COPYING included with this distribution for more information. | |
16 */ | |
17 | |
18 #ifndef CONNECTIONITEM_H | |
19 #define CONNECTIONITEM_H | |
20 | |
21 #include <QGraphicsItem> | |
22 | |
23 class Connection; | |
24 | |
25 class ChangesetItem; | |
26 class UncommittedItem; | |
27 | |
28 class ConnectionItem : public QGraphicsItem | |
29 { | |
30 public: | |
31 enum Type { | |
32 Normal, | |
33 Split, | |
34 Merge | |
35 }; | |
36 | |
37 ConnectionItem() : m_type(Normal), m_parent(0), m_child(0) { } | |
38 | |
39 virtual QRectF boundingRect() const; | |
40 virtual void paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *); | |
41 | |
42 Type connectionType() const { return m_type; } | |
43 void setConnectionType(Type t) { m_type = t; } | |
44 | |
45 //!!! deletion signals from parent/child? | |
46 | |
47 ChangesetItem *parent() { return m_parent; } | |
48 ChangesetItem *child() { return m_child; } | |
49 | |
50 void setParent(ChangesetItem *p) { m_parent = p; } | |
51 void setChild(ChangesetItem *c) { m_child = c; } | |
52 void setChild(UncommittedItem *u) { m_uncommitted = u; } | |
53 | |
54 private: | |
55 Type m_type; | |
56 ChangesetItem *m_parent; | |
57 ChangesetItem *m_child; | |
58 UncommittedItem *m_uncommitted; | |
59 }; | |
60 | |
61 #endif // CONNECTIONITEM_H |