itom 1.4.0
|
00001 /* ******************************************************************** 00002 itom software 00003 URL: http://www.uni-stuttgart.de/ito 00004 Copyright (C) 2013, Institut für Technische Optik (ITO), 00005 Universität 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 00068 QToolBar *m_pMainToolBar; 00069 QMenu* m_pContextMenu; 00070 QTreeWidgetItem* m_firstCurrentItem; 00071 QString m_firstCurrentItemKey; 00072 00073 private slots: 00074 void mnuDeleteItem(); 00075 void mnuExportItem(); 00076 void mnuImportItem(); 00077 void mnuRenameItem(); 00078 00079 void treeWidgetItemSelectionChanged() { updateActions(); }; 00080 void treeWidgetItemChanged(QTreeWidgetItem * item, int column); 00081 void treeViewContextMenuRequested(const QPoint &pos); 00082 00083 signals: 00084 void setStatusInformation(QString text, int timeout = 0); 00085 }; 00086 00087 } //end namespace ito 00088 00089 #endif