]> sigrok.org Git - pulseview.git/blobdiff - pv/views/trace/viewitem.hpp
Implement expansion marker animation and its infrastructure
[pulseview.git] / pv / views / trace / viewitem.hpp
index 91242f57478e3bb9223bb8f01abf14118853c21a..423e75d2f313e38ec7cd156831c1119edaea47f8 100644 (file)
@@ -22,7 +22,9 @@
 
 #include <list>
 
+#include <QMouseEvent>
 #include <QPen>
+#include <QPoint>
 
 #include "viewitempaintparams.hpp"
 
@@ -52,12 +54,16 @@ public:
 public:
        ViewItem();
 
-public:
        /**
         * Returns true if the item is visible and enabled.
         */
        virtual bool enabled() const = 0;
 
+       /**
+        * Returns true if the item may be selected.
+        */
+       virtual bool is_selectable(QPoint pos) const;
+
        /**
         * Returns true if the item has been selected by the user.
         */
@@ -71,7 +77,7 @@ public:
        /**
         * Returns true if the item may be dragged/moved.
         */
-       virtual bool is_draggable() const;
+       virtual bool is_draggable(QPoint pos) const;
 
        /**
         * Returns true if the item is being dragged.
@@ -145,7 +151,6 @@ public:
         */
        virtual void paint_fore(QPainter &p, ViewItemPaintParams &pp);
 
-public:
        /**
         * Gets the text color.
         * @remarks This color is computed by comparing the lightness
@@ -155,14 +160,22 @@ public:
        static QColor select_text_color(QColor background);
 
 public:
-       virtual QMenu* create_context_menu(QWidget *parent);
+       virtual QMenu* create_header_context_menu(QWidget *parent);
 
-       virtual QMenu* create_view_context_menu(QWidget *parent);
+       virtual QMenu* create_view_context_menu(QWidget *parent, QPoint &click_pos);
 
        virtual pv::widgets::Popup* create_popup(QWidget *parent);
 
        virtual void delete_pressed();
 
+       virtual void hover_point_changed(const QPoint &hp);
+
+       /**
+        * Handles left mouse button press events.
+        * @param event the mouse event that triggered this handler.
+        */
+       virtual void mouse_left_press_event(const QMouseEvent* event);
+
 protected:
        static QPen highlight_pen();