summaryrefslogtreecommitdiffstats
path: root/lib/libchmfile/libchmfileimpl.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-29 19:00:37 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-29 19:00:37 +0000
commit25794f504692e5a36c490438814e9dfda8aaa2dd (patch)
tree8061e6d27b5bc9042afdff177872779c4e8c9015 /lib/libchmfile/libchmfileimpl.h
parent35ff2a942f63b5201c04f41c3097e61cdd7817e9 (diff)
downloadkchmviewer-25794f504692e5a36c490438814e9dfda8aaa2dd.tar.gz
kchmviewer-25794f504692e5a36c490438814e9dfda8aaa2dd.zip
TQt4 port kchmviewer
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kchmviewer@1234150 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/libchmfile/libchmfileimpl.h')
-rw-r--r--lib/libchmfile/libchmfileimpl.h74
1 files changed, 37 insertions, 37 deletions
diff --git a/lib/libchmfile/libchmfileimpl.h b/lib/libchmfile/libchmfileimpl.h
index b609b16..c6558f7 100644
--- a/lib/libchmfile/libchmfileimpl.h
+++ b/lib/libchmfile/libchmfileimpl.h
@@ -34,7 +34,7 @@ class LCHMSearchProgressResult
inline LCHMSearchProgressResult() {}
inline LCHMSearchProgressResult( u_int32_t t, u_int32_t u ) : titleoff(t),urloff(u) {}
- QValueVector<u_int64_t> offsets;
+ TQValueVector<u_int64_t> offsets;
u_int32_t titleoff;
u_int32_t urloff;
};
@@ -51,25 +51,25 @@ class LCHMFileImpl
~LCHMFileImpl();
// Implementations for LCHMFile members
- bool loadFile( const QString& archiveName );
+ bool loadFile( const TQString& archiveName );
void closeAll();
- QString title() const { return encodeWithCurrentCodec( m_title ); }
- QString homeUrl() const { return encodeWithCurrentCodec( m_home ); }
+ TQString title() const { return encodeWithCurrentCodec( m_title ); }
+ TQString homeUrl() const { return encodeWithCurrentCodec( m_home ); }
- bool getFileContentAsString( QString * str, const QString& url, bool internal_encoding = false );
- bool getFileContentAsBinary( QByteArray * data, const QString& url ) const;
- bool getFileSize( unsigned int * size, const QString& url );
+ bool getFileContentAsString( TQString * str, const TQString& url, bool internal_encoding = false );
+ bool getFileContentAsBinary( TQByteArray * data, const TQString& url ) const;
+ bool getFileSize( unsigned int * size, const TQString& url );
- bool enumerateFiles( QStringList * files );
- QString getTopicByUrl ( const QString& url ) const;
+ bool enumerateFiles( TQStringList * files );
+ TQString getTopicByUrl ( const TQString& url ) const;
- const QPixmap * getBookIconPixmap( unsigned int imagenum );
+ const TQPixmap * getBookIconPixmap( unsigned int imagenum );
bool setCurrentEncoding( const LCHMTextEncoding * encoding );
//! Parse the HHC or HHS file, and fill the context (asIndex is false) or index (asIndex is true) array.
- bool parseFileAndFillArray (const QString& file, QT34VECTOR< LCHMParsedEntry > * data, bool asIndex );
+ bool parseFileAndFillArray (const TQString& file, QT34VECTOR< LCHMParsedEntry > * data, bool asIndex );
/*!
* \brief Fast search using the $FIftiMain file in the .chm.
@@ -82,7 +82,7 @@ class LCHMFileImpl
* \param phrase_search Indicates that word offset information should be kept.
* \return true if the search found something, false otherwise.
*/
- bool searchWord( const QString& word,
+ bool searchWord( const TQString& word,
bool wholeWords,
bool titlesOnly,
LCHMSearchProgressResults& results,
@@ -95,46 +95,46 @@ class LCHMFileImpl
* The keys are the URLs and the values are the page titles.
*/
void getSearchResults( const LCHMSearchProgressResults& tempres,
- QStringList * results,
+ TQStringList * results,
unsigned int limit_results = 500 );
//! Looks up fileName in the archive.
- bool ResolveObject( const QString& fileName, chmUnitInfo *ui ) const;
+ bool ResolveObject( const TQString& fileName, chmUnitInfo *ui ) const;
//! Retrieves an uncompressed chunk of a file in the .chm.
size_t RetrieveObject(const chmUnitInfo *ui, unsigned char *buffer, LONGUINT64 fileOffset, LONGINT64 bufferSize) const;
//! Encode the string with the currently selected text codec, if possible. Or return as-is, if not.
- inline QString encodeWithCurrentCodec (const QString& str) const
+ inline TQString encodeWithCurrentCodec (const TQString& str) const
{
return (m_textCodec ? m_textCodec->toUnicode (str) : str);
}
//! Encode the string with the currently selected text codec, if possible. Or return as-is, if not.
- inline QString encodeWithCurrentCodec (const char * str) const
+ inline TQString encodeWithCurrentCodec (const char * str) const
{
- return (m_textCodec ? m_textCodec->toUnicode (str) : (QString) str);
+ return (m_textCodec ? m_textCodec->toUnicode (str) : (TQString) str);
}
//! Encode the string from internal files with the currently selected text codec, if possible.
//! Or return as-is, if not.
- inline QString encodeInternalWithCurrentCodec (const QString& str) const
+ inline TQString encodeInternalWithCurrentCodec (const TQString& str) const
{
return (m_textCodecForSpecialFiles ? m_textCodecForSpecialFiles->toUnicode (str) : str);
}
//! Encode the string from internal files with the currently selected text codec, if possible.
//! Or return as-is, if not.
- inline QString encodeInternalWithCurrentCodec (const char * str) const
+ inline TQString encodeInternalWithCurrentCodec (const char * str) const
{
- return (m_textCodecForSpecialFiles ? m_textCodecForSpecialFiles->toUnicode (str) : (QString) str);
+ return (m_textCodecForSpecialFiles ? m_textCodecForSpecialFiles->toUnicode (str) : (TQString) str);
}
//! Helper. Translates from Win32 encodings to generic wxWidgets ones.
- const char * GetFontEncFromCharSet (const QString& font) const;
+ const char * GetFontEncFromCharSet (const TQString& font) const;
//! Helper. Returns the $FIftiMain offset of leaf node or 0.
- u_int32_t GetLeafNodeOffset(const QString& text,
+ u_int32_t GetLeafNodeOffset(const TQString& text,
u_int32_t initalOffset,
u_int32_t buffSize,
u_int16_t treeDepth );
@@ -168,23 +168,23 @@ class LCHMFileImpl
bool guessTextEncoding ();
//! Change the current CHM encoding for internal files and texts.
- //! Encoding could be either simple Qt codepage, or set like CP1251/KOI8, which allows to
+ //! Encoding could be either simple TQt codepage, or set like CP1251/KOI8, which allows to
//! set up encodings separately for text (first) and internal files (second)
bool changeFileEncoding( const char *qtencoding );
//! Convert the word, so it has an appropriate encoding
- QCString convertSearchWord ( const QString &src );
+ TQCString convertSearchWord ( const TQString &src );
/*!
* Helper procedure in TOC parsing, decodes the string between the quotes (first or last) with decoding HTML
* entities like &iacute;
*/
- int findStringInQuotes (const QString& tag, int offset, QString& value, bool firstquote, bool decodeentities );
+ int findStringInQuotes (const TQString& tag, int offset, TQString& value, bool firstquote, bool decodeentities );
/*!
* Decodes Unicode HTML entities according to current encoding.
*/
- QString decodeEntity (const QString& entity );
+ TQString decodeEntity (const TQString& entity );
/*!
* \brief Returns the list of all available text encodings.
@@ -216,7 +216,7 @@ class LCHMFileImpl
/*!
* Normalizes path to search in internal arrays
*/
- QString normalizeUrl (const QString& path ) const;
+ TQString normalizeUrl (const TQString& path ) const;
// Members
@@ -225,36 +225,36 @@ class LCHMFileImpl
chmFile * m_chmFile;
//! Opened file name
- QString m_filename;
+ TQString m_filename;
//! Home url, got from CHM file
- QString m_home;
+ TQString m_home;
//! Context tree filename. Got from CHM file
- QString m_topicsFile;
+ TQString m_topicsFile;
//! Index filename. Got from CHM file
- QString m_indexFile;
+ TQString m_indexFile;
//! Chm Title. Got from CHM file
- QString m_title;
+ TQString m_title;
// Localization stuff
//! LCID from CHM file, used in encoding detection
short m_detectedLCID;
//! font charset from CHM file, used in encoding detection
- QString m_font;
+ TQString m_font;
//! Chosen text codec
- QTextCodec * m_textCodec;
- QTextCodec * m_textCodecForSpecialFiles;
+ TQTextCodec * m_textCodec;
+ TQTextCodec * m_textCodecForSpecialFiles;
//! Current encoding
const LCHMTextEncoding * m_currentEncoding;
//! Map to decode HTML entitles like &acute; based on current encoding
- QMap<QString, QString> m_entityDecodeMap;
+ TQMap<TQString, TQString> m_entityDecodeMap;
//! TRUE if /#TOPICS, /#STRINGS, /#URLTBL and /#URLSTR are resolved, and the members below are valid
bool m_lookupTablesValid;
@@ -282,5 +282,5 @@ class LCHMFileImpl
LCHMTocImageKeeper m_imagesKeeper;
//! Map url->topic
- QMap< QString, QString > m_url2topics;
+ TQMap< TQString, TQString > m_url2topics;
};