00001 /*************************************************************************** 00002 qgsshapefile.h - description 00003 ------------------- 00004 begin : Fri Dec 19 2003 00005 copyright : (C) 2003 by Denis Antipov 00006 email : 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 /* $Id: qgsshapefile.h 9138 2008-08-23 21:37:31Z jef $ */ 00018 00019 #ifndef QGSSHAPEFILE_H 00020 #define QGSSHAPEFILE_H 00021 00022 #include <vector> 00023 #include <QString> 00024 #include <QStringList> 00025 #include <QObject> 00026 #include <ogr_api.h> 00027 00028 class QProgressDialog; 00029 class QTextCodec; 00030 00031 class OGRLayer; 00032 class OGRDataSource; 00033 extern "C" 00034 { 00035 #include <libpq-fe.h> 00036 } 00037 00038 00039 class QgsShapeFile : public QObject 00040 { 00041 Q_OBJECT 00042 public: 00043 00044 QgsShapeFile( QString fileName, QString encoding = QString() ); 00045 ~QgsShapeFile(); 00046 int getFeatureCount(); 00047 QString getFeatureClass(); 00048 bool insertLayer( QString dbname, QString schema, QString primary_key, QString geom_col, 00049 QString srid, PGconn * conn, QProgressDialog& pro, 00050 bool &fin, QString& errorText ); 00051 00052 bool is_valid(); 00053 QString getName(); 00054 QString getTable(); 00055 void setTable( QString new_table ); 00056 void setDefaultTable(); 00057 std::vector <QString> column_names; 00058 std::vector <QString> column_types; 00059 void setColumnNames( QStringList ); 00060 bool scanGeometries(); 00061 00062 00063 private: 00064 QString table_name; 00065 OGRDataSourceH ogrDataSource; 00066 OGRLayerH ogrLayer; 00067 bool import_canceled; 00068 bool valid; 00070 bool isMulti; 00071 bool hasMoreDimensions; 00072 int features; 00073 QString fileName; 00074 QString geom_type; 00075 QStringList geometries; 00076 QTextCodec* codec; 00077 00078 public slots: 00079 void cancelImport(); 00080 }; 00081 00082 #endif
1.5.1