]> git.cworth.org Git - vogl/blob - src/vogleditor/vogleditor_timelineitem.h
Initial vogl checkin
[vogl] / src / vogleditor / vogleditor_timelineitem.h
1 /**************************************************************************
2  *
3  * Copyright 2013-2014 RAD Game Tools and Valve Software
4  * All Rights Reserved.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to deal
8  * in the Software without restriction, including without limitation the rights
9  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10  * copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  *
24  **************************************************************************/
25
26 #ifndef VOGLEDITOR_TIMELINEITEM_H
27 #define VOGLEDITOR_TIMELINEITEM_H
28
29 #include <QList>
30 #include <QVariant>
31 #include <QAbstractItemModel>
32
33 class vogleditor_frameItem;
34 class vogleditor_apiCallItem;
35
36 class vogleditor_timelineItem
37 {
38 public:
39    vogleditor_timelineItem(float time, vogleditor_timelineItem* parent = 0);
40    vogleditor_timelineItem(float begin, float end, vogleditor_timelineItem *parent = 0);
41    ~vogleditor_timelineItem();
42
43    void appendChild(vogleditor_timelineItem *child);
44
45    vogleditor_timelineItem* child(int row);
46    vogleditor_timelineItem* parent();
47
48    int childCount() const;
49
50    QBrush* getBrush();
51
52    void setBrush(QBrush* brush);
53
54    float getBeginTime() const;
55    float getEndTime() const;
56    float getDuration() const;
57
58    float getMaxChildDuration() const;
59
60    bool isSpan() const;
61    bool isMarker() const;
62
63    vogleditor_frameItem* getFrameItem() const
64    {
65       return m_pFrameItem;
66    }
67
68    void setFrameItem(vogleditor_frameItem* pFrameItem)
69    {
70       m_pFrameItem = pFrameItem;
71    }
72
73    vogleditor_apiCallItem* getApiCallItem() const
74    {
75       return m_pApiCallItem;
76    }
77
78    void setApiCallItem(vogleditor_apiCallItem* pItem )
79    {
80       m_pApiCallItem = pItem;
81    }
82
83 private:
84     QBrush* m_brush;
85     float m_beginTime;
86     float m_endTime;
87     float m_duration;
88     bool m_isSpan;
89     float m_maxChildDuration;
90
91     QList<vogleditor_timelineItem*> childItems;
92
93     vogleditor_timelineItem* m_parentItem;
94     vogleditor_frameItem* m_pFrameItem;
95     vogleditor_apiCallItem* m_pApiCallItem;
96 };
97
98 #endif // VOGLEDITOR_TIMELINEITEM_H