diff options
Diffstat (limited to 'lib/kofficecore/KoGenStyles.h')
-rw-r--r-- | lib/kofficecore/KoGenStyles.h | 118 |
1 files changed, 59 insertions, 59 deletions
diff --git a/lib/kofficecore/KoGenStyles.h b/lib/kofficecore/KoGenStyles.h index ad05d6e0..17771c69 100644 --- a/lib/kofficecore/KoGenStyles.h +++ b/lib/kofficecore/KoGenStyles.h @@ -19,9 +19,9 @@ #ifndef KOGENSTYLES_H #define KOGENSTYLES_H -#include <qdict.h> -#include <qmap.h> -#include <qvaluevector.h> +#include <tqdict.h> +#include <tqmap.h> +#include <tqvaluevector.h> #include <koffice_export.h> @@ -76,7 +76,7 @@ public: ForceNumbering = 0, // it's the default anyway DontForceNumbering = 1 }; - // KDE4 TODO: use QFlags and change the arg type in lookup + // KDE4 TODO: use TQFlags and change the arg type in lookup /** * Look up a style in the collection, inserting it if necessary. @@ -94,9 +94,9 @@ public: * @return the name for this style * @todo ### rename lookup to insert */ - QString lookup( const KoGenStyle& style, const QString& name = QString::null, int flags = NoFlag ); + TQString lookup( const KoGenStyle& style, const TQString& name = TQString(), int flags = NoFlag ); - typedef QMap<KoGenStyle, QString> StyleMap; + typedef TQMap<KoGenStyle, TQString> StyleMap; /** * Return the entire collection of styles * Use this for saving the styles @@ -105,7 +105,7 @@ public: struct NamedStyle { const KoGenStyle* style; ///< @note owned by the collection - QString name; + TQString name; }; /** * Return all styles of a given type @@ -116,12 +116,12 @@ public: * otherwise only those NOT marked for styles.xml. * @see lookup */ - QValueList<NamedStyle> styles( int type, bool markedForStylesXml = false ) const; + TQValueList<NamedStyle> styles( int type, bool markedForStylesXml = false ) const; /** * @return an existing style by name */ - const KoGenStyle* style( const QString& name ) const; + const KoGenStyle* style( const TQString& name ) const; /** * @return an existing style by name, which can be modified. @@ -130,7 +130,7 @@ public: * Only do this if you know for sure no other 'user' of that style will * be affected. */ - KoGenStyle* styleForModification( const QString& name ); + KoGenStyle* styleForModification( const TQString& name ); /** * Mark a given automatic style as being needed in styles.xml. @@ -144,7 +144,7 @@ public: * * @see styles, KoGenStyle::setAutoStyleInStylesDotXml */ - void markStyleForStylesXml( const QString& name ); + void markStyleForStylesXml( const TQString& name ); /** * Outputs debug information @@ -152,7 +152,7 @@ public: void dump(); private: - QString makeUniqueName( const QString& base, int flags ) const; + TQString makeUniqueName( const TQString& base, int flags ) const; /// style definition -> name StyleMap m_styleMap; @@ -160,12 +160,12 @@ private: /// Map with the style name as key. /// This map is mainly used to check for name uniqueness /// The value of the bool doesn't matter. - typedef QMap<QString, bool> NameMap; // KDE4: QSet + typedef TQMap<TQString, bool> NameMap; // KDE4: TQSet NameMap m_styleNames; NameMap m_autoStylesInStylesDotXml; /// List of styles (used to preserve ordering) - typedef QValueVector<NamedStyle> StyleArray; + typedef TQValueVector<NamedStyle> StyleArray; StyleArray m_styleArray; class Private; @@ -216,10 +216,10 @@ public: * @param familyName The value for style:family, e.g. text, paragraph, graphic etc. * The family is for style:style elements only; number styles and list styles don't have one. * - * @param parentName If set, name of the parent style from which this one inherits. + * @param tqparentName If set, name of the tqparent style from which this one inherits. */ explicit KoGenStyle( int type = 0, const char* familyName = 0, - const QString& parentName = QString::null ); + const TQString& tqparentName = TQString() ); ~KoGenStyle(); /* @@ -249,8 +249,8 @@ public: /// Return the family name const char* familyName() const { return m_familyName.data(); } - /// Return the name of style's parent, if set - QString parentName() const { return m_parentName; } + /// Return the name of style's tqparent, if set + TQString tqparentName() const { return m_parentName; } /** * @brief The types of properties @@ -274,7 +274,7 @@ public: { /** * DefaultType depends on family: e.g. paragraph-properties if family=paragraph - * or on the type of style (e.g. page-layout -> page-layout-properties). + * or on the type of style (e.g. page-tqlayout -> page-tqlayout-properties). * (In fact that tag name is the one passed to writeStyle) */ DefaultType = 0, @@ -291,80 +291,80 @@ public: }; /// Add a property to the style - void addProperty( const QString& propName, const QString& propValue, PropertyType type = DefaultType ) { + void addProperty( const TQString& propName, const TQString& propValue, PropertyType type = DefaultType ) { m_properties[type].insert( propName, propValue ); } /// Overloaded version of addProperty that takes a char*, usually for "..." - void addProperty( const QString& propName, const char* propValue, PropertyType type = DefaultType ) { - m_properties[type].insert( propName, QString::fromUtf8( propValue ) ); + void addProperty( const TQString& propName, const char* propValue, PropertyType type = DefaultType ) { + m_properties[type].insert( propName, TQString::fromUtf8( propValue ) ); } /// Overloaded version of addProperty that converts an int to a string - void addProperty( const QString& propName, int propValue, PropertyType type = DefaultType ) { - m_properties[type].insert( propName, QString::number( propValue ) ); + void addProperty( const TQString& propName, int propValue, PropertyType type = DefaultType ) { + m_properties[type].insert( propName, TQString::number( propValue ) ); } /// Overloaded version of addProperty that converts a bool to a string (false/true) - void addProperty( const QString& propName, bool propValue, PropertyType type = DefaultType ) { + void addProperty( const TQString& propName, bool propValue, PropertyType type = DefaultType ) { m_properties[type].insert( propName, propValue ? "true" : "false" ); } /** * Add a property which represents a distance, measured in pt * The number is written out with the highest possible precision - * (unlike QString::number and setNum, which default to 6 digits), + * (unlike TQString::number and setNum, which default to 6 digits), * and the unit name ("pt") is appended to it. */ - void addPropertyPt( const QString& propName, double propValue, PropertyType type = DefaultType ); + void addPropertyPt( const TQString& propName, double propValue, PropertyType type = DefaultType ); /** * Add an attribute to the style * The difference between property and attributes is a bit oasis-format-specific: * attributes are for the style element itself, and properties are in the style:properties child element */ - void addAttribute( const QString& attrName, const QString& attrValue ) { + void addAttribute( const TQString& attrName, const TQString& attrValue ) { m_attributes.insert( attrName, attrValue ); } /// Overloaded version of addAttribute that takes a char*, usually for "..." - void addAttribute( const QString& attrName, const char* attrValue ) { - m_attributes.insert( attrName, QString::fromUtf8( attrValue ) ); + void addAttribute( const TQString& attrName, const char* attrValue ) { + m_attributes.insert( attrName, TQString::fromUtf8( attrValue ) ); } /// Overloaded version of addAttribute that converts an int to a string - void addAttribute( const QString& attrName, int attrValue ) { - m_attributes.insert( attrName, QString::number( attrValue ) ); + void addAttribute( const TQString& attrName, int attrValue ) { + m_attributes.insert( attrName, TQString::number( attrValue ) ); } /// Overloaded version of addAttribute that converts a bool to a string - void addAttribute( const QString& attrName, bool attrValue ) { + void addAttribute( const TQString& attrName, bool attrValue ) { m_attributes.insert( attrName, attrValue ? "true" : "false" ); } /** * Add an attribute which represents a distance, measured in pt * The number is written out with the highest possible precision - * (unlike QString::number and setNum, which default to 6 digits), + * (unlike TQString::number and setNum, which default to 6 digits), * and the unit name ("pt") is appended to it. */ - void addAttributePt( const QString& attrName, double attrValue ); + void addAttributePt( const TQString& attrName, double attrValue ); /** * @brief Add a child element to the style properties. * - * What is meant here is that the contents of the QString + * What is meant here is that the contents of the TQString * will be written out literally. This means you should use * KoXmlWriter to generate it: * @code - * QBuffer buffer; + * TQBuffer buffer; * buffer.open( IO_WriteOnly ); * KoXmlWriter elementWriter( &buffer ); // TODO pass indentation level * elementWriter.startElement( "..." ); * ... * elementWriter.endElement(); - * QString elementContents = QString::fromUtf8( buffer.buffer(), buffer.buffer().size() ); + * TQString elementContents = TQString::fromUtf8( buffer.buffer(), buffer.buffer().size() ); * gs.addChildElement( "...", elementContents ); * @endcode * * The value of @p elementName isn't used, except that it must be unique. */ - void addChildElement( const QString& elementName, const QString& elementContents ) { + void addChildElement( const TQString& elementName, const TQString& elementContents ) { m_properties[ChildElement].insert( elementName, elementContents ); } @@ -372,14 +372,14 @@ public: * @brief Add a style:map to the style. * @param styleMap the attributes for the map, associated as (name,value). */ - void addStyleMap( const QMap<QString, QString>& styleMap ) { + void addStyleMap( const TQMap<TQString, TQString>& styleMap ) { m_maps.append( styleMap ); } /** * @return true if the style has no attributes, no properties, no style map etc. * This can be used by applications which do not save all attributes unconditionally, - * but only those that differ from the parent. But note that lookup() can't find this out... + * but only those that differ from the tqparent. But note that lookup() can't find this out... */ bool isEmpty() const { if ( !m_attributes.isEmpty() || ! m_maps.isEmpty() ) @@ -393,7 +393,7 @@ public: /** * Write the definition of this style to @p writer, using the OASIS format. * @param writer the KoXmlWriter in which @p elementName will be created and filled in - * @param styles the styles collection, used to look up the parent style + * @param styles the styles collection, used to look up the tqparent style * @param elementName the name of the XML element, e.g. "style:style". Don't forget to * pass style:default-style if isDefaultStyle(). * @param name must come from the collection. It will be ignored if isDefaultStyle() is true. @@ -403,11 +403,11 @@ public: * @param closeElement set it to false to be able to add more child elements to the style element * @param drawElement set it to true to add "draw:name" (used for gradient/hatch style) otherwise add "style:name" */ - void writeStyle( KoXmlWriter* writer, KoGenStyles& styles, const char* elementName, const QString& name, + void writeStyle( KoXmlWriter* writer, KoGenStyles& styles, const char* elementName, const TQString& name, const char* propertiesElementName, bool closeElement = true, bool drawElement = false ) const; /** - * QMap requires a complete sorting order. + * TQMap requires a complete sorting order. * Another solution would have been a qdict and a key() here, a la KoTextFormat, * but the key was difficult to generate. * Solutions with only a hash value (not representative of the whole data) @@ -415,26 +415,26 @@ public: */ bool operator<( const KoGenStyle &other ) const; - /// Not needed for QMap, but can still be useful + /// Not needed for TQMap, but can still be useful bool operator==( const KoGenStyle &other ) const; private: - QString property( const QString& propName, PropertyType type ) const { - QMap<QString, QString>::const_iterator it = m_properties[type].find( propName ); + TQString property( const TQString& propName, PropertyType type ) const { + TQMap<TQString, TQString>::const_iterator it = m_properties[type].tqfind( propName ); if ( it != m_properties[type].end() ) return it.data(); - return QString::null; + return TQString(); } - QString attribute( const QString& propName ) const { - QMap<QString, QString>::const_iterator it = m_attributes.find( propName ); + TQString attribute( const TQString& propName ) const { + TQMap<TQString, TQString>::const_iterator it = m_attributes.tqfind( propName ); if ( it != m_attributes.end() ) return it.data(); - return QString::null; + return TQString(); } void writeStyleProperties( KoXmlWriter* writer, PropertyType i, - const char* elementName, const KoGenStyle* parentStyle ) const; + const char* elementName, const KoGenStyle* tqparentStyle ) const; #ifndef NDEBUG void printDebug() const; @@ -444,13 +444,13 @@ private: // Note that the copy constructor and assignment operator are allowed. // Better not use pointers below! int m_type; - QCString m_familyName; - QString m_parentName; - /// We use QMaps since they provide automatic sorting on the key (important for unicity!) - QMap<QString, QString> m_properties[N_NumTypes]; - QMap<QString, QString> m_attributes; - typedef QMap<QString, QString> StyleMap; - QValueVector<StyleMap> m_maps; // we can't really sort the maps between themselves... + TQCString m_familyName; + TQString m_parentName; + /// We use TQMaps since they provide automatic sorting on the key (important for unicity!) + TQMap<TQString, TQString> m_properties[N_NumTypes]; + TQMap<TQString, TQString> m_attributes; + typedef TQMap<TQString, TQString> StyleMap; + TQValueVector<StyleMap> m_maps; // we can't really sort the maps between themselves... bool m_autoStyleInStylesDotXml; bool m_defaultStyle; |