diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/store/KoXmlWriter.h | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/store/KoXmlWriter.h')
-rw-r--r-- | lib/store/KoXmlWriter.h | 68 |
1 files changed, 34 insertions, 34 deletions
diff --git a/lib/store/KoXmlWriter.h b/lib/store/KoXmlWriter.h index 232f9a65..5261dd5f 100644 --- a/lib/store/KoXmlWriter.h +++ b/lib/store/KoXmlWriter.h @@ -20,32 +20,32 @@ #ifndef XMLWRITER_H #define XMLWRITER_H -#include <qstring.h> -#include <qvaluestack.h> -#include <qmap.h> +#include <tqstring.h> +#include <tqvaluestack.h> +#include <tqmap.h> #include <koffice_export.h> -class QIODevice; +class TQIODevice; /** - * A class for writing out XML (to any QIODevice), with a special attention on performance. + * A class for writing out XML (to any TQIODevice), with a special attention on performance. * The XML is being written out along the way, which avoids requiring the entire - * document in memory (like QDom does), and avoids using QTextStream at all - * (which in Qt3 has major performance issues when converting to utf8). + * document in memory (like TQDom does), and avoids using TQTextStream at all + * (which in TQt3 has major performance issues when converting to utf8). */ class KOSTORE_EXPORT KoXmlWriter { public: /** * Create a KoXmlWriter instance to write out an XML document into - * the given QIODevice. + * the given TQIODevice. */ - KoXmlWriter( QIODevice* dev, int indentLevel = 0 ); + KoXmlWriter( TQIODevice* dev, int indentLevel = 0 ); /// Destructor ~KoXmlWriter(); - QIODevice *device() const { return m_dev; } + TQIODevice *device() const { return m_dev; } /** * Start the XML document. @@ -73,14 +73,14 @@ public: * Overloaded version of addAttribute( const char*, const char* ), * which is a bit slower because it needs to convert @p value to utf8 first. */ - inline void addAttribute( const char* attrName, const QString& value ) { + inline void addAttribute( const char* attrName, const TQString& value ) { addAttribute( attrName, value.utf8() ); } /** * Add an attribute whose value is an integer */ inline void addAttribute( const char* attrName, int value ) { - QCString str; + TQCString str; str.setNum( value ); addAttribute( attrName, str.data() ); } @@ -88,26 +88,26 @@ public: * Add an attribute whose value is an unsigned integer */ inline void addAttribute( const char* attrName, uint value ) { - QCString str; + TQCString str; str.setNum( value ); addAttribute( attrName, str.data() ); } /** * Add an attribute whose value is a floating point number * 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) */ void addAttribute( const char* attrName, double value ); /** * 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 char* attrName, double value ); /// Overloaded version of the one taking a const char* argument, for convenience - inline void addAttribute( const char* attrName, const QCString& value ) { + inline void addAttribute( const char* attrName, const TQCString& value ) { addAttribute( attrName, value.data() ); } /** @@ -123,11 +123,11 @@ public: * Overloaded version of addTextNode( const char* ), * which is a bit slower because it needs to convert @p str to utf8 first. */ - inline void addTextNode( const QString& str ) { + inline void addTextNode( const TQString& str ) { addTextNode( str.utf8() ); } /// Overloaded version of the one taking a const char* argument - inline void addTextNode( const QCString& cstr ) { + inline void addTextNode( const TQCString& cstr ) { addTextNode( cstr.data() ); } /** @@ -165,7 +165,7 @@ public: * for XML already, so it will usually come from another KoXmlWriter. * This is usually used with KTempFile. */ - void addCompleteElement( QIODevice* dev ); + void addCompleteElement( TQIODevice* dev ); // #### Maybe we want to subclass KoXmlWriter for manifest files. /** @@ -175,23 +175,23 @@ public: * when we add support for encrypting/signing. * @note OASIS-specific */ - void addManifestEntry( const QString& fullPath, const QString& mediaType ); + void addManifestEntry( const TQString& fullPath, const TQString& mediaType ); /** * Special helper for writing config item into settings.xml * @note OASIS-specific */ - void addConfigItem( const QString & configName, const QString& value ); + void addConfigItem( const TQString & configName, const TQString& value ); /// @note OASIS-specific - void addConfigItem( const QString & configName, bool value ); + void addConfigItem( const TQString & configName, bool value ); /// @note OASIS-specific - void addConfigItem( const QString & configName, int value ); + void addConfigItem( const TQString & configName, int value ); /// @note OASIS-specific - void addConfigItem( const QString & configName, double value ); + void addConfigItem( const TQString & configName, double value ); /// @note OASIS-specific - void addConfigItem( const QString & configName, long value ); + void addConfigItem( const TQString & configName, long value ); /// @note OASIS-specific - void addConfigItem( const QString & configName, short value ); + void addConfigItem( const TQString & configName, short value ); // TODO addConfigItem for datetime and base64Binary @@ -205,14 +205,14 @@ public: * * @note OASIS-specific */ - void addTextSpan( const QString& text ); + void addTextSpan( const TQString& text ); /** * Overloaded version of addTextSpan which takes an additional tabCache map. * @param text the text to write * @param tabCache optional map allowing to find a tab for a given character index * @note OASIS-specific */ - void addTextSpan( const QString& text, const QMap<int, int>& tabCache ); + void addTextSpan( const TQString& text, const TQMap<int, int>& tabCache ); /** * @return the current indentation level. @@ -226,7 +226,7 @@ private: : tagName( t ), hasChildren( false ), lastChildIsText( false ), openingTagClosed( false ), indentInside( ind ) {} const char* tagName; - bool hasChildren; ///< element or text children + bool hasChildren; ///< element or text tqchildren bool lastChildIsText; ///< last child is a text node bool openingTagClosed; ///< true once the '\>' in \<tag a="b"\> is written out bool indentInside; ///< whether to indent the contents of this tag @@ -237,15 +237,15 @@ private: // writeCString is much faster than writeString. // Try to use it as much as possible, especially with constants. - void writeString( const QString& str ); + void writeString( const TQString& str ); // unused and possibly incorrect if length != size - //inline void writeCString( const QCString& cstr ) { + //inline void writeCString( const TQCString& cstr ) { // m_dev->writeBlock( cstr.data(), cstr.size() - 1 ); //} inline void writeCString( const char* cstr ) { - m_dev->writeBlock( cstr, qstrlen( cstr ) ); + m_dev->writeBlock( cstr, tqstrlen( cstr ) ); } inline void writeChar( char c ) { m_dev->putch( c ); @@ -261,8 +261,8 @@ private: void prepareForTextNode(); void init(); - QIODevice* m_dev; - QValueStack<Tag> m_tags; + TQIODevice* m_dev; + TQValueStack<Tag> m_tags; int m_baseIndentLevel; class Private; |