Skip to content

Commit 2dae372

Browse files
author
mhugent
committedOct 21, 2008
Added symbology functions of QgsMapLayer to sip file
git-svn-id: http://svn.osgeo.org/qgis/trunk@9512 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 43f2596 commit 2dae372

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed
 

‎python/core/qgsmaplayer.sip

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,73 @@ public:
192192

193193
/** A convenience function to capitalise the layer name */
194194
static QString capitaliseLayerName(const QString name);
195+
196+
/** Retrieve the default style for this layer if one
197+
* exists (either as a .qml file on disk or as a
198+
* record in the users style table in their personal qgis.db)
199+
* @param a reference to a flag that will be set to false if
200+
* we did not manage to load the default style.
201+
* @return a QString with any status messages
202+
* @see also loadNamedStyle ();
203+
*/
204+
virtual QString loadDefaultStyle( bool & theResultFlag );
205+
206+
/** Retrieve a named style for this layer if one
207+
* exists (either as a .qml file on disk or as a
208+
* record in the users style table in their personal qgis.db)
209+
* @param QString theURI - the file name or other URI for the
210+
* style file. First an attempt will be made to see if this
211+
* is a file and load that, if that fails the qgis.db styles
212+
* table will be consulted to see if there is a style who's
213+
* key matches the URI.
214+
* @param a reference to a flag that will be set to false if
215+
* we did not manage to load the default style.
216+
* @return a QString with any status messages
217+
* @see also loadDefaultStyle ();
218+
*/
219+
virtual QString loadNamedStyle( const QString theURI, bool & theResultFlag );
220+
221+
virtual bool loadNamedStyleFromDb( const QString db, const QString theURI, QString &qml );
222+
223+
/** Save the properties of this layer as the default style
224+
* (either as a .qml file on disk or as a
225+
* record in the users style table in their personal qgis.db)
226+
* @param a reference to a flag that will be set to false if
227+
* we did not manage to save the default style.
228+
* @return a QString with any status messages
229+
* @see also loadNamedStyle () and saveNamedStyle()
230+
*/
231+
virtual QString saveDefaultStyle( bool & theResultFlag );
232+
233+
/** Save the properties of this layer as a named style
234+
* (either as a .qml file on disk or as a
235+
* record in the users style table in their personal qgis.db)
236+
* @param QString theURI - the file name or other URI for the
237+
* style file. First an attempt will be made to see if this
238+
* is a file and save to that, if that fails the qgis.db styles
239+
* table will be used to create a style entry who's
240+
* key matches the URI.
241+
* @param a reference to a flag that will be set to false if
242+
* we did not manage to save the default style.
243+
* @return a QString with any status messages
244+
* @see also saveDefaultStyle ();
245+
*/
246+
virtual QString saveNamedStyle( const QString theURI, bool & theResultFlag );
247+
248+
/** Read the symbology for the current layer from the Dom node supplied.
249+
* @param QDomNode node that will contain the symbology definition for this layer.
250+
* @param errorMessage reference to string that will be updated with any error messages
251+
* @return true in case of success.
252+
*/
253+
virtual bool readSymbology( const QDomNode& node, QString& errorMessage ) = 0;
254+
255+
/** Write the symbology for the layer into the docment provided.
256+
* @param QDomNode the node that will have the style element added to it.
257+
* @param QDomDocument the document that will have the QDomNode added.
258+
* @param errorMessage reference to string that will be updated with any error messages
259+
* @return true in case of success.
260+
*/
261+
virtual bool writeSymbology( QDomNode&, QDomDocument& doc, QString& errorMessage ) const = 0;
195262

196263
public slots:
197264

0 commit comments

Comments
 (0)
Please sign in to comment.