]> sigrok.org Git - pulseview.git/blobdiff - pv/view/viewitem.hpp
Added ViewItemOwner
[pulseview.git] / pv / view / viewitem.hpp
index eb0823e47e8f1b55b897597a0c8bf14a0b960742..dd3d2aa0c2c61a4969a53c6a5fc899cb5c7e802b 100644 (file)
@@ -18,8 +18,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#ifndef PULSEVIEW_PV_VIEWITEM_H
-#define PULSEVIEW_PV_VIEWITEM_H
+#ifndef PULSEVIEW_PV_VIEWITEM_HPP
+#define PULSEVIEW_PV_VIEWITEM_HPP
 
 #include <list>
 
 
 #include <list>
 
@@ -39,6 +39,8 @@ class Popup;
 
 namespace view {
 
 
 namespace view {
 
+class ViewItemOwner;
+
 class ViewItem : public QObject
 {
        Q_OBJECT
 class ViewItem : public QObject
 {
        Q_OBJECT
@@ -100,6 +102,14 @@ public:
         */
        virtual QRectF label_rect(const QRectF &rect) const = 0;
 
         */
        virtual QRectF label_rect(const QRectF &rect) const = 0;
 
+       /**
+        * Computes the outline rectangle of the viewport hit-box.
+        * @param rect the rectangle of the viewport area.
+        * @return Returns the rectangle of the hit-box.
+        * @remarks The default implementation returns an empty hit-box.
+        */
+       virtual QRectF hit_box_rect(const QRectF &rect) const;
+
        /**
         * Paints the signal label.
         * @param p the QPainter to paint into.
        /**
         * Paints the signal label.
         * @param p the QPainter to paint into.
@@ -141,7 +151,7 @@ public:
 public:
        virtual QMenu* create_context_menu(QWidget *parent);
 
 public:
        virtual QMenu* create_context_menu(QWidget *parent);
 
-       virtual pv::widgets::Popup* create_popup(QWidget *parent) = 0;
+       virtual pv::widgets::Popup* create_popup(QWidget *parent);
 
        virtual void delete_pressed();
 
 
        virtual void delete_pressed();
 
@@ -159,4 +169,4 @@ private:
 } // namespace view
 } // namespace pv
 
 } // namespace view
 } // namespace pv
 
-#endif // PULSEVIEW_PV_VIEWITEM_H
+#endif // PULSEVIEW_PV_VIEWITEM_HPP