00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _PANESTACK_H_
00018 #define _PANESTACK_H_
00019
00020 #include <QFrame>
00021
00022 #include <map>
00023
00024 class QWidget;
00025 class QLabel;
00026 class QStackedWidget;
00027 class QSplitter;
00028 class QHBoxLayout;
00029 class View;
00030 class Pane;
00031 class Layer;
00032 class ViewManager;
00033 class PropertyContainer;
00034 class PropertyStack;
00035
00036 class PaneStack : public QFrame
00037 {
00038 Q_OBJECT
00039
00040 public:
00041 PaneStack(QWidget *parent, ViewManager *viewManager);
00042
00043 Pane *addPane(bool suppressPropertyBox = false);
00044 void deletePane(Pane *pane);
00045
00046 int getPaneCount() const;
00047 Pane *getPane(int n);
00048 int getPaneIndex(Pane *pane);
00049
00050 void hidePane(Pane *pane);
00051 void showPane(Pane *pane);
00052
00053 int getHiddenPaneCount() const;
00054 Pane *getHiddenPane(int n);
00055
00056 void setCurrentPane(Pane *pane);
00057 void setCurrentLayer(Pane *pane, Layer *layer);
00058 Pane *getCurrentPane();
00059
00060 enum LayoutStyle {
00061 NoPropertyStacks = 0,
00062 SinglePropertyStackLayout = 1,
00063 PropertyStackPerPaneLayout = 2
00064 };
00065
00066 LayoutStyle getLayoutStyle() const { return m_layoutStyle; }
00067 void setLayoutStyle(LayoutStyle style);
00068
00069 void setPropertyStackMinWidth(int mw);
00070
00071 void sizePanesEqually();
00072
00073 signals:
00074 void currentPaneChanged(Pane *pane);
00075 void currentLayerChanged(Pane *pane, Layer *layer);
00076 void rightButtonMenuRequested(Pane *pane, QPoint position);
00077 void propertyStacksResized(int width);
00078 void propertyStacksResized();
00079 void contextHelpChanged(const QString &);
00080
00081 void paneAdded(Pane *pane);
00082 void paneAdded();
00083 void paneHidden(Pane *pane);
00084 void paneHidden();
00085 void paneAboutToBeDeleted(Pane *pane);
00086 void paneDeleted();
00087
00088 void dropAccepted(Pane *pane, QStringList uriList);
00089 void dropAccepted(Pane *pane, QString text);
00090
00091 void paneDeleteButtonClicked(Pane *pane);
00092
00093 public slots:
00094 void propertyContainerAdded(PropertyContainer *);
00095 void propertyContainerRemoved(PropertyContainer *);
00096 void propertyContainerSelected(View *client, PropertyContainer *);
00097 void viewSelected(View *v);
00098 void paneInteractedWith();
00099 void rightButtonMenuRequested(QPoint);
00100 void paneDropAccepted(QStringList);
00101 void paneDropAccepted(QString);
00102 void paneDeleteButtonClicked();
00103
00104 protected:
00105 Pane *m_currentPane;
00106
00107 struct PaneRec
00108 {
00109 Pane *pane;
00110 QWidget *propertyStack;
00111 QLabel *currentIndicator;
00112 QFrame *frame;
00113 QHBoxLayout *layout;
00114 };
00115
00116 std::vector<PaneRec> m_panes;
00117 std::vector<PaneRec> m_hiddenPanes;
00118
00119 std::map<QWidget *, Pane *> m_xButtonMap;
00120
00121 QSplitter *m_splitter;
00122 QStackedWidget *m_propertyStackStack;
00123
00124 ViewManager *m_viewManager;
00125 int m_propertyStackMinWidth;
00126 void sizePropertyStacks();
00127
00128 LayoutStyle m_layoutStyle;
00129 };
00130
00131 #endif
00132