TaskDialogPython.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) 2011 Werner Mayer <wmayer[at]users.sourceforge.net>     *
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_TASKDIALOGPYTHON_H
00025 #define GUI_TASKVIEW_TASKDIALOGPYTHON_H
00026 
00027 #include "TaskDialog.h"
00028 #include "TaskWatcher.h"
00029 #include <CXX/Extensions.hxx>
00030 
00031 namespace Gui {
00032 namespace TaskView {
00033 
00034 class ControlPy : public Py::PythonExtension<ControlPy> 
00035 {
00036 public:
00037     static void init_type(void);    // announce properties and methods
00038     static ControlPy* getInstance();
00039 
00040     ControlPy();
00041     ~ControlPy();
00042 
00043     Py::Object repr();
00044     Py::Object showDialog(const Py::Tuple&);
00045     Py::Object activeDialog(const Py::Tuple&);
00046     Py::Object closeDialog(const Py::Tuple&);
00047     Py::Object addTaskWatcher(const Py::Tuple&);
00048     Py::Object clearTaskWatcher(const Py::Tuple&);
00049     Py::Object isAllowedAlterDocument(const Py::Tuple&);
00050     Py::Object isAllowedAlterView(const Py::Tuple&);
00051     Py::Object isAllowedAlterSelection(const Py::Tuple&);
00052 
00053 private:
00054     static ControlPy* instance;
00055 };
00056 
00057 class GuiExport TaskWatcherPython : public TaskWatcher
00058 {
00059 public:
00060     TaskWatcherPython(const Py::Object&);
00061     ~TaskWatcherPython();
00062     bool shouldShow();
00063 
00064 private:
00065     Py::Object watcher;
00066 };
00067 
00068 class GuiExport TaskDialogPython : public TaskDialog
00069 {
00070 public:
00071     TaskDialogPython(const Py::Object&);
00072     ~TaskDialogPython();
00073 
00074     virtual QDialogButtonBox::StandardButtons getStandardButtons(void) const;
00075     virtual void modifyStandardButtons(QDialogButtonBox*);
00076 
00077     virtual bool isAllowedAlterDocument(void) const;
00078     virtual bool isAllowedAlterView(void) const;
00079     virtual bool isAllowedAlterSelection(void) const;
00080     virtual bool needsFullSpace() const;
00081 
00082 public:
00083     virtual void open();
00084     virtual void clicked(int);
00085     virtual bool accept();
00086     virtual bool reject();
00087     virtual void helpRequested();
00088     
00089 private:
00090     Py::Object dlg;
00091 };
00092 
00093 } //namespace TaskView
00094 } //namespace Gui
00095 
00096 #endif // GUI_TASKVIEW_TASKDIALOGPYTHON_H
00097 

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