Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Docstring updates
  • Loading branch information
manisandro committed Jun 2, 2016
1 parent ed2487d commit 0ac8ce1
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 9 deletions.
5 changes: 5 additions & 0 deletions python/core/qgsowsconnection.sip
Expand Up @@ -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;

Expand Down
11 changes: 8 additions & 3 deletions python/core/raster/qgsrasterdataprovider.sip
Expand Up @@ -10,17 +10,22 @@ class QgsImageFetcher : QObject
#include <qgsrasterdataprovider.h>
%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 );
};

Expand Down
2 changes: 2 additions & 0 deletions python/gui/qgisinterface.sip
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions src/app/qgisappinterface.h
Expand Up @@ -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;
Expand Down
5 changes: 5 additions & 0 deletions src/core/qgsowsconnection.h
Expand Up @@ -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;

Expand Down
11 changes: 8 additions & 3 deletions src/core/raster/qgsrasterdataprovider.h
Expand Up @@ -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 );
};

Expand Down
2 changes: 2 additions & 0 deletions src/gui/qgisinterface.h
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion src/gui/qgssourceselectdialog.cpp
Expand Up @@ -36,10 +36,11 @@
#include <QRadioButton>
#include <QImageReader>


/** 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;
};
Expand Down
16 changes: 14 additions & 2 deletions src/gui/qgssourceselectdialog.h
Expand Up @@ -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:
Expand All @@ -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();

Expand Down

0 comments on commit 0ac8ce1

Please sign in to comment.