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 _PANESTACK_H_ Chris@0: #define _PANESTACK_H_ Chris@0: Chris@108: #include Chris@0: Chris@0: class QWidget; Chris@0: class QLabel; Chris@108: class QStackedWidget; Chris@108: class QSplitter; Chris@108: class QHBoxLayout; Chris@52: class View; Chris@0: class Pane; Chris@17: class Layer; Chris@0: class ViewManager; Chris@0: class PropertyContainer; Chris@0: class PropertyStack; Chris@0: Chris@108: class PaneStack : public QFrame Chris@0: { Chris@0: Q_OBJECT Chris@0: Chris@0: public: Chris@0: PaneStack(QWidget *parent, ViewManager *viewManager); Chris@0: Chris@0: Pane *addPane(bool suppressPropertyBox = false); // I own the returned value Chris@52: void deletePane(Pane *pane); // Deletes the pane, but _not_ its layers Chris@0: Chris@52: int getPaneCount() const; // Returns only count of visible panes Chris@52: Pane *getPane(int n); // Of visible panes; I own the returned value Chris@52: Chris@52: void hidePane(Pane *pane); // Also removes pane from getPane/getPaneCount Chris@52: void showPane(Pane *pane); // Returns pane to getPane/getPaneCount Chris@52: Chris@52: int getHiddenPaneCount() const; Chris@52: Pane *getHiddenPane(int n); // I own the returned value Chris@43: Chris@0: void setCurrentPane(Pane *pane); Chris@19: void setCurrentLayer(Pane *pane, Layer *layer); Chris@0: Pane *getCurrentPane(); Chris@0: Chris@108: enum LayoutStyle { Chris@108: SinglePropertyStackLayout = 1, Chris@108: PropertyStackPerPaneLayout = 2 Chris@108: }; Chris@108: Chris@108: LayoutStyle getLayoutStyle() const { return m_layoutStyle; } Chris@108: void setLayoutStyle(LayoutStyle style); Chris@108: Chris@0: signals: Chris@0: void currentPaneChanged(Pane *pane); Chris@17: void currentLayerChanged(Pane *pane, Layer *layer); Chris@89: void rightButtonMenuRequested(Pane *pane, QPoint position); Chris@0: Chris@0: public slots: Chris@0: void propertyContainerAdded(PropertyContainer *); Chris@0: void propertyContainerRemoved(PropertyContainer *); Chris@52: void propertyContainerSelected(View *client, PropertyContainer *); Chris@0: void paneInteractedWith(); Chris@89: void rightButtonMenuRequested(QPoint); Chris@0: Chris@0: protected: Chris@0: Pane *m_currentPane; Chris@52: Chris@52: struct PaneRec Chris@52: { Chris@108: Pane *pane; Chris@108: QWidget *propertyStack; Chris@108: QLabel *currentIndicator; Chris@108: QFrame *frame; Chris@108: QHBoxLayout *layout; Chris@52: }; Chris@52: Chris@52: std::vector m_panes; Chris@52: std::vector m_hiddenPanes; Chris@52: Chris@108: QSplitter *m_splitter; Chris@108: QStackedWidget *m_propertyStackStack; Chris@108: Chris@0: ViewManager *m_viewManager; // I don't own this Chris@0: void sizePropertyStacks(); Chris@108: Chris@108: LayoutStyle m_layoutStyle; Chris@0: }; Chris@0: Chris@0: #endif Chris@0: