This commit is contained in:
Matthias Kuhn 2017-04-07 08:50:57 +02:00
parent f450b98b26
commit d902575f58
13 changed files with 913 additions and 360 deletions

View File

@ -4,7 +4,6 @@ core/qgis.sip
core/qgsapplication.sip
core/qgsbearingutils.sip
core/qgsbrowsermodel.sip
core/qgscolorramp.sip
core/qgscolorscheme.sip
core/qgscolorschemeregistry.sip
core/qgscontexthelp.sip
@ -52,7 +51,6 @@ core/qgsfontutils.sip
core/qgslabelsearchtree.sip
core/qgslegendrenderer.sip
core/qgslegendsettings.sip
core/qgslegendstyle.sip
core/qgslogger.sip
core/qgsmaphittest.sip
core/qgsmaplayer.sip
@ -71,14 +69,12 @@ core/qgsmapsettings.sip
core/qgsmaptopixel.sip
core/qgsmapunitscale.sip
core/qgsmargins.sip
core/qgsmessagelog.sip
core/qgsmessageoutput.sip
core/qgsmimedatautils.sip
core/qgsmultirenderchecker.sip
core/qgsnetworkaccessmanager.sip
core/qgsnetworkcontentfetcher.sip
core/qgsobjectcustomproperties.sip
core/qgsofflineediting.sip
core/qgsogcutils.sip
core/qgsoptionalexpression.sip
core/qgsowsconnection.sip
@ -427,7 +423,6 @@ gui/qgsmaptoolzoom.sip
gui/qgsmaplayerstylemanagerwidget.sip
gui/qgsmessagebar.sip
gui/qgsmessagebaritem.sip
gui/qgsmessagelogviewer.sip
gui/qgsmessageviewer.sip
gui/qgsnewhttpconnection.sip
gui/qgsnewmemorylayerdialog.sip

File diff suppressed because it is too large Load Diff

View File

@ -1,48 +1,88 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgslegendstyle.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsLegendStyle
{
%Docstring
Composer legend components style
%End
%TypeHeaderCode
#include <qgslegendstyle.h>
#include "qgslegendstyle.h"
%End
public:
enum Style
{
Undefined, // should not happen, only if corrupted project file
Hidden, // special style, item is hidden includeing margins around
Undefined,
Hidden,
Title,
Group,
Subgroup, // layer
Symbol, // symbol without label
Subgroup,
Symbol,
SymbolLabel
};
enum Side // margin side
enum Side //! margin side
{
Top,
Bottom,
Left,
Right,
};
Right };
QgsLegendStyle();
QFont font() const;
QFont & rfont();
void setFont( const QFont & font );
%Docstring
:rtype: QFont
%End
void setFont( const QFont &font );
double margin( Side side );
%Docstring
:rtype: float
%End
void setMargin( Side side, double margin );
// set all margins
void setMargin( double margin );
%Docstring
set all margins
%End
void writeXml( const QString& name, QDomElement& elem, QDomDocument & doc ) const;
void writeXml( const QString &name, QDomElement &elem, QDomDocument &doc ) const;
void readXml( const QDomElement& elem, const QDomDocument& doc );
void readXml( const QDomElement &elem, const QDomDocument &doc );
/** Get name for style, used in project file */
static QString styleName( Style s );
%Docstring
Get name for style, used in project file
:rtype: str
%End
/** Get style from name, used in project file */
static Style styleFromName( const QString& styleName );
static Style styleFromName( const QString &styleName );
%Docstring
Get style from name, used in project file
:rtype: Style
%End
/** Get style label, translated, used in UI */
static QString styleLabel( Style s );
%Docstring
Get style label, translated, used in UI
:rtype: str
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgslegendstyle.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,43 +1,77 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmessagelog.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMessageLog : QObject
{
%TypeHeaderCode
#include <qgsmessagelog.h>
%Docstring
Interface for logging messages from QGIS in GUI independent way.
This class provides abstraction of a tabbed window for showing messages to the user.
By default QgsMessageLogOutput will be used if not overridden with another
message log creator function.
QGIS application uses QgsMessageLog class for logging messages in a dockable
window for the user.
QgsMessageLog is not usually directly created, but rather accessed through
QgsApplication.messageLog().
%End
%TypeHeaderCode
#include "qgsmessagelog.h"
%End
public:
QgsMessageLog();
enum MessageLevel
{
ALL,
INFO,
WARNING,
CRITICAL,
};
NONE };
//! add a message to the instance (and create it if necessary)
static void logMessage( const QString& message, const QString& tag = QString::null, MessageLevel level = WARNING );
QgsMessageLog();
static void logMessage( const QString &message, const QString &tag = QString(), MessageLevel level = QgsMessageLog::WARNING );
%Docstring
add a message to the instance (and create it if necessary)
%End
signals:
void messageReceived( const QString& message, const QString& tag, MessageLevel level );
void messageReceived( const QString &message, const QString &tag, QgsMessageLog::MessageLevel level );
void messageReceived( bool received );
};
/**
\brief Default implementation of message logging interface
This class outputs log messages to the standard output. Therefore it might
be the right choice for apps without GUI.
*/
class QgsMessageLogConsole : QObject
{
%TypeHeaderCode
#include <qgsmessagelog.h>
%Docstring
Default implementation of message logging interface
This class outputs log messages to the standard output. Therefore it might
be the right choice for apps without GUI.
%End
%TypeHeaderCode
#include "qgsmessagelog.h"
%End
public:
QgsMessageLogConsole();
public slots:
void logMessage( const QString& message, const QString& tag, QgsMessageLog::MessageLevel level );
void logMessage( const QString &message, const QString &tag, QgsMessageLog::MessageLevel level );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsmessagelog.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,13 +1,22 @@
/** \class QgsOfflineEditing
* \brief Class for accessing functionality of Offline Editing Plugin.
* This class can be used to access offline editing functionality from plugins.
*/
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsofflineediting.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
struct sqlite3;
class QgsOfflineEditing : QObject
{
%TypeHeaderCode
#include <qgsofflineediting.h>
%End
%TypeHeaderCode
#include "qgsofflineediting.h"
%End
public:
enum ProgressMode
{
@ -21,49 +30,75 @@ class QgsOfflineEditing : QObject
};
QgsOfflineEditing();
~QgsOfflineEditing();
/** Convert current project for offline editing
* @param offlineDataPath path to offline db file
* @param offlineDbFile offline db file name
* @param layerIds list of layer names to convert
*/
bool convertToOfflineProject( const QString& offlineDataPath, const QString& offlineDbFile, const QStringList& layerIds, bool onlySelected = false );
bool convertToOfflineProject( const QString &offlineDataPath, const QString &offlineDbFile, const QStringList &layerIds, bool onlySelected = false );
%Docstring
Convert current project for offline editing
\param offlineDataPath Path to offline db file
\param offlineDbFile Offline db file name
\param layerIds List of layer names to convert
\param onlySelected Only copy selected features from layers where a selection is present
:rtype: bool
%End
/** Return true if current project is offline */
bool isOfflineProject() const;
%Docstring
Return true if current project is offline
:rtype: bool
%End
/** Synchronize to remote layers */
void synchronize();
%Docstring
Synchronize to remote layers
%End
signals:
/** Emit a signal that processing has started */
void progressStarted();
%Docstring
The signal is emitted when the process has started.
%End
/** Emit a signal that the next layer of numLayers has started processing
* @param layer current layer index
* @param numLayers total number of layers
*/
void layerProgressUpdated( int layer, int numLayers );
%Docstring
Is emitted whenever a new layer is being processed.
It is possible to estimate the progress of the complete operation by
comparing the index of the current layer to the total amount
numLayers.
%End
/** Emit a signal that sets the mode for the progress of the current operation
* @param mode progress mode
* @param maximum total number of entities to process in the current operation
*/
void progressModeSet( QgsOfflineEditing::ProgressMode mode, int maximum );
%Docstring
Is emitted when the mode for the progress of the current operation is
set.
\param mode progress mode
\param maximum total number of entities to process in the current operation
%End
/** Emit a signal with the progress of the current mode
* @param progress current index of processed entities
*/
void progressUpdated( int progress );
%Docstring
Emitted with the progress of the current mode
\param progress current index of processed entities
%End
/** Emit a signal that processing of all layers has finished */
void progressStopped();
%Docstring
Emitted when the processing of all layers has finished
%End
void warning( const QString &title, const QString &message );
%Docstring
Emitted when a warning needs to be displayed.
\param title title string for message
\param message A descriptive message for the warning
%End
/**
* Emitted when a warning needs to be displayed.
* @param title title string for message
* @param message A descriptive message for the warning
*/
void warning( const QString& title, const QString& message );
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsofflineediting.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -1,16 +1,40 @@
/** \ingroup gui
* A generic dialog widget for displaying QGIS log messages.
*/
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsmessagelogviewer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
class QgsMessageLogViewer: QDialog
{
%TypeHeaderCode
#include <qgsmessagelogviewer.h>
%Docstring
A generic dialog widget for displaying QGIS log messages.
%End
%TypeHeaderCode
#include "qgsmessagelogviewer.h"
%End
public:
QgsMessageLogViewer( QStatusBar *statusBar = 0, QWidget *parent /TransferThis/ = 0, const Qt::WindowFlags& fl = QgisGui::ModalDialogFlags );
~QgsMessageLogViewer();
QgsMessageLogViewer( QStatusBar *statusBar = 0, QWidget *parent /TransferThis/ = 0, Qt::WindowFlags fl = QgisGui::ModalDialogFlags );
public slots:
void logMessage( QString message, QString tag, QgsMessageLog::MessageLevel level );
protected:
void closeEvent( QCloseEvent *e );
void reject();
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsmessagelogviewer.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

View File

@ -29,6 +29,25 @@
*/
class CORE_EXPORT QgsColorRamp
{
#ifdef SIP_RUN
SIP_CONVERT_TO_SUBCLASS_CODE
if ( sipCpp->type() == "gradient" )
sipType = sipType_QgsGradientColorRamp;
else if ( sipCpp->type() == "random" )
sipType = sipType_QgsLimitedRandomColorRamp;
else if ( sipCpp->type() == "randomcolors" )
sipType = sipType_QgsRandomColorRamp;
else if ( sipCpp->type() == "preset" )
sipType = sipType_QgsPresetSchemeColorRamp;
else if ( sipCpp->type() == "colorbrewer" )
sipType = sipType_QgsColorBrewerColorRamp;
else if ( sipCpp->type() == "cpt-city" )
sipType = sipType_QgsCptCityColorRamp;
else
sipType = 0;
SIP_END
#endif
public:
virtual ~QgsColorRamp() = default;
@ -58,7 +77,7 @@ class CORE_EXPORT QgsColorRamp
/** Creates a clone of the color ramp.
*/
virtual QgsColorRamp *clone() const = 0;
virtual QgsColorRamp *clone() const = 0 SIP_FACTORY;
/** Returns a string map containing all the color ramp's properties.
*/
@ -257,12 +276,12 @@ class CORE_EXPORT QgsLimitedRandomColorRamp : public QgsColorRamp
* \param properties color ramp properties
* \see properties()
*/
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() );
static QgsColorRamp *create( const QgsStringMap &properties = QgsStringMap() ) SIP_FACTORY;
virtual double value( int index ) const override;
virtual QColor color( double value ) const override;
virtual QString type() const override { return QStringLiteral( "random" ); }
virtual QgsLimitedRandomColorRamp *clone() const override;
virtual QgsLimitedRandomColorRamp *clone() const override SIP_FACTORY;
virtual QgsStringMap properties() const override;
int count() const override { return mCount; }
@ -345,7 +364,12 @@ class CORE_EXPORT QgsLimitedRandomColorRamp : public QgsColorRamp
protected:
int mCount;
int mHueMin, mHueMax, mSatMin, mSatMax, mValMin, mValMax;
int mHueMin;
int mHueMax;
int mSatMin;
int mSatMax;
int mValMin;
int mValMax;
QList<QColor> mColors;
};
@ -376,9 +400,9 @@ class CORE_EXPORT QgsRandomColorRamp: public QgsColorRamp
QString type() const override;
QgsRandomColorRamp *clone() const override;
virtual QgsRandomColorRamp *clone() const override SIP_FACTORY;
QgsStringMap properties() const override;
virtual QgsStringMap properties() const override;
protected:
@ -431,7 +455,7 @@ class CORE_EXPORT QgsPresetSchemeColorRamp : public QgsColorRamp, public QgsColo
virtual QColor color( double value ) const override;
virtual QString type() const override { return QStringLiteral( "preset" ); }
virtual void invert() override;
virtual QgsPresetSchemeColorRamp *clone() const override;
virtual QgsPresetSchemeColorRamp *clone() const override SIP_FACTORY;
virtual QgsStringMap properties() const override;
int count() const override;
@ -479,7 +503,7 @@ class CORE_EXPORT QgsColorBrewerColorRamp : public QgsColorRamp
virtual QColor color( double value ) const override;
virtual QString type() const override { return QStringLiteral( "colorbrewer" ); }
virtual void invert() override;
virtual QgsColorBrewerColorRamp *clone() const override;
virtual QgsColorBrewerColorRamp *clone() const override SIP_FACTORY;
virtual QgsStringMap properties() const override;
virtual int count() const override { return mColors; }
@ -569,9 +593,9 @@ class CORE_EXPORT QgsCptCityColorRamp : public QgsGradientColorRamp
virtual void invert() override;
virtual QgsCptCityColorRamp *clone() const override;
virtual QgsCptCityColorRamp *clone() const override SIP_FACTORY;
void copy( const QgsCptCityColorRamp *other );
QgsGradientColorRamp *cloneGradientRamp() const;
QgsGradientColorRamp *cloneGradientRamp() const SIP_FACTORY;
virtual QgsStringMap properties() const override;
@ -579,7 +603,7 @@ class CORE_EXPORT QgsCptCityColorRamp : public QgsGradientColorRamp
QString variantName() const { return mVariantName; }
QStringList variantList() const { return mVariantList; }
/* lazy loading - have to call loadPalette() explicitly */
// lazy loading - have to call loadPalette() explicitly
void setSchemeName( const QString &schemeName ) { mSchemeName = schemeName; mFileLoaded = false; }
void setVariantName( const QString &variantName ) { mVariantName = variantName; mFileLoaded = false; }
void setVariantList( const QStringList &variantList ) { mVariantList = variantList; }
@ -598,13 +622,13 @@ class CORE_EXPORT QgsCptCityColorRamp : public QgsGradientColorRamp
QgsStringMap copyingInfo() const;
protected:
QString mSchemeName;
QString mVariantName;
QStringList mVariantList;
bool mFileLoaded;
bool mMultiStops;
bool mInverted;
};

View File

@ -52,8 +52,12 @@ class CORE_EXPORT QgsLegendSettings
*/
void setTitleAlignment( Qt::AlignmentFlag alignment ) { mTitleAlignment = alignment; }
//! Returns reference to modifiable style
QgsLegendStyle &rstyle( QgsLegendStyle::Style s ) { return mStyleMap[s]; }
/**
* Returns reference to modifiable style
*
* \note Not available in Python bindings.
*/
SIP_SKIP QgsLegendStyle &rstyle( QgsLegendStyle::Style s ) { return mStyleMap[s]; }
//! Returns style
QgsLegendStyle style( QgsLegendStyle::Style s ) const { return mStyleMap.value( s ); }
void setStyle( QgsLegendStyle::Style s, const QgsLegendStyle &style ) { mStyleMap[s] = style; }

View File

@ -25,6 +25,7 @@
#include <QDomDocument>
#include "qgis_core.h"
#include "qgis.h"
/** \ingroup core
* Composer legend components style
@ -34,15 +35,15 @@ class CORE_EXPORT QgsLegendStyle
public:
enum Style
{
Undefined, // should not happen, only if corrupted project file
Hidden, // special style, item is hidden includeing margins around
Undefined, //!< Should not happen, only if corrupted project file
Hidden, //!< Special style, item is hidden including margins around
Title,
Group,
Subgroup, // layer
Symbol, // symbol without label
Subgroup, //!< Layer
Symbol, //!< Symbol without label
SymbolLabel
};
enum Side // margin side
enum Side //! margin side
{
Top = 0,
Bottom = 1,
@ -52,13 +53,13 @@ class CORE_EXPORT QgsLegendStyle
QgsLegendStyle();
QFont font() const { return mFont; }
QFont &rfont() { return mFont; }
SIP_SKIP QFont &rfont() { return mFont; }
void setFont( const QFont &font ) { mFont = font; }
double margin( Side side ) { return mMarginMap.value( side ); }
void setMargin( Side side, double margin ) { mMarginMap[side] = margin; }
// set all margins
//! set all margins
void setMargin( double margin );
void writeXml( const QString &name, QDomElement &elem, QDomDocument &doc ) const;
@ -76,7 +77,7 @@ class CORE_EXPORT QgsLegendStyle
private:
QFont mFont;
// Space around element
//! Space around element
QMap<Side, double> mMarginMap;
};

View File

@ -52,7 +52,7 @@ class CORE_EXPORT QgsMessageLog : public QObject
QgsMessageLog();
//! add a message to the instance (and create it if necessary)
static void logMessage( const QString &message, const QString &tag = QString::null, MessageLevel level = WARNING );
static void logMessage( const QString &message, const QString &tag = QString(), MessageLevel level = QgsMessageLog::WARNING );
signals:
void messageReceived( const QString &message, const QString &tag, QgsMessageLog::MessageLevel level );

View File

@ -65,27 +65,34 @@ class CORE_EXPORT QgsOfflineEditing : public QObject
void synchronize();
signals:
//! Emit a signal that processing has started
/**
* The signal is emitted when the process has started.
*/
void progressStarted();
/** Emit a signal that the next layer of numLayers has started processing
* \param layer current layer index
* \param numLayers total number of layers
/**
* Is emitted whenever a new layer is being processed.
* It is possible to estimate the progress of the complete operation by
* comparing the index of the current \a layer to the total amount
* \a numLayers.
*/
void layerProgressUpdated( int layer, int numLayers );
/** Emit a signal that sets the mode for the progress of the current operation
/**
* Is emitted when the mode for the progress of the current operation is
* set.
* \param mode progress mode
* \param maximum total number of entities to process in the current operation
*/
void progressModeSet( QgsOfflineEditing::ProgressMode mode, int maximum );
/** Emit a signal with the progress of the current mode
/** Emitted with the progress of the current mode
* \param progress current index of processed entities
*/
void progressUpdated( int progress );
//! Emit a signal that processing of all layers has finished
//! Emitted when the processing of all layers has finished
void progressStopped();
/**

View File

@ -23,6 +23,7 @@
#include <QString>
#include "qgis_gui.h"
#include "qgis.h"
class QStatusBar;
class QCloseEvent;
@ -34,7 +35,7 @@ class GUI_EXPORT QgsMessageLogViewer: public QDialog, private Ui::QgsMessageLogV
{
Q_OBJECT
public:
QgsMessageLogViewer( QStatusBar *statusBar = nullptr, QWidget *parent = nullptr, Qt::WindowFlags fl = QgisGui::ModalDialogFlags );
QgsMessageLogViewer( QStatusBar *statusBar = nullptr, QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags fl = QgisGui::ModalDialogFlags );
public slots:
void logMessage( QString message, QString tag, QgsMessageLog::MessageLevel level );

View File

@ -237,6 +237,7 @@ class CORE_EXPORT QgsSipifyHeader : public QtClass<QVariant>, private Ui::QgsBas
private:
void PrivateAgain();
/* Single line block comments shouldn't break the parser */
struct ProcessFeatureWrapper
{