/python/core/auto_generated/qgsmaplayerlegend.sip.in

https://github.com/ricardogsilva/Quantum-GIS · Autoconf · 391 lines · 265 code · 120 blank · 6 comment · 31 complexity · 876900a8400aba0e649003c7d970fca6 MD5 · raw file

  1. /************************************************************************
  2. * This file has been generated automatically from *
  3. * *
  4. * src/core/qgsmaplayerlegend.h *
  5. * *
  6. * Do not edit manually ! Edit header and run scripts/sipify.pl again *
  7. ************************************************************************/
  8. class QgsMapLayerLegend : QObject
  9. {
  10. %Docstring(signature="appended")
  11. The :py:class:`QgsMapLayerLegend` class is abstract interface for implementations
  12. of legends for one map layer.
  13. .. versionadded:: 2.6
  14. %End
  15. %TypeHeaderCode
  16. #include "qgsmaplayerlegend.h"
  17. %End
  18. public:
  19. explicit QgsMapLayerLegend( QObject *parent /TransferThis/ = 0 );
  20. %Docstring
  21. Constructor for QgsMapLayerLegend
  22. %End
  23. virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context );
  24. %Docstring
  25. Reads configuration from a DOM element previously written by :py:func:`~QgsMapLayerLegend.writeXml`
  26. .. versionadded:: 3.2
  27. %End
  28. virtual QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context ) const;
  29. %Docstring
  30. Writes configuration to a DOM element, to be used later with :py:func:`~QgsMapLayerLegend.readXml`
  31. .. versionadded:: 3.2
  32. %End
  33. virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) = 0 /Factory/;
  34. %Docstring
  35. Returns list of legend nodes to be used for a particular layer tree layer node.
  36. Ownership is transferred to the caller.
  37. %End
  38. static QgsMapLayerLegend *defaultVectorLegend( QgsVectorLayer *vl ) /Factory/;
  39. %Docstring
  40. Create new legend implementation for vector layer
  41. %End
  42. static QgsMapLayerLegend *defaultRasterLegend( QgsRasterLayer *rl ) /Factory/;
  43. %Docstring
  44. Create new legend implementation for raster layer
  45. %End
  46. static QgsMapLayerLegend *defaultMeshLegend( QgsMeshLayer *ml ) /Factory/;
  47. %Docstring
  48. Create new legend implementation for mesh layer
  49. %End
  50. static QgsMapLayerLegend *defaultPointCloudLegend( QgsPointCloudLayer *layer ) /Factory/;
  51. %Docstring
  52. Create new legend implementation for a point cloud ``layer``.
  53. .. versionadded:: 3.18
  54. %End
  55. signals:
  56. void itemsChanged();
  57. %Docstring
  58. Emitted when existing items/nodes got invalid and should be replaced by new ones
  59. %End
  60. };
  61. class QgsMapLayerLegendUtils
  62. {
  63. %Docstring(signature="appended")
  64. Miscellaneous utility functions for handling of map layer legend
  65. .. versionadded:: 2.6
  66. %End
  67. %TypeHeaderCode
  68. #include "qgsmaplayerlegend.h"
  69. %End
  70. public:
  71. static void setLegendNodeOrder( QgsLayerTreeLayer *nodeLayer, const QList<int> &order );
  72. static QList<int> legendNodeOrder( QgsLayerTreeLayer *nodeLayer );
  73. static bool hasLegendNodeOrder( QgsLayerTreeLayer *nodeLayer );
  74. static void setLegendNodeUserLabel( QgsLayerTreeLayer *nodeLayer, int originalIndex, const QString &newLabel );
  75. static QString legendNodeUserLabel( QgsLayerTreeLayer *nodeLayer, int originalIndex );
  76. static bool hasLegendNodeUserLabel( QgsLayerTreeLayer *nodeLayer, int originalIndex );
  77. static void setLegendNodePatchShape( QgsLayerTreeLayer *nodeLayer, int originalIndex, const QgsLegendPatchShape &shape );
  78. %Docstring
  79. Sets the legend patch ``shape`` for the legend node belonging to ``nodeLayer`` at the specified ``originalIndex``.
  80. .. seealso:: :py:func:`legendNodePatchShape`
  81. .. versionadded:: 3.14
  82. %End
  83. static QgsLegendPatchShape legendNodePatchShape( QgsLayerTreeLayer *nodeLayer, int originalIndex );
  84. %Docstring
  85. Returns the legend patch shape for the legend node belonging to ``nodeLayer`` at the specified ``originalIndex``.
  86. .. seealso:: :py:func:`setLegendNodePatchShape`
  87. .. versionadded:: 3.14
  88. %End
  89. static void setLegendNodeSymbolSize( QgsLayerTreeLayer *nodeLayer, int originalIndex, QSizeF size );
  90. %Docstring
  91. Sets the legend symbol ``size`` for the legend node belonging to ``nodeLayer`` at the specified ``originalIndex``.
  92. If either the width or height are non-zero, they will be used when rendering the legend node instead of the default
  93. symbol width or height from :py:class:`QgsLegendSettings`.
  94. .. seealso:: :py:func:`legendNodeSymbolSize`
  95. .. versionadded:: 3.14
  96. %End
  97. static QSizeF legendNodeSymbolSize( QgsLayerTreeLayer *nodeLayer, int originalIndex );
  98. %Docstring
  99. Returns the legend node symbol size for the legend node belonging to ``nodeLayer`` at the specified ``originalIndex``.
  100. If either the width or height are non-zero, they will be used when rendering the legend node instead of the default
  101. symbol width or height from :py:class:`QgsLegendSettings`.
  102. .. seealso:: :py:func:`setLegendNodeSymbolSize`
  103. .. versionadded:: 3.14
  104. %End
  105. static void setLegendNodeCustomSymbol( QgsLayerTreeLayer *nodeLayer, int originalIndex, const QgsSymbol *symbol );
  106. %Docstring
  107. Sets a custom legend ``symbol`` for the legend node belonging to ``nodeLayer`` at the specified ``originalIndex``.
  108. If ``symbol`` is non-``None``, it will be used in place of the default symbol when rendering
  109. the legend node.
  110. .. seealso:: :py:func:`legendNodeCustomSymbol`
  111. .. versionadded:: 3.14
  112. %End
  113. static QgsSymbol *legendNodeCustomSymbol( QgsLayerTreeLayer *nodeLayer, int originalIndex ) /Factory/;
  114. %Docstring
  115. Returns the custom legend symbol for the legend node belonging to ``nodeLayer`` at the specified ``originalIndex``.
  116. If the symbol is non-``None``, it will be used in place of the default symbol when rendering
  117. the legend node.
  118. Caller takes ownership of the returned symbol.
  119. .. seealso:: :py:func:`setLegendNodeCustomSymbol`
  120. .. versionadded:: 3.14
  121. %End
  122. static void setLegendNodeColorRampSettings( QgsLayerTreeLayer *nodeLayer, int originalIndex, const QgsColorRampLegendNodeSettings *settings );
  123. %Docstring
  124. Sets a custom legend color ramp ``settings`` for the legend node belonging to ``nodeLayer`` at the specified ``originalIndex``.
  125. If the corresponding legend node is not a :py:class:`QgsColorRampLegendNode` then calling this method will have no effect.
  126. If ``settings`` is non-``None``, they will be used in place of the default settigns when rendering
  127. the legend node.
  128. .. seealso:: :py:func:`legendNodeColorRampSettings`
  129. .. versionadded:: 3.18
  130. %End
  131. static QgsColorRampLegendNodeSettings *legendNodeColorRampSettings( QgsLayerTreeLayer *nodeLayer, int originalIndex ) /Factory/;
  132. %Docstring
  133. Returns the custom legend color ramp settings for the legend node belonging to ``nodeLayer`` at the specified ``originalIndex``.
  134. If the corresponding legend node is not a :py:class:`QgsColorRampLegendNode` then calling this method will return ``None``.
  135. If the returned value is non-``None``, they will be used in place of the default settings when rendering
  136. the legend node.
  137. Caller takes ownership of the returned settings.
  138. .. seealso:: :py:func:`setLegendNodeColorRampSettings`
  139. .. versionadded:: 3.18
  140. %End
  141. static void setLegendNodeColumnBreak( QgsLayerTreeLayer *nodeLayer, int originalIndex, bool columnBreakBeforeNode );
  142. %Docstring
  143. Sets whether a forced column break should occur before the node.
  144. .. seealso:: :py:func:`legendNodeColumnBreak`
  145. .. versionadded:: 3.14
  146. %End
  147. static bool legendNodeColumnBreak( QgsLayerTreeLayer *nodeLayer, int originalIndex );
  148. %Docstring
  149. Returns whether a forced column break should occur before the node.
  150. .. seealso:: :py:func:`setLegendNodeColumnBreak`
  151. .. versionadded:: 3.14
  152. %End
  153. static void applyLayerNodeProperties( QgsLayerTreeLayer *nodeLayer, QList<QgsLayerTreeModelLegendNode *> &nodes );
  154. %Docstring
  155. update according to layer node's custom properties (order of items, user labels for items)
  156. %End
  157. };
  158. class QgsDefaultVectorLayerLegend : QgsMapLayerLegend
  159. {
  160. %Docstring(signature="appended")
  161. Default legend implementation for vector layers
  162. .. versionadded:: 2.6
  163. %End
  164. %TypeHeaderCode
  165. #include "qgsmaplayerlegend.h"
  166. %End
  167. public:
  168. explicit QgsDefaultVectorLayerLegend( QgsVectorLayer *vl );
  169. bool textOnSymbolEnabled() const;
  170. %Docstring
  171. Returns whether the "text on symbol" functionality is enabled. When enabled, legend symbols
  172. may have extra text rendered on top. The content of labels and their style is controlled
  173. by :py:func:`~QgsDefaultVectorLayerLegend.textOnSymbolContent` and :py:func:`~QgsDefaultVectorLayerLegend.textOnSymbolTextFormat`.
  174. .. versionadded:: 3.2
  175. %End
  176. void setTextOnSymbolEnabled( bool enabled );
  177. %Docstring
  178. Sets whether the "text on symbol" functionality is enabled. When enabled, legend symbols
  179. may have extra text rendered on top. The content of labels and their style is controlled
  180. by :py:func:`~QgsDefaultVectorLayerLegend.textOnSymbolContent` and :py:func:`~QgsDefaultVectorLayerLegend.textOnSymbolTextFormat`.
  181. .. versionadded:: 3.2
  182. %End
  183. bool showLabelLegend() const;
  184. %Docstring
  185. Returns whether the legend for the labeling is shown
  186. .. versionadded:: 3.20
  187. %End
  188. void setShowLabelLegend( bool enabled );
  189. %Docstring
  190. Sets if a legend for the labeling should be shown
  191. :param enabled: true to show label legend entries
  192. .. versionadded:: 3.20
  193. %End
  194. QgsTextFormat textOnSymbolTextFormat() const;
  195. %Docstring
  196. Returns text format of symbol labels for "text on symbol" functionality.
  197. .. versionadded:: 3.2
  198. %End
  199. void setTextOnSymbolTextFormat( const QgsTextFormat &format );
  200. %Docstring
  201. Sets text format of symbol labels for "text on symbol" functionality.
  202. .. versionadded:: 3.2
  203. %End
  204. QHash<QString, QString> textOnSymbolContent() const;
  205. %Docstring
  206. Returns per-symbol content of labels for "text on symbol" functionality. In the passed dictionary
  207. the keys are rule keys of legend items, the values are labels to be shown.
  208. .. versionadded:: 3.2
  209. %End
  210. void setTextOnSymbolContent( const QHash<QString, QString> &content );
  211. %Docstring
  212. Sets per-symbol content of labels for "text on symbol" functionality. In the passed dictionary
  213. the keys are rule keys of legend items, the values are labels to be shown.
  214. .. versionadded:: 3.2
  215. %End
  216. virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) /Factory/;
  217. virtual void readXml( const QDomElement &elem, const QgsReadWriteContext &context );
  218. virtual QDomElement writeXml( QDomDocument &doc, const QgsReadWriteContext &context ) const;
  219. };
  220. class QgsDefaultRasterLayerLegend : QgsMapLayerLegend
  221. {
  222. %Docstring(signature="appended")
  223. Default legend implementation for raster layers
  224. .. versionadded:: 2.6
  225. %End
  226. %TypeHeaderCode
  227. #include "qgsmaplayerlegend.h"
  228. %End
  229. public:
  230. explicit QgsDefaultRasterLayerLegend( QgsRasterLayer *rl );
  231. virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) /Factory/;
  232. };
  233. class QgsDefaultMeshLayerLegend : QgsMapLayerLegend
  234. {
  235. %Docstring(signature="appended")
  236. Default legend implementation for mesh layers
  237. .. versionadded:: 3.4
  238. %End
  239. %TypeHeaderCode
  240. #include "qgsmaplayerlegend.h"
  241. %End
  242. public:
  243. explicit QgsDefaultMeshLayerLegend( QgsMeshLayer *ml );
  244. %Docstring
  245. Creates an instance for the given mesh layer
  246. %End
  247. virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) /Factory/;
  248. };
  249. class QgsDefaultPointCloudLayerLegend : QgsMapLayerLegend
  250. {
  251. %Docstring(signature="appended")
  252. Default legend implementation for point cloud layers
  253. .. versionadded:: 3.18
  254. %End
  255. %TypeHeaderCode
  256. #include "qgsmaplayerlegend.h"
  257. %End
  258. public:
  259. explicit QgsDefaultPointCloudLayerLegend( QgsPointCloudLayer *layer );
  260. %Docstring
  261. Creates an instance for the given point cloud layer
  262. %End
  263. virtual QList<QgsLayerTreeModelLegendNode *> createLayerTreeModelLegendNodes( QgsLayerTreeLayer *nodeLayer ) /Factory/;
  264. };
  265. /************************************************************************
  266. * This file has been generated automatically from *
  267. * *
  268. * src/core/qgsmaplayerlegend.h *
  269. * *
  270. * Do not edit manually ! Edit header and run scripts/sipify.pl again *
  271. ************************************************************************/