]> sigrok.org Git - pulseview.git/blobdiff - pv/view/timeitem.hpp
DecodeTrace: Let the view know when we need more space
[pulseview.git] / pv / view / timeitem.hpp
index ff2664a664b17a7163574c446a217304845406a3..cd6f5f2499c428555189257482e118fd4ab57709 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#ifndef PULSEVIEW_PV_VIEW_TIMEITEM_H
-#define PULSEVIEW_PV_VIEW_TIMEITEM_H
+#ifndef PULSEVIEW_PV_VIEW_TIMEITEM_HPP
+#define PULSEVIEW_PV_VIEW_TIMEITEM_HPP
 
-#include "selectableitem.hpp"
+#include "viewitem.hpp"
 
 namespace pv {
 namespace view {
 
 class View;
 
-class TimeItem : public SelectableItem
+class TimeItem : public ViewItem
+
 {
        Q_OBJECT
 
@@ -43,10 +44,16 @@ public:
        /**
         * Sets the time of the marker.
         */
-       virtual void set_time(double time) = 0;
+       virtual void set_time(const pv::util::Timestamp& time) = 0;
 
        virtual float get_x() const = 0;
 
+       /**
+        * Drags the item to a delta relative to the drag point.
+        * @param delta the offset from the drag point.
+        */
+       void drag_by(const QPoint &delta);
+
 protected:
        View &view_;
 };
@@ -54,4 +61,4 @@ protected:
 } // namespace view
 } // namespace pv
 
-#endif // PULSEVIEW_PV_VIEW_TIMEITEM_H
+#endif // PULSEVIEW_PV_VIEW_TIMEITEM_HPP