/* oscarprotocol.h - Oscar Protocol Plugin Copyright (c) 2003 by Olivier Goffart Kopete (c) 2003 by the Kopete developers ************************************************************************* * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ************************************************************************* */ #ifndef ICQPROTOCOL_H #define ICQPROTOCOL_H #include "kopeteprotocol.h" #include "kopetemimetypehandler.h" #include "kopeteonlinestatus.h" class TQComboBox; /*class ICQUserInfoWidget; class ICQContact;*/ namespace ICQ { class OnlineStatusManager; } class ICQProtocolHandler : public Kopete::MimeTypeHandler { public: ICQProtocolHandler(); void handleURL(const TQString &mimeType, const KURL & url) const; }; class ICQProtocol : public Kopete::Protocol { TQ_OBJECT public: ICQProtocol(TQObject *parent, const char *name, const TQStringList &args); virtual ~ICQProtocol(); /** * Return the active instance of the protocol */ static ICQProtocol *protocol(); virtual bool canSendOffline() const; virtual Kopete::Contact *deserializeContact( Kopete::MetaContact *metaContact, const TQMap &serializedData, const TQMap &addressBookData ); AddContactPage *createAddContactWidget(TQWidget *parent, Kopete::Account *account); KopeteEditAccountWidget *createEditAccountWidget(Kopete::Account *account, TQWidget *parent); Kopete::Account *createNewAccount(const TQString &accountId); ICQ::OnlineStatusManager *statusManager(); const Kopete::ContactPropertyTmpl firstName; const Kopete::ContactPropertyTmpl lastName; const Kopete::ContactPropertyTmpl awayMessage; const Kopete::ContactPropertyTmpl emailAddress; const Kopete::ContactPropertyTmpl ipAddress; const Kopete::ContactPropertyTmpl clientFeatures; const Kopete::ContactPropertyTmpl buddyIconHash; const Kopete::ContactPropertyTmpl contactEncoding; const TQMap &genders() { return mGenders; } const TQMap &countries() { return mCountries; } const TQMap &languages() { return mLanguages; } const TQMap &encodings() { return mEncodings; } const TQMap &maritals() { return mMarital; } const TQMap &interests() { return mInterests; } void fillComboFromTable( TQComboBox*, const TQMap& ); void setComboFromTable( TQComboBox*, const TQMap&, int ); int getCodeForCombo( TQComboBox*, const TQMap& ); /* void fillTZCombo(TQComboBox *combo); void setTZComboValue(TQComboBox *combo, const char &tz); char getTZComboValue(TQComboBox *combo); */ private: void initGenders(); void initLang(); void initCountries(); void initEncodings(); void initMaritals(); void initInterests(); private: static ICQProtocol* protocolStatic_; ICQ::OnlineStatusManager* statusManager_; TQMap mGenders; TQMap mCountries; TQMap mLanguages; TQMap mEncodings; TQMap mMarital; TQMap mInterests; ICQProtocolHandler protohandler; }; #endif