diff options
Diffstat (limited to 'kopete/protocols/irc/libkirc/kircengine.h')
-rw-r--r-- | kopete/protocols/irc/libkirc/kircengine.h | 336 |
1 files changed, 168 insertions, 168 deletions
diff --git a/kopete/protocols/irc/libkirc/kircengine.h b/kopete/protocols/irc/libkirc/kircengine.h index 50cb8f49..4fb381f1 100644 --- a/kopete/protocols/irc/libkirc/kircengine.h +++ b/kopete/protocols/irc/libkirc/kircengine.h @@ -33,12 +33,12 @@ #include <kdebugclasses.h> #endif -#include <qdatetime.h> -#include <qdict.h> -#include <qintdict.h> -#include <qregexp.h> -#include <qstring.h> -#include <qstringlist.h> +#include <tqdatetime.h> +#include <tqdict.h> +#include <tqintdict.h> +#include <tqregexp.h> +#include <tqstring.h> +#include <tqstringlist.h> class QRegExp; @@ -55,21 +55,21 @@ class Engine { Q_OBJECT -// Q_PROPERTY(QUrl serverURL READ serverURL WRITE setServerURL) +// Q_PROPERTY(TQUrl serverURL READ serverURL WRITE setServerURL) // Extracted from the base of the serverURL. // Q_PROPERTY(bool useSSL); -// Q_PROPERTY(QString user READ user); -// Q_PROPERTY(QString password); -// Q_PROPERTY(QString host READ host); +// Q_PROPERTY(TQString user READ user); +// Q_PROPERTY(TQString password); +// Q_PROPERTY(TQString host READ host); // Q_PROPERTY(int port READ host); // Extracted from the query of the serverURL. // Q_PROPERTY(bool reqsPasswd); -// Q_PROPERTY(QString name); // real name -// Q_PROPERTY(QStringList nickList READ nickList WRITE setNickList) -// Q_PROPERTY(QString nick READ nick) -// Q_PROPERTY(QStringList portList) +// Q_PROPERTY(TQString name); // real name +// Q_PROPERTY(TQStringList nickList READ nickList WRITE setNickList) +// Q_PROPERTY(TQString nick READ nick) +// Q_PROPERTY(TQStringList portList) Q_ENUMS(Status) @@ -105,38 +105,38 @@ public: MessageOfTheDayCondensedMessage }; - Engine( QObject *parent = 0, const char* name = 0 ); + Engine( TQObject *parent = 0, const char* name = 0 ); ~Engine(); -// QString nick() const; -// QStringList nickList() const; -// void setNickList(const QStringList& nickList); +// TQString nick() const; +// TQStringList nickList() const; +// void setNickList(const TQStringList& nickList); -// QUrl serverURL() const; -// bool setServerURL(const QUrl &url); +// TQUrl serverURL() const; +// bool setServerURL(const TQUrl &url); - inline const QString ¤tHost() const + inline const TQString ¤tHost() const { return m_Host; }; inline Q_UINT16 currentPort() { return m_Port; } - inline const QString &nickName() const + inline const TQString &nickName() const { return m_Nickname; }; - inline const QString &password() const + inline const TQString &password() const { return m_Passwd; } - inline void setPassword(const QString &passwd) + inline void setPassword(const TQString &passwd) { m_Passwd = passwd; }; - inline const QString &userName() const + inline const TQString &userName() const { return m_Username; } - void setUserName(const QString &newName); + void setUserName(const TQString &newName); - void setRealName(const QString &newName); - inline const QString &realName() const + void setRealName(const TQString &newName); + inline const TQString &realName() const { return m_realName; } inline const bool reqsPassword() const @@ -148,18 +148,18 @@ public: const bool useSSL() const { return m_useSSL; }; void setUseSSL( bool useSSL ); - inline const QTextCodec *codec() const + inline const TQTextCodec *codec() const { return defaultCodec; }; - const QTextCodec *codecForNick( const QString &nick ) const; + const TQTextCodec *codecForNick( const TQString &nick ) const; - inline void setDefaultCodec( QTextCodec* codec ) + inline void setDefaultCodec( TQTextCodec* codec ) { defaultCodec = codec; }; - void setVersionString(const QString &versionString); - void setUserString(const QString &userString); - void setSourceString(const QString &sourceString); - void connectToServer(const QString &host, Q_UINT16 port, const QString &nickname, bool useSSL = false); + void setVersionString(const TQString &versionString); + void setUserString(const TQString &userString); + void setSourceString(const TQString &sourceString); + void connectToServer(const TQString &host, Q_UINT16 port, const TQString &nickname, bool useSSL = false); KExtendedSocket *socket() { return m_sock; }; @@ -173,102 +173,102 @@ public: inline bool isConnected() const { return m_status == Connected; } - inline void setCodec( const QString &nick, const QTextCodec *codec ) + inline void setCodec( const TQString &nick, const TQTextCodec *codec ) { codecs.replace( nick, codec ); } /* Custom CTCP replies handling */ - inline QString &customCtcp( const QString &s ) + inline TQString &customCtcp( const TQString &s ) { return customCtcpMap[s]; } - inline void addCustomCtcp( const QString &ctcp, const QString &reply ) + inline void addCustomCtcp( const TQString &ctcp, const TQString &reply ) { customCtcpMap[ ctcp.lower() ] = reply; } - KIRC::EntityPtr getEntity(const QString &name); + KIRC::EntityPtr getEntity(const TQString &name); public slots: //Message output - void writeRawMessage(const QString &message); + void writeRawMessage(const TQString &message); - void writeMessage(const QString &message, const QTextCodec *codec = 0 ); - void writeMessage(const QString &command, const QStringList &args, - const QString &suffix = QString::null, const QTextCodec *codec = 0); + void writeMessage(const TQString &message, const TQTextCodec *codec = 0 ); + void writeMessage(const TQString &command, const TQStringList &args, + const TQString &suffix = TQString::null, const TQTextCodec *codec = 0); - void writeCtcpMessage(const QString &command, const QString &to, const QString &ctcpMessage); + void writeCtcpMessage(const TQString &command, const TQString &to, const TQString &ctcpMessage); - void writeCtcpMessage(const QString &command, const QString &to, const QString &suffix, - const QString &ctcpCommand, const QStringList &ctcpArgs, const QString &ctcpSuffix = QString::null, + void writeCtcpMessage(const TQString &command, const TQString &to, const TQString &suffix, + const TQString &ctcpCommand, const TQStringList &ctcpArgs, const TQString &ctcpSuffix = TQString::null, bool emitRepliedCtcp = true); - inline void writeCtcpQueryMessage(const QString &to, const QString &suffix, - const QString &ctcpCommand, const QStringList &ctcpArgs = QStringList(), const QString &ctcpSuffix = QString::null, + inline void writeCtcpQueryMessage(const TQString &to, const TQString &suffix, + const TQString &ctcpCommand, const TQStringList &ctcpArgs = TQStringList(), const TQString &ctcpSuffix = TQString::null, bool emitRepliedCtcp = true) { return writeCtcpMessage("PRIVMSG", to, suffix, ctcpCommand, ctcpArgs, ctcpSuffix, emitRepliedCtcp); } - inline void writeCtcpReplyMessage(const QString &to, const QString &ctcpMessage) + inline void writeCtcpReplyMessage(const TQString &to, const TQString &ctcpMessage) { writeCtcpMessage("NOTICE", to, ctcpMessage); } - inline void writeCtcpReplyMessage(const QString &to, const QString &suffix, - const QString &ctcpCommand, const QStringList &ctcpArgs = QStringList(), const QString &ctcpSuffix = QString::null, + inline void writeCtcpReplyMessage(const TQString &to, const TQString &suffix, + const TQString &ctcpCommand, const TQStringList &ctcpArgs = TQStringList(), const TQString &ctcpSuffix = TQString::null, bool emitRepliedCtcp = true) { return writeCtcpMessage("NOTICE", to, suffix, ctcpCommand, ctcpArgs, ctcpSuffix, emitRepliedCtcp); } - inline void writeCtcpErrorMessage(const QString &to, const QString &ctcpLine, const QString &errorMsg, + inline void writeCtcpErrorMessage(const TQString &to, const TQString &ctcpLine, const TQString &errorMsg, bool emitRepliedCtcp=true) - { return writeCtcpReplyMessage(to, QString::null, "ERRMSG", ctcpLine, errorMsg, emitRepliedCtcp); } + { return writeCtcpReplyMessage(to, TQString::null, "ERRMSG", ctcpLine, errorMsg, emitRepliedCtcp); } - bool bind(const QString &command, QObject *object, const char *member, + bool bind(const TQString &command, TQObject *object, const char *member, int minArgs = KIRC::MessageRedirector::Unknown, int maxArgs = KIRC::MessageRedirector::Unknown, - const QString &helpMessage = QString::null); + const TQString &helpMessage = TQString::null); - bool bind(int id, QObject *object, const char *member, + bool bind(int id, TQObject *object, const char *member, int minArgs = KIRC::MessageRedirector::Unknown, int maxArgs = KIRC::MessageRedirector::Unknown, - const QString &helpMessage = QString::null); + const TQString &helpMessage = TQString::null); - bool bindCtcpQuery(const QString &command, QObject *object, const char *member, + bool bindCtcpQuery(const TQString &command, TQObject *object, const char *member, int minArgs = KIRC::MessageRedirector::Unknown, int maxArgs = KIRC::MessageRedirector::Unknown, - const QString &helpMessage = QString::null); + const TQString &helpMessage = TQString::null); - bool bindCtcpReply(const QString &command, QObject *object, const char *member, + bool bindCtcpReply(const TQString &command, TQObject *object, const char *member, int minArgs = KIRC::MessageRedirector::Unknown, int maxArgs = KIRC::MessageRedirector::Unknown, - const QString &helpMessage = QString::null); + const TQString &helpMessage = TQString::null); - void away(bool isAway, const QString &awayMessage = QString::null); - void ison(const QStringList &nickList); - void join(const QString &name, const QString &key); - void kick(const QString &user, const QString &channel, const QString &reason); + void away(bool isAway, const TQString &awayMessage = TQString::null); + void ison(const TQStringList &nickList); + void join(const TQString &name, const TQString &key); + void kick(const TQString &user, const TQString &channel, const TQString &reason); void list(); - void mode(const QString &target, const QString &mode); - void motd(const QString &server = QString::null); - void nick(const QString &newNickname); - void notice(const QString &target, const QString &message); - void part(const QString &name, const QString &reason); - void pass(const QString &password); - void privmsg(const QString &contact, const QString &message); + void mode(const TQString &target, const TQString &mode); + void motd(const TQString &server = TQString::null); + void nick(const TQString &newNickname); + void notice(const TQString &target, const TQString &message); + void part(const TQString &name, const TQString &reason); + void pass(const TQString &password); + void privmsg(const TQString &contact, const TQString &message); /** * Send a quit message for the given reason. * If now is set to true the connection is closed and no event message is sent. * Therefore setting now to true should only be used while destroying the object. */ - void quit(const QString &reason, bool now=false); + void quit(const TQString &reason, bool now=false); - void topic(const QString &channel, const QString &topic); - void user(const QString &newUsername, const QString &hostname, const QString &newRealname); - void user(const QString &newUsername, Q_UINT8 mode, const QString &newRealname); - void whois(const QString &user); + void topic(const TQString &channel, const TQString &topic); + void user(const TQString &newUsername, const TQString &hostname, const TQString &newRealname); + void user(const TQString &newUsername, Q_UINT8 mode, const TQString &newRealname); + void whois(const TQString &user); /* CTCP commands */ - void CtcpRequestCommand(const QString &contact, const QString &command); - void CtcpRequest_action(const QString &contact, const QString &message); - void CtcpRequest_dcc(const QString &, const QString &, unsigned int port, KIRC::Transfer::Type type); - void CtcpRequest_ping(const QString &target); - void CtcpRequest_version(const QString &target); + void CtcpRequestCommand(const TQString &contact, const TQString &command); + void CtcpRequest_action(const TQString &contact, const TQString &message); + void CtcpRequest_dcc(const TQString &, const TQString &, unsigned int port, KIRC::Transfer::Type type); + void CtcpRequest_ping(const TQString &target); + void CtcpRequest_version(const TQString &target); public slots: void showInfoDialog(); @@ -296,88 +296,88 @@ signals: void receivedMessage( KIRC::Engine::ServerMessageType type, const KIRC::EntityPtr &from, const KIRC::EntityPtrList &to, - const QString &msg); + const TQString &msg); - void successfullyChangedNick(const QString &, const QString &); + void successfullyChangedNick(const TQString &, const TQString &); //ServerContact Signals - void incomingMotd(const QString &motd); - void incomingNotice(const QString &originating, const QString &message); - void incomingHostInfo(const QString &servername, const QString &version, - const QString &userModes, const QString &channelModes); - void incomingYourHostInfo(const QString &servername, const QString &version, - const QString &userModes, const QString &channelModes); - void incomingConnectString(const QString &clients); + void incomingMotd(const TQString &motd); + void incomingNotice(const TQString &originating, const TQString &message); + void incomingHostInfo(const TQString &servername, const TQString &version, + const TQString &userModes, const TQString &channelModes); + void incomingYourHostInfo(const TQString &servername, const TQString &version, + const TQString &userModes, const TQString &channelModes); + void incomingConnectString(const TQString &clients); //Channel Contact Signals - void incomingMessage(const QString &originating, const QString &target, const QString &message); - void incomingTopicChange(const QString &, const QString &, const QString &); - void incomingExistingTopic(const QString &, const QString &); - void incomingTopicUser(const QString &channel, const QString &user, const QDateTime &time); - void incomingJoinedChannel(const QString &channel,const QString &nick); - void incomingPartedChannel(const QString &channel,const QString &nick, const QString &reason); - void incomingNamesList(const QString &channel, const QStringList &nicknames); - void incomingEndOfNames(const QString &channel); - void incomingChannelMode(const QString &channel, const QString &mode, const QString ¶ms); - void incomingCannotSendToChannel(const QString &channel, const QString &message); - void incomingChannelModeChange(const QString &channel, const QString &nick, const QString &mode); - void incomingChannelHomePage(const QString &channel, const QString &url); + void incomingMessage(const TQString &originating, const TQString &target, const TQString &message); + void incomingTopicChange(const TQString &, const TQString &, const TQString &); + void incomingExistingTopic(const TQString &, const TQString &); + void incomingTopicUser(const TQString &channel, const TQString &user, const TQDateTime &time); + void incomingJoinedChannel(const TQString &channel,const TQString &nick); + void incomingPartedChannel(const TQString &channel,const TQString &nick, const TQString &reason); + void incomingNamesList(const TQString &channel, const TQStringList &nicknames); + void incomingEndOfNames(const TQString &channel); + void incomingChannelMode(const TQString &channel, const TQString &mode, const TQString ¶ms); + void incomingCannotSendToChannel(const TQString &channel, const TQString &message); + void incomingChannelModeChange(const TQString &channel, const TQString &nick, const TQString &mode); + void incomingChannelHomePage(const TQString &channel, const TQString &url); //Contact Signals - void incomingPrivMessage(const QString &, const QString &, const QString &); - void incomingQuitIRC(const QString &user, const QString &reason); - void incomingUserModeChange(const QString &nick, const QString &mode); - void incomingNoSuchNickname(const QString &nick); + void incomingPrivMessage(const TQString &, const TQString &, const TQString &); + void incomingQuitIRC(const TQString &user, const TQString &reason); + void incomingUserModeChange(const TQString &nick, const TQString &mode); + void incomingNoSuchNickname(const TQString &nick); // CTCP Signals -// void action(const QString &from, const QString &to, const QString &message); - void incomingAction(const QString &channel, const QString &originating, const QString &message); - void incomingPrivAction(const QString &target, const QString &originating, const QString &message); +// void action(const TQString &from, const TQString &to, const TQString &message); + void incomingAction(const TQString &channel, const TQString &originating, const TQString &message); + void incomingPrivAction(const TQString &target, const TQString &originating, const TQString &message); //Response Signals - void incomingUserOnline(const QString &nick); - void incomingWhoIsUser(const QString &nickname, const QString &username, - const QString &hostname, const QString &realname); - void incomingWhoWasUser(const QString &nickname, const QString &username, - const QString &hostname, const QString &realname); - void incomingWhoIsServer(const QString &nickname, const QString &server, const QString &serverInfo); - void incomingWhoIsOperator(const QString &nickname); - void incomingWhoIsIdentified(const QString &nickname); - void incomingWhoIsChannels(const QString &nickname, const QString &channel); - void incomingWhoIsIdle(const QString &nickname, unsigned long seconds); /* 317 */ - void incomingSignOnTime(const QString &nickname, unsigned long seconds); /* 317 */ - void incomingEndOfWhois(const QString &nickname); - void incomingEndOfWhoWas(const QString &nickname); - - void incomingWhoReply( const QString &nick, const QString &channel, const QString &user, const QString &host, - const QString &server,bool away, const QString &flag, uint hops, const QString &realName ); - - void incomingEndOfWho( const QString &query ); + void incomingUserOnline(const TQString &nick); + void incomingWhoIsUser(const TQString &nickname, const TQString &username, + const TQString &hostname, const TQString &realname); + void incomingWhoWasUser(const TQString &nickname, const TQString &username, + const TQString &hostname, const TQString &realname); + void incomingWhoIsServer(const TQString &nickname, const TQString &server, const TQString &serverInfo); + void incomingWhoIsOperator(const TQString &nickname); + void incomingWhoIsIdentified(const TQString &nickname); + void incomingWhoIsChannels(const TQString &nickname, const TQString &channel); + void incomingWhoIsIdle(const TQString &nickname, unsigned long seconds); /* 317 */ + void incomingSignOnTime(const TQString &nickname, unsigned long seconds); /* 317 */ + void incomingEndOfWhois(const TQString &nickname); + void incomingEndOfWhoWas(const TQString &nickname); + + void incomingWhoReply( const TQString &nick, const TQString &channel, const TQString &user, const TQString &host, + const TQString &server,bool away, const TQString &flag, uint hops, const TQString &realName ); + + void incomingEndOfWho( const TQString &query ); //Error Message Signals void incomingServerLoadTooHigh(); - void incomingNickInUse(const QString &usingNick); - void incomingNickChange(const QString &, const QString &); + void incomingNickInUse(const TQString &usingNick); + void incomingNickChange(const TQString &, const TQString &); void incomingFailedServerPassword(); - void incomingFailedChankey(const QString &); - void incomingFailedChanBanned(const QString &); - void incomingFailedChanInvite(const QString &); - void incomingFailedChanFull(const QString &); - void incomingFailedNickOnLogin(const QString &); - void incomingNoNickChan(const QString &); - void incomingWasNoNick(const QString &); + void incomingFailedChankey(const TQString &); + void incomingFailedChanBanned(const TQString &); + void incomingFailedChanInvite(const TQString &); + void incomingFailedChanFull(const TQString &); + void incomingFailedNickOnLogin(const TQString &); + void incomingNoNickChan(const TQString &); + void incomingWasNoNick(const TQString &); //General Signals - void incomingUnknown(const QString &); - void incomingUnknownCtcp(const QString &); - void incomingKick(const QString &channel, const QString &nick, - const QString &nickKicked, const QString &reason); + void incomingUnknown(const TQString &); + void incomingUnknownCtcp(const TQString &); + void incomingKick(const TQString &channel, const TQString &nick, + const TQString &nickKicked, const TQString &reason); - void incomingUserIsAway(const QString &nick, const QString &awayMessage); - void incomingListedChan(const QString &chan, uint users, const QString &topic); + void incomingUserIsAway(const TQString &nick, const TQString &awayMessage); + void incomingListedChan(const TQString &chan, uint users, const TQString &topic); void incomingEndOfList(); - void incomingCtcpReply(const QString &type, const QString &target, const QString &messageReceived); + void incomingCtcpReply(const TQString &type, const TQString &target, const TQString &messageReceived); private slots: void destroyed(KIRC::Entity *entity); @@ -479,50 +479,50 @@ private: void bindCtcp(); void setStatus(KIRC::Engine::Status status); - bool invokeCtcpCommandOfMessage(const QDict<KIRC::MessageRedirector> &map, KIRC::Message &message); + bool invokeCtcpCommandOfMessage(const TQDict<KIRC::MessageRedirector> &map, KIRC::Message &message); /* * Methods that handles all the bindings creations. * This methods is used by all the bind(...) methods. */ - bool _bind(QDict<KIRC::MessageRedirector> &dict, - QString command, QObject *object, const char *member, - int minArgs, int maxArgs, const QString &helpMessage); + bool _bind(TQDict<KIRC::MessageRedirector> &dict, + TQString command, TQObject *object, const char *member, + int minArgs, int maxArgs, const TQString &helpMessage); //Static regexes - static const QRegExp m_RemoveLinefeeds; + static const TQRegExp m_RemoveLinefeeds; KIRC::Engine::Status m_status; - QString m_Host; + TQString m_Host; Q_UINT16 m_Port; -// QUrl serverURL; -// QUrl currentServerURL; - QString m_Nickname; - QString m_Username; - QString m_realName; - QString m_Passwd; +// TQUrl serverURL; +// TQUrl currentServerURL; + TQString m_Nickname; + TQString m_Username; + TQString m_realName; + TQString m_Passwd; bool m_ReqsPasswd; bool m_FailedNickOnLogin; bool m_useSSL; - QValueList<KIRC::Entity *> m_entities; + TQValueList<KIRC::Entity *> m_entities; KIRC::EntityPtr m_server; KIRC::EntityPtr m_self; - QString m_VersionString; - QString m_UserString; - QString m_SourceString; - QString m_PendingNick; + TQString m_VersionString; + TQString m_UserString; + TQString m_SourceString; + TQString m_PendingNick; - QDict<KIRC::MessageRedirector> m_commands; -// QIntDict<KIRC::MessageRedirector> m_numericCommands; - QDict<KIRC::MessageRedirector> m_ctcpQueries; - QDict<KIRC::MessageRedirector> m_ctcpReplies; + TQDict<KIRC::MessageRedirector> m_commands; +// TQIntDict<KIRC::MessageRedirector> m_numericCommands; + TQDict<KIRC::MessageRedirector> m_ctcpQueries; + TQDict<KIRC::MessageRedirector> m_ctcpReplies; - QMap<QString, QString> customCtcpMap; - QDict<QTextCodec> codecs; - QTextCodec *defaultCodec; + TQMap<TQString, TQString> customCtcpMap; + TQDict<TQTextCodec> codecs; + TQTextCodec *defaultCodec; KExtendedSocket *m_sock; }; |