• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegames API Reference
  • KDE Home
  • Contact Us
 

libkdegames/libkdegamesprivate

  • sources
  • kde-4.14
  • kdegames
  • libkdegames
  • libkdegamesprivate
kgamesvgdocument.h
Go to the documentation of this file.
1 
6 /***************************************************************************
7  * Copyright (C) 2007 Mark A. Taff <kde@marktaff.com> *
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU Library General Public License *
11  * version 2 as published by the Free Software Foundation *
12  * *
13  * This program is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16  * GNU Library General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU Library General Public *
19  * License along with this program; if not, write to the *
20  * Free Software Foundation, Inc., *
21  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
22  ***************************************************************************/
23 
24 #ifndef _KGAMESVGDOCUMENT_H_
25 #define _KGAMESVGDOCUMENT_H_
26 
27 #include <QtCore/QHash>
28 #include <QtCore/QStringList>
29 #include <QtGui/QMatrix>
30 #include <QtXml/QDomDocument>
31 #include "libkdegamesprivate_export.h"
32 
33 
34 class KGameSvgDocumentPrivate;
35 
115 class KDEGAMESPRIVATE_EXPORT KGameSvgDocument : public QDomDocument
116 {
117 public:
121  explicit KGameSvgDocument();
122 
126  KGameSvgDocument(const KGameSvgDocument &doc);
127 
131  virtual ~KGameSvgDocument();
132 
136  KGameSvgDocument& operator=(const KGameSvgDocument &doc);
137 
141  enum MatrixOption {
145  ApplyToCurrentMatrix = 0x01,
149  ReplaceCurrentMatrix = 0x02
150  };
152  typedef QFlags<MatrixOption> MatrixOptions;
153 
157  enum StylePropertySortOption {
161  Unsorted = 0x01,
165  UseInkscapeOrder = 0x02
166  };
168  typedef QFlags<StylePropertySortOption> StylePropertySortOptions;
169 
187  QDomNode elementByUniqueAttributeValue(const QString& attributeName, const QString& attributeValue);
188 
202  QDomNode elementById(const QString& attributeValue);
203 
208  void load();
209 
217  void load(const QString& svgFilename);
218 
227  void rotate(double degrees, const MatrixOptions& options = ApplyToCurrentMatrix);
228 
238  void translate(int xPixels, int yPixels, const MatrixOptions& options = ApplyToCurrentMatrix);
239 
249  void shear(double xRadians, double yRadians, const MatrixOptions& options = ApplyToCurrentMatrix);
250 
263  void skew(double xDegrees, double yDegrees, const MatrixOptions& options = ApplyToCurrentMatrix);
264 
277  void scale(double xFactor, double yFactor, const MatrixOptions& options = ApplyToCurrentMatrix);
278 
285  QDomNode currentNode() const;
286 
294  void setCurrentNode(const QDomNode& node);
295 
302  QString svgFilename() const;
303 
311  void setSvgFilename(const QString& svgFilename);
312 
327  QString styleProperty(const QString& propertyName) const;
328 
343  void setStyleProperty(const QString& propertyName, const QString& propertyValue);
344 
350  QString nodeToSvg() const;
351 
360  QByteArray nodeToByteArray() const;
361 
371  QString style() const;
372 
384  void setStyle(const QString& styleAttribute);
385 
391  QDomNodeList patterns() const;
392 
398  QDomNodeList linearGradients() const;
399 
405  QDomNodeList radialGradients() const;
406 
412  QDomNodeList defs() const;
413 
419  QDomNode def() const;
420 
426  QString transform() const;
427 
438  void setTransform(const QString& transformAttribute);
439 
445  QHash<QString, QString> styleProperties() const;
446 
459  void setStyleProperties(const QHash<QString, QString>& _styleProperties, const StylePropertySortOptions& options = Unsorted);
460 
467  QMatrix transformMatrix() const;
468 
481  void setTransformMatrix(QMatrix& matrix, const MatrixOptions& options = ApplyToCurrentMatrix);
482 
483 private:
484 
485 
489  KGameSvgDocumentPrivate * const d;
490 
491 };
492 Q_DECLARE_OPERATORS_FOR_FLAGS(KGameSvgDocument::MatrixOptions)
493 Q_DECLARE_OPERATORS_FOR_FLAGS(KGameSvgDocument::StylePropertySortOptions)
494 
495 #endif // _KGAMESVGDOCUMENT_H_
QByteArray
KDEGAMESPRIVATE_EXPORT
#define KDEGAMESPRIVATE_EXPORT
Definition: libkdegamesprivate_export.h:46
QDomNodeList
QDomDocument::elementById
QDomElement elementById(const QString &elementId)
QDomNode
QFlags
libkdegamesprivate_export.h
KGameSvgDocument::StylePropertySortOptions
QFlags< StylePropertySortOption > StylePropertySortOptions
Q_DECLARE_FLAGS macro confuses doxygen, so create typedef's manually.
Definition: kgamesvgdocument.h:168
QHash
KGameSvgDocument::StylePropertySortOption
StylePropertySortOption
Options for sorting style properties when building a style attribute.
Definition: kgamesvgdocument.h:157
KGameSvgDocument
A class for manipulating an SVG file using DOM.
Definition: kgamesvgdocument.h:115
QString
KGameSvgDocument::MatrixOptions
QFlags< MatrixOption > MatrixOptions
Q_DECLARE_FLAGS macro confuses doxygen, so create typedef's manually.
Definition: kgamesvgdocument.h:152
QDomDocument
KGameSvgDocument::MatrixOption
MatrixOption
Options for applying (multiplying) or replacing the current matrix.
Definition: kgamesvgdocument.h:141
QDomDocument::operator=
QDomDocument & operator=(const QDomDocument &x)
QMatrix
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:18:50 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkdegames/libkdegamesprivate

Skip menu "libkdegames/libkdegamesprivate"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdegames API Reference

Skip menu "kdegames API Reference"
  • granatier
  • kapman
  • kblackbox
  • kgoldrunner
  • kigo
  • kmahjongg
  • KShisen
  • ksquares
  • libkdegames
  •   highscore
  •   libkdegamesprivate
  •     kgame
  • libkmahjongg
  • palapeli
  •   libpala

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal