diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-29 00:55:34 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-29 00:55:34 +0000 |
commit | c4189d200e71c7ef82e9a6e34935ad225154d658 (patch) | |
tree | f7f29a1159e0402472ff2ab22617a8113f66263c /kbarcode/tokenprovider.h | |
parent | 2f888b1578e65ec1bc514996eb509fcaf34462d6 (diff) | |
download | kbarcode-c4189d200e71c7ef82e9a6e34935ad225154d658.tar.gz kbarcode-c4189d200e71c7ef82e9a6e34935ad225154d658.zip |
TQt4 port kbarcode
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kbarcode@1233956 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbarcode/tokenprovider.h')
-rw-r--r-- | kbarcode/tokenprovider.h | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/kbarcode/tokenprovider.h b/kbarcode/tokenprovider.h index ac7e57f..566fbb3 100644 --- a/kbarcode/tokenprovider.h +++ b/kbarcode/tokenprovider.h @@ -23,8 +23,8 @@ // use KJS instead of #define NO_KJS_EMBED -#include <qstring.h> -#include <qregexp.h> +#include <tqstring.h> +#include <tqregexp.h> #include <time.h> #include "documentitem.h" @@ -37,7 +37,7 @@ class tToken { public: tToken() {}; - tToken( const QString & t, const QString & d, bool a = false ) + tToken( const TQString & t, const TQString & d, bool a = false ) { token = t; description = d; @@ -51,14 +51,14 @@ class tToken { appendix = rhs.appendix; } - QString token; - QString description; + TQString token; + TQString description; bool appendix; }; struct tCategories { int category; - QValueList<tToken> tokens; + TQValueList<tToken> tokens; }; @@ -72,7 +72,7 @@ namespace KJS { } #endif // NO_KJS_EMBED -class QPaintDevice; +class TQPaintDevice; /** This class handles the replacement of tokens like [date] or [article_no]. * @@ -82,12 +82,12 @@ class TokenProvider { public: enum ECategories { CAT_DATABASE, CAT_LABEL, CAT_CUSTOM, CAT_DATE, CAT_ADDRESS }; - TokenProvider( QPaintDevice* paintdevice ); + TokenProvider( TQPaintDevice* paintdevice ); virtual ~TokenProvider(); static bool hasJavaScript(); - static QValueList<tCategories>* getTokens(); + static TQValueList<tCategories>* getTokens(); /** * Get a caption which can be displayed to the user from @@ -97,7 +97,7 @@ class TokenProvider { * * @returns a translated caption which can be displayed to the user */ - static const QString captionForCategory( ECategories e ) { + static const TQString captionForCategory( ECategories e ) { return s_captions[e]; } @@ -108,25 +108,25 @@ class TokenProvider { inline void setIndex( unsigned int index ) { m_index = index; m_update = true; } inline void setPage( unsigned int page ) { m_page = page; m_update = true; } - inline void setArticleNo( const QString & t ) { article_no = t; m_update = true; } - inline void setBarcodeNo( const QString & t ) { barcode_no = t; m_update = true; } - inline void setCustomerNo( const QString & t ) { customer_no = t; m_update = true; } - inline void setEncodingTypeName( const QString & t ) { encoding_type_name = t; m_update = true; } - inline void setGroup( const QString & t ) { group = t; m_update = true; } - inline void setLabelName( const QString & t ) { label_name = t; m_update = true; } + inline void setArticleNo( const TQString & t ) { article_no = t; m_update = true; } + inline void setBarcodeNo( const TQString & t ) { barcode_no = t; m_update = true; } + inline void setCustomerNo( const TQString & t ) { customer_no = t; m_update = true; } + inline void setEncodingTypeName( const TQString & t ) { encoding_type_name = t; m_update = true; } + inline void setGroup( const TQString & t ) { group = t; m_update = true; } + inline void setLabelName( const TQString & t ) { label_name = t; m_update = true; } inline void setCol( unsigned int c ) { col = c; m_update = true; } inline void setRow( unsigned int r ) { row = r; m_update = true; } - inline void setSerial( const QString &t, unsigned int inc ) { m_serial = t; m_increment = inc; m_update = true; m_contains_update = true;} + inline void setSerial( const TQString &t, unsigned int inc ) { m_serial = t; m_increment = inc; m_update = true; m_contains_update = true;} inline void setAddressee( KABC::Addressee* pAddressee ) { m_address = pAddressee; } inline int index() const { return m_index; } inline unsigned int page() const { return m_page; } - inline const QString & articleNo() const { return article_no; } - inline const QString & barcodeNo() const { return barcode_no; } - inline const QString & serial() const { return m_serial; } + inline const TQString & articleNo() const { return article_no; } + inline const TQString & barcodeNo() const { return barcode_no; } + inline const TQString & serial() const { return m_serial; } - inline void setPaintDevice( QPaintDevice* paint ) { m_printer = paint; } - inline QPaintDevice* paintDevice() const { return m_printer; } + inline void setPaintDevice( TQPaintDevice* paint ) { m_printer = paint; } + inline TQPaintDevice* paintDevice() const { return m_printer; } /** * parse the given java script code and return its result @@ -134,21 +134,21 @@ class TokenProvider { * or an error message * @p script javascript code to execute */ - QString jsParse( const QString & script ); + TQString jsParse( const TQString & script ); /** * parse the given java script code and return its result * @returns true or false * @p script javascript code to execute */ - bool jsParseToBool( const QString & script ); + bool jsParseToBool( const TQString & script ); /** * parse the given text for tokens and return a * string with all tokens replaced correctly. - * @param text QString look in this text for tokens to replace + * @param text TQString look in this text for tokens to tqreplace */ - QString parse( const QString & text ); + TQString parse( const TQString & text ); /** @@ -162,44 +162,44 @@ class TokenProvider { * A user defined variable is something like [$MyVar1]. Variable * names are case insensitive. */ - QStringList listUserVars(); + TQStringList listUserVars(); - inline void setUserVars( const QMap<QString,QString> & data ); + inline void setUserVars( const TQMap<TQString,TQString> & data ); private: static void init(); - const QString createSerial(); + const TQString createSerial(); - QString escapeText( const QString & t ); - QString unescapeText( const QString & t ); + TQString escapeText( const TQString & t ); + TQString unescapeText( const TQString & t ); /** A helper function called from parse * which returns the value for every known * token @p text. */ - QString process( const QString & text ); + TQString process( const TQString & text ); /** A helper function called from parse * which returns the value for every known * token @p t. */ - QString processAddresses( const QString & t ); + TQString processAddresses( const TQString & t ); /** a helper function needed by listUserVars. * which adds all user defined variables to * m_findUserVars. */ - QString processUserVars( const QString & t ); + TQString processUserVars( const TQString & t ); - void findBrackets( QString & text, QString (TokenProvider::*parserfunction)( const QString & ) ); + void findBrackets( TQString & text, TQString (TokenProvider::*parserfunction)( const TQString & ) ); /** * run a SQL Query and return it result - * @param query QString the SQL command to execute + * @param query TQString the SQL command to execute */ - QString query( const QString & query ); + TQString query( const TQString & query ); unsigned int m_index; unsigned int m_page; @@ -207,28 +207,28 @@ class TokenProvider { DocumentItemList m_document_items; - QMap<QString,QString> m_uservardata; + TQMap<TQString,TQString> m_uservardata; - QString article_no; - QString barcode_no; - QString customer_no; - QString encoding_type_name; - QString group; - QString label_name; - QString m_serial; + TQString article_no; + TQString barcode_no; + TQString customer_no; + TQString encoding_type_name; + TQString group; + TQString label_name; + TQString m_serial; unsigned int row; unsigned int col; bool m_update; bool m_contains_update; - QPaintDevice* m_printer; - QRegExp date_reg_exp ; + TQPaintDevice* m_printer; + TQRegExp date_reg_exp ; KABC::Addressee* m_address; - QStringList* m_findUserVarsList; - static QValueList<tCategories> s_categories; - static QMap<ECategories, QString> s_captions; + TQStringList* m_findUserVarsList; + static TQValueList<tCategories> s_categories; + static TQMap<ECategories, TQString> s_captions; #ifdef NO_KJS_EMBED static KJS::Interpreter* s_interpreter; @@ -242,7 +242,7 @@ inline void TokenProvider::setCurrentDocumentItems( const DocumentItemList & lis m_document_items = list; } -inline void TokenProvider::setUserVars( const QMap<QString,QString> & data ) +inline void TokenProvider::setUserVars( const TQMap<TQString,TQString> & data ) { m_uservardata = data; } |