UnitTestPy.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) 2006 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 TESTGUI_UNITTESTPY_H
00025 #define TESTGUI_UNITTESTPY_H
00026 
00027 #include <Base/PyObjectBase.h>
00028 #include <CXX/Extensions.hxx>
00029 
00030 
00031 namespace TestGui
00032 {
00033 
00034 class UnitTestDialog;
00035 class UnitTestDialogPy : public Py::PythonExtension<UnitTestDialogPy>
00036 {
00037 public:
00038     static void init_type(void);    // announce properties and methods
00039 
00040     UnitTestDialogPy();
00041     ~UnitTestDialogPy();
00042 
00043     Py::Object repr();
00044     Py::Object getattr(const char *);
00045     int setattr(const char *, const Py::Object &);
00046 
00047     Py::Object clearErrorList   (const Py::Tuple&);
00048     Py::Object insertError      (const Py::Tuple&);
00049     Py::Object setUnitTest      (const Py::Tuple&);
00050     Py::Object getUnitTest      (const Py::Tuple&);
00051     Py::Object setStatusText    (const Py::Tuple&);
00052     Py::Object setProgressFrac  (const Py::Tuple&);
00053     Py::Object errorDialog      (const Py::Tuple&);
00054     Py::Object setRunCount      (const Py::Tuple&);
00055     Py::Object setFailCount     (const Py::Tuple&);
00056     Py::Object setErrorCount    (const Py::Tuple&);
00057     Py::Object setRemainCount   (const Py::Tuple&);
00058     Py::Object updateGUI        (const Py::Tuple&);
00059 
00060 private:
00061     typedef PyObject* (*method_varargs_handler)(PyObject *_self, PyObject *_args);
00062     static method_varargs_handler pycxx_handler;
00063     static PyObject *method_varargs_ext_handler(PyObject *_self, PyObject *_args);
00064 };
00065 
00066 //===========================================================================
00067 // UnitTestPy - Python wrapper
00068 //===========================================================================
00069 
00070 class UnitTestPy :public Base::PyObjectBase
00071 {
00072         Py_Header;
00073 
00074 protected:
00075         ~UnitTestPy();
00076 
00077 public:
00078   UnitTestPy(PyTypeObject *T = &Type);
00079         static PyObject *PyMake(PyTypeObject *, PyObject *, PyObject *);
00080 
00081         //---------------------------------------------------------------------
00082         // python exports goes here +++++++++++++++++++++++++++++++++++++++++++
00083         //---------------------------------------------------------------------
00084 
00085         virtual PyObject *_repr(void);                                  // the representation
00086         PyObject *_getattr(char *attr);                                 // __getattr__ function
00087         int _setattr(char *attr, PyObject *value);              // __setattr__ function
00088 
00089   PYFUNCDEF_D(UnitTestPy,clearErrorList)
00090   PYFUNCDEF_D(UnitTestPy,insertError)
00091   PYFUNCDEF_D(UnitTestPy,setUnitTest)
00092   PYFUNCDEF_D(UnitTestPy,getUnitTest)
00093   PYFUNCDEF_D(UnitTestPy,setStatusText)
00094   PYFUNCDEF_D(UnitTestPy,setProgressFraction)
00095   PYFUNCDEF_D(UnitTestPy,errorDialog)
00096   PYFUNCDEF_D(UnitTestPy,setRunCount)
00097   PYFUNCDEF_D(UnitTestPy,setFailCount)
00098   PYFUNCDEF_D(UnitTestPy,setErrorCount)
00099   PYFUNCDEF_D(UnitTestPy,setRemainCount)
00100   PYFUNCDEF_D(UnitTestPy,updateGUI)
00101 };
00102 
00103 } //namespace TESTGUI_UNITTESTPY_H
00104 
00105 
00106 #endif
00107 

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