Tulip  4.6.0
Better Visualization Through Research
library/tulip-gui/include/tulip/WorkspacePanel.h
00001 /*
00002  *
00003  * This file is part of Tulip (www.tulip-software.org)
00004  *
00005  * Authors: David Auber and the Tulip development Team
00006  * from LaBRI, University of Bordeaux
00007  *
00008  * Tulip is free software; you can redistribute it and/or modify
00009  * it under the terms of the GNU Lesser General Public License
00010  * as published by the Free Software Foundation, either version 3
00011  * of the License, or (at your option) any later version.
00012  *
00013  * Tulip is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00016  * See the GNU General Public License for more details.
00017  *
00018  */
00019 ///@cond DOXYGEN_HIDDEN
00020 
00021 #ifndef WORKSPACEPANEL_H
00022 #define WORKSPACEPANEL_H
00023 
00024 #include <QFrame>
00025 #include <QAction>
00026 
00027 #include <tulip/tulipconf.h>
00028 
00029 class QDragEnterEvent;
00030 class QGraphicsObject;
00031 class QPropertyAnimation;
00032 class QGraphicsProxyWidget;
00033 class QGraphicsRectItem;
00034 class QMimeData;
00035 
00036 namespace Ui {
00037 class WorkspacePanel;
00038 }
00039 
00040 namespace tlp {
00041 class Graph;
00042 class View;
00043 class Interactor;
00044 class GraphHierarchiesModel;
00045 
00046 class TLP_QT_SCOPE WorkspacePanel : public QFrame {
00047   Q_OBJECT
00048 
00049   Ui::WorkspacePanel* _ui;
00050   tlp::View* _view;
00051   QString _viewName;
00052   QMap<QAction*, QWidget*> _actionTriggers;
00053   QGraphicsRectItem* _overlayRect;
00054 
00055   QGraphicsProxyWidget* _viewConfigurationWidgets;
00056   bool _viewConfigurationExpanded;
00057   QGraphicsProxyWidget* _currentInteractorConfigurationItem;
00058 
00059   QPointF configurationTabPosition(bool expanded) const;
00060   void setConfigurationTabExpanded(bool expanded, bool animate=true);
00061 
00062 public:
00063   explicit WorkspacePanel(tlp::View* view, QWidget* parent=NULL);
00064   virtual ~WorkspacePanel();
00065 
00066   bool eventFilter(QObject *, QEvent *);
00067 
00068   tlp::View* view() const;
00069   QString viewName() const;
00070 
00071 public slots:
00072   void setView(tlp::View* view);
00073   void setCurrentInteractor(tlp::Interactor*);
00074   void setGraphsModel(tlp::GraphHierarchiesModel*);
00075   void viewGraphSet(tlp::Graph*);
00076   void setOverlayMode(bool);
00077   void setHighlightMode(bool);
00078   bool isGraphSynchronized() const;
00079 
00080 signals:
00081   void drawNeeded();
00082   void swapWithPanels(WorkspacePanel* panel);
00083   void changeGraphSynchronization(bool);
00084 
00085 protected slots:
00086   void hideConfigurationTab();
00087   void interactorActionTriggered();
00088   void viewDestroyed();
00089   void graphComboIndexChanged();
00090   void setCurrentInteractorConfigurationVisible(bool);
00091   void actionChanged();
00092 
00093   void scrollInteractorsRight();
00094   void scrollInteractorsLeft();
00095   void resetInteractorsScrollButtonsVisibility();
00096   void refreshInteractorsToolbar();
00097   void toggleSynchronization(bool);
00098 
00099 protected:
00100 
00101   void resizeEvent(QResizeEvent *);
00102 
00103   void dragEnterEvent(QDragEnterEvent *);
00104   void dropEvent(QDropEvent *);
00105   void dragLeaveEvent(QDragLeaveEvent *);
00106 
00107   bool handleDragEnterEvent(QEvent* e, const QMimeData* mimedata);
00108   bool handleDropEvent(const QMimeData* mimedata);
00109 
00110 };
00111 
00112 }
00113 
00114 #endif // WORKSPACEPANEL_H
00115 ///@endcond
 All Classes Files Functions Variables Enumerations Enumerator Properties