Skip to content

Commit

Permalink
- add missing sip bindings
Browse files Browse the repository at this point in the history
- port widgets_tree.py to QtXml and update customization.xml (fixes #5752 and  #8054)
  • Loading branch information
jef-n committed Jun 22, 2013
1 parent c8f1bb9 commit 99f998a
Show file tree
Hide file tree
Showing 57 changed files with 4,074 additions and 1,752 deletions.
15 changes: 15 additions & 0 deletions python/core/composer/qgscomposereffect.sip
@@ -0,0 +1,15 @@
class QgsComposerEffect : QGraphicsEffect
{
%TypeHeaderCode
#include <qgscomposereffect.h>
%End
public:
QgsComposerEffect();
~QgsComposerEffect();

void setCompositionMode( const QPainter::CompositionMode compositionMode );

protected:
/** Called whenever source needs to be drawn */
virtual void draw( QPainter *painter );
};
49 changes: 49 additions & 0 deletions python/core/composer/qgscomposerlegendstyle.sip
@@ -0,0 +1,49 @@
class QgsComposerLegendStyle
{
%TypeHeaderCode
#include <qgscomposerlegendstyle.h>
%End
public:
enum Style
{
Undefined, // should not happen, only if corrupted project file
Hidden, // special style, item is hidden includeing margins around
Title,
Group,
Subgroup, // layer
Symbol, // symbol without label
SymbolLabel
};
enum Side // margin side
{
Top = 0,
Bottom = 1,
Left = 2,
Right = 3
};
QgsComposerLegendStyle();
~QgsComposerLegendStyle();

QFont font() const;
QFont & rfont();
void setFont( const QFont & font );

double margin( Side side );
void setMargin( Side side, double margin );

// set all margins
void setMargin( double margin );

void writeXML( QString name, QDomElement& elem, QDomDocument & doc ) const;

void readXML( const QDomElement& elem, const QDomDocument& doc );

/** Get name for style, used in project file */
static QString styleName( Style s );

/** Get style from name, used in project file */
static Style styleFromName( QString styleName );

/** Get style label, translated, used in UI */
static QString styleLabel( Style s );
};
18 changes: 18 additions & 0 deletions python/core/core.sip
Expand Up @@ -89,6 +89,17 @@
%Include qgsvectoroverlay.sip
%Include qgsfontutils.sip

%Include qgscachedfeatureiterator.sip
%Include qgscacheindex.sip
%Include qgscacheindexfeatureid.sip
%Include qgscentralpointpositionmanager.sip
%Include qgsfeaturestore.sip
%Include qgsgeometrycache.sip
%Include qgspalobjectpositionmanager.sip
%Include qgsprojectfiletransform.sip
%Include qgsvectorlayereditutils.sip
%Include qgsvectorlayerfeatureiterator.sip

%Include composer/qgsaddremoveitemcommand.sip
%Include composer/qgsaddremovemultiframecommand.sip
%Include composer/qgscomposerarrow.sip
Expand Down Expand Up @@ -118,6 +129,8 @@
%Include composer/qgssingleboxscalebarstyle.sip
%Include composer/qgsticksscalebarstyle.sip
%Include composer/qgscomposertexttable.sip
%Include composer/qgscomposereffect.sip
%Include composer/qgscomposerlegendstyle.sip

%Include qgsdiagramrendererv2.sip
%Include diagram/qgsdiagram.sip
Expand Down Expand Up @@ -169,6 +182,9 @@
%Include raster/qgspalettedrasterrenderer.sip
%Include raster/qgscubicrasterresampler.sip
%Include raster/qgsmultibandcolorrenderer.sip
%Include raster/qgsbrightnesscontrastfilter.sip
%Include raster/qgshuesaturationfilter.sip
%Include raster/qgsrasterdrawer.sip

%Include symbology-ng/qgsstylev2.sip
%Include symbology-ng/qgssvgcache.sip
Expand All @@ -193,3 +209,5 @@
%Include symbology-ng/qgslinesymbollayerv2.sip
%Include symbology-ng/qgsmarkersymbollayerv2.sip
%Include symbology-ng/qgssymbollayerv2registry.sip

%Include symbology-ng/qgssymbologyv2conversion.sip
77 changes: 77 additions & 0 deletions python/core/qgscachedfeatureiterator.sip
@@ -0,0 +1,77 @@
class QgsCachedFeatureIterator : QgsAbstractFeatureIterator
{
%TypeHeaderCode
#include <qgscachedfeatureiterator.h>
%End
public:
/**
* @brief
* This constructor creates a feature iterator, that delivers only cached information, based on the
* @link QgsFeatureIds @endlink. No request is made to the backend.
*
* @param vlCache The vector layer cache to use
* @param featureRequest The feature request to answer
* @param featureIds The feature ids to return
*/
QgsCachedFeatureIterator( QgsVectorLayerCache* vlCache, QgsFeatureRequest featureRequest, QgsFeatureIds featureIds );

/**
* @brief
*
* @param f
* @return bool
*/
virtual bool nextFeature( QgsFeature& f );

/**
* @brief
*
* @return bool
*/
virtual bool rewind();

/**
* @brief
*
* @return bool
*/
virtual bool close();
};

class QgsCachedFeatureWriterIterator : QgsAbstractFeatureIterator
{
%TypeHeaderCode
#include <qgscachedfeatureiterator.h>
%End
public:
/**
* @brief
* This constructor creates a feature iterator, which queries the backend and caches retrieved features.
*
* @param vlCache The vector layer cache to use
* @param featureRequest The feature request to answer
*/
QgsCachedFeatureWriterIterator( QgsVectorLayerCache* vlCache, QgsFeatureRequest featureRequest );

/**
* @brief
*
* @param f
* @return bool
*/
virtual bool nextFeature( QgsFeature& f );

/**
* @brief
*
* @return bool
*/
virtual bool rewind();

/**
* @brief
*
* @return bool
*/
virtual bool close();
};
48 changes: 48 additions & 0 deletions python/core/qgscacheindex.sip
@@ -0,0 +1,48 @@
class QgsAbstractCacheIndex
{
%TypeHeaderCode
#include <qgscacheindex.h>
%End
public:
QgsAbstractCacheIndex();
virtual ~QgsAbstractCacheIndex();

/**
* Is called, whenever a feature is removed from the cache. You should update your indexes, so
* they become invalid in case this feature was required to successfuly answer a request.
*/
virtual void flushFeature( const QgsFeatureId fid ) = 0;

/**
* Sometimes, the whole cache changes its state and its easier to just withdraw everything.
* In this case, this method is issued. Be sure to clear all cache information in here.
*/
virtual void flush() = 0;

/**
* @brief
* Implement this method to update the the indices, in case you need information contained by the request
* to properly index. (E.g. spatial index)
* Does nothing by default
*
* @param featureRequest The feature request that was answered
* @param fids The feature ids that have been returned
*/
virtual void requestCompleted( QgsFeatureRequest featureRequest, QgsFeatureIds fids );

/**
* Is called, when a feature request is issued on a cached layer.
* If this cache index is able to completely answer the feature request, it will return true
* and write the list of feature ids of cached features to cachedFeatures. If it is not able
* it will return false and the cachedFeatures state is undefined.
*
* @param featureIterator A reference to a {@link QgsFeatureIterator}. A valid featureIterator will
* be assigned in case this index is able to answer the request and the return
* value is true.
* @param featureRequest The feature request, for which this index is queried.
*
* @return True, if this index holds the information to answer the request.
*
*/
virtual bool getCacheIterator( QgsFeatureIterator& featureIterator, const QgsFeatureRequest& featureRequest ) = 0;
};
47 changes: 47 additions & 0 deletions python/core/qgscacheindexfeatureid.sip
@@ -0,0 +1,47 @@
class QgsCacheIndexFeatureId : QgsAbstractCacheIndex
{
%TypeHeaderCode
#include <qgscacheindexfeatureid.h>
%End
public:
QgsCacheIndexFeatureId( QgsVectorLayerCache* );

/**
* Is called, whenever a feature is removed from the cache. You should update your indexes, so
* they become invalid in case this feature was required to successfuly answer a request.
*/
virtual void flushFeature( const QgsFeatureId fid );

/**
* Sometimes, the whole cache changes its state and its easier to just withdraw everything.
* In this case, this method is issued. Be sure to clear all cache information in here.
*/
virtual void flush();

/**
* @brief
* Implement this method to update the the indices, in case you need information contained by the request
* to properly index. (E.g. spatial index)
* Does nothing by default
*
* @param featureRequest The feature request that was answered
* @param fids The feature ids that have been returned
*/
virtual void requestCompleted( QgsFeatureRequest featureRequest, QgsFeatureIds fids );

/**
* Is called, when a feature request is issued on a cached layer.
* If this cache index is able to completely answer the feature request, it will return true
* and write the list of feature ids of cached features to cachedFeatures. If it is not able
* it will return false and the cachedFeatures state is undefined.
*
* @param featureIterator A reference to a {@link QgsFeatureIterator}. A valid featureIterator will
* be assigned in case this index is able to answer the request and the return
* value is true.
* @param featureRequest The feature request, for which this index is queried.
*
* @return True, if this index holds the information to answer the request.
*
*/
virtual bool getCacheIterator( QgsFeatureIterator& featureIterator, const QgsFeatureRequest& featureRequest );
};
13 changes: 13 additions & 0 deletions python/core/qgscentralpointpositionmanager.sip
@@ -0,0 +1,13 @@
class QgsCentralPointPositionManager : QgsOverlayObjectPositionManager
{
%TypeHeaderCode
#include <qgscentralpointpositionmanager.h>
%End
public:
QgsCentralPointPositionManager();
~QgsCentralPointPositionManager();
void addLayer( QgsVectorLayer* vl, QList<QgsVectorOverlay*>& overlays );
/**Removes all the overlays*/
void removeLayers();
void findObjectPositions( const QgsRenderContext& context, QGis::UnitType unitType );
};
23 changes: 23 additions & 0 deletions python/core/qgsfeatureiterator.sip
@@ -1,3 +1,26 @@
class QgsAbstractFeatureIterator
{
%TypeHeaderCode
#include <qgsfeatureiterator.h>
%End
public:
//! base class constructor - stores the iteration parameters
QgsAbstractFeatureIterator( const QgsFeatureRequest& request );

//! destructor makes sure that the iterator is closed properly
virtual ~QgsAbstractFeatureIterator();

//! fetch next feature, return true on success
virtual bool nextFeature( QgsFeature& f ) = 0;
//! reset the iterator to the starting position
virtual bool rewind() = 0;
//! end of iterating: free the resources / lock
virtual bool close() = 0;

protected:
void ref(); // add reference
void deref(); // remove reference, delete if refs == 0
};


class QgsFeatureIterator
Expand Down
39 changes: 39 additions & 0 deletions python/core/qgsfeaturestore.sip
@@ -0,0 +1,39 @@
class QgsFeatureStore
{
%TypeHeaderCode
#include <qgsfeaturestore.h>
%End
public:
//! Constructor
QgsFeatureStore();

//! Constructor
QgsFeatureStore( const QgsFeatureStore &rhs );

//! Constructor
QgsFeatureStore( const QgsFields& fields, const QgsCoordinateReferenceSystem& crs );

//! Destructor
~QgsFeatureStore();

/** Get fields list */
QgsFields& fields();

/** Set fields */
void setFields( const QgsFields & fields );

/** Get crs */
QgsCoordinateReferenceSystem crs() const;

/** Set crs */
void setCrs( const QgsCoordinateReferenceSystem& crs );

/** Get features list reference */
QgsFeatureList& features();

/** Set map of optional parameters */
void setParams( const QMap<QString, QVariant> &theParams );

/** Get map of optional parameters */
QMap<QString, QVariant> params() const;
};
30 changes: 30 additions & 0 deletions python/core/qgsgeometrycache.sip
@@ -0,0 +1,30 @@
class QgsGeometryCache
{
%TypeHeaderCode
#include <qgsgeometrycache.h>
%End
public:
QgsGeometryCache( QgsVectorLayer* layer );
~QgsGeometryCache();

QgsGeometryMap& cachedGeometries();

//! fetch geometry from cache, return true if successful
bool geometry( QgsFeatureId fid, QgsGeometry& geometry );

//! store a geometry in the cache
void cacheGeometry( QgsFeatureId fid, const QgsGeometry& geom );

//! get rid of the cached geometry
void removeGeometry( QgsFeatureId fid );


/** Deletes the geometries in mCachedGeometries */
void deleteCachedGeometries();

void setCachedGeometriesRect( const QgsRectangle& extent );
const QgsRectangle& cachedGeometriesRect();

protected:
QgsVectorLayerEditBuffer *editBuffer();
};

0 comments on commit 99f998a

Please sign in to comment.