diff options
author | Mavridis Philippe <mavridisf@gmail.com> | 2022-03-10 13:29:18 +0200 |
---|---|---|
committer | Mavridis Philippe <mavridisf@gmail.com> | 2022-03-10 13:29:18 +0200 |
commit | d52839aabbba103f273dbae5c17a59d646598d1d (patch) | |
tree | 6543ce0302db024abc2d7f8ef5e7e41909938176 /tdecore/svgicons/ksvgiconengine.h | |
parent | 2fcbb8f256f515bec9b5db93743f281b00aba827 (diff) | |
download | tdelibs-d52839aabbba103f273dbae5c17a59d646598d1d.tar.gz tdelibs-d52839aabbba103f273dbae5c17a59d646598d1d.zip |
svgicons: API changes proposalfeat/tdehtml+svg
Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
Diffstat (limited to 'tdecore/svgicons/ksvgiconengine.h')
-rw-r--r-- | tdecore/svgicons/ksvgiconengine.h | 72 |
1 files changed, 66 insertions, 6 deletions
diff --git a/tdecore/svgicons/ksvgiconengine.h b/tdecore/svgicons/ksvgiconengine.h index 9ed825194..51f76acc4 100644 --- a/tdecore/svgicons/ksvgiconengine.h +++ b/tdecore/svgicons/ksvgiconengine.h @@ -21,8 +21,13 @@ #ifndef KSVGIconEngine_H #define KSVGIconEngine_H +#include <tqdom.h> #include <tdelibs_export.h> +/** + * \file ksvgiconengine.h + */ + class KSVGIconPainter; class TDECORE_EXPORT KSVGIconEngine @@ -30,14 +35,69 @@ class TDECORE_EXPORT KSVGIconEngine public: KSVGIconEngine(); ~KSVGIconEngine(); - - bool load(int width, int height, const TQString &path); - KSVGIconPainter *painter(); - TQImage *image(); + /** + * @short Reads SVG(Z) document @p path, parses and renders its contents. + * + * @param path is the path of the SVG document. + * @param width is the width of the render result. Omit it or pass 0 to use document's default. + * @param height is the height of the render result. Omit it or pass 0 to use document's default. + * + * @return True if rendering is successful, otherwise false. + */ + bool load(const TQString &path, int width = 0, int height = 0); + + /** + * @deprecated + * @short Reads SVG(Z) document @p path, parses and renders its contents. + * + * This function uses the old parameter order which does not allow width and height to be omitted + * and is kept for compatibility. Prefer the variant below instead. + * + * @see load(const TQString&, int, int); + */ + bool load(int width, int height, const TQString &path) KDE_DEPRECATED; + + /** + * @short Renders the SVG data stored as DOM in @p data. + * + * @param data is the TQDocDocument representation of the SVG document to render. + * @see load(const TQString&, int, int); + */ + bool parse(const TQDomDocument &data, int width = 0, int height = 0); + + /** + * @short Renders the SVG data stored as string in @p data. + * + * This function is a wrapper provided for convenience. + * + * @param data is a TQString containing the SVG document to render. + * @see parse(const TQDomDocument&, int, int); + */ + bool parse(const TQString &data, int width = 0, int height = 0); + + /** + * @short Returns a pointer to the engine's KSVGIconPainter object. + * + * Typically you won't need access to the painter and you won't be able to do so + * from outside tdelibs (since the KSVGIconPainter header is not installed). + */ + KSVGIconPainter *painter(); + + /** + * @short Returns a pointer to the rendered TQImage. + */ + TQImage *image(); + + /** + * @short Returns the rendered image's width. + */ + double width(); - double width(); - double height(); + /** + * @short Returns the rendered image's height. + */ + double height(); private: struct Private; |