00001 /*************************************************************************** 00002 * Copyright (c) Jürgen Riegel (juergen.riegel@web.de) 2006 * 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 00025 #ifndef APP_FEATURETEST_H 00026 #define APP_FEATURETEST_H 00027 00028 00029 #include "DocumentObject.h" 00030 #include "PropertyUnits.h" 00031 #include "PropertyGeo.h" 00032 #include "PropertyLinks.h" 00033 00034 namespace App 00035 { 00036 00038 class FeatureTest : public DocumentObject 00039 { 00040 PROPERTY_HEADER(App::FeatureTest); 00041 00042 public: 00043 FeatureTest(); 00044 00045 ~FeatureTest(); 00046 00047 // Standard Properties (PorpertyStandard.h) 00048 App::PropertyInteger Integer; 00049 App::PropertyFloat Float; 00050 App::PropertyBool Bool; 00051 App::PropertyString String; 00052 App::PropertyPath Path; 00053 App::PropertyStringList StringList; 00054 00055 App::PropertyColor Colour; 00056 App::PropertyColorList ColourList; 00057 00058 // special types 00059 App::PropertyDistance Distance; 00060 App::PropertyAngle Angle; 00061 00062 // Constraint types 00063 App::PropertyEnumeration Enum; 00064 App::PropertyIntegerConstraint ConstraintInt; 00065 App::PropertyFloatConstraint ConstraintFloat; 00066 00067 // Standard Properties (PorpertyStandard.h) 00068 App::PropertyIntegerList IntegerList; 00069 App::PropertyFloatList FloatList; 00070 00071 // Standard Properties (PropertyLinks.h) 00072 App::PropertyLink Link; 00073 App::PropertyLinkSub LinkSub; 00074 App::PropertyLinkList LinkList; 00075 00076 // Standard Properties (PropertyGeo.h) 00077 App::PropertyMatrix Matrix; 00078 App::PropertyVector Vector; 00079 App::PropertyVectorList VectorList; 00080 App::PropertyPlacement Placement; 00081 00082 // Properties to test the Document::recompute() 00083 App::PropertyLink Source1; 00084 App::PropertyLink Source2; 00085 App::PropertyLinkList SourceN; 00086 App::PropertyString ExecResult; 00087 App::PropertyInteger ExceptionType; 00088 App::PropertyInteger ExecCount; 00089 00090 App::PropertyInteger TypeHidden; 00091 App::PropertyInteger TypeReadOnly; 00092 App::PropertyInteger TypeOutput; 00093 App::PropertyInteger TypeAll; 00094 App::PropertyInteger TypeTransient; 00095 00098 00099 virtual DocumentObjectExecReturn *execute(void); 00101 //FIXME: Propably it makes sense to have a view provider for unittests (e.g. Gui::ViewProviderTest) 00102 virtual const char* getViewProviderName(void) const { 00103 return "Gui::ViewProviderFeature"; 00104 } 00106 }; 00107 00109 class FeatureTestException :public FeatureTest 00110 { 00111 PROPERTY_HEADER(App::FeatureTestException); 00112 00113 public: 00114 FeatureTestException(); 00115 00117 App::PropertyInteger ExceptionType; 00118 00120 virtual DocumentObjectExecReturn *execute(void); 00122 virtual const char* getViewProviderName(void) const { 00123 return "Gui::ViewProviderFeature"; 00124 } 00125 }; 00126 00127 00128 00129 } //namespace App 00130 00131 #endif // APP_FEATURETEST_H