]> sigrok.org Git - pulseview.git/blobdiff - pv/views/trace/flag.hpp
Session: Fix issue #67 by improving error handling
[pulseview.git] / pv / views / trace / flag.hpp
index 2df13ca805e3ee74e5a185a372fc55049c7c8c80..eb4bf87c6008d9f84f737e1dd4a0086812ce47e7 100644 (file)
@@ -17,8 +17,8 @@
  * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef PULSEVIEW_PV_VIEWS_TRACEVIEW_FLAG_HPP
-#define PULSEVIEW_PV_VIEWS_TRACEVIEW_FLAG_HPP
+#ifndef PULSEVIEW_PV_VIEWS_TRACE_FLAG_HPP
+#define PULSEVIEW_PV_VIEWS_TRACE_FLAG_HPP
 
 #include <memory>
 
@@ -41,7 +41,7 @@ class Flag : public TimeMarker, public enable_shared_from_this<Flag>
        Q_OBJECT
 
 public:
-       static const QColor FillColour;
+       static const QColor FillColor;
 
 public:
        /**
@@ -60,18 +60,31 @@ public:
        /**
         * Returns true if the item is visible and enabled.
         */
-       bool enabled() const;
+       virtual bool enabled() const override;
 
        /**
-        * Gets the text to show in the marker.
+        * Gets the current text to show in the marker - this may be dynamic.
         */
-       QString get_text() const;
+       virtual QString get_display_text() const override;
 
-       pv::widgets::Popup* create_popup(QWidget *parent);
+       /**
+        * Gets the default text used to show the marker - e.g. the user-editable
+        * name.
+        */
+       virtual QString get_text() const override;
+
+       /**
+        * Sets the text to show in the marker.
+        */
+       virtual void set_text(const QString &text) override;
+
+       virtual pv::widgets::Popup* create_popup(QWidget *parent) override;
+
+       virtual QMenu* create_header_context_menu(QWidget *parent) override;
 
-       QMenu* create_context_menu(QWidget *parent);
+       virtual void delete_pressed() override;
 
-       void delete_pressed();
+       QRectF label_rect(const QRectF &rect) const override;
 
 private Q_SLOTS:
        void on_delete();
@@ -86,4 +99,4 @@ private:
 } // namespace views
 } // namespace pv
 
-#endif // PULSEVIEW_PV_VIEWS_TRACEVIEW_FLAG_HPP
+#endif // PULSEVIEW_PV_VIEWS_TRACE_FLAG_HPP