Warning, file /office/calligra/libs/odf/KoGenStyle.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* This file is part of the KDE project
0002    Copyright (C) 2004-2006 David Faure <faure@kde.org>
0003    Copyright (C) 2007-2008 Thorsten Zachmann <zachmann@kde.org>
0004    Copyright (C) 2009 Inge Wallin <inge@lysator.liu.se>
0005    Copyright (C) 2010 KO GmbH <jos.van.den.oever@kogmbh.com>
0006    Copyright (C) 2010 Jarosław Staniek <staniek@kde.org>
0007    Copyright (C) 2011 Pierre Ducroquet <pinaraf@pinaraf.info>
0008 
0009    This library is free software; you can redistribute it and/or
0010    modify it under the terms of the GNU Library General Public
0011    License as published by the Free Software Foundation; either
0012    version 2 of the License, or (at your option) any later version.
0013 
0014    This library is distributed in the hope that it will be useful,
0015    but WITHOUT ANY WARRANTY; without even the implied warranty of
0016    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0017    Library General Public License for more details.
0018 
0019    You should have received a copy of the GNU Library General Public License
0020    along with this library; see the file COPYING.LIB.  If not, write to
0021    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0022  * Boston, MA 02110-1301, USA.
0023 */
0024 
0025 #ifndef KOGENSTYLE_H
0026 #define KOGENSTYLE_H
0027 
0028 #include <QList>
0029 #include <QMap>
0030 #include <QString>
0031 #include "koodf_export.h"
0032 
0033 class QTextLength;
0034 class KoGenStyles;
0035 class KoXmlWriter;
0036 
0037 /**
0038  * A generic style, i.e. basically a collection of properties and a name.
0039  * Instances of KoGenStyle can either be held in the KoGenStyles collection,
0040  * or created (e.g. on the stack) and given to KoGenStyles::insert().
0041  *
0042  * @author David Faure <faure@kde.org>
0043  */
0044 class KOODF_EXPORT KoGenStyle
0045 {
0046 public:
0047     /**
0048      * Possible values for the "type" argument of the KoGenStyle constructor.
0049      * @note If there is still something missing, add it here so that it is possible to use the same
0050      *       saving code in all applications.
0051      */
0052     enum Type {
0053         PageLayoutStyle,             ///< style:page-layout as in odf 14.3 Page Layout
0054         TextStyle,                   ///< style:style from family "text" as in odf 14.8.1 Text Styles
0055                                      ///<  (office:styles)
0056         TextAutoStyle,               ///< style:style from family "text" as in odf 14.8.1 Text Styles
0057                                      ///<  (office:automatic-styles)
0058         ParagraphStyle,              ///< style:style from family "paragraph" as in odf 14.1 Style Element
0059                                      ///<  (office:styles)
0060         ParagraphAutoStyle,          ///< style:style from family "paragraph" as in odf 14.1 Style Element
0061                                      ///<  (office:automatic-styles)
0062         SectionStyle,                ///< style:style from family "section" as in odf 14.8.3 Section Styles
0063                                      ///<  (office:styles)
0064         SectionAutoStyle,            ///< style:style from family "section" as in odf 14.8.3 Section Styles
0065                                      ///<  (office:automatic-styles)
0066         RubyStyle,                   ///< style:style from family "ruby" as in odf 14.8.4 Ruby Style
0067                                      ///<  (office:styles)
0068         RubyAutoStyle,               ///< style:style from family "ruby" as in odf 14.8.4 Ruby Style
0069                                      ///<  (office:automatic-styles)
0070         TableStyle,                  ///< style:style from family "table" as in odf 14.12 Table Formatting
0071                                      ///<  Properties (office:styles)
0072         TableAutoStyle,              ///< style:style from family "table" as in odf 14.12 Table Formatting Properties
0073                                      ///<  (office:automatic-styles)
0074         TableColumnStyle,            ///< style:style from family "table-column" as in odf 15.9 Column Formatting
0075                                      ///<  Properties (office:styles)
0076         TableColumnAutoStyle,        ///< style:style from family "table-column" as in odf 15.9 Column Formatting
0077                                      ///<  Properties (office:automatic-styles)
0078         TableRowStyle,               ///< style:style from family "table-row" as in odf 15.10 Table Row Formatting
0079                                      ///<  Properties (office:styles)
0080         TableRowAutoStyle,           ///< style:style from family "table-row" as in odf 15.10 Table Row Formatting
0081                                      ///<  Properties (office:automatic-styles)
0082         TableCellStyle,              ///< style:style from family "table-cell" as in odf 15.11 Table Cell Formatting
0083                                      ///<  Properties (office:styles)
0084         TableCellAutoStyle,          ///< style:style from family "table-cell" as in odf 15.11 Table Cell Formatting
0085                                      ///<  Properties (office:automatic-styles)
0086         GraphicStyle,                ///< style:style from family "graphic" as in 14.13.1 Graphic and Presentation
0087                                      ///<  Styles (office:automatic-styles)
0088         GraphicAutoStyle,            ///< style:style from family "graphic" as in 14.13.1 Graphic and Presentation
0089                                      ///<  Styles (office:automatic-styles)
0090         PresentationStyle,           ///< style:style from family "presentation" as in 14.13.1 Graphic and
0091                                      ///<  Presentation Styles (office:styles)
0092         PresentationAutoStyle,       ///< style:style from family "presentation" as in 14.13.1 Graphic and
0093                                      ///<  Presentation Styles (office:automatic-styles)
0094         DrawingPageStyle,            ///< style:style from family "drawing-page" as in odf 14.13.2 Drawing Page Style
0095                                      ///<  (office:styles)
0096         DrawingPageAutoStyle,        ///< style:style from family "drawing-page" as in odf 14.13.2 Drawing Page Style
0097                                      ///<  (office:automatic-styles)
0098         ChartStyle,                  ///< style:style from family "chart" as in odf 14.16 Chart Styles
0099                                      ///<  (office:styles)
0100         ChartAutoStyle,              ///< style:style from family "chart" as in odf 14.16 Chart Styles
0101                                      ///<  (office:automatic-styles)
0102 
0103         ListStyle,                   ///< text:list-style as in odf 14.10 List Style (office:styles)
0104         ListAutoStyle,               ///< text:list-style as in odf 14.10 List Style (office:automatic-styles)
0105         NumericNumberStyle,          ///< number:number-style as in odf 14.7.1 Number Style
0106         NumericDateStyle,            ///< number:date-style as in odf 14.7.4 Date Style
0107         NumericTimeStyle,            ///< number:time-style as in odf 14.7.5 Time Style
0108         NumericFractionStyle,        ///< number:number-style as in odf 14.7.1 Number Style
0109         NumericPercentageStyle,      ///< number:percentage-style as in odf 14.7.3 Percentage Style
0110         NumericScientificStyle,      ///< number:number-style as in odf 14.7.1 Number Style
0111         NumericCurrencyStyle,        ///< number:currency-style as in odf 14.7.2 Currency Style
0112         NumericTextStyle,            ///< number:text-style 14.7.7 Text Style
0113                                      ///<  @note unused
0114         HatchStyle,                  ///< draw:hatch as in odf 14.14.3 Hatch (office:styles)
0115         StrokeDashStyle,             ///< draw:stroke-dash as in odf 14.14.7 Stroke Dash (office:styles)
0116         GradientStyle,               ///< draw:gradient as in odf 14.14.1 Gradient (office:styles)
0117         LinearGradientStyle,         ///< svg:linearGradient as in odf 14.14.2 SVG Gradients (office:styles)
0118         RadialGradientStyle,         ///< svg:radialGradient as in odf 14.14.2 SVG Gradients (office:styles)
0119         ConicalGradientStyle,        ///< calligra:conicalGradient calligra extension for conical gradients
0120         FillImageStyle,              ///< draw:fill-image as in odf 14.14.4 Fill Image (office:styles)
0121         NumericBooleanStyle,         ///< number:boolean 14.7.6 Boolean Style
0122                                      ///<  @note unused
0123         OpacityStyle,                ///< draw:opacity as in odf 14.14.5 Opacity Gradient
0124                                      ///<  @note unused
0125         MarkerStyle,                 ///< draw:marker as in odf 14.14.6 Marker
0126         PresentationPageLayoutStyle, ///< style:presentation-page-layout as in odf 14.15 Presentation Page Layouts
0127         OutlineLevelStyle,           ///< text:outline-style as in odf 1.2 section 16.34
0128         //   TODO differently
0129         MasterPageStyle,             ///< style:master-page as in odf 14.4 14.4 Master Pages (office:master-styles)
0130         // style:default-style as in odf 14.2 Default Styles
0131         // 14.5 Table Templates
0132         /// @internal @note always update when adding values to this enum
0133         LastStyle = MasterPageStyle
0134     };
0135 
0136     /**
0137      * Start the definition of a new style. Its name will be set later by KoGenStyles::insert(),
0138      * but first you must define its properties and attributes.
0139      *
0140      * @param type this is a hook for the application to categorize styles
0141      * See the Style* enum. Ignored when writing out the style.
0142      *
0143      * @param familyName The value for style:family, e.g. text, paragraph, graphic etc.
0144      * The family is for style:style elements only; number styles and list styles don't have one.
0145      *
0146      * @param parentName If set, name of the parent style from which this one inherits.
0147      */
0148     explicit KoGenStyle(Type type = PageLayoutStyle, const char *familyName = 0,
0149                         const QString &parentName = QString());
0150     ~KoGenStyle();
0151 
0152     /**
0153      * setAutoStyleInStylesDotXml(true) marks a given automatic style as being needed in styles.xml.
0154      * For instance styles used by headers and footers need to go there, since
0155      * they are saved in styles.xml, and styles.xml must be independent from content.xml.
0156      *
0157      * The application should use KoGenStyles::styles( type, true ) in order to retrieve
0158      * those styles and save them separately.
0159      */
0160     void setAutoStyleInStylesDotXml(bool b) {
0161         m_autoStyleInStylesDotXml = b;
0162     }
0163     /// @return the value passed to setAutoStyleInStylesDotXml; false by default
0164     bool autoStyleInStylesDotXml() const {
0165         return m_autoStyleInStylesDotXml;
0166     }
0167 
0168     /**
0169      * setDefaultStyle(true) marks a given style as being the default style.
0170      * This means we expect that you will call writeStyle( ...,"style:default-style"),
0171      * and its name will be omitted in the output.
0172      */
0173     void setDefaultStyle(bool b) {
0174         m_defaultStyle = b;
0175     }
0176     /// @return the value passed to setDefaultStyle; false by default
0177     bool isDefaultStyle() const {
0178         return m_defaultStyle;
0179     }
0180 
0181     /// Return the type of this style, as set in the constructor
0182     Type type() const {
0183         return m_type;
0184     }
0185 
0186     /// Return the family name
0187     const char* familyName() const {
0188         return m_familyName.data();
0189     }
0190 
0191     /// Sets the name of style's parent.
0192     void setParentName(const QString &name) {
0193         m_parentName = name;
0194     }
0195 
0196     /// Return the name of style's parent, if set
0197     QString parentName() const {
0198         return m_parentName;
0199     }
0200 
0201     /**
0202      *  @brief The types of properties
0203      *
0204      *  Simple styles only write one foo-properties tag, in which case they can just use DefaultType.
0205      *  However a given style might want to write several kinds of properties, in which case it would
0206      *  need to use other property types than the default one.
0207      *
0208      *  For instance this style:
0209      *  @code
0210      *  <style:style style:family="chart">
0211      *    <style:chart-properties .../>
0212      *    <style:graphic-properties .../>
0213      *    <style:text-properties .../>
0214      *  </style:style>
0215      *  @endcode
0216      *  would use DefaultType for chart-properties (and would pass "style:chart-properties" to writeStyle(),
0217      *  and would use GraphicType and TextType.
0218      */
0219     enum PropertyType {
0220         /**
0221          *  DefaultType depends on family: e.g. paragraph-properties if family=paragraph
0222          *  or on the type of style (e.g. page-layout -> page-layout-properties).
0223          *  (In fact that tag name is the one passed to writeStyle)
0224          */
0225         DefaultType,
0226         /// TextType is always text-properties.
0227         TextType,
0228         /// ParagraphType is always paragraph-properties.
0229         ParagraphType,
0230         /// GraphicType is always graphic-properties.
0231         GraphicType,
0232         /// SectionType is always section-properties.
0233         SectionType,
0234         /// RubyType is always ruby-properties.
0235         RubyType,
0236         /// TableType is always table-properties.
0237         TableType,
0238         /// TableColumnType is always table-column-properties
0239         TableColumnType,
0240         /// TableRowType is always table-row-properties.
0241         TableRowType,
0242         /// TableCellType is always for table-cell-properties.
0243         TableCellType,
0244         /// PresentationType is always for presentation-properties.
0245         PresentationType,
0246         /// DrawingPageType is always for drawing-page-properties.
0247         DrawingPageType,
0248         /// ChartType is always for chart-properties.
0249         ChartType,
0250         Reserved1, ///< @internal for binary compatible extensions
0251         /// For elements that are children of the style itself, not any of the properties
0252         StyleChildElement,
0253         /// @internal @note always update when adding values to this enum
0254         LastPropertyType = StyleChildElement
0255     };
0256 
0257     /// Add a property to the style. Passing DefaultType as property type uses a style-type specific property type.
0258     void addProperty(const QString &propName, const QString &propValue, PropertyType type = DefaultType) {
0259         if (type == DefaultType) {
0260             type = m_propertyType;
0261         }
0262         m_properties[type].insert(propName, propValue);
0263     }
0264     /// Overloaded version of addProperty that takes a char*, usually for "..."
0265     void addProperty(const QString &propName, const char *propValue, PropertyType type = DefaultType) {
0266         if (type == DefaultType) {
0267             type = m_propertyType;
0268         }
0269         m_properties[type].insert(propName, QString::fromUtf8(propValue));
0270     }
0271     /// Overloaded version of addProperty that converts an int to a string
0272     void addProperty(const QString &propName, int propValue, PropertyType type = DefaultType) {
0273         if (type == DefaultType) {
0274             type = m_propertyType;
0275         }
0276         m_properties[type].insert(propName, QString::number(propValue));
0277     }
0278     /// Overloaded version of addProperty that converts a bool to a string (false/true)
0279     void addProperty(const QString &propName, bool propValue, PropertyType type = DefaultType) {
0280         if (type == DefaultType) {
0281             type = m_propertyType;
0282         }
0283         m_properties[type].insert(propName, propValue ? "true" : "false");
0284     }
0285 
0286     /**
0287      *  Add a property which represents a distance, measured in pt
0288      *  The number is written out with the highest possible precision
0289      *  (unlike QString::number and setNum, which default to 6 digits),
0290      *  and the unit name ("pt") is appended to it.
0291      */
0292     void addPropertyPt(const QString &propName, qreal propValue, PropertyType type = DefaultType);
0293     
0294     /**
0295      *  Add a property which represents a length, measured in pt, or in percent
0296      *  The number is written out with the highest possible precision
0297      *  (unlike QString::number and setNum, which default to 6 digits) or as integer (for percents),
0298      *  and the unit name ("pt" or "%") is appended to it.
0299      */
0300     void addPropertyLength(const QString &propName, const QTextLength &propValue, PropertyType type = DefaultType);
0301 
0302     /**
0303      *  Remove a property from the style.  Passing DefaultType as property type
0304      *  uses a style-type specific property type.
0305      */
0306     void removeProperty(const QString &propName, PropertyType type = DefaultType) {
0307         if (type == DefaultType) {
0308             type = m_propertyType;
0309         }
0310         m_properties[type].remove(propName);
0311     }
0312 
0313     /**
0314      *  Remove properties of defined type from the style.  Passing DefaultType
0315      *  as property type uses a style-type specific property type.
0316      */
0317     void removeAllProperties(PropertyType type = DefaultType) {
0318         if (type == DefaultType) {
0319             type = m_propertyType;
0320         }
0321         m_properties[type].clear();
0322     }
0323 
0324     /**
0325      *  Add an attribute to the style
0326      *  The difference between property and attributes is a bit oasis-format-specific:
0327      *  attributes are for the style element itself, and properties are in the style:properties child element
0328      */
0329     void addAttribute(const QString &attrName, const QString& attrValue) {
0330         m_attributes.insert(attrName, attrValue);
0331     }
0332     /// Overloaded version of addAttribute that takes a char*, usually for "..."
0333     void addAttribute(const QString &attrName, const char* attrValue) {
0334         m_attributes.insert(attrName, QString::fromUtf8(attrValue));
0335     }
0336     /// Overloaded version of addAttribute that converts an int to a string
0337     void addAttribute(const QString &attrName, int attrValue) {
0338         m_attributes.insert(attrName, QString::number(attrValue));
0339     }
0340 
0341     /// Overloaded version of addAttribute that converts a bool to a string
0342     void addAttribute(const QString &attrName, bool attrValue) {
0343         m_attributes.insert(attrName, attrValue ? "true" : "false");
0344     }
0345 
0346     /**
0347      *  Add an attribute which represents a distance, measured in pt
0348      *  The number is written out with the highest possible precision
0349      *  (unlike QString::number and setNum, which default to 6 digits),
0350      *  and the unit name ("pt") is appended to it.
0351      */
0352     void addAttributePt(const QString &attrName, qreal attrValue);
0353 
0354     /**
0355      * Add an attribute that represents a percentage value as defined in ODF
0356      */
0357     void addAttributePercent(const QString &attrName, qreal value);
0358 
0359     /**
0360      * Add an attribute that represents a percentage value as defined in ODF
0361      */
0362     void addAttributePercent(const QString &attrName, int value);
0363 
0364     /**
0365      *  Remove an attribute from the style.
0366      */
0367     void removeAttribute(const QString &attrName) {
0368         m_attributes.remove(attrName);
0369     }
0370 
0371 
0372     /**
0373      * @brief Add a child element to the style properties.
0374      *
0375      * What is meant here is that the contents of the QString
0376      * will be written out literally. This means you should use
0377      * KoXmlWriter to generate it:
0378      * @code
0379      * QBuffer buffer;
0380      * buffer.open( QIODevice::WriteOnly );
0381      * KoXmlWriter elementWriter( &buffer );  // TODO pass indentation level
0382      * elementWriter.startElement( "..." );
0383      * ...
0384      * elementWriter.endElement();
0385      * QString elementContents = QString::fromUtf8( buffer.buffer(), buffer.buffer().size() );
0386      * gs.addChildElement( "...", elementContents );
0387      * @endcode
0388      *
0389      * The value of @p elementName is only used to set the order on how the child elements are written out.
0390      */
0391     void addChildElement(const QString &elementName, const QString& elementContents, PropertyType type = DefaultType) {
0392         if (type == DefaultType) {
0393             type = m_propertyType;
0394         }
0395         m_childProperties[type].insert(elementName, elementContents);
0396     }
0397 
0398     /**
0399      * Same like \a addChildElement above but with QByteArray to explicit convert from QByteArray
0400      * to QString using utf8 to prevent a dirty pitfall.
0401      */
0402     void addChildElement(const QString &elementName, const QByteArray& elementContents, PropertyType type = DefaultType) {
0403         if (type == DefaultType) {
0404             type = m_propertyType;
0405         }
0406         m_childProperties[type].insert(elementName, QString::fromUtf8(elementContents));
0407     }
0408 
0409     /**
0410      * Same like \a addChildElement above but adds a child style which is not child of any of the properties
0411      * The value of @p elementName is only used to set the order on how the child elements are written out.
0412      */
0413     void addStyleChildElement(const QString &elementName, const QString& elementContents) {
0414         m_properties[StyleChildElement].insertMulti(elementName, elementContents);
0415     }
0416 
0417     /**
0418      * Same like \a addStyleChildElement above but with QByteArray to explicit convert from QByteArray
0419      * to QString using utf8 to prevent a dirty pitfall.
0420      * The value of @p elementName is only used to set the order on how the child elements are written out.
0421      */
0422     void addStyleChildElement(const QString &elementName, const QByteArray& elementContents) {
0423         m_properties[StyleChildElement].insertMulti(elementName, QString::fromUtf8(elementContents));
0424     }
0425 
0426     /**
0427      * @brief Add a style:map to the style.
0428      * @param styleMap the attributes for the map, associated as (name,value).
0429      */
0430     void addStyleMap(const QMap<QString, QString> &styleMap);
0431 
0432     /**
0433      * @return true if the style has no attributes, no properties, no style map etc.
0434      * This can be used by applications which do not save all attributes unconditionally,
0435      * but only those that differ from the parent. But note that KoGenStyles::insert() can't find this out...
0436      */
0437     bool isEmpty() const;
0438 
0439     /**
0440      *  Write the definition of this style to @p writer, using the OASIS format.
0441      *  @param writer the KoXmlWriter in which @p elementName will be created and filled in
0442      *  @param styles the styles collection, used to look up the parent style
0443      *  @param elementName the name of the XML element, e.g. "style:style". Don't forget to
0444      *  pass style:default-style if isDefaultStyle().
0445      *  @param name must come from the collection. It will be ignored if isDefaultStyle() is true.
0446      *  @param propertiesElementName the name of the XML element with the style properties,
0447      *  e.g. "style:text-properties". Can be 0 in special cases where there should be no such item,
0448      *  in which case the attributes and elements are added under the style itself.
0449      *  @param closeElement set it to false to be able to add more child elements to the style element
0450      *  @param drawElement set it to true to add "draw:name" (used for gradient/hatch style) otherwise add "style:name"
0451      */
0452     void writeStyle(KoXmlWriter *writer, const KoGenStyles &styles, const char *elementName, const QString &name,
0453                     const char *propertiesElementName, bool closeElement = true, bool drawElement = false) const;
0454 
0455     /**
0456      *  Write the definition of these style properties to @p writer, using the OASIS format.
0457      *  @param writer the KoXmlWriter in which @p elementName will be created and filled in
0458      *  @param type the type of properties to write
0459      *  @param parentStyle the parent to this style
0460      */
0461     void writeStyleProperties(KoXmlWriter *writer, PropertyType type,
0462                               const KoGenStyle *parentStyle = 0) const;
0463 
0464     /**
0465      *  QMap requires a complete sorting order.
0466      *  Another solution would have been a qdict and a key() here, a la KoTextFormat,
0467      *  but the key was difficult to generate.
0468      *  Solutions with only a hash value (not representative of the whole data)
0469      *  require us to write a hashtable by hand....
0470      */
0471     bool operator<(const KoGenStyle &other) const;
0472 
0473     /// Not needed for QMap, but can still be useful
0474     bool operator==(const KoGenStyle &other) const;
0475 
0476     /**
0477      * Returns a property of this style. In prinicpal this class is meant to be write-only, but
0478      * some exceptional cases having read-support as well is very useful.  Passing DefaultType
0479      * as property type uses a style-type specific property type.
0480      */
0481     QString property(const QString &propName, PropertyType type = DefaultType) const {
0482         if (type == DefaultType) {
0483             type = m_propertyType;
0484         }
0485         const QMap<QString, QString>::const_iterator it = m_properties[type].constFind(propName);
0486         if (it != m_properties[type].constEnd())
0487             return it.value();
0488         return QString();
0489     }
0490 
0491     /**
0492      * Returns a property of this style. In prinicpal this class is meant to be write-only, but
0493      * some exceptional cases having read-support as well is very useful.  Passing DefaultType
0494      * as property type uses a style-type specific property type.
0495      */
0496     QString childProperty(const QString &propName, PropertyType type = DefaultType) const {
0497         if (type == DefaultType) {
0498             type = m_propertyType;
0499         }
0500         const QMap<QString, QString>::const_iterator it = m_childProperties[type].constFind(propName);
0501         if (it != m_childProperties[type].constEnd())
0502             return it.value();
0503         return QString();
0504     }
0505 
0506     /// Returns an attribute of this style. In prinicpal this class is meant to be write-only, but some exceptional cases having read-support as well is very useful.
0507     QString attribute(const QString &propName) const {
0508         const QMap<QString, QString>::const_iterator it = m_attributes.constFind(propName);
0509         if (it != m_attributes.constEnd())
0510             return it.value();
0511         return QString();
0512     }
0513 
0514     /**
0515      * Copies properties of defined type from a style to another style.
0516      * This is needed in rare cases where two styles have properties of different types
0517      * and we want to merge them to one style.
0518      */
0519     static void copyPropertiesFromStyle(const KoGenStyle &sourceStyle, KoGenStyle &targetStyle, PropertyType type = DefaultType);
0520 
0521 private:
0522 #ifndef NDEBUG
0523     void printDebug() const;
0524 #endif
0525 
0526 private:
0527     // Note that the copy constructor and assignment operator are allowed.
0528     // Better not use pointers below!
0529     // TODO turn this into a QSharedData class
0530     PropertyType m_propertyType;
0531     Type m_type;
0532     QByteArray m_familyName;
0533     QString m_parentName;
0534     /// We use QMaps since they provide automatic sorting on the key (important for unicity!)
0535     typedef QMap<QString, QString> StyleMap;
0536     StyleMap m_properties[LastPropertyType+1];
0537     StyleMap m_childProperties[LastPropertyType+1];
0538     StyleMap m_attributes;
0539     QList<StyleMap> m_maps; // we can't really sort the maps between themselves...
0540 
0541     bool m_autoStyleInStylesDotXml;
0542     bool m_defaultStyle;
0543     short m_unused2;
0544 
0545     // For insert()
0546     friend class KoGenStyles;
0547 };
0548 
0549 #endif /* KOGENSTYLE_H */