16 changes: 16 additions & 0 deletions python/core/qgspalobjectpositionmanager.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
class QgsPALObjectPositionManager : QgsOverlayObjectPositionManager
{
%TypeHeaderCode
#include <qgspalobjectpositionmanager.h>
%End
public:
QgsPALObjectPositionManager();
~QgsPALObjectPositionManager();
void addLayer( QgsVectorLayer* vl, QList<QgsVectorOverlay*>& overlays );
void findObjectPositions( const QgsRenderContext& renderContext, QGis::UnitType unitType );
void removeLayers();

/**Sets algorithm used for object placements. Possibilities are:
Chain, Popmusic tabu chain, Popmusic tabu, Popmusic chain*/
void setPlacementAlgorithm( const QString& algorithmName );
};
23 changes: 23 additions & 0 deletions python/core/qgsprojectfiletransform.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
class QgsProjectFileTransform
{
%TypeHeaderCode
#include <qgsprojectfiletransform.h>
%End
public:
//Default constructor
~QgsProjectFileTransform();

/*! Create an instance from a Dom and a supplied version
* @param domDocument The Dom document to use as content
* @param version Version number
*/
QgsProjectFileTransform( QDomDocument & domDocument,
QgsProjectVersion version );
bool updateRevision( QgsProjectVersion version );

/*! Prints the contents via QgsDebugMsg()
*/
void dump();

static void convertRasterProperties( QDomDocument& doc, QDomNode& parentNode, QDomElement& rasterPropertiesElem, QgsRasterLayer* rlayer );
};
91 changes: 91 additions & 0 deletions python/core/qgsvectorlayereditutils.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
class QgsVectorLayerEditUtils
{
%TypeHeaderCode
#include <qgsvectorlayereditutils.h>
%End
public:
QgsVectorLayerEditUtils( QgsVectorLayer* layer );

QgsGeometryCache* cache();

/** Insert a new vertex before the given vertex number,
* in the given ring, item (first number is index 0), and feature
* Not meaningful for Point geometries
*/
bool insertVertex( double x, double y, QgsFeatureId atFeatureId, int beforeVertex );

/** Moves the vertex at the given position number,
* ring and item (first number is index 0), and feature
* to the given coordinates
*/
bool moveVertex( double x, double y, QgsFeatureId atFeatureId, int atVertex );

/** Deletes a vertex from a feature
*/
bool deleteVertex( QgsFeatureId atFeatureId, int atVertex );

/** Adds a ring to polygon/multipolygon features
@return
0 in case of success,
1 problem with feature type,
2 ring not closed,
3 ring not valid,
4 ring crosses existing rings,
5 no feature found where ring can be inserted*/
int addRing( const QList<QgsPoint>& ring );

/** Adds a new part polygon to a multipart feature
@return
0 in case of success,
1 if selected feature is not multipart,
2 if ring is not a valid geometry,
3 if new polygon ring not disjoint with existing rings,
4 if no feature was selected,
5 if several features are selected,
6 if selected geometry not found*/
int addPart( const QList<QgsPoint>& ring, QgsFeatureId featureId );

/** Translates feature by dx, dy
@param featureId id of the feature to translate
@param dx translation of x-coordinate
@param dy translation of y-coordinate
@return 0 in case of success*/
int translateFeature( QgsFeatureId featureId, double dx, double dy );

/** Splits features cut by the given line
* @param splitLine line that splits the layer features
* @param topologicalEditing true if topological editing is enabled
* @return
* 0 in case of success,
* 4 if there is a selection but no feature split
*/
int splitFeatures( const QList<QgsPoint>& splitLine, bool topologicalEditing = false );

/** Adds topological points for every vertex of the geometry.
* @param geom the geometry where each vertex is added to segments of other features
* @note geom is not going to be modified by the function
* @return 0 in case of success
*/
int addTopologicalPoints( QgsGeometry* geom );

/** Adds a vertex to segments which intersect point p but don't
* already have a vertex there. If a feature already has a vertex at position p,
* no additional vertex is inserted. This method is useful for topological
* editing.
* @param p position of the vertex
* @return 0 in case of success
*/
int addTopologicalPoints( const QgsPoint& p );

/** Inserts vertices to the snapped segments.
* This is useful for topological editing if snap to segment is enabled.
* @param snapResults results collected from the snapping operation
* @return 0 in case of success
*/
int insertSegmentVerticesForSnap( const QList<QgsSnappingResult>& snapResults );

protected:
/** Little helper function that gives bounding box from a list of points.
@return 0 in case of success */
int boundingBoxFromPointList( const QList<QgsPoint>& list, double& xmin, double& ymin, double& xmax, double& ymax ) const;
};
29 changes: 29 additions & 0 deletions python/core/qgsvectorlayerfeatureiterator.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
class QgsVectorLayerFeatureIterator : QgsAbstractFeatureIterator
{
%TypeHeaderCode
#include <qgsvectorlayerfeatureiterator.h>
%End
public:
QgsVectorLayerFeatureIterator( QgsVectorLayer* layer, const QgsFeatureRequest& request );

~QgsVectorLayerFeatureIterator();

//! fetch next feature, return true on success
virtual bool nextFeature( QgsFeature& feature );

//! reset the iterator to the starting position
virtual bool rewind();

//! end of iterating: free the resources / lock
virtual bool close();

protected:
void rewindEditBuffer();
void prepareJoins();
bool fetchNextAddedFeature( QgsFeature& f );
bool fetchNextChangedGeomFeature( QgsFeature& f );
void useAddedFeature( const QgsFeature& src, QgsFeature& f );
void useChangedAttributeFeature( QgsFeatureId fid, const QgsGeometry& geom, QgsFeature& f );
bool nextFeatureFid( QgsFeature& f );
void addJoinedAttributes( QgsFeature &f );
};
30 changes: 30 additions & 0 deletions python/core/raster/qgsbrightnesscontrastfilter.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
class QgsBrightnessContrastFilter : QgsRasterInterface
{
%TypeHeaderCode
#include <qgsbrightnesscontrastfilter.h>
%End
public:
QgsBrightnessContrastFilter( QgsRasterInterface *input = 0 );
~QgsBrightnessContrastFilter();

QgsRasterInterface * clone() const /Factory/;

int bandCount() const;

QGis::DataType dataType( int bandNo ) const;

bool setInput( QgsRasterInterface* input );

QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height );

void setBrightness( int brightness );
int brightness() const;

void setContrast( int contrast );
int contrast() const;

void writeXML( QDomDocument& doc, QDomElement& parentElem ) const;

/**Sets base class members from xml. Usually called from create() methods of subclasses*/
void readXML( const QDomElement& filterElem );
};
47 changes: 47 additions & 0 deletions python/core/raster/qgshuesaturationfilter.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
class QgsHueSaturationFilter : QgsRasterInterface
{
%TypeHeaderCode
#include <qgshuesaturationfilter.h>
%End
public:

// Available modes for converting a raster to grayscale
enum GrayscaleMode
{
GrayscaleOff,
GrayscaleLightness,
GrayscaleLuminosity,
GrayscaleAverage
};

QgsHueSaturationFilter( QgsRasterInterface *input = 0 );
~QgsHueSaturationFilter();

QgsRasterInterface * clone() const /Factory/;

int bandCount() const;

QGis::DataType dataType( int bandNo ) const;

bool setInput( QgsRasterInterface* input );

QgsRasterBlock *block( int bandNo, const QgsRectangle &extent, int width, int height );

void setSaturation( int saturation );
int saturation() const;

void setGrayscaleMode( QgsHueSaturationFilter::GrayscaleMode grayscaleMode );
QgsHueSaturationFilter::GrayscaleMode grayscaleMode() const;

void setColorizeOn( bool colorizeOn );
bool colorizeOn() const;
void setColorizeColor( QColor colorizeColor );
QColor colorizeColor() const;
void setColorizeStrength( int colorizeStrength );
int colorizeStrength() const;

void writeXML( QDomDocument& doc, QDomElement& parentElem ) const;

/**Sets base class members from xml. Usually called from create() methods of subclasses*/
void readXML( const QDomElement& filterElem );
};
20 changes: 20 additions & 0 deletions python/core/raster/qgsrasterdrawer.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
class QgsRasterDrawer
{
%TypeHeaderCode
#include <qgsrasterdrawer.h>
%End
public:
QgsRasterDrawer( QgsRasterIterator *iterator );
~QgsRasterDrawer();

void draw( QPainter* p, QgsRasterViewPort* viewPort, const QgsMapToPixel* theQgsMapToPixel );

protected:
/**Draws raster part
@param p the painter to draw to
@param viewPort view port to draw to
@param img image to draw
@param topLeftCol Left position relative to left border of viewport
@param topLeftRow Top position relative to top border of viewport*/
void drawImage( QPainter* p, QgsRasterViewPort* viewPort, const QImage& img, int topLeftCol, int topLeftRow ) const;
};
15 changes: 15 additions & 0 deletions python/core/symbology-ng/qgssymbologyv2conversion.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class QgsSymbologyV2Conversion
{
%TypeHeaderCode
#include <qgssymbologyv2conversion.h>
%End
public:

/** Read old renderer definition from XML and create matching new renderer */
static QgsFeatureRendererV2* readOldRenderer( const QDomNode& layerNode, QGis::GeometryType geomType );

static QString penStyle2QString( Qt::PenStyle penstyle );
static Qt::PenStyle qString2PenStyle( QString string );
static QString brushStyle2QString( Qt::BrushStyle brushstyle );
static Qt::BrushStyle qString2BrushStyle( QString string );
};
42 changes: 42 additions & 0 deletions python/gui/attributetable/qgsattributetabledelegate.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
class QgsAttributeTableDelegate : QItemDelegate
{
%TypeHeaderCode
#include <qgsattributetabledelegate.h>
%End
QgsVectorLayer *layer( const QAbstractItemModel *model ) const;

public:
/** Constructor
* @param parent parent object
*/
QgsAttributeTableDelegate( QObject* parent = 0 );
/** Used to create an editor for when the user tries to
* change the contents of a cell */
QWidget * createEditor(
QWidget *parent,
const QStyleOptionViewItem &option,
const QModelIndex &index ) const;

/** Overloads the paint method form the QItemDelegate bas class */
void paint(
QPainter * painter,
const QStyleOptionViewItem & option,
const QModelIndex & index ) const;

/**
* Sets data from editor back to model. Overloads default method
* @param editor editor which was created by create editor function in this class
* @param model model where data should be updated
* @param index index of field which is to be modified
*/
void setModelData( QWidget *editor, QAbstractItemModel *model, const QModelIndex &index ) const;

/**
* Sets data from model into the editor. Overloads default method
* @param editor editor which was created by create editor function in this class
* @param index index of field which is to be retrieved
*/
void setEditorData( QWidget *editor, const QModelIndex &index ) const;

void setFeatureSelectionModel( QgsFeatureSelectionModel* featureSelectionModel );
};
133 changes: 133 additions & 0 deletions python/gui/attributetable/qgsattributetablefiltermodel.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
class QgsAttributeTableFilterModel: QSortFilterProxyModel, QgsFeatureModel
{
%TypeHeaderCode
#include <qgsattributetablefiltermodel.h>
%End
public:
enum FilterMode
{
ShowAll,
ShowSelected,
ShowVisible,
ShowFilteredList,
ShowEdited
};

/**
*
* Make sure, the master model is already loaded, so the selection will get synchronized.
*
* @param parent parent object (owner)
* @param sourceModel The QgsAttributeTableModel to use as source (mostly referred to as master model)
* @param canvas The mapCanvas. Used to identify the currently visible features.
*/
QgsAttributeTableFilterModel( QgsMapCanvas* canvas, QgsAttributeTableModel* sourceModel, QObject* parent = 0 );

void setSourceModel( QgsAttributeTableModel* sourceModel );

/**
* Changes the sort order of the features. If set to true, selected features
* will be sorted on top, regardless of the current sort column
*
* @param selectedOnTop Specify, if selected features should be sorted on top
*/
void setSelectedOnTop( bool selectedOnTop );

/**
* Returns if selected features are currently shown on top
*
* @return True if selected are shown on top
*/
bool selectedOnTop();

/**
* Specify a list of features, which the filter will accept.
* The filter mode will automatically be adjusted to show only these features (ShowFilteredList).
*
* @param ids The list of feature ids which will be accepted by the filter
*/
virtual void setFilteredFeatures( QgsFeatureIds ids );

/**
* Set the filter mode the filter will use.
*
* @param filterMode Sets the current mode of the filter
*/
void setFilterMode( FilterMode filterMode );

/**
* Returns the layer this filter acts on.
*
* @return Abovementioned layer
*/
QgsVectorLayer *layer() const;

/**
* Returns the layerCache this filter acts on.
*
* @return The layer cache
*/
QgsVectorLayerCache *layerCache() const;

/**
* Returns the table model this filter is using
*
* @return the table model in quesion
*/
QgsAttributeTableModel *masterModel() const;

/**
* Returns the feature id for a given model index.
*
* @param row A model index of the row in question
*
* @return The feature id of the feature visible in the provided row
*/
QgsFeatureId rowToId( const QModelIndex& row );

QModelIndex fidToIndex( QgsFeatureId fid );
QModelIndexList fidToIndexList( QgsFeatureId fid );

virtual QModelIndex mapToMaster( const QModelIndex &proxyIndex ) const;

virtual QModelIndex mapFromMaster( const QModelIndex &sourceIndex ) const;

protected:
/**
* Returns true if the source row will be accepted
*
* @param sourceRow row from the source model
* @param sourceParent parent index in the source model
*/
bool filterAcceptsRow( int sourceRow, const QModelIndex &sourceParent ) const;

/**
* Updates the list of currently visible features on the map canvas.
* Is called automatically when the filter mode is adjusted or the extents changed.
*/
void generateListOfVisibleFeatures();

/**
* Used by the sorting algorithm. Compares the two model indices. Will also consider the
* selection state of the feature in case selected features are to be shown on top.
*/
bool lessThan( const QModelIndex &left, const QModelIndex &right ) const;

/**
* Sort by the given column using the given order.
* Prefetches all the data from the layer to speed up sorting.
*
* @param column The column which should be sorted
* @param order The order ( Qt::AscendingOrder or Qt::DescendingOrder )
*/
virtual void sort( int column, Qt::SortOrder order = Qt::AscendingOrder );

public slots:
/**
* Is called upon every change of the visible extents on the map canvas.
* When a change is signalled, the filter is updated and invalidated if needed.
*
*/
void extentsChanged();

};
191 changes: 191 additions & 0 deletions python/gui/attributetable/qgsattributetablemodel.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
class QgsAttributeTableModel : QAbstractTableModel
{
%TypeHeaderCode
#include <qgsattributetablemodel.h>
%End
public:
enum Role
{
SortRole,
FeatureIdRole,
FieldIndexRole,
};

public:
/**
* Constructor
* @param layerCache A layer cache to use as backend
* @param parent The parent QObject (owner)
*/
QgsAttributeTableModel( QgsVectorLayerCache *layerCache, QObject *parent = 0 );

virtual ~QgsAttributeTableModel();

/**
* Loads the layer into the model
* Preferably to be called, before basing any other models on this model
*/
virtual void loadLayer();

/**
* Returns the number of rows
* @param parent parent index
*/
virtual int rowCount( const QModelIndex &parent = QModelIndex() ) const;

/**
* Returns the number of columns
* @param parent parent index
*/
int columnCount( const QModelIndex &parent = QModelIndex() ) const;

/**
* Returns header data
* @param section required section
* @param orientation horizontal or vertical orientation
* @param role data role
*/
QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const;

/**
* Returns data on the given index
* @param index model index
* @param role data role
*/
virtual QVariant data( const QModelIndex &index, int role ) const;

/**
* Updates data on given index
* @param index model index
* @param value new data value
* @param role data role
*/
virtual bool setData( const QModelIndex &index, const QVariant &value, int role = Qt::EditRole );

/**
* Returns item flags for the index
* @param index model index
*/
Qt::ItemFlags flags( const QModelIndex &index ) const;

/**
* Reloads the model data between indices
* @param index1 start index
* @param index2 end index
*/
void reload( const QModelIndex &index1, const QModelIndex &index2 );

/**
* Remove rows
*/
bool removeRows( int row, int count, const QModelIndex &parent = QModelIndex() );

/**
* Resets the model
*/
void resetModel();

/**
* Maps feature id to table row
* @param id feature id
*/
int idToRow( QgsFeatureId id ) const;

QModelIndex idToIndex( QgsFeatureId id ) const;

QModelIndexList idToIndexList( QgsFeatureId id ) const;

/**
* get field index from column
*/
int fieldIdx( int col ) const;

/**
* get column from field index
*/
int fieldCol( int idx ) const;

/**
* Maps row to feature id
* @param row row number
*/
QgsFeatureId rowToId( int row ) const;

/**
* Swaps two rows
* @param a first row
* @param b second row
*/
void swapRows( QgsFeatureId a, QgsFeatureId b );

/**
* Returns the layer this model uses as backend. Retrieved from the layer cache.
*/
QgsVectorLayer* layer() const;

/**
* Returns the layer cache this model uses as backend.
*/
QgsVectorLayerCache* layerCache() const;

/**
* Execute an action
*/
void executeAction( int action, const QModelIndex &idx ) const;

/**
* Return the feature attributes at given model index
* @return feature attributes at given model index
*/
QgsFeature feature( const QModelIndex &idx ) const;

/**
* Caches the entire data for one column. This should be called prior to sorting,
* so the data does not have to be fetched for every single comparison.
* Specify -1 as column to invalidate the cache
*
* @param column The column index of the field to catch
*/
void prefetchColumnData( int column );

signals:
/**
* Model has been changed
*/
void modelChanged();

//! @note not available in python bindings
// void progress( int i, bool &cancel );
void finished();

protected slots:
/**
* Launched when attribute value has been changed
* @param fid feature id
* @param idx attribute index
* @param value new value
*/
virtual void attributeValueChanged( QgsFeatureId fid, int idx, const QVariant &value );
/**
* Launched when a feature has been deleted
* @param fid feature id
*/
virtual void featureDeleted( QgsFeatureId fid );
/**
* Launched when a feature has been added
* @param fid feature id
* @param inOperation guard insertion with beginInsertRows() / endInsertRows()
*/
virtual void featureAdded( QgsFeatureId fid, bool inOperation = true );

/**
* Launched when layer has been deleted
*/
virtual void layerDeleted();

protected:
/**
* Gets mFieldCount, mAttributes and mValueMaps
*/
virtual void loadAttributes();
};
144 changes: 144 additions & 0 deletions python/gui/attributetable/qgsdualview.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
class QgsDualView : QStackedWidget
{
%TypeHeaderCode
#include <qgsdualview.h>
%End

public:
/**
* The view modes, in which this widget can present information.
* Relates to the QStackedWidget stacks.
*
*/
enum ViewMode
{
/**
* Shows the features and attributes in a table layout
*/
AttributeTable,
/**
* Show a list of the features, where one can be chosen
* and the according attribute dialog will be presented
* in the neighbouring frame.
*/
AttributeEditor
};

/**
* @brief Constructor
* @param parent The parent widget
*/
explicit QgsDualView( QWidget* parent = 0 );
virtual ~QgsDualView();

/**
* Has to be called to initialize the dual view.
*
* @param layer The layer which should be used to fetch features
* @param mapCanvas The mapCanvas (used for the FilterMode
* {@link QgsAttributeTableFilterModel::ShowVisible}
* @param myDa Used for attribute dialog creation
*/
void init( QgsVectorLayer* layer, QgsMapCanvas* mapCanvas, QgsDistanceArea myDa );

/**
* Change the current view mode.
*
* @param view The view mode to set
*/
void setView( ViewMode view );

/**
* Set the filter mode
*
* @param filterMode
*/
void setFilterMode( QgsAttributeTableFilterModel::FilterMode filterMode );

/**
* Toggle the selectedOnTop flag. If enabled, selected features will be moved to top.
*
* @param selectedOnTop True: Show selected features on top.
* False: Use defined sorting column.
*/
void setSelectedOnTop( bool selectedOnTop );

/**
* Returns the number of features on the layer.
*
* @return Number of features
*/
int featureCount();

/**
* Returns the number of features which are currently visible, according to the
* filter restrictions
*
* @return Number of features
*/
int filteredFeatureCount();

/**
* Set a list of currently visible features
*
* @param filteredFeatures A list of feature ids
*
*/
void setFilteredFeatures( QgsFeatureIds filteredFeatures );

/**
* Returns the model which has the information about all features (not only filtered)
*
* @return The master model
*/
QgsAttributeTableModel* masterModel() const;

protected:
/**
* Initializes widgets which depend on the attributes of this layer
*/
void columnBoxInit();

virtual void hideEvent( QHideEvent * );
virtual void focusOutEvent( QFocusEvent * );

public slots:
/**
* @brief Set the current edit selection in the {@link AttributeEditor} mode.
*
* @param fids A list of edited features (Currently only one at a time is supported)
*/
void setCurrentEditSelection( const QgsFeatureIds& fids );

/**
* @brief saveEditChanges
*/

void saveEditChanges();

signals:
/**
* Is emitted, whenever the display expression is successfully changed
* @param expression The expression that was applied
*/
void displayExpressionChanged( const QString expression );

/**
* Is emitted, whenever the filter changes
*/
void filterChanged();
};

class QgsAttributeTableAction : public QAction
{
%TypeHeaderCode
#include <qgsdualview.h>
%End

public:
QgsAttributeTableAction( const QString &name, QgsDualView *dualView, int action, const QModelIndex &fieldIdx );

public slots:
void execute();
void featureForm();
};
67 changes: 67 additions & 0 deletions python/gui/attributetable/qgsfeaturelistmodel.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
class QgsFeatureListModel : QAbstractProxyModel, QgsFeatureModel
{
%TypeHeaderCode
#include <qgsfeaturelistmodel.h>
%End
public:
struct FeatureInfo
{
public:
FeatureInfo();
bool isNew;
bool isEdited;
};

public:
explicit QgsFeatureListModel( QgsAttributeTableFilterModel *sourceModel, QObject* parent = 0 );
virtual ~QgsFeatureListModel();

virtual void setSourceModel( QgsAttributeTableFilterModel* sourceModel );
QgsVectorLayerCache* layerCache();
virtual QVariant data( const QModelIndex& index, int role ) const;
virtual Qt::ItemFlags flags( const QModelIndex& index ) const;

QgsAttributeTableModel* masterModel();

/**
* @param expression A {@link QgsExpression} compatible string.
* @return true if the expression could be set, false if there was a parse error.
* If it fails, the old expression will still be applied. Call {@link parserErrorString()}
* for a meaningful error message.
*/
bool setDisplayExpression( const QString expression );

/**
* @brief Returns a detailed message about errors while parsing a QgsExpression.
* @return A message containg information about the parser error.
*/
QString parserErrorString();

const QString& displayExpression() const;
bool featureByIndex( const QModelIndex& index, QgsFeature& feat );
QgsFeatureId idxToFid( const QModelIndex& index ) const;
QModelIndex fidToIdx( const QgsFeatureId fid ) const;

virtual QModelIndex mapToSource( const QModelIndex& proxyIndex ) const;
virtual QModelIndex mapFromSource( const QModelIndex& sourceIndex ) const;

virtual QModelIndex mapToMaster( const QModelIndex& proxyIndex ) const;
virtual QModelIndex mapFromMaster( const QModelIndex& sourceIndex ) const;

virtual QItemSelection mapSelectionFromMaster( const QItemSelection& selection ) const;
virtual QItemSelection mapSelectionToMaster( const QItemSelection& selection ) const;

virtual QModelIndex index( int row, int column, const QModelIndex& parent = QModelIndex() ) const;
virtual QModelIndex parent( const QModelIndex& child ) const;
virtual int columnCount( const QModelIndex&parent = QModelIndex() ) const;
virtual int rowCount( const QModelIndex& parent = QModelIndex() ) const;

QModelIndex fidToIndex( QgsFeatureId fid );
QModelIndexList fidToIndexList( QgsFeatureId fid );

public slots:
void onBeginRemoveRows( const QModelIndex& parent, int first, int last );
void onEndRemoveRows( const QModelIndex& parent, int first, int last );
void onBeginInsertRows( const QModelIndex& parent, int first, int last );
void onEndInsertRows( const QModelIndex& parent, int first, int last );
};
99 changes: 99 additions & 0 deletions python/gui/attributetable/qgsfeaturelistview.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
class QgsFeatureListView : QListView
{
%TypeHeaderCode
#include <qgsfeaturelistview.h>
%End
public:
/**
* Creates a feature list view
*
* @param parent owner
*/
explicit QgsFeatureListView( QWidget* parent = 0 );

/**
* Destructor
*/
virtual ~QgsFeatureListView();

/**
* Returns the layer cache
* @return the layer cache used as backend
*/
QgsVectorLayerCache* layerCache();

/**
* Set the {@link QgsFeatureListModel} which is used to retrieve information
*
* @param featureListModel The model to use
*/
virtual void setModel( QgsFeatureListModel* featureListModel );
/**
* Get the featureListModel used by this view
*
* @return The model in use
*/
QgsFeatureListModel* featureListModel();

/**
* The display expression is an expression used to render the fields into a single string
* which is displaied.
*
* @param displayExpression The expression used to render the feature
*
* @see QgsExpression
*/
bool setDisplayExpression( const QString displayExpression );

/**
* Returns the expression which is currently used to render the features.
*
* @return A string containing the currend display expression
*
* @see QgsExpression
*/
const QString& displayExpression() const;

/**
* Returns a detailed message about errors while parsing a QgsExpression.
*
* @return A message containg information about the parser error.
*/
QString parserErrorString();

protected:
virtual void mouseMoveEvent( QMouseEvent *event );
virtual void mousePressEvent( QMouseEvent *event );
virtual void mouseReleaseEvent( QMouseEvent *event );
virtual void keyPressEvent( QKeyEvent *event );

signals:
/**
* Is emitted, whenever the current edit selection has been changed.
*
* @param feat the feature, which will be edited.
*/
void currentEditSelectionChanged( QgsFeature &feat );

/**
* Is emitted, whenever the display expression is successfully changed
* @param expression The expression that was applied
*/
void displayExpressionChanged( const QString expression );

public slots:
/**
* Set the feature(s) to be edited
*
* @param fids A list of features to be edited
*/
void setEditSelection( const QgsFeatureIds &fids );

/**
* Select all currently visible features
*/
virtual void selectAll();

void repaintRequested( QModelIndexList indexes );
void repaintRequested();
};
27 changes: 27 additions & 0 deletions python/gui/attributetable/qgsfeaturelistviewdelegate.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
class QgsFeatureListViewDelegate : QItemDelegate
{
%TypeHeaderCode
#include <qgsfeaturelistviewdelegate.h>
%End
public:
enum Element
{
EditElement,
SelectionElement
};

explicit QgsFeatureListViewDelegate( QgsFeatureListModel* listModel, QObject *parent = 0 );

void setEditSelectionModel( QItemSelectionModel* editSelectionModel );

Element positionToElement( const QPoint& pos );

void setFeatureSelectionModel( QgsFeatureSelectionModel* featureSelectionModel );

signals:
void editButtonClicked( QModelIndex& index );

protected:
virtual QSize sizeHint( const QStyleOptionViewItem& option, const QModelIndex& index ) const;
virtual void paint( QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index ) const;
};
9 changes: 9 additions & 0 deletions python/gui/attributetable/qgsfeaturemodel.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class QgsFeatureModel
{
%TypeHeaderCode
#include <qgsfeaturemodel.h>
%End
public:
virtual QModelIndex fidToIndex( QgsFeatureId fid ) = 0;
};

75 changes: 75 additions & 0 deletions python/gui/attributetable/qgsfeatureselectionmodel.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
class QgsFeatureSelectionModel : QItemSelectionModel
{
%TypeHeaderCode
#include <qgsfeatureselectionmodel.h>
%End
public:
explicit QgsFeatureSelectionModel( QAbstractItemModel* model, QgsFeatureModel* featureModel, QgsVectorLayer* layer, QObject* parent );

/**
* Enables or disables synchronisation to the {@link QgsVectorLayer}
* When synchronisation is disabled, any selection change will be buffered inside this selection model.
* When enabled, any buffered changes are communicated to the layer and the buffer is emptied.
* Mainly to be used for performance reasons, because selection change on the layer can cost time as it
* repaints the layer.
*
* @param enable The synchronisation status to set.
*/
void enableSync( bool enable );

/**
* Returns the selection status of a given feature id.
*
* @param fid The featureid to determine the selection status of
*
* @return The selection status
*/

virtual bool isSelected( QgsFeatureId fid );
/**
* Returns the selection status of a given QModelIndex.
*
* @param index The index to determine the selection status of
*
* @return The selection status
*/
virtual bool isSelected( const QModelIndex& index );

signals:
/**
* Request a repaint of a list of model indexes.
* Views using this model should connect to and properly process this signal.
*
* @param indexes The model indexes which need to be repainted
*/
void requestRepaint( QModelIndexList indexes );

/**
* Request a repaint of the visible items of connected views.
* Views using this model should connect to and properly process this signal.
*/
void requestRepaint();

public slots:
/**
* Overwritten to do NOTHING (we handle selection ourselves)
*
* @see selectFeatures( const QItemSelection&, SelectionFlags )
*/
virtual void select( const QModelIndex &index, SelectionFlags command );

/**
* Overwritten to do NOTHING (we handle selection ourselves)
*
* @see selectFeatures( const QItemSelection&, SelectionFlags )
*/
virtual void select( const QItemSelection &selection, SelectionFlags command );

/**
* Select features on this table. Is to be used in favor of the stock select methods.
*
* @param selection The QItemSelection which will be selected
* @param command The command to apply. Select, Deselect and ClearAndSelect are processed.
*/
virtual void selectFeatures( const QItemSelection &selection, SelectionFlags command );
};
26 changes: 26 additions & 0 deletions python/gui/gui.sip
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

%Import core/core.sip

%Include qgsblendmodecombobox.sip

%Include qgisinterface.sip
%Include qgsannotationitem.sip
%Include qgsattributeeditor.sip
Expand Down Expand Up @@ -67,8 +69,26 @@
%Include qgstextannotationitem.sip
%Include qgsvertexmarker.sip
%Include qgssublayersdialog.sip
%Include qgscharacterselectdialog.sip
%Include qgscomposerruler.sip
%Include qgsdatadefinedbutton.sip
%Include qgsdetaileditemwidget.sip
%Include qgserrordialog.sip
%Include qgsexpressionselectiondialog.sip
%Include qgshighlight.sip
%Include qgsoptionsdialogbase.sip
%Include qgssvgannotationitem.sip

%Include attributetable/qgsattributetabledelegate.sip
%Include attributetable/qgsattributetablefiltermodel.sip
%Include attributetable/qgsattributetableview.sip
%Include attributetable/qgsattributetablemodel.sip
%Include attributetable/qgsdualview.sip
%Include attributetable/qgsfeaturelistmodel.sip
%Include attributetable/qgsfeaturelistview.sip
%Include attributetable/qgsfeaturelistviewdelegate.sip
%Include attributetable/qgsfeaturemodel.sip
%Include attributetable/qgsfeatureselectionmodel.sip

%Include raster/qgsmultibandcolorrendererwidget.sip
%Include raster/qgspalettedrendererwidget.sip
Expand Down Expand Up @@ -100,3 +120,9 @@
%Include symbology-ng/qgsvectorfieldsymbollayerwidget.sip
%Include symbology-ng/qgsvectorgradientcolorrampv2dialog.sip
%Include symbology-ng/qgsvectorrandomcolorrampv2dialog.sip
%Include symbology-ng/qgscolorrampcombobox.sip
%Include symbology-ng/characterwidget.sip
%Include symbology-ng/qgsdashspacedialog.sip
%Include symbology-ng/qgsdatadefinedsymboldialog.sip
%Include symbology-ng/qgsstylev2exportimportdialog.sip
%Include symbology-ng/qgssvgselectorwidget.sip
20 changes: 20 additions & 0 deletions python/gui/qgsblendmodecombobox.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/** \ingroup gui
* A combobox which lets the user select blend modes from a predefined list
**/
class QgsBlendModeComboBox : QComboBox
{
%TypeHeaderCode
#include <qgsblendmodecombobox.h>
%End
public:
QgsBlendModeComboBox( QWidget* parent = 0 );
virtual ~QgsBlendModeComboBox();

//! Function to read the selected blend mode as QPainter::CompositionMode
QPainter::CompositionMode blendMode();
//! Function to set the selected blend mode from QPainter::CompositionMode
void setBlendMode( QPainter::CompositionMode blendMode );

public slots:
void updateModes();
};
12 changes: 12 additions & 0 deletions python/gui/qgscharacterselectdialog.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class QgsCharacterSelectorDialog : QDialog
{
%TypeHeaderCode
#include <qgscharacterselectdialog.h>
%End
public:
QgsCharacterSelectorDialog( QWidget* parent = 0, Qt::WFlags fl = QgisGui::ModalDialogFlags );
~QgsCharacterSelectorDialog();

public slots:
const QChar& selectCharacter( bool* gotChar, const QFont& font, const QString& style );
};
29 changes: 29 additions & 0 deletions python/gui/qgscomposerruler.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
class QgsComposerRuler : QWidget
{
%TypeHeaderCode
#include <qgscomposerruler.h>
%End
public:
enum Direction
{
Horizontal,
Vertical
};

QgsComposerRuler( Direction d );
~QgsComposerRuler();

QSize minimumSizeHint() const;

void setSceneTransform( const QTransform& transform );
void updateMarker( const QPointF& pos );

void setComposition( QgsComposition* c );
QgsComposition* composition();

protected:
void paintEvent( QPaintEvent* event );
void mouseMoveEvent( QMouseEvent* event );
void mouseReleaseEvent( QMouseEvent* event );
void mousePressEvent( QMouseEvent* event );
};
209 changes: 209 additions & 0 deletions python/gui/qgsdatadefinedbutton.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
class QgsDataDefinedButton : QToolButton
{
%TypeHeaderCode
#include <qgsdatadefinedbutton.h>
%End
public:
enum DataType
{
AnyType = 0,
String = 1,
Int = 2,
Double = 4
};
typedef QFlags<QgsDataDefinedButton::DataType> DataTypes;

/**
* Construct a new data defined button
*
* @param parent The parent QWidget
* @param vl Pointer to the associated vector layer
* @param datadefined Data defined property
* @param datatypes The expected data types to be compared against the variant type of the QgsField from data source and expression result
* @param description The description of expected input data
*/
QgsDataDefinedButton( QWidget* parent = 0,
const QgsVectorLayer* vl = 0,
const QgsDataDefined* datadefined = 0,
DataTypes datatypes = AnyType,
QString description = "" );
~QgsDataDefinedButton();

/**
* Initialize a newly constructed data defined button (useful if button already included from form layout)
*
* @param vl Pointer to the associated vector layer
* @param datadefined Data defined property
* @param datatypes The expected data types to be compared against the variant type of the QgsField from data source and expression result
* @param description The description of expected input data
*/
void init( const QgsVectorLayer* vl,
const QgsDataDefined* datadefined = 0,
DataTypes datatypes = AnyType,
QString description = QString( "" ) );

QMap< QString, QString > definedProperty() const;

/**
* Whether the current data definition or expression is to be used
*/
bool isActive();

/**
* Whether the current expression is to be used instead of field mapping
*/
bool useExpression();

/**
* The current defined expression
*/
QString getExpression() const;

/**
* The current defined field
*/
QString getField() const;

/**
* The current definition
* @returns empty QString if not active, otherwise currently defined expression or field name
*/
QString currentDefinition() const;

/**
* The valid data types that will work for the definition (QVariant-coercible to expected type)
* Compared against the variant type of the QgsField from data source and expression result
*/
const DataTypes& validDataTypes() const;

/**
* The full definition description and current definition (internally generated on a contextual basis)
*/
QString fullDescription() const;

/**
* The usage information about this data definition
*/
QString usageInfo() const;

/**
* Set the usage information about this data definition
*/
void setUsageInfo( const QString& info );

/**
* Register list of sibling widgets that get disabled/enabled when data definition or expression is set/unset
*/
void registerEnabledWidgets( QList<QWidget*> wdgts );

/**
* Register a sibling widget that gets disabled/enabled when data definition or expression is set/unset
*/
void registerEnabledWidget( QWidget* wdgt );

/**
* Return widget siblings that get disabled/enabled when data definition or expression is set/unset
*
* @return unguarded pointers from guarded ones
*/
QList<QWidget*> registeredEnabledWidgets();

/**
* Clears list of sibling widgets
*/
void clearEnabledWidgets();

/**
* Register list of sibling widgets that get checked when data definition or expression is active
*/
void registerCheckedWidgets( QList<QWidget*> wdgts );

/**
* Register a sibling widget that get checked when data definition or expression is active
*/
void registerCheckedWidget( QWidget* wdgt );

/**
* Return widget siblings that get checked when data definition or expression is active
*
* @return unguarded pointers from guarded ones
*/
QList<QWidget*> registeredCheckedWidgets();

/**
* Clears list of checkable sibling widgets
*/
void clearCheckedWidgets();

/**
* Common descriptions for expected input values
*/
static QString trString();
static QString boolDesc();
static QString anyStringDesc();
static QString intDesc();
static QString intPosDesc();
static QString intPosOneDesc();
static QString doubleDesc();
static QString doublePosDesc();
static QString doubleXYDesc();
static QString double180RotDesc();
static QString intTranspDesc();
static QString unitsMmMuDesc();
static QString unitsMmMuPercentDesc();
static QString colorNoAlphaDesc();
static QString colorAlphaDesc();
static QString textHorzAlignDesc();
static QString textVertAlignDesc();
static QString penJoinStyleDesc();
static QString blendModesDesc();
static QString svgPathDesc();

public slots:
/**
* Set whether the current data definition or expression is to be used
*/
void setActive( bool active );

/**
* Set siblings' enabled property when data definition or expression is set/unset
*/
void disableEnabledWidgets( bool disable );

/**
* Set siblings' checked property when data definition or expression is active
*/
void checkCheckedWidgets( bool check );

signals:
/**
* Emitted when data definition or expression is changed
* @param definition The current definition or expression (empty string if inactive)
*/
void dataDefinedChanged( const QString& definition );

/**
* Emitted when active state changed
* @param active Whether the definition is active
*/
void dataDefinedActivated( bool active );

protected:
void mouseReleaseEvent( QMouseEvent *event );

/**
* Set whether the current expression is to be used instead of field mapping
*/
void setUseExpression( bool use );

/**
* Set the current defined expression
*/
void setExpression( QString exp );

/**
* Set the current defined field
*/
void setField( QString field );

};
11 changes: 11 additions & 0 deletions python/gui/qgsdetaileditemwidget.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class QgsDetailedItemWidget : QWidget
{
%TypeHeaderCode
#include <qgsdetaileditemwidget.h>
%End
public:
QgsDetailedItemWidget( QWidget * parent = 0 );
~QgsDetailedItemWidget();
void setData( QgsDetailedItemData theData );
void setChecked( bool theFlag );
};
21 changes: 21 additions & 0 deletions python/gui/qgserrordialog.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
class QgsErrorDialog : public QDialog
{
%TypeHeaderCode
#include <qgserrordialog.h>
%End
public:
QgsErrorDialog( const QgsError & theError, const QString & theTitle, QWidget *parent = 0, Qt::WFlags fl = QgisGui::ModalDialogFlags );
~QgsErrorDialog();

/** Show dialog with error
* @param theError error
* @param theTitle title
* @param parent parent object
* @param fl widget flags
*/
static void show( const QgsError & theError, const QString & theTitle, QWidget *parent = 0, Qt::WFlags fl = QgisGui::ModalDialogFlags );

public slots:
void on_mDetailPushButton_clicked();
void on_mDetailCheckBox_stateChanged( int state );
};
59 changes: 59 additions & 0 deletions python/gui/qgsexpressionselectiondialog.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
class QgsExpressionSelectionDialog : public QDialog
{
%TypeHeaderCode
#include <qgsexpressionselectiondialog.h>
%End
public:
/**
* Creates a new selection dialog.
* @param layer The layer on which the selection is to be performed.
* @param startText A default expression text to be applied (Defaults to empty)
* @param parent parent object (owner)
*/
QgsExpressionSelectionDialog( QgsVectorLayer* layer, QString startText = QString(), QWidget* parent = 0 );

/**
* The builder widget that is used by the dialog
* @return The builder widget that is used by the dialog
*/
QgsExpressionBuilderWidget* expressionBuilder();

/**
* Sets the current expression text
* @param text the expression text to set
*/
void setExpressionText( const QString& text );

/**
* Returns the current expression text
* @return The expression text
*/
QString expressionText();

/**
*Sets geometry calculator used in distance/area calculations.
*/
void setGeomCalculator( const QgsDistanceArea & da );

public slots:
void on_mActionSelect_triggered();
void on_mActionAddToSelection_triggered();
void on_mActionRemoveFromSelection_triggered();
void on_mActionSelectInstersect_triggered();
void on_mPbnClose_clicked();

protected:
/**
* Implementation for closeEvent
* Saves the window geometry
* @param closeEvent Event object. Unused.
*/
virtual void closeEvent( QCloseEvent *closeEvent );

/**
* Implementation for done (default behavior when pressing esc)
* Calls close, so the window geometry gets saved and the object deleted.
* @param r Result value. Unused.
*/
virtual void done( int r );
};
18 changes: 18 additions & 0 deletions python/gui/qgshighlight.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class QgsHighlight : public QgsMapCanvasItem
{
%TypeHeaderCode
#include <qgshighlight.h>
%End
public:
QgsHighlight( QgsMapCanvas *mapCanvas, QgsGeometry *geom, QgsVectorLayer *layer );
~QgsHighlight();

void setColor( const QColor & color );
void setWidth( int width );

protected:
virtual void paint( QPainter* p );

//! recalculates needed rectangle
void updateRect();
};
34 changes: 34 additions & 0 deletions python/gui/qgsoptionsdialogbase.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
class QgsOptionsDialogBase : QDialog
{
%TypeHeaderCode
#include <qgsoptionsdialogbase.h>
%End
public:
/** Constructor
* @param settingsKey QSettings subgroup key for saving/restore ui states, e.g. "ProjectProperties".
* @param parent parent object (owner)
* @param fl widget flags
*/
QgsOptionsDialogBase( QString settingsKey, QWidget* parent = 0, Qt::WFlags fl = 0 );
~QgsOptionsDialogBase();

/** Set up the base ui connections for vertical tabs.
* @param restoreUi Whether to restore the base ui at this time.
*/
void initOptionsBase( bool restoreUi = true );

/** Restore the base ui.
* Sometimes useful to do at end of subclass's constructor.
*/
void restoreOptionsBaseUi();

protected slots:
void updateOptionsListVerticalTabs();
void optionsStackedWidget_CurrentChanged( int indx );
void optionsStackedWidget_WidgetRemoved( int indx );
void warnAboutMissingObjects();

protected:
void showEvent( QShowEvent* e );
void paintEvent( QPaintEvent* e );
};
18 changes: 18 additions & 0 deletions python/gui/qgssvgannotationitem.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class QgsSvgAnnotationItem : QgsAnnotationItem
{
%TypeHeaderCode
#include <qgssvgannotationitem.h>
%End
public:

QgsSvgAnnotationItem( QgsMapCanvas* canvas );
~QgsSvgAnnotationItem();

void writeXML( QDomDocument& doc ) const;
void readXML( const QDomDocument& doc, const QDomElement& itemElem );

void paint( QPainter* painter );

void setFilePath( const QString& file );
QString filePath() const;
};
28 changes: 28 additions & 0 deletions python/gui/symbology-ng/characterwidget.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
class CharacterWidget : QWidget
{
%TypeHeaderCode
#include <characterwidget.h>
%End
public:
CharacterWidget( QWidget *parent = 0 );
QSize sizeHint() const;

int getColumns() const;
int getSquareSize() const;

public slots:
void updateFont( const QFont &font );
void updateSize( double fontSize );
void updateStyle( const QString &fontStyle );
void updateFontMerging( bool enable );
void updateColumns( int cols );

signals:
void characterSelected( const QChar &character );

protected:
void mouseMoveEvent( QMouseEvent *event );
void mousePressEvent( QMouseEvent *event );
void paintEvent( QPaintEvent *event );
};

24 changes: 24 additions & 0 deletions python/gui/symbology-ng/qgscolorrampcombobox.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
class QgsColorRampComboBox : QComboBox
{
%TypeHeaderCode
#include <qgscolorrampcombobox.h>
%End
public:
QgsColorRampComboBox( QWidget *parent = 0 );

~QgsColorRampComboBox();

//! initialize the combo box with color ramps from the style
void populate( QgsStyleV2* style );

//! add/select color ramp which was used previously by the renderer
void setSourceColorRamp( QgsVectorColorRampV2* sourceRamp );

//! return new instance of the current color ramp or NULL if there is no active color ramp
QgsVectorColorRampV2* currentColorRamp();

static QSize rampIconSize;

public slots:
void colorRampChanged( int index );
};
11 changes: 11 additions & 0 deletions python/gui/symbology-ng/qgsdashspacedialog.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class QgsDashSpaceDialog : QDialog
{
%TypeHeaderCode
#include <qgsdashspacedialog.h>
%End
public:
QgsDashSpaceDialog( const QVector<qreal>& v, QWidget * parent = 0, Qt::WindowFlags f = 0 );
~QgsDashSpaceDialog();

QVector<qreal> dashDotVector() const;
};
22 changes: 22 additions & 0 deletions python/gui/symbology-ng/qgsdatadefinedsymboldialog.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
class QgsDataDefinedSymbolDialog : QDialog
{
%TypeHeaderCode
#include <qgsdatadefinedsymboldialog.h>
%End
public:
class DataDefinedSymbolEntry
{
public:
DataDefinedSymbolEntry( const QString& p, const QString& t, const QString& v, const QString& h );
};

QgsDataDefinedSymbolDialog( const QList< QgsDataDefinedSymbolDialog::DataDefinedSymbolEntry >& entries, const QgsVectorLayer* vl, QWidget * parent = 0, Qt::WindowFlags f = 0 );
~QgsDataDefinedSymbolDialog();
QMap< QString, QString > dataDefinedProperties() const;

//common help texts
static QString doubleHelpText();
static QString colorHelpText();
static QString offsetHelpText();
static QString fileNameHelpText();
};
25 changes: 25 additions & 0 deletions python/gui/symbology-ng/qgsstylev2exportimportdialog.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
class QgsStyleV2ExportImportDialog : QDialog
{
%TypeHeaderCode
#include <qgsstylev2exportimportdialog.h>
%End
public:
enum Mode
{
Export,
Import
};

// constructor
// mode argument must be 0 for saving and 1 for loading
QgsStyleV2ExportImportDialog( QgsStyleV2* style, QWidget *parent = NULL, Mode mode = Export );
~QgsStyleV2ExportImportDialog();

public slots:
void doExportImport();
void selectAll();
void clearSelection();

void importTypeChanged( int );
void browse();
};
79 changes: 79 additions & 0 deletions python/gui/symbology-ng/qgssvgselectorwidget.sip
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
class QgsSvgSelectorListModel : QAbstractListModel
{
%TypeHeaderCode
#include <qgssvgselectorwidget.h>
%End
public:
QgsSvgSelectorListModel( QObject* parent );

// Constructor to create model for icons in a specific path
QgsSvgSelectorListModel( QObject* parent, QString path );

int rowCount( const QModelIndex & parent = QModelIndex() ) const;

QVariant data( const QModelIndex & index, int role = Qt::DisplayRole ) const;
};

class QgsSvgSelectorGroupsModel : QStandardItemModel
{
%TypeHeaderCode
#include <qgssvgselectorwidget.h>
%End
public:
QgsSvgSelectorGroupsModel( QObject* parent );
};


class QgsSvgSelectorWidget : QWidget
{
%TypeHeaderCode
#include <qgssvgselectorwidget.h>
%End
public:
QgsSvgSelectorWidget( QWidget* parent = 0 );
~QgsSvgSelectorWidget();

static QgsSvgSelectorWidget* create( QWidget* parent = 0 ) /Factory/;

QString currentSvgPath() const;
QString currentSvgPathToName() const;

QTreeView* groupsTreeView();
QListView* imagesListView();
QLineEdit* filePathLineEdit();
QPushButton* filePathButton();
QCheckBox* relativePathCheckbox();
QLayout* selectorLayout();

public slots:
/** Accepts absolute and relative paths */
void setSvgPath( const QString& svgPath );

signals:
void svgSelected( const QString& path );

protected:
void populateList();
};

class QgsSvgSelectorDialog : QDialog
{
%TypeHeaderCode
#include <qgssvgselectorwidget.h>
%End
public:
QgsSvgSelectorDialog( QWidget* parent = 0, Qt::WFlags fl = QgisGui::ModalDialogFlags,
QDialogButtonBox::StandardButtons buttons = QDialogButtonBox::Close | QDialogButtonBox::Ok,
Qt::Orientation orientation = Qt::Horizontal );
~QgsSvgSelectorDialog();

//! Returns the central layout. Widgets added to it must have this dialog as parent
QVBoxLayout* layout();

//! Returns the button box
QDialogButtonBox* buttonBox();

//! Returns pointer to the embedded SVG selector widget
QgsSvgSelectorWidget* svgSelector();

};
3,665 changes: 1,980 additions & 1,685 deletions resources/customization.xml

Large diffs are not rendered by default.

57 changes: 24 additions & 33 deletions scripts/widgets_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,34 +38,36 @@

import sys
import os, glob, imp
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from PyQt4.uic import loadUi, compileUi
from xml.etree.ElementTree import Element, SubElement, Comment, tostring
from xml.dom import minidom
from PyQt4.QtXml import *

# qwt_plot is missing somehow but it may depend on installed packages
from PyQt4 import Qwt5 as qwt_plot
sys.modules['qwt_plot'] = qwt_plot

from qgis.gui import QgsAttributeTableView

# loadUi is looking for custom widget in module which is lowercase version of
# the class, which do not exist (AFAIK) -> preload them, problems anyway:
# missing in gui: QgsColorRampComboBox, QgsRendererRulesTreeWidget,
# QgsRendererRulesTreeWidget, QgsAttributeTableView
# and QgsProjectionSelector cannot open db file
from qgis import gui
for m in ['qgscolorbutton', 'qgscolorrampcombobox', 'qgsprojectionselector', 'qgslabelpreview', 'qgsrulebasedrendererv2widget', 'qgsattributetableview' ]:
for m in ['qgscolorbutton', 'qgscolorrampcombobox', 'qgsprojectionselector', 'qgslabelpreview', 'qgsrulebasedrendererv2widget', 'qgscollapsiblegroupbox', 'qgsblendmodecombobox', 'qgsexpressionbuilderwidget', 'qgsrasterformatsaveoptionswidget', 'qgsrasterpyramidsoptionswidget', 'qgsscalecombobox', 'qgsfilterlineedit', 'qgsdualview' ]:
sys.modules[m] = gui

class UiInspector:
def __init__(self ):
self.ui_dir = os.path.abspath ( os.path.join( os.path.dirname(__file__) , '../src/ui/*.ui' ) )
def __init__(self):
self.ui_dir = os.path.abspath ( os.path.join( os.path.dirname(__file__), '../src/ui/*.ui' ) )
self.printMsg ( "Loading UI files " + self.ui_dir )
# list of widget classes we want to follow
self.follow = [
QWidget, QDialog,
QCheckBox, QComboBox, QDial, QPushButton, QLabel, QLCDNumber, QLineEdit, QRadioButton, QScrollBar, QSlider, QSpinBox, QTextEdit,
QDateEdit, QTimeEdit, QDateTimeEdit, QListView, QProgressBar, QTableView, QTabWidget, QTextBrowser, QDialogButtonBox,
QScrollArea, QGroupBox, QStackedWidget,
QScrollArea, QGroupBox, QStackedWidget,
]

def printMsg ( self, msg ):
Expand All @@ -77,7 +79,8 @@ def widgetXml(self, element, widget, level = 0, label = None ):
#self.printMsg ( "objectName: " + widget.objectName() )
#self.printMsg ( "windowTitle: " + widget.windowTitle() )

if not widget.objectName(): return
if not widget.objectName():
return

lab = label
if hasattr( widget, 'text' ):
Expand All @@ -87,12 +90,11 @@ def widgetXml(self, element, widget, level = 0, label = None ):
if not lab:
lab = ''

lab = unicode(lab).encode("ascii","replace")

sub_element = SubElement( element, 'widget')
sub_element.set('class', widget.__class__.__name__ )
sub_element.set('objectName', widget.objectName() )
sub_element.set('label', lab )
subElement = self.doc.createElement('widget')
subElement.setAttribute('class', widget.__class__.__name__ )
subElement.setAttribute('objectName', widget.objectName() )
subElement.setAttribute('label', lab )
element.appendChild( subElement )

#print str ( widget.children () )
# tab widget label is stored in QTabWidget->QTabBarPrivate->tabList->QTab ..
Expand All @@ -103,35 +105,24 @@ def widgetXml(self, element, widget, level = 0, label = None ):
for child in children:
w = child['widget']
if w.isWidgetType() and ( type(w) in self.follow ):
self.widgetXml ( sub_element, w, level+1, child['label'] )

self.widgetXml( subElement, w, level+1, child['label'] )

def treeXml(self, element ):
xml = ''
# debug
def xml(self) :
self.doc = QDomDocument()
element = self.doc.createElement( "qgiswidgets" )
self.doc.appendChild( element )
for p in glob.glob( self.ui_dir ):
self.printMsg ( "Loading " + p )
# qgsrasterlayerpropertiesbase.ui is giving: No module named qwt_plot
try:
widget = loadUi ( p )
#print dir ( ui )
self.widgetXml ( element, widget )
self.widgetXml( element, widget )
except Exception, e:
#except IOError, e:
self.printMsg ( str(e) )

return xml

def xml( self ) :
#xml = "<?xml version='1.0' encoding='UTF-8'?>\n"
#xml += "<!DOCTYPE qgiswidgets SYSTEM 'http://mrcc.com/qgiswidgets.dtd'>\n"
element = Element('qgiswidgets')
self.treeXml( element )

string = tostring ( element, 'utf-8' )
reparsed = minidom.parseString(string)
xml = reparsed.toprettyxml(indent=" ")
return xml
self.printMsg( str(e) )

return self.doc.toString( 2 )


if __name__ == '__main__':
Expand Down
4 changes: 0 additions & 4 deletions src/core/qgscacheindexfeatureid.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ class CORE_EXPORT QgsCacheIndexFeatureId : public QgsAbstractCacheIndex
*/
virtual bool getCacheIterator( QgsFeatureIterator& featureIterator, const QgsFeatureRequest& featureRequest );

signals:

public slots:

private:
QgsVectorLayerCache* C;
};
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgscentralpointpositionmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class QgsPoint;
a feature. It does not consider conflicts in case of several overlay layers
* \note This class has been added in version 1.1
*/
class QgsCentralPointPositionManager: public QgsOverlayObjectPositionManager
class CORE_EXPORT QgsCentralPointPositionManager : public QgsOverlayObjectPositionManager
{
public:
QgsCentralPointPositionManager();
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgspalobjectpositionmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class QgsPALGeometry;
/**A class that uses the PAL library for overlay object placement
* \note This class has been added in version 1.1
*/
class QgsPALObjectPositionManager: public QgsOverlayObjectPositionManager
class CORE_EXPORT QgsPALObjectPositionManager: public QgsOverlayObjectPositionManager
{
public:
QgsPALObjectPositionManager();
Expand Down
2 changes: 1 addition & 1 deletion src/core/raster/qgsrasterdrawer.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class QgsRasterIterator;
/** \ingroup core
* The drawing pipe for raster layers.
*/
class QgsRasterDrawer
class CORE_EXPORT QgsRasterDrawer
{
public:
QgsRasterDrawer( QgsRasterIterator* iterator );
Expand Down
1 change: 0 additions & 1 deletion src/core/symbology-ng/qgssymbologyv2conversion.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class CORE_EXPORT QgsSymbologyV2Conversion
/** Read old renderer definition from XML and create matching new renderer */
static QgsFeatureRendererV2* readOldRenderer( const QDomNode& layerNode, QGis::GeometryType geomType );


static QString penStyle2QString( Qt::PenStyle penstyle );
static Qt::PenStyle qString2PenStyle( QString string );
static QString brushStyle2QString( Qt::BrushStyle brushstyle );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsdetaileditemwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* A widget renderer for detailed item views.
* @see also QgsDetailedItem and QgsDetailedItemData.
*/
class QgsDetailedItemWidget :
class GUI_EXPORT QgsDetailedItemWidget :
public QWidget, private Ui::QgsDetailedItemWidgetBase
{
Q_OBJECT
Expand Down
2 changes: 1 addition & 1 deletion src/gui/symbology-ng/characterwidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class QPaintEvent;
QT_END_NAMESPACE

//! [0]
class CharacterWidget : public QWidget
class GUI_EXPORT CharacterWidget : public QWidget
{
Q_OBJECT

Expand Down
3 changes: 0 additions & 3 deletions src/gui/symbology-ng/qgscolorrampcombobox.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@ class QgsColorRampComboBox : public QComboBox

static QSize rampIconSize;

signals:

public slots:

void colorRampChanged( int index );

protected:
Expand Down
2 changes: 1 addition & 1 deletion src/gui/symbology-ng/qgsdashspacedialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include "ui_qgsdashspacedialogbase.h"

/**A dialog to enter a custom dash space pattern for lines*/
class QgsDashSpaceDialog: public QDialog, private Ui::QgsDashSpaceDialogBase
class GUI_EXPORT QgsDashSpaceDialog: public QDialog, private Ui::QgsDashSpaceDialogBase
{
Q_OBJECT
public:
Expand Down
3 changes: 1 addition & 2 deletions src/gui/symbology-ng/qgsstylev2exportimportdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
* *
***************************************************************************/


#ifndef QGSSTYLEV2EXPORTIMPORTDIALOG_H
#define QGSSTYLEV2EXPORTIMPORTDIALOG_H

Expand All @@ -29,7 +28,7 @@

class QgsStyleV2;

class QgsStyleV2ExportImportDialog : public QDialog, private Ui::QgsStyleV2ExportImportDialogBase
class GUI_EXPORT QgsStyleV2ExportImportDialog : public QDialog, private Ui::QgsStyleV2ExportImportDialogBase
{
Q_OBJECT

Expand Down
18 changes: 0 additions & 18 deletions src/gui/symbology-ng/qgsvectorfieldwidget.h

This file was deleted.