QGIS/src/providers/wms/qgswmsdataitems.h

186 lines
5.3 KiB
C
Raw Normal View History

/***************************************************************************
qgswmsdataitems.h
---------------------
begin : October 2011
copyright : (C) 2011 by Martin Dobias
2012-10-08 00:29:13 +02:00
email : wonder dot sk at gmail dot com
***************************************************************************
* *
* 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. *
* *
***************************************************************************/
2011-10-13 21:17:05 -03:00
#ifndef QGSWMSDATAITEMS_H
#define QGSWMSDATAITEMS_H
#include "qgsdataitem.h"
#include "qgsdataitemprovider.h"
#include "qgsdatasourceuri.h"
2011-10-13 21:17:05 -03:00
#include "qgswmsprovider.h"
[FEATURE] QGIS - GeoNode Integration: Integrate with QGIS Browser Panel (#4816) * add Geonode connection menu to the toolbar * add header files for geonode-qgis client * add action to launch geonode connection dialog from menubar * Move to proper directory * Add geonodeconnection class. * Add unit test for geonode connection. * Use const static to avoid typo. * Get list layers from geonode. * Add get maps method. * Geonode connection dialog (#13) * add new geonode connection dialog * apply functionality to the geonode connection manager dialog * add save and load geonode connection functionality * edit baseKey and credentialBaseKey * remove auto-connect slots * Add unit test for geonode connection. * Add wms url getter. * Add uuid and layer name in the table. * Add handler for the list layer clicked. WIP. * Use new style connect, better hacky to get wms url. * update gitignore * Make QGIS able to add WMS layer from geonode. With hacky code. * Fix Docstring. * Show web service type (WMS/WFS) in layer table. * fix http and toolbar menu * add geonode data item to the browser panel as an extention of ows provider * [WIP] Add WFS. * Add geonode get service url. * combobox functionality and test geonode connection * Add WFS. * Disable add button if it's a map. Currently we can't do anything for map. * Add busy cursor when add layer. * get service uri capabilitites * add available layers to the geonode browser panel * remove debugging footprint and replace old style connect * add actions (new, edit, delete) to geonode browser panel * fix getLayers by WMS url * add Geonode connection menu to the toolbar * Filter out invalid layer / map. * Fix service url method. * Add service url for XYZ for GeoNode QGIS Server backend. * Add XYZ url to geonode connection dialog. * Add XYZ layer to QGIS. * fix double geonode submenu * add wfs/wms layers from browser panel using its native provider * comply with qgis3 new class naming * Handle different prefix for layer in GeoNode QGIS Server backend. * base class for cms connection * make geonode connection as a derived class from cms connection * update cmakelists * move geonode connection to geocms dir * update CMakeLists * Handle geonode 2.7 with new API. * Handle multiple geoserver url in one geonode. * Fix add xyz for qgis server. Fix add wms, wfs, xyz for geoserver in geonode 2.7 * Refactor serviceURL to return QStringList. * add 'add geonode layer' icon * add geonode to the data source manager dialog * [GeoNode-Client] Fix add WFS layer. * fix wms url parameter * add xyz dataitems * Use new style connect. * [GeoNode Client] Handle qgis server specific typename to make add WFS works. * Code improvement. * [GeoNode Client] Make geonode dialog in add universal layer can add layer. * Open universal add layer when click Add GeoNode layer. * Make sure the geonode url has protocol. * Handle geonode version in a better way. * make sure the serviceUrl method has scheme in its urls * add services option to the dialog * remove version label if not wfs * construct wms url with parameters for geonode connection * handle layer from multi service urls for every wfs, wms, & xyz services * fix new style connect using static_cast * hode close button if dialog is in embedded mode * fix xyz layer naming in the browser tree * create base class for geocms dataitems * fix compiling warning * Use struct instead QVariantMap. * tidy up code * Tidy up code, use QgsStringMap instead QVariantMap. * Add spellok for catalogue. * update sip * update sip * Use naming convention for QgsGeoCmsConnection and use QUuid. * Async by using GeoNodeRequest class. * Move geonode to src/gui. * Use stack not heap. * Remove unused includes. * Use signal to handle request. * Use QStringLiteral. * Switch to use Q_FOREACH. * Use Q_FOREACH and addressing PR's review. * Set private for data members. * update sip * Update sip. * Update sip. * Fix sip problem to make it buildable again. * Remove geocms * Tidy up code. * Use QgsSetting Scope::Provider. * Fix missing zip.h
2017-08-07 02:24:12 +07:00
#include "qgsgeonodeconnection.h"
2011-10-13 21:17:05 -03:00
class QgsWmsCapabilitiesDownload;
2011-10-13 21:17:05 -03:00
class QgsWMSConnectionItem : public QgsDataCollectionItem
{
Q_OBJECT
2011-10-13 21:17:05 -03:00
public:
2017-03-03 08:42:00 +01:00
QgsWMSConnectionItem( QgsDataItem *parent, QString name, QString path, QString uri );
~QgsWMSConnectionItem() override;
2011-10-13 21:17:05 -03:00
2017-03-03 08:42:00 +01:00
QVector<QgsDataItem *> createChildren() override;
bool equal( const QgsDataItem *other ) override;
2011-10-13 21:17:05 -03:00
#ifdef HAVE_GUI
QList<QAction *> actions( QWidget *parent ) override;
#endif
public slots:
#ifdef HAVE_GUI
void editConnection();
void deleteConnection();
#endif
void deleteLater() override;
private:
QString mUri;
QgsWmsCapabilitiesDownload *mCapabilitiesDownload = nullptr;
2011-10-13 21:17:05 -03:00
};
// WMS Layers may be nested, so that they may be both QgsDataCollectionItem and QgsLayerItem
// We have to use QgsDataCollectionItem and support layer methods if necessary
class QgsWMSLayerItem : public QgsLayerItem
{
Q_OBJECT
public:
2017-03-03 08:42:00 +01:00
QgsWMSLayerItem( QgsDataItem *parent, QString name, QString path,
const QgsWmsCapabilitiesProperty &capabilitiesProperty,
const QgsDataSourceUri &dataSourceUri,
const QgsWmsLayerProperty &layerProperty );
2011-10-13 21:17:05 -03:00
QString createUri();
QgsWmsCapabilitiesProperty mCapabilitiesProperty;
QgsDataSourceUri mDataSourceUri;
2011-10-13 21:17:05 -03:00
QgsWmsLayerProperty mLayerProperty;
};
class QgsWMTSLayerItem : public QgsLayerItem
{
Q_OBJECT
public:
2017-03-03 08:42:00 +01:00
QgsWMTSLayerItem( QgsDataItem *parent,
const QString &name,
const QString &path,
const QgsDataSourceUri &dataSourceUri,
const QString &id,
const QString &format,
const QString &style,
const QString &tileMatrixSet,
const QString &crs,
const QString &title );
QString createUri();
QString layerName() const override { return mTitle; }
private:
QgsDataSourceUri mDataSourceUri;
QString mId, mFormat, mStyle, mTileMatrixSet, mCrs, mTitle;
};
2011-10-13 21:17:05 -03:00
class QgsWMSRootItem : public QgsDataCollectionItem
{
Q_OBJECT
public:
2017-03-03 08:42:00 +01:00
QgsWMSRootItem( QgsDataItem *parent, QString name, QString path );
2011-10-13 21:17:05 -03:00
2017-03-03 08:42:00 +01:00
QVector<QgsDataItem *> createChildren() override;
2011-10-13 21:17:05 -03:00
#ifdef HAVE_GUI
QList<QAction *> actions( QWidget *parent ) override;
QWidget *paramWidget() override;
#endif
2011-10-13 21:17:05 -03:00
public slots:
#ifdef HAVE_GUI
void newConnection();
#endif
2011-10-13 21:17:05 -03:00
};
//! Provider for WMS root data item
class QgsWmsDataItemProvider : public QgsDataItemProvider
{
public:
QString name() override { return QStringLiteral( "WMS" ); }
int capabilities() override { return QgsDataProvider::Net; }
QgsDataItem *createDataItem( const QString &path, QgsDataItem *parentItem ) override;
[FEATURE] QGIS - GeoNode Integration: Integrate with QGIS Browser Panel (#4816) * add Geonode connection menu to the toolbar * add header files for geonode-qgis client * add action to launch geonode connection dialog from menubar * Move to proper directory * Add geonodeconnection class. * Add unit test for geonode connection. * Use const static to avoid typo. * Get list layers from geonode. * Add get maps method. * Geonode connection dialog (#13) * add new geonode connection dialog * apply functionality to the geonode connection manager dialog * add save and load geonode connection functionality * edit baseKey and credentialBaseKey * remove auto-connect slots * Add unit test for geonode connection. * Add wms url getter. * Add uuid and layer name in the table. * Add handler for the list layer clicked. WIP. * Use new style connect, better hacky to get wms url. * update gitignore * Make QGIS able to add WMS layer from geonode. With hacky code. * Fix Docstring. * Show web service type (WMS/WFS) in layer table. * fix http and toolbar menu * add geonode data item to the browser panel as an extention of ows provider * [WIP] Add WFS. * Add geonode get service url. * combobox functionality and test geonode connection * Add WFS. * Disable add button if it's a map. Currently we can't do anything for map. * Add busy cursor when add layer. * get service uri capabilitites * add available layers to the geonode browser panel * remove debugging footprint and replace old style connect * add actions (new, edit, delete) to geonode browser panel * fix getLayers by WMS url * add Geonode connection menu to the toolbar * Filter out invalid layer / map. * Fix service url method. * Add service url for XYZ for GeoNode QGIS Server backend. * Add XYZ url to geonode connection dialog. * Add XYZ layer to QGIS. * fix double geonode submenu * add wfs/wms layers from browser panel using its native provider * comply with qgis3 new class naming * Handle different prefix for layer in GeoNode QGIS Server backend. * base class for cms connection * make geonode connection as a derived class from cms connection * update cmakelists * move geonode connection to geocms dir * update CMakeLists * Handle geonode 2.7 with new API. * Handle multiple geoserver url in one geonode. * Fix add xyz for qgis server. Fix add wms, wfs, xyz for geoserver in geonode 2.7 * Refactor serviceURL to return QStringList. * add 'add geonode layer' icon * add geonode to the data source manager dialog * [GeoNode-Client] Fix add WFS layer. * fix wms url parameter * add xyz dataitems * Use new style connect. * [GeoNode Client] Handle qgis server specific typename to make add WFS works. * Code improvement. * [GeoNode Client] Make geonode dialog in add universal layer can add layer. * Open universal add layer when click Add GeoNode layer. * Make sure the geonode url has protocol. * Handle geonode version in a better way. * make sure the serviceUrl method has scheme in its urls * add services option to the dialog * remove version label if not wfs * construct wms url with parameters for geonode connection * handle layer from multi service urls for every wfs, wms, & xyz services * fix new style connect using static_cast * hode close button if dialog is in embedded mode * fix xyz layer naming in the browser tree * create base class for geocms dataitems * fix compiling warning * Use struct instead QVariantMap. * tidy up code * Tidy up code, use QgsStringMap instead QVariantMap. * Add spellok for catalogue. * update sip * update sip * Use naming convention for QgsGeoCmsConnection and use QUuid. * Async by using GeoNodeRequest class. * Move geonode to src/gui. * Use stack not heap. * Remove unused includes. * Use signal to handle request. * Use QStringLiteral. * Switch to use Q_FOREACH. * Use Q_FOREACH and addressing PR's review. * Set private for data members. * update sip * Update sip. * Update sip. * Fix sip problem to make it buildable again. * Remove geocms * Tidy up code. * Use QgsSetting Scope::Provider. * Fix missing zip.h
2017-08-07 02:24:12 +07:00
QVector<QgsDataItem *> createDataItems( const QString &path, QgsDataItem *parentItem ) override;
};
//! Root item for XYZ tile layers
class QgsXyzTileRootItem : public QgsDataCollectionItem
{
Q_OBJECT
public:
2017-03-03 08:42:00 +01:00
QgsXyzTileRootItem( QgsDataItem *parent, QString name, QString path );
2017-03-03 08:42:00 +01:00
QVector<QgsDataItem *> createChildren() override;
#ifdef HAVE_GUI
QList<QAction *> actions( QWidget *parent ) override;
#endif
private slots:
#ifdef HAVE_GUI
void newConnection();
#endif
};
//! Item implementation for XYZ tile layers
class QgsXyzLayerItem : public QgsLayerItem
{
Q_OBJECT
public:
2017-03-03 08:42:00 +01:00
QgsXyzLayerItem( QgsDataItem *parent, QString name, QString path, const QString &encodedUri );
#ifdef HAVE_GUI
QList<QAction *> actions( QWidget *parent ) override;
#endif
public slots:
#ifdef HAVE_GUI
void editConnection();
void deleteConnection();
#endif
};
//! Provider for XYZ root data item
class QgsXyzTileDataItemProvider : public QgsDataItemProvider
{
public:
QString name() override { return QStringLiteral( "XYZ Tiles" ); }
int capabilities() override { return QgsDataProvider::Net; }
QgsDataItem *createDataItem( const QString &path, QgsDataItem *parentItem ) override
{
if ( path.isEmpty() )
return new QgsXyzTileRootItem( parentItem, QStringLiteral( "XYZ Tiles" ), QStringLiteral( "xyz:" ) );
return nullptr;
}
[FEATURE] QGIS - GeoNode Integration: Integrate with QGIS Browser Panel (#4816) * add Geonode connection menu to the toolbar * add header files for geonode-qgis client * add action to launch geonode connection dialog from menubar * Move to proper directory * Add geonodeconnection class. * Add unit test for geonode connection. * Use const static to avoid typo. * Get list layers from geonode. * Add get maps method. * Geonode connection dialog (#13) * add new geonode connection dialog * apply functionality to the geonode connection manager dialog * add save and load geonode connection functionality * edit baseKey and credentialBaseKey * remove auto-connect slots * Add unit test for geonode connection. * Add wms url getter. * Add uuid and layer name in the table. * Add handler for the list layer clicked. WIP. * Use new style connect, better hacky to get wms url. * update gitignore * Make QGIS able to add WMS layer from geonode. With hacky code. * Fix Docstring. * Show web service type (WMS/WFS) in layer table. * fix http and toolbar menu * add geonode data item to the browser panel as an extention of ows provider * [WIP] Add WFS. * Add geonode get service url. * combobox functionality and test geonode connection * Add WFS. * Disable add button if it's a map. Currently we can't do anything for map. * Add busy cursor when add layer. * get service uri capabilitites * add available layers to the geonode browser panel * remove debugging footprint and replace old style connect * add actions (new, edit, delete) to geonode browser panel * fix getLayers by WMS url * add Geonode connection menu to the toolbar * Filter out invalid layer / map. * Fix service url method. * Add service url for XYZ for GeoNode QGIS Server backend. * Add XYZ url to geonode connection dialog. * Add XYZ layer to QGIS. * fix double geonode submenu * add wfs/wms layers from browser panel using its native provider * comply with qgis3 new class naming * Handle different prefix for layer in GeoNode QGIS Server backend. * base class for cms connection * make geonode connection as a derived class from cms connection * update cmakelists * move geonode connection to geocms dir * update CMakeLists * Handle geonode 2.7 with new API. * Handle multiple geoserver url in one geonode. * Fix add xyz for qgis server. Fix add wms, wfs, xyz for geoserver in geonode 2.7 * Refactor serviceURL to return QStringList. * add 'add geonode layer' icon * add geonode to the data source manager dialog * [GeoNode-Client] Fix add WFS layer. * fix wms url parameter * add xyz dataitems * Use new style connect. * [GeoNode Client] Handle qgis server specific typename to make add WFS works. * Code improvement. * [GeoNode Client] Make geonode dialog in add universal layer can add layer. * Open universal add layer when click Add GeoNode layer. * Make sure the geonode url has protocol. * Handle geonode version in a better way. * make sure the serviceUrl method has scheme in its urls * add services option to the dialog * remove version label if not wfs * construct wms url with parameters for geonode connection * handle layer from multi service urls for every wfs, wms, & xyz services * fix new style connect using static_cast * hode close button if dialog is in embedded mode * fix xyz layer naming in the browser tree * create base class for geocms dataitems * fix compiling warning * Use struct instead QVariantMap. * tidy up code * Tidy up code, use QgsStringMap instead QVariantMap. * Add spellok for catalogue. * update sip * update sip * Use naming convention for QgsGeoCmsConnection and use QUuid. * Async by using GeoNodeRequest class. * Move geonode to src/gui. * Use stack not heap. * Remove unused includes. * Use signal to handle request. * Use QStringLiteral. * Switch to use Q_FOREACH. * Use Q_FOREACH and addressing PR's review. * Set private for data members. * update sip * Update sip. * Update sip. * Fix sip problem to make it buildable again. * Remove geocms * Tidy up code. * Use QgsSetting Scope::Provider. * Fix missing zip.h
2017-08-07 02:24:12 +07:00
QVector<QgsDataItem *> createDataItems( const QString &path, QgsDataItem *parentItem ) override;
};
2011-10-13 21:17:05 -03:00
#endif // QGSWMSDATAITEMS_H