00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkQtSQLQuery.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00015 /*------------------------------------------------------------------------- 00016 Copyright 2008 Sandia Corporation. 00017 Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00018 the U.S. Government retains certain rights in this software. 00019 -------------------------------------------------------------------------*/ 00027 #ifndef __vtkQtSQLQuery_h 00028 #define __vtkQtSQLQuery_h 00029 00030 // Check for Qt SQL module before defining this class. 00031 #include <qglobal.h> 00032 #if (QT_EDITION & QT_MODULE_SQL) 00033 00034 #include "QVTKWin32Header.h" 00035 #include "vtkSQLQuery.h" 00036 #include "vtkType.h" 00037 00038 class vtkVariant; 00039 class vtkQtSQLQueryInternals; 00040 00041 class QVTK_EXPORT vtkQtSQLQuery : public vtkSQLQuery 00042 { 00043 public: 00044 static vtkQtSQLQuery* New(); 00045 vtkTypeMacro(vtkQtSQLQuery, vtkSQLQuery); 00046 void PrintSelf(ostream& os, vtkIndent indent); 00047 00050 virtual bool Execute(); 00051 00053 virtual int GetNumberOfFields(); 00054 00056 virtual const char* GetFieldName(int col); 00057 00060 virtual int GetFieldType(int col); 00061 00063 virtual bool NextRow(); 00064 00066 virtual vtkVariant DataValue(vtkIdType c); 00067 //ETX 00068 00070 virtual bool HasError(); 00071 00073 virtual const char* GetLastErrorText(); 00074 00075 protected: 00076 vtkQtSQLQuery(); 00077 ~vtkQtSQLQuery(); 00078 00079 //BTX 00080 vtkQtSQLQueryInternals* Internals; 00081 friend class vtkQtSQLDatabase; 00082 //ETX 00083 00084 private: 00085 00086 // Using the convenience function internally 00087 vtkSetStringMacro(LastErrorText); 00088 00089 char* LastErrorText; 00090 00091 vtkQtSQLQuery(const vtkQtSQLQuery &); // Not implemented. 00092 void operator=(const vtkQtSQLQuery &); // Not implemented. 00093 }; 00094 00095 #endif // (QT_EDITION & QT_MODULE_SQL) 00096 #endif // __vtkQtSQLQuery_h 00097