/* Copyright (C) 2002 Nikolas Zimmermann This file is part of the KDE project This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef KSVGIconEngine_H #define KSVGIconEngine_H #include #include /** * \file ksvgiconengine.h */ class KSVGIconPainter; class TDECORE_EXPORT KSVGIconEngine { public: KSVGIconEngine(); ~KSVGIconEngine(); /** * @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(); /** * @short Returns the rendered image's height. */ double height(); private: struct Private; Private *d; }; #endif