TaskView.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) 2009 Jürgen Riegel <juergen.riegel@web.de>              *
00003  *                                                                         *
00004  *   This file is part of the FreeCAD CAx development system.              *
00005  *                                                                         *
00006  *   This library is free software; you can redistribute it and/or         *
00007  *   modify it under the terms of the GNU Library General Public           *
00008  *   License as published by the Free Software Foundation; either          *
00009  *   version 2 of the License, or (at your option) any later version.      *
00010  *                                                                         *
00011  *   This library  is distributed in the hope that it will be useful,      *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU Library General Public License for more details.                  *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Library General Public     *
00017  *   License along with this library; see the file COPYING.LIB. If not,    *
00018  *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
00019  *   Suite 330, Boston, MA  02111-1307, USA                                *
00020  *                                                                         *
00021  ***************************************************************************/
00022 
00023 
00024 #ifndef GUI_TASKVIEW_TASKVIEW_H
00025 #define GUI_TASKVIEW_TASKVIEW_H
00026 
00027 #include <map>
00028 #include <string>
00029 #include <vector>
00030 #include <boost/signals.hpp>
00031 
00032 #include <Gui/iisTaskPanel/include/iisTaskPanel>
00033 #include <Gui/Selection.h>
00034 #include "TaskWatcher.h"
00035 
00036 namespace App {
00037 class Property;
00038 }
00039 
00040 namespace Gui {
00041 class ControlSingleton;
00042 namespace DockWnd{
00043 class CombiView;
00044 }
00045 namespace TaskView {
00046 
00047 typedef boost::signals::connection Connection;
00048 class TaskEditControl;
00049 class TaskDialog;
00050 
00052 class GuiExport TaskContent 
00053 {
00054 
00055 public:
00056     //TaskContent();
00057     //~TaskContent();
00058 };
00059 
00061 class GuiExport TaskBox : public iisTaskBox, public TaskContent
00062 {
00063     Q_OBJECT
00064 
00065 public:
00066     TaskBox(const QPixmap &icon, const QString &title, bool expandable, QWidget *parent);
00067     ~TaskBox();
00068     void hideGroupBox();
00069 
00070 protected:
00071     void showEvent(QShowEvent*);
00072     void actionEvent (QActionEvent*);
00073 
00074 private:
00075     bool wasShown;
00076 };
00077 
00079 class GuiExport TaskWidget : public QWidget, public TaskContent
00080 {
00081     Q_OBJECT
00082 
00083 public:
00084     TaskWidget(QWidget *parent=0);
00085     ~TaskWidget();
00086 };
00087 
00093 class GuiExport TaskView : public QScrollArea, public Gui::SelectionSingleton::ObserverType
00094 {
00095     Q_OBJECT
00096 
00097 public:
00098     TaskView(QWidget *parent = 0);
00099     ~TaskView();
00100 
00102     virtual void OnChange(Gui::SelectionSingleton::SubjectType &rCaller,
00103                           Gui::SelectionSingleton::MessageType Reason);
00104 
00105     friend class Gui::DockWnd::CombiView;
00106     friend class Gui::ControlSingleton;
00107 
00108     void addTaskWatcher(const std::vector<TaskWatcher*> &Watcher);
00109     void clearTaskWatcher(void);
00110 
00111 protected Q_SLOTS:
00112     void accept();
00113     void reject();
00114     void helpRequested();
00115     void clicked (QAbstractButton * button);
00116 
00117 protected:
00118     void keyPressEvent(QKeyEvent*);
00119     void addTaskWatcher(void);
00120     void removeTaskWatcher(void);
00122     void updateWatcher(void);
00124     void showDialog(TaskDialog *dlg);
00125     // removes the running dialog after accept() or reject() from the TaskView
00126     void removeDialog(void);
00127 
00128     void slotActiveDocument(const App::Document&);
00129     void slotDeletedDocument();
00130 
00131     std::vector<TaskWatcher*> ActiveWatcher;
00132 
00133     iisTaskPanel* taskPanel;
00134     TaskDialog *ActiveDialog;
00135     TaskEditControl *ActiveCtrl;
00136 
00137     Connection connectApplicationActiveDocument;
00138     Connection connectApplicationDeleteDocument;
00139 };
00140 
00141 } //namespace TaskView
00142 } //namespace Gui
00143 
00144 #endif // GUI_TASKVIEW_TASKVIEW_H

Generated on Wed Nov 23 19:00:44 2011 for FreeCAD by  doxygen 1.6.1