Chris@0: Chris@58: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@0: Chris@0: /* Chris@59: Sonic Visualiser Chris@59: An audio file viewer and annotation editor. Chris@59: Centre for Digital Music, Queen Mary, University of London. Chris@59: This file copyright 2006 Chris Cannam. Chris@0: Chris@59: This program is free software; you can redistribute it and/or Chris@59: modify it under the terms of the GNU General Public License as Chris@59: published by the Free Software Foundation; either version 2 of the Chris@59: License, or (at your option) any later version. See the file Chris@59: COPYING included with this distribution for more information. 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@44: virtual bool shouldIlluminateLocalFeatures(const Layer *layer, Chris@44: QPoint &pos) const; Chris@42: virtual bool shouldIlluminateLocalSelection(QPoint &pos, Chris@42: bool &closeToLeft, Chris@44: bool &closeToRight) const; 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@89: void rightButtonMenuRequested(QPoint position); 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@44: Selection getSelectionAt(int x, bool &closeToLeft, bool &closeToRight) const; Chris@17: Chris@42: bool editSelectionStart(QMouseEvent *e); Chris@42: bool editSelectionDrag(QMouseEvent *e); Chris@42: bool editSelectionEnd(QMouseEvent *e); Chris@42: bool selectionIsBeingEdited() const; Chris@42: 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@42: Selection m_editingSelection; Chris@42: int m_editingSelectionEdge; Chris@0: }; Chris@0: Chris@0: #endif Chris@0: