[QGIS Commit] r9512 - trunk/qgis/python/core

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Oct 21 15:27:41 EDT 2008


Author: mhugent
Date: 2008-10-21 15:27:41 -0400 (Tue, 21 Oct 2008)
New Revision: 9512

Modified:
   trunk/qgis/python/core/qgsmaplayer.sip
Log:
Added symbology functions of QgsMapLayer to sip file

Modified: trunk/qgis/python/core/qgsmaplayer.sip
===================================================================
--- trunk/qgis/python/core/qgsmaplayer.sip	2008-10-21 17:54:10 UTC (rev 9511)
+++ trunk/qgis/python/core/qgsmaplayer.sip	2008-10-21 19:27:41 UTC (rev 9512)
@@ -192,6 +192,73 @@
 
     /** A convenience function to capitalise the layer name */
     static QString capitaliseLayerName(const QString name);
+
+	/** Retrieve the default style for this layer if one
+     * exists (either as a .qml file on disk or as a
+     * record in the users style table in their personal qgis.db)
+     * @param a reference to a flag that will be set to false if
+     * we did not manage to load the default style.
+     * @return a QString with any status messages
+     * @see also loadNamedStyle ();
+     */
+    virtual QString loadDefaultStyle( bool & theResultFlag );
+
+    /** Retrieve a named style for this layer if one
+     * exists (either as a .qml file on disk or as a
+     * record in the users style table in their personal qgis.db)
+     * @param QString theURI - the file name or other URI for the
+     * style file. First an attempt will be made to see if this
+     * is a file and load that, if that fails the qgis.db styles
+     * table will be consulted to see if there is a style who's
+     * key matches the URI.
+     * @param a reference to a flag that will be set to false if
+     * we did not manage to load the default style.
+     * @return a QString with any status messages
+     * @see also loadDefaultStyle ();
+     */
+    virtual QString loadNamedStyle( const QString theURI, bool & theResultFlag );
+
+    virtual bool loadNamedStyleFromDb( const QString db, const QString theURI, QString &qml );
+
+    /** Save the properties of this layer as the default style
+     * (either as a .qml file on disk or as a
+     * record in the users style table in their personal qgis.db)
+     * @param a reference to a flag that will be set to false if
+     * we did not manage to save the default style.
+     * @return a QString with any status messages
+     * @see also loadNamedStyle () and saveNamedStyle()
+     */
+    virtual QString saveDefaultStyle( bool & theResultFlag );
+
+    /** Save the properties of this layer as a named style
+     * (either as a .qml file on disk or as a
+     * record in the users style table in their personal qgis.db)
+     * @param QString theURI - the file name or other URI for the
+     * style file. First an attempt will be made to see if this
+     * is a file and save to that, if that fails the qgis.db styles
+     * table will be used to create a style entry who's
+     * key matches the URI.
+     * @param a reference to a flag that will be set to false if
+     * we did not manage to save the default style.
+     * @return a QString with any status messages
+     * @see also saveDefaultStyle ();
+     */
+    virtual QString saveNamedStyle( const QString theURI, bool & theResultFlag );
+
+    /** Read the symbology for the current layer from the Dom node supplied.
+     * @param QDomNode node that will contain the symbology definition for this layer.
+     * @param errorMessage reference to string that will be updated with any error messages
+     * @return true in case of success.
+    */
+    virtual bool readSymbology( const QDomNode& node, QString& errorMessage ) = 0;
+
+    /** Write the symbology for the layer into the docment provided.
+     *  @param QDomNode the node that will have the style element added to it.
+     *  @param QDomDocument the document that will have the QDomNode added.
+     * @param errorMessage reference to string that will be updated with any error messages
+     *  @return true in case of success.
+     */
+    virtual bool writeSymbology( QDomNode&, QDomDocument& doc, QString& errorMessage ) const = 0;	
     
 public slots:
 



More information about the QGIS-commit mailing list