X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;ds=sidebyside;f=pv%2Fview%2Fflag.hpp;fp=pv%2Fview%2Fflag.hpp;h=659d5cc1c55143aaa88bf45113f980f9a2483cf9;hb=8914fe790fb677c56194a3ae4da06ba671fca78a;hp=0000000000000000000000000000000000000000;hpb=98cfe4e8dadad2cf710eb46fd5c85d9d0520a875;p=pulseview.git diff --git a/pv/view/flag.hpp b/pv/view/flag.hpp new file mode 100644 index 0000000..659d5cc --- /dev/null +++ b/pv/view/flag.hpp @@ -0,0 +1,72 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2014 Joel Holdsworth + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef PULSEVIEW_PV_VIEW_FLAG_H +#define PULSEVIEW_PV_VIEW_FLAG_H + +#include "timemarker.hpp" + +namespace pv { +namespace view { + +class Flag : public TimeMarker +{ + Q_OBJECT + +public: + static const QColor FillColour; + +public: + /** + * Constructor. + * @param view A reference to the view that owns this cursor pair. + * @param time The time to set the flag to. + * @param text The text of the marker. + */ + Flag(View &view, double time, const QString &text); + + /** + * Copy constructor. + */ + Flag(const Flag &flag); + + /** + * Returns true if the item is visible and enabled. + */ + bool enabled() const; + + /** + * Gets the text to show in the marker. + */ + QString get_text() const; + + pv::widgets::Popup* create_popup(QWidget *parent); + +private Q_SLOTS: + void on_text_changed(const QString &text); + +private: + QString text_; +}; + +} // namespace view +} // namespace pv + +#endif // PULSEVIEW_PV_VIEW_FLAG_H