]> sigrok.org Git - pulseview.git/blobdiff - pv/view/viewwidget.hpp
ViewWidget: Define ViewTypes
[pulseview.git] / pv / view / viewwidget.hpp
index 6fd1ecefd1f853a2403fc880cacb36c1c699a108..e6d2aa60125db71cba6fcb07b79403d4af90d4a7 100644 (file)
@@ -18,8 +18,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#ifndef PULSEVIEW_PV_VIEWWIDGET_H
-#define PULSEVIEW_PV_VIEWWIDGET_H
+#ifndef PULSEVIEW_PV_VIEWWIDGET_HPP
+#define PULSEVIEW_PV_VIEWWIDGET_HPP
 
 #include <memory>
 
@@ -30,6 +30,11 @@ class QTouchEvent;
 namespace pv {
 namespace view {
 
+enum ViewType {
+       TraceView,
+       TabularDecodeView
+};
+
 class View;
 class ViewItem;
 
@@ -40,6 +45,15 @@ class ViewWidget : public QWidget
 protected:
        ViewWidget(View &parent);
 
+       /**
+        * Indicates when a view item is being hovered over.
+        * @param item The item that is being hovered over, or @c nullptr
+        * if no view item is being hovered over.
+        * @remarks the default implementation does nothing.
+        */
+       virtual void item_hover(
+               const std::shared_ptr<pv::view::ViewItem> &item);
+
        /**
         * Indicates the event an a view item has been clicked.
         * @param item the view item that has been clicked.
@@ -112,12 +126,12 @@ protected:
         * Handles touch begin update and end events.
         * @param e the event that triggered this handler.
         */
-       virtual bool touch_event(QTouchEvent *e);
+       virtual bool touch_event(QTouchEvent *event);
 
 protected:
        bool event(QEvent *event);
 
-       void mousePressEvent(QMouseEvent * event);
+       void mousePressEvent(QMouseEvent *event);
        void mouseReleaseEvent(QMouseEvent *event);
        void mouseMoveEvent(QMouseEvent *event);
 
@@ -140,4 +154,4 @@ protected:
 } // namespace view
 } // namespace pv
 
-#endif // PULSEVIEW_PV_VIEWWIDGET_H
+#endif // PULSEVIEW_PV_VIEWWIDGET_HPP