svgui  1.9
PropertyStack.h
Go to the documentation of this file.
00001 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*-  vi:set ts=8 sts=4 sw=4: */
00002 
00003 /*
00004     Sonic Visualiser
00005     An audio file viewer and annotation editor.
00006     Centre for Digital Music, Queen Mary, University of London.
00007     This file copyright 2006 Chris Cannam.
00008     
00009     This program is free software; you can redistribute it and/or
00010     modify it under the terms of the GNU General Public License as
00011     published by the Free Software Foundation; either version 2 of the
00012     License, or (at your option) any later version.  See the file
00013     COPYING included with this distribution for more information.
00014 */
00015 
00016 #ifndef _PROPERTY_STACK_H_
00017 #define _PROPERTY_STACK_H_
00018 
00019 #include <QFrame>
00020 #include <QTabWidget>
00021 #include <vector>
00022 
00023 class Layer;
00024 class View;
00025 class PropertyBox;
00026 class PropertyContainer;
00027 
00028 class PropertyStack : public QTabWidget
00029 {
00030     Q_OBJECT
00031 
00032 public:
00033     PropertyStack(QWidget *parent, View *client);
00034     virtual ~PropertyStack();
00035 
00036     View *getClient() { return m_client; }
00037     bool containsContainer(PropertyContainer *container) const;
00038     int getContainerIndex(PropertyContainer *container) const;
00039 
00040 signals:
00041     void viewSelected(View *client);
00042     void propertyContainerSelected(View *client, PropertyContainer *container);
00043     void contextHelpChanged(const QString &);
00044 
00045 public slots:
00046     void propertyContainerAdded(PropertyContainer *);
00047     void propertyContainerRemoved(PropertyContainer *);
00048     void propertyContainerPropertyChanged(PropertyContainer *);
00049     void propertyContainerPropertyRangeChanged(PropertyContainer *);
00050     void propertyContainerNameChanged(PropertyContainer *);
00051 
00052     void showLayer(bool);
00053 
00054     void mouseEnteredTabBar();
00055     void mouseLeftTabBar();
00056     void activeTabClicked();
00057 
00058 protected slots:
00059     void selectedContainerChanged(int);
00060 
00061 protected:
00062     View *m_client;
00063     std::vector<PropertyBox *> m_boxes;
00064 
00065     void repopulate();
00066     void updateValues(PropertyContainer *);
00067 };
00068 
00069 #endif