diff --git a/python/core/qgsowsconnection.sip b/python/core/qgsowsconnection.sip index 91ddd345681..c13a4e67637 100644 --- a/python/core/qgsowsconnection.sip +++ b/python/core/qgsowsconnection.sip @@ -15,14 +15,19 @@ class QgsOWSConnection : QObject //! Destructor ~QgsOWSConnection(); + /** Returns the list of connections for the specified service */ static QStringList connectionList( const QString & theService ); + /** Deletes the connection for the specified service with the specified name */ static void deleteConnection( const QString & theService, const QString & name ); + /** Retreives the selected connection for the specified service */ static QString selectedConnection( const QString & theService ); + /** Marks the specified connection for the specified service as selected */ static void setSelectedConnection( const QString & theService, const QString & name ); QString mConnName; + /** Returns the connection uri */ QgsDataSourceURI uri() const; QString mConnectionInfo; diff --git a/python/core/raster/qgsrasterdataprovider.sip b/python/core/raster/qgsrasterdataprovider.sip index 4316dab656e..b1c312dff1d 100644 --- a/python/core/raster/qgsrasterdataprovider.sip +++ b/python/core/raster/qgsrasterdataprovider.sip @@ -10,17 +10,22 @@ class QgsImageFetcher : QObject #include %End public: - + /** Constructor */ QgsImageFetcher( QObject* parent = 0 ); + /** Destructor */ virtual ~QgsImageFetcher(); - // Make sure to connect to "finish" and "error" before starting + /** Starts the image download + * @note Make sure to connect to "finish" and "error" before starting */ virtual void start() = 0; signals: - + /** Emitted when the download completes + * @param legend The downloaded legend image */ void finish( const QImage& legend ); + /** Emitted to report progress */ void progress( qint64 received, qint64 total ); + /** Emitted when an error occurs */ void error( const QString& msg ); }; diff --git a/python/gui/qgisinterface.sip b/python/gui/qgisinterface.sip index 7b2ffec81c4..74fb31e814b 100644 --- a/python/gui/qgisinterface.sip +++ b/python/gui/qgisinterface.sip @@ -423,7 +423,9 @@ class QgisInterface : QObject virtual QAction *actionAddRasterLayer() = 0; virtual QAction *actionAddPgLayer() = 0; virtual QAction *actionAddWmsLayer() = 0; + /** Get access to the native Add ArcGIS FeatureServer action. */ virtual QAction *actionAddAfsLayer() = 0; + /** Get access to the native Add ArcGIS MapServer action. */ virtual QAction *actionAddAmsLayer() = 0; virtual QAction *actionCopyLayerStyle() = 0; virtual QAction *actionPasteLayerStyle() = 0; diff --git a/src/app/qgisappinterface.h b/src/app/qgisappinterface.h index c0eab3a228a..26d32437bbd 100644 --- a/src/app/qgisappinterface.h +++ b/src/app/qgisappinterface.h @@ -397,7 +397,9 @@ class APP_EXPORT QgisAppInterface : public QgisInterface virtual QAction *actionAddRasterLayer() override; virtual QAction *actionAddPgLayer() override; virtual QAction *actionAddWmsLayer() override; + /** Get access to the native Add ArcGIS FeatureServer action. */ virtual QAction *actionAddAfsLayer() override; + /** Get access to the native Add ArcGIS MapServer action. */ virtual QAction *actionAddAmsLayer() override; virtual QAction *actionCopyLayerStyle() override; virtual QAction *actionPasteLayerStyle() override; diff --git a/src/core/qgsowsconnection.h b/src/core/qgsowsconnection.h index 57df7e59733..031fa8eddfb 100644 --- a/src/core/qgsowsconnection.h +++ b/src/core/qgsowsconnection.h @@ -45,14 +45,19 @@ class CORE_EXPORT QgsOWSConnection : public QObject //! Destructor ~QgsOWSConnection(); + /** Returns the list of connections for the specified service */ static QStringList connectionList( const QString & theService ); + /** Deletes the connection for the specified service with the specified name */ static void deleteConnection( const QString & theService, const QString & name ); + /** Retreives the selected connection for the specified service */ static QString selectedConnection( const QString & theService ); + /** Marks the specified connection for the specified service as selected */ static void setSelectedConnection( const QString & theService, const QString & name ); QString mConnName; + /** Returns the connection uri */ QgsDataSourceURI uri() const; QString mConnectionInfo; diff --git a/src/core/raster/qgsrasterdataprovider.h b/src/core/raster/qgsrasterdataprovider.h index 67cf0af05de..c158dcaebc5 100644 --- a/src/core/raster/qgsrasterdataprovider.h +++ b/src/core/raster/qgsrasterdataprovider.h @@ -60,17 +60,22 @@ class CORE_EXPORT QgsImageFetcher : public QObject { Q_OBJECT public: - + /** Constructor */ QgsImageFetcher( QObject* parent = 0 ) : QObject( parent ) {} + /** Destructor */ virtual ~QgsImageFetcher() {} - // Make sure to connect to "finish" and "error" before starting + /** Starts the image download + * @note Make sure to connect to "finish" and "error" before starting */ virtual void start() = 0; signals: - + /** Emitted when the download completes + * @param legend The downloaded legend image */ void finish( const QImage& legend ); + /** Emitted to report progress */ void progress( qint64 received, qint64 total ); + /** Emitted when an error occurs */ void error( const QString& msg ); }; diff --git a/src/gui/qgisinterface.h b/src/gui/qgisinterface.h index 20832afe3b3..62dd2aa4213 100644 --- a/src/gui/qgisinterface.h +++ b/src/gui/qgisinterface.h @@ -480,7 +480,9 @@ class GUI_EXPORT QgisInterface : public QObject virtual QAction *actionAddRasterLayer() = 0; virtual QAction *actionAddPgLayer() = 0; virtual QAction *actionAddWmsLayer() = 0; + /** Get access to the native Add ArcGIS FeatureServer action. */ virtual QAction *actionAddAfsLayer() = 0; + /** Get access to the native Add ArcGIS MapServer action. */ virtual QAction *actionAddAmsLayer() = 0; virtual QAction *actionCopyLayerStyle() = 0; virtual QAction *actionPasteLayerStyle() = 0; diff --git a/src/gui/qgssourceselectdialog.cpp b/src/gui/qgssourceselectdialog.cpp index 30d1abf5a9d..517f315d17e 100644 --- a/src/gui/qgssourceselectdialog.cpp +++ b/src/gui/qgssourceselectdialog.cpp @@ -36,10 +36,11 @@ #include #include - +/** Item delegate with tweaked sizeHint. */ class QgsSourceSelectItemDelegate : public QItemDelegate { public: + /** Constructor */ QgsSourceSelectItemDelegate( QObject *parent = 0 ) : QItemDelegate( parent ) { } QSize sizeHint( const QStyleOptionViewItem &option, const QModelIndex &index ) const override; }; diff --git a/src/gui/qgssourceselectdialog.h b/src/gui/qgssourceselectdialog.h index 45537523a8e..05c444b4563 100644 --- a/src/gui/qgssourceselectdialog.h +++ b/src/gui/qgssourceselectdialog.h @@ -18,20 +18,28 @@ class QSortFilterProxyModel; class QgsGenericProjectionSelector; class QgsOWSConnection; - +/** + * Generic class listing layers available from a remote service. + */ class GUI_EXPORT QgsSourceSelectDialog : public QDialog, protected Ui::QgsSourceSelectBase { Q_OBJECT public: + /** Whether the dialog is for a map service or a feature service */ enum ServiceType { MapService, FeatureService }; + /** Constructor */ QgsSourceSelectDialog( const QString& serviceName, ServiceType serviceType, QWidget* parent, Qt::WindowFlags fl ); + /** Destructor */ ~QgsSourceSelectDialog(); + /** Sets the current extent and CRS. Used to select an appropriate CRS and possibly to retreive data only in the current extent */ void setCurrentExtentAndCrs( const QgsRectangle& canvasExtent, const QgsCoordinateReferenceSystem& canvasCrs ); signals: + /** Emitted when a layer is added from the dialog */ void addLayer( QString uri, QString typeName ); + /** Emitted when the connections for the service were changed */ void connectionsChanged(); protected: @@ -48,18 +56,22 @@ class GUI_EXPORT QgsSourceSelectDialog : public QDialog, protected Ui::QgsSource QgsRectangle mCanvasExtent; QgsCoordinateReferenceSystem mCanvasCrs; + /** To be implemented in the child class. Called when a new connection is initiated. */ virtual bool connectToService( const QgsOWSConnection& connection ) = 0; + /** May be implemented in child classes for services which support customized queries. */ virtual void buildQuery( const QgsOWSConnection&, const QModelIndex& ) {} + /** To be implemented in the child class. Constructs an URI for the specified service layer. */ virtual QString getLayerURI( const QgsOWSConnection& connection, const QString& layerTitle, const QString& layerName, const QString& crs = QString(), const QString& filter = QString(), const QgsRectangle& bBox = QgsRectangle() ) const = 0; + /** Updates the UI for the list of available image encodings from the specified list. */ void populateImageEncodings( const QStringList& availableEncodings ); + /** Returns the selected image encoding. */ QString getSelectedImageEncoding() const; - private: void populateConnectionList();