Gui/TaskView/TaskDialog.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_TASKDIALOG_H
00025 #define GUI_TASKVIEW_TASKDIALOG_H
00026 
00027 #include <map>
00028 #include <string>
00029 #include <vector>
00030 
00031 #include <QDialogButtonBox>
00032 
00033 #include <Gui/iisTaskPanel/include/iisTaskPanel>
00034 #include <Gui/Selection.h>
00035 
00036 namespace App {
00037 
00038 }
00039 
00040 namespace Gui {
00041 namespace TaskView {
00042 
00043 class TaskContent;
00044 
00046 class GuiExport TaskDialog : public QObject
00047 {
00048     Q_OBJECT
00049 
00050 public:
00051     enum ButtonPosition {
00052         North, South
00053     };
00054 
00055     TaskDialog();
00056     ~TaskDialog();
00057 
00058     void setButtonPosition(ButtonPosition p)
00059     { pos = p; }
00060     ButtonPosition buttonPosition() const
00061     { return pos; }
00062     const std::vector<QWidget*> &getDialogContent(void) const;
00063 
00065     virtual QDialogButtonBox::StandardButtons getStandardButtons(void) const
00066     { return QDialogButtonBox::Ok|QDialogButtonBox::Cancel; }
00067     virtual void modifyStandardButtons(QDialogButtonBox*)
00068     {}
00069 
00070     virtual bool isAllowedAlterDocument(void) const
00071     { return false; }
00072     virtual bool isAllowedAlterView(void) const
00073     { return true; }
00074     virtual bool isAllowedAlterSelection(void) const
00075     { return true; }
00076     virtual bool needsFullSpace() const
00077     { return false; }
00078 
00079 public:
00081     virtual void open();
00083     virtual void clicked(int);
00085     virtual bool accept();
00087     virtual bool reject();
00089     virtual void helpRequested();
00090 
00091 protected:
00093     std::vector<QWidget*> Content;
00094     ButtonPosition pos;
00095 };
00096 
00097 } //namespace TaskView
00098 } //namespace Gui
00099 
00100 #endif // GUI_TASKVIEW_TASKDIALOG_H

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