2009-12-07 21:03:45 +00:00
|
|
|
/**
|
|
|
|
* \class QgsLegendInterface
|
|
|
|
* \brief Abstract base class to make QgsLegend available to plugins.
|
|
|
|
*/
|
|
|
|
class QgsLegendInterface : QObject
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgslegendinterface.h>
|
|
|
|
%End
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
/** Constructor */
|
|
|
|
QgsLegendInterface();
|
|
|
|
|
|
|
|
/** Virtual destructor */
|
|
|
|
~QgsLegendInterface();
|
|
|
|
|
2010-04-06 16:12:39 +00:00
|
|
|
//! Return a string list of groups
|
2009-12-07 21:03:45 +00:00
|
|
|
virtual QStringList groups() =0;
|
|
|
|
|
2010-04-06 16:12:39 +00:00
|
|
|
//! Return all layers in the project in legend order
|
|
|
|
//! @note added in 1.5
|
|
|
|
virtual QList< QgsMapLayer * > layers() const = 0;
|
|
|
|
|
2009-12-07 21:03:45 +00:00
|
|
|
signals:
|
|
|
|
|
|
|
|
//! emitted when a group index has changed
|
|
|
|
void groupIndexChanged( int oldIndex, int newIndex );
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
|
|
|
|
//! Add a new group
|
|
|
|
virtual int addGroup( QString name, bool expand = true ) =0;
|
|
|
|
|
|
|
|
//! Remove group on index
|
|
|
|
virtual void removeGroup( int groupIndex ) =0;
|
|
|
|
|
|
|
|
//! Move a layer to a group
|
|
|
|
virtual void moveLayer( QgsMapLayer * layer, int groupIndex ) =0;
|
2010-01-21 20:17:29 +00:00
|
|
|
|
2010-01-23 21:50:09 +00:00
|
|
|
//! refresh layer symbology
|
|
|
|
//! \note added in 1.5
|
|
|
|
virtual void refreshLayerSymbology( QgsMapLayer *layer ) =0;
|
2009-12-07 21:03:45 +00:00
|
|
|
};
|
|
|
|
|