/
qgsoracledataitems.h
124 lines (93 loc) · 3.48 KB
/
qgsoracledataitems.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/***************************************************************************
qgsoracledataitems.h
---------------------
begin : August 2012
copyright : (C) 2012 by Juergen E. Fischer
email : jef at norbit dot de
***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef QGSORACLEDATAITEMS_H
#define QGSORACLEDATAITEMS_H
#include <QSqlDatabase>
#include <QMainWindow>
#include "qgsdataitem.h"
#include "qgsoracletablemodel.h"
#include "qgsoraclesourceselect.h"
#include "qgsmimedatautils.h"
#include "qgsvectorlayerexporter.h"
class QSqlDatabase;
class QgsOracleRootItem;
class QgsOracleConnectionItem;
class QgsOracleOwnerItem;
class QgsOracleLayerItem;
class QgsOracleRootItem : public QgsDataCollectionItem
{
Q_OBJECT
public:
QgsOracleRootItem( QgsDataItem *parent, QString name, QString path );
~QgsOracleRootItem();
QVector<QgsDataItem *> createChildren() override;
QVariant sortKey() const override { return 5; }
virtual QWidget *paramWidget() override;
QList<QAction *> actions( QWidget *parent ) override;
static QMainWindow *sMainWindow;
public slots:
void connectionsChanged();
void newConnection();
};
class QgsOracleConnectionItem : public QgsDataCollectionItem
{
Q_OBJECT
public:
QgsOracleConnectionItem( QgsDataItem *parent, QString name, QString path );
~QgsOracleConnectionItem();
QVector<QgsDataItem *> createChildren() override;
virtual bool equal( const QgsDataItem *other ) override;
QList<QAction *> actions( QWidget *parent ) override;
virtual bool acceptDrop() override { return true; }
virtual bool handleDrop( const QMimeData *data, Qt::DropAction action ) override;
void refresh() override;
signals:
void addGeometryColumn( QgsOracleLayerProperty );
public slots:
void editConnection();
void deleteConnection();
void refreshConnection();
void setLayerType( QgsOracleLayerProperty layerProperty );
void threadStarted();
void threadFinished();
private:
void stop();
QMap<QString, QgsOracleOwnerItem * > mOwnerMap;
QgsOracleColumnTypeThread *mColumnTypeThread = nullptr;
void setAllAsPopulated();
};
class QgsOracleOwnerItem : public QgsDataCollectionItem
{
Q_OBJECT
public:
QgsOracleOwnerItem( QgsDataItem *parent, QString name, QString path );
~QgsOracleOwnerItem();
QVector<QgsDataItem *> createChildren();
void addLayer( QgsOracleLayerProperty layerProperty );
};
class QgsOracleLayerItem : public QgsLayerItem
{
Q_OBJECT
public:
QgsOracleLayerItem( QgsDataItem *parent, QString name, QString path, QgsLayerItem::LayerType layerType, QgsOracleLayerProperty layerProperties );
~QgsOracleLayerItem();
QString createUri();
QList<QAction *> actions( QWidget *parent ) override;
public slots:
void deleteLayer();
private:
QgsOracleLayerProperty mLayerProperty;
};
#endif // QGSORACLEDATAITEMS_H