]> git.cworth.org Git - apitrace/blob - gui/graphing/graphing.h
d3dretrace: Use DirectXTex for d3d10 state too.
[apitrace] / gui / graphing / graphing.h
1 #ifndef GRAPHING_H
2 #define GRAPHING_H
3
4 #include <QString>
5
6 /**
7  * A simple struct to hold a horizontal or vertical selection
8  */
9 struct SelectionState {
10     enum SelectionType {
11         None,
12         Horizontal,
13         Vertical
14     };
15
16     SelectionType type;
17     qint64 start;
18     qint64 end;
19 };
20
21
22 /**
23  * Fairly generic data provider for graphs
24  */
25 class GraphDataProvider {
26 public:
27     virtual ~GraphDataProvider(){}
28
29     /* Number of elements in graph */
30     virtual qint64 size() const = 0;
31
32     /* Returns value for index */
33     virtual qint64 value(qint64 index) const = 0;
34
35     /* Is the item at index selected */
36     virtual bool selected(qint64 index) const = 0;
37
38     /* Get mouse hover tooltip for item */
39     virtual QString itemTooltip(qint64 index) const = 0;
40
41     /* Called on item double click */
42     virtual void itemDoubleClicked(qint64 index) const = 0;
43
44     /* Set pointer to selection state */
45     virtual void setSelectionState(SelectionState* state) = 0;
46 };
47
48 #endif