Chris@0: Chris@0: /* -*- c-basic-offset: 4 -*- vi:set ts=8 sts=4 sw=4: */ Chris@0: Chris@0: /* Chris@0: A waveform viewer and audio annotation editor. Chris@5: Chris Cannam, Queen Mary University of London, 2005-2006 Chris@0: Chris@0: This is experimental software. Not for distribution. Chris@0: */ Chris@0: Chris@0: #ifndef _PANE_H_ Chris@0: #define _PANE_H_ Chris@0: Chris@0: #include Chris@0: #include Chris@0: Chris@0: #include "base/ZoomConstraint.h" Chris@0: #include "base/View.h" Chris@13: #include "base/Selection.h" Chris@0: Chris@0: class QWidget; Chris@0: class QPaintEvent; Chris@0: class Layer; Chris@0: Chris@0: class Pane : public View Chris@0: { Chris@0: Q_OBJECT Chris@0: Chris@0: public: Chris@0: Pane(QWidget *parent = 0); Chris@34: virtual QString getPropertyContainerIconName() const { return "pane"; } Chris@0: Chris@0: virtual bool shouldIlluminateLocalFeatures(const Layer *layer, QPoint &pos); Chris@0: Chris@0: void setCentreLineVisible(bool visible); Chris@0: bool getCentreLineVisible() const { return m_centreLineVisible; } Chris@0: Chris@8: virtual QString toXmlString(QString indent = "", Chris@8: QString extraAttributes = "") const; Chris@8: Chris@0: signals: Chris@0: void paneInteractedWith(); Chris@0: Chris@13: public slots: Chris@13: virtual void toolModeChanged(); Chris@13: Chris@0: protected: Chris@0: virtual void paintEvent(QPaintEvent *e); Chris@0: virtual void mousePressEvent(QMouseEvent *e); Chris@0: virtual void mouseReleaseEvent(QMouseEvent *e); Chris@0: virtual void mouseMoveEvent(QMouseEvent *e); Chris@0: virtual void mouseDoubleClickEvent(QMouseEvent *e); Chris@0: virtual void leaveEvent(QEvent *e); Chris@0: virtual void wheelEvent(QWheelEvent *e); Chris@0: Chris@17: Selection getSelectionAt(int x, bool &closeToLeft, bool &closeToRight); Chris@17: Chris@0: bool m_identifyFeatures; Chris@0: QPoint m_identifyPoint; Chris@0: QPoint m_clickPos; Chris@0: QPoint m_mousePos; Chris@0: bool m_clickedInRange; Chris@0: bool m_shiftPressed; Chris@13: bool m_ctrlPressed; Chris@17: bool m_navigating; Chris@17: bool m_resizing; Chris@0: size_t m_dragCentreFrame; Chris@0: bool m_centreLineVisible; Chris@13: size_t m_selectionStartFrame; Chris@0: }; Chris@0: Chris@0: #endif Chris@0: