diff options
Diffstat (limited to 'kbabel/kbabeldict/searchengine.h')
-rw-r--r-- | kbabel/kbabeldict/searchengine.h | 144 |
1 files changed, 72 insertions, 72 deletions
diff --git a/kbabel/kbabeldict/searchengine.h b/kbabel/kbabeldict/searchengine.h index db722362..a10e6193 100644 --- a/kbabel/kbabeldict/searchengine.h +++ b/kbabel/kbabeldict/searchengine.h @@ -34,11 +34,11 @@ #ifndef SEARCH_ENGINE_H #define SEARCH_ENGINE_H -#include <qdatetime.h> -#include <qptrlist.h> -#include <qobject.h> -#include <qstring.h> -#include <qwidget.h> +#include <tqdatetime.h> +#include <tqptrlist.h> +#include <tqobject.h> +#include <tqstring.h> +#include <tqwidget.h> #include <kaboutdata.h> #include <kconfigbase.h> @@ -55,50 +55,50 @@ public: * Information about the location, where this entry was found. * For example the PO-file it was found in, etc. * */ - QString location; + TQString location; /** * The complete path of the file, where this entry was found */ - QString filePath; + TQString filePath; /** The date of the last change */ - QDateTime lastChange; + TQDateTime lastChange; /** The language, the translation belongs to */ - QString languageCode; + TQString languageCode; /** * The translator of this string * For example the translator found in the header of the PO-file. */ - QString translator; + TQString translator; /** * The name of a project this translation is a part of. */ - QString projectName; + TQString projectName; /** * Keywords defined for @ref projectName. For example KDE_3_1_BRANCH (project branch) */ - QStringList projectKeywords; + TQStringList projectKeywords; /** * Part/context in a project, for example "multimedia", "admin", etc. */ - QString projectContext; + TQString projectContext; /** * Status of the translation, for example "approved", "spellchecked", "unknown" */ - QString status; + TQString status; /** * Additional information to be presented to the user, for example a comment */ - QString description; + TQString description; }; @@ -114,16 +114,16 @@ public: SearchResult(const SearchResult&); /** The requested string to search for */ - QString requested; + TQString requested; /** The string that, was found (a list if it is a plural form) */ - QStringList found; + TQStringList found; /** The number of a plural form to search for */ uint requestedPluralForm; /** The translation of the found string */ - QString translation; + TQString translation; /** The number of a plural form of the translated string found */ uint translationPluralForm; @@ -133,21 +133,21 @@ public: * using rich text. If you don't use rich text, you can leave * it empty */ - QString plainTranslation; + TQString plainTranslation; /** * This string contains the plain string, that was found, if you are * using rich text. If you don't use rich text, you can leave * it empty */ - QString plainFound; + TQString plainFound; /** * This string contains the plain requested string if you are * using rich text. If you don't use rich text, you can leave * it empty */ - QString plainRequested; + TQString plainRequested; /** * Constains a score for the found translation. 0 means exact matching. @@ -156,7 +156,7 @@ public: */ int score; - QPtrList<TranslationInfo> descriptions; + TQPtrList<TranslationInfo> descriptions; }; /** @@ -167,9 +167,9 @@ class KDE_EXPORT SearchFilter public: SearchFilter() : _projects() - , _location( QString::null ) - , _languageCode( QString::null ) - , _origLanguageCode( QString::null ) + , _location( TQString::null ) + , _languageCode( TQString::null ) + , _origLanguageCode( TQString::null ) , _translators() , _projectKeywords() , _projectContexts() @@ -178,45 +178,45 @@ public: virtual ~SearchFilter() {} - void setProjectName( const QString& project ) { _projects = project; } - void setProjectName( const QStringList& projects ) { _projects = projects; } + void setProjectName( const TQString& project ) { _projects = project; } + void setProjectName( const TQStringList& projects ) { _projects = projects; } /** * Information about the location, where this entry was found. * For example the PO-file it was found in, etc. * */ - void setLocation( const QString& location) { _location = location; } - QString location() const { return _location; } + void setLocation( const TQString& location) { _location = location; } + TQString location() const { return _location; } /** The original language, the translation was made from */ - void setOriginalLanguage( const QString& languageCode) { _origLanguageCode = languageCode; } + void setOriginalLanguage( const TQString& languageCode) { _origLanguageCode = languageCode; } /** The language, the translation belongs to */ - void setTranslationLanguage( const QString& languageCode) { _languageCode = languageCode; } + void setTranslationLanguage( const TQString& languageCode) { _languageCode = languageCode; } /** * The translator of this string * For example the translator found in the header of the PO-file. */ - void setTranslator( const QString& translator) { _translators = translator ; } - void setTranslator( const QStringList& translators) { _translators = translators ; } + void setTranslator( const TQString& translator) { _translators = translator ; } + void setTranslator( const TQStringList& translators) { _translators = translators ; } /** * Keywords defined for @ref projectName. For example KDE_3_1_BRANCH (project branch) */ - void setProjectKeywords( const QStringList& projectKeywords ) { _projectKeywords = projectKeywords; } + void setProjectKeywords( const TQStringList& projectKeywords ) { _projectKeywords = projectKeywords; } /** * Part/context in a project, for example "multimedia", "admin", etc. */ - void setProjectContext( const QString& projectContext) { _projectContexts = projectContext; } - void setProjectContext( const QStringList& projectContexts) { _projectContexts = projectContexts; } + void setProjectContext( const TQString& projectContext) { _projectContexts = projectContext; } + void setProjectContext( const TQStringList& projectContexts) { _projectContexts = projectContexts; } /** * Status of the translation, for example "approved", "spellchecked", "unknown" */ - void setStatus( const QString& translationStatus) { _translationStatus = translationStatus; } - void setStatus( const QStringList& translationStati) { _translationStatus = translationStati; } + void setStatus( const TQString& translationStatus) { _translationStatus = translationStatus; } + void setStatus( const TQStringList& translationStati) { _translationStatus = translationStati; } /** * The key method of the class - check, if the argument @@ -225,14 +225,14 @@ public: virtual bool match( const TranslationInfo& toCheck ); private: - QStringList _projects; - QString _location; - QString _languageCode; - QString _origLanguageCode; - QStringList _translators; - QStringList _projectKeywords ; - QStringList _projectContexts; - QStringList _translationStatus; + TQStringList _projects; + TQString _location; + TQString _languageCode; + TQString _origLanguageCode; + TQStringList _translators; + TQStringList _projectKeywords ; + TQStringList _projectContexts; + TQStringList _translationStatus; }; /** @@ -246,7 +246,7 @@ class KDE_EXPORT PrefWidget : public QWidget Q_OBJECT public: - PrefWidget(QWidget *parent, const char* name=0); + PrefWidget(TQWidget *parent, const char* name=0); virtual ~PrefWidget(); public slots: @@ -270,7 +270,7 @@ class KDE_EXPORT SearchEngine : public QObject Q_OBJECT public: - SearchEngine(QObject *parent=0, const char *name=0); + SearchEngine(TQObject *parent=0, const char *name=0); virtual ~SearchEngine(); @@ -297,26 +297,26 @@ public: * @returns the exact translation of text or a empty string * if no exact match was found. */ - virtual QString translate(const QString& text, const uint pluralForm = 0)=0; + virtual TQString translate(const TQString& text, const uint pluralForm = 0)=0; /** * @returns the translation of text according to the plugin settings or a empty string * if no match was found. */ - virtual QString searchTranslation(const QString&, int &score, const uint pluralForm = 0) { + virtual TQString searchTranslation(const TQString&, int &score, const uint pluralForm = 0) { Q_UNUSED(pluralForm); - score = 0; return QString::null; + score = 0; return TQString::null; } /** * @returns a fuzzy translation of text or a empty string * if no good match was found. */ - virtual QString fuzzyTranslation(const QString& /*text*/, int &score, const uint pluralForm = 0) { + virtual TQString fuzzyTranslation(const TQString& /*text*/, int &score, const uint pluralForm = 0) { Q_UNUSED(pluralForm); - score = 0; return QString::null; }; + score = 0; return TQString::null; }; /** @@ -329,7 +329,7 @@ public: * @return true, if successfull */ virtual bool messagesForFilter(const SearchFilter* filter - , QValueList<SearchResult>& resultList, QString& error) + , TQValueList<SearchResult>& resultList, TQString& error) { Q_UNUSED(filter); Q_UNUSED(resultList); @@ -354,19 +354,19 @@ public: * a tabbed widget. * @param parent the parent of the returned widget */ - virtual PrefWidget* preferencesWidget(QWidget *parent)=0; + virtual PrefWidget* preferencesWidget(TQWidget *parent)=0; /** @returns information about this SearchEngine */ virtual const KAboutData *about() const= 0; /** @returns the i18n name of this search engine */ - virtual QString name() const= 0; + virtual TQString name() const= 0; /** @returns a untranslated name of this engine */ - virtual QString id() const= 0; + virtual TQString id() const= 0; /** @returns the last error message */ - virtual QString lastError() = 0; + virtual TQString lastError() = 0; /** @@ -382,7 +382,7 @@ public: * a number between 0 and 100. @param ngram_len should be * a value between 3 and 5. */ - static uint ngramMatch (const QString& text1, const QString& text2, + static uint ngramMatch (const TQString& text1, const TQString& text2, uint ngram_len=3); public slots: @@ -391,14 +391,14 @@ public slots: * @returns false, if an error occured. Use @ref lastError * to get the last error message */ - virtual bool startSearch(const QString& s, uint pluralForm = 0, const SearchFilter* filter = 0) = 0; + virtual bool startSearch(const TQString& s, uint pluralForm = 0, const SearchFilter* filter = 0) = 0; /** * starts a search for string s in the translated text * @returns false, if an error occured. Use @ref lastError * to get the last error message */ - virtual bool startSearchInTranslation(const QString& s, uint pluralForm = 0, const SearchFilter* filter = 0); + virtual bool startSearchInTranslation(const TQString& s, uint pluralForm = 0, const SearchFilter* filter = 0); /** stops a search */ @@ -425,22 +425,22 @@ public slots: * on the edited file. The default implementation does nothing. * @param file The edited file with path */ - virtual void setEditedFile(const QString& file); + virtual void setEditedFile(const TQString& file); /** * This method allows a search engine to use different settings depending * on the edited package. The default implementation does nothing. * @param package The name of the package, that is currently translated. */ - virtual void setEditedPackage(const QString& package); + virtual void setEditedPackage(const TQString& package); /** * This method allows a search engine to use different settings depending * on the language code. The default implementation does nothing. * @param lang The current language code (e.g. de). */ - virtual void setLanguageCode(const QString& lang); - virtual void setLanguage(const QString& languageCode, const QString& languageName); + virtual void setLanguageCode(const TQString& lang); + virtual void setLanguage(const TQString& languageCode, const TQString& languageName); @@ -453,8 +453,8 @@ public slots: * @param pluralForm the number of the plural form of the translation * @param description the additional description, e.g., a PO comment */ - virtual void stringChanged( const QStringList& orig, const QString& translated - , const uint translationPluralForm, const QString& description); + virtual void stringChanged( const TQStringList& orig, const TQString& translated + , const uint translationPluralForm, const TQString& description); /** * If the database is editable this slot should open an dialog to let @@ -470,13 +470,13 @@ public slots: * returns "foobar", while n=1 would return "src" * FIXME: isn't it a code duplication? */ - static QString directory(const QString& path, int n); + static TQString directory(const TQString& path, int n); /** * computes a score to assess the match of the two strings: * 0 means exact match, bigger means worse */ - static uint score(const QString& orig, const QString& found); + static uint score(const TQString& orig, const TQString& found); signals: /** signals, that a new search started */ @@ -493,7 +493,7 @@ signals: * progressbar or if you do something else then searching, * maybe loading a big file */ - void progressStarts(const QString&); + void progressStarts(const TQString&); void progressEnds(); @@ -523,10 +523,10 @@ signals: * signals, that an error occured, for example, that you wasn't * able to open a database. */ - void hasError(const QString& error); + void hasError(const TQString& error); protected: - QPtrList<SearchResult> results; + TQPtrList<SearchResult> results; bool autoUpdate; }; |