itom 2.2.1
K:/git-itom/sources/itom/Qitom/widgets/workspaceDockWidget.h
00001 /* ********************************************************************
00002     itom software
00003     URL: http://www.uni-stuttgart.de/ito
00004     Copyright (C) 2016, Institut fuer Technische Optik (ITO),
00005     Universitaet Stuttgart, Germany
00006 
00007     This file is part of itom.
00008   
00009     itom is free software; you can redistribute it and/or modify it
00010     under the terms of the GNU Library General Public Licence as published by
00011     the Free Software Foundation; either version 2 of the Licence, or (at
00012     your option) any later version.
00013 
00014     itom is distributed in the hope that it will be useful, but
00015     WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library
00017     General Public Licence for more details.
00018 
00019     You should have received a copy of the GNU Library General Public License
00020     along with itom. If not, see <http://www.gnu.org/licenses/>.
00021 *********************************************************************** */
00022 
00023 #ifndef WORKSPACEDOCKWIDGET_H
00024 #define WORKSPACEDOCKWIDGET_H
00025 
00026 #include "workspaceWidget.h"
00027 #include "abstractDockWidget.h"
00028 
00029 #include <qwidget.h>
00030 #include <qaction.h>
00031 #include <qtoolbar.h>
00032 #include <qevent.h>
00033 
00034 
00035 namespace ito {
00036 
00037 
00038 class WorkspaceDockWidget : public AbstractDockWidget
00039 {
00040     Q_OBJECT
00041 
00042 public:
00043     WorkspaceDockWidget(const QString &title, const QString &objName, bool globalNotLocal, QWidget *parent = NULL, bool docked = true, bool isDockAvailable = true, tFloatingStyle floatingStyle = floatingNone, tMovingStyle movingStyle = movingEnabled);
00044     ~WorkspaceDockWidget();
00045 
00046 protected:
00047 
00048     //void closeEvent(QCloseEvent *event);
00049     void dragEnterEvent(QDragEnterEvent *event);
00050     void dropEvent(QDropEvent *event);
00051 
00052     void createActions();
00053     void createMenus();
00054     void createToolBars();
00055     void createStatusBar(){}
00056     void updateActions();
00057     void updatePythonActions(){ updateActions(); }
00058 
00059 private:
00060     bool m_globalNotLocal;
00061 
00062     WorkspaceWidget *m_pWorkspaceWidget;
00063     ShortcutAction *m_actDelete;
00064     ShortcutAction *m_actRename;
00065     ShortcutAction *m_actExport;
00066     ShortcutAction *m_actImport;
00067     QAction *m_actUnpack;
00068 
00069     //special actions
00070     QAction *m_separatorSpecialActionsToolBar;
00071     QAction *m_separatorSpecialActionsContextMenu;
00072     ShortcutAction *m_dObjPlot1d;
00073     ShortcutAction *m_dObjPlot2d;
00074     ShortcutAction *m_dObjPlot25d;
00075     ShortcutAction *m_dObjPlot3d;
00076 
00077     QToolBar *m_pMainToolBar;
00078     QMenu* m_pContextMenu;
00079     QTreeWidgetItem* m_firstCurrentItem;
00080     QString m_firstCurrentItemKey;
00081 
00082     void mnuPlotGeneric(const QString &plotClass);
00083 
00084 private slots:
00085     void mnuDeleteItem();
00086     void mnuExportItem();
00087     void mnuImportItem();
00088     void mnuRenameItem();
00089     void mnuToggleUnpack();
00090     void mnuPlot1D();
00091     void mnuPlot2D();
00092     void mnuPlot25D();
00093 
00094     void treeWidgetItemSelectionChanged() { updateActions(); };
00095     void treeWidgetItemChanged(QTreeWidgetItem * item, int column);
00096     void treeViewContextMenuRequested(const QPoint &pos);
00097 
00098 public slots:
00099     void checkToggleUnpack();
00100     void propertiesChanged();
00101 
00102 signals:
00103     void setStatusInformation(QString text, int timeout = 0);
00104 };
00105 
00106 } //end namespace ito
00107 
00108 #endif
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Friends