* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef PULSEVIEW_PV_VIEW_DECODE_ANNOTATION_HPP
-#define PULSEVIEW_PV_VIEW_DECODE_ANNOTATION_HPP
+#ifndef PULSEVIEW_PV_DATA_DECODE_ANNOTATION_HPP
+#define PULSEVIEW_PV_DATA_DECODE_ANNOTATION_HPP
-#include <stdint.h>
+#include <cstdint>
+#include <vector>
+#include <QColor>
#include <QString>
+#include "pv/data/decode/row.hpp"
+
using std::vector;
struct srd_proto_data;
namespace data {
namespace decode {
+class RowData;
+
class Annotation
{
public:
- Annotation(const srd_proto_data *const pdata);
+ Annotation(uint64_t start_sample, uint64_t end_sample,
+ const vector<QString>* texts, uint32_t ann_class_id, const RowData *data);
+ Annotation(Annotation&& a);
+ Annotation& operator=(Annotation&& a);
+
+ const RowData* row_data() const;
+ const Row* row() const;
uint64_t start_sample() const;
uint64_t end_sample() const;
- int format() const;
- const vector<QString>& annotations() const;
+ uint64_t length() const;
+
+ uint32_t ann_class_id() const;
+ const QString ann_class_name() const;
+ const QString ann_class_description() const;
+
+ const vector<QString>* annotations() const;
+ const QString longest_annotation() const;
+
+ bool visible() const;
+
+ const QColor color() const;
+ const QColor bright_color() const;
+ const QColor dark_color() const;
+
+ bool operator<(const Annotation &other) const;
private:
uint64_t start_sample_;
uint64_t end_sample_;
- int format_;
- vector<QString> annotations_;
+ const vector<QString>* texts_;
+ uint32_t ann_class_id_;
+ const RowData* data_;
};
} // namespace decode
} // namespace data
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_DECODE_ANNOTATION_HPP
+#endif // PULSEVIEW_PV_DATA_DECODE_ANNOTATION_HPP