diff options
Diffstat (limited to 'kopete/protocols/gadu/gaducontact.h')
-rw-r--r-- | kopete/protocols/gadu/gaducontact.h | 119 |
1 files changed, 119 insertions, 0 deletions
diff --git a/kopete/protocols/gadu/gaducontact.h b/kopete/protocols/gadu/gaducontact.h new file mode 100644 index 00000000..9a51838e --- /dev/null +++ b/kopete/protocols/gadu/gaducontact.h @@ -0,0 +1,119 @@ +// -*- Mode: c++-mode; c-basic-offset: 2; indent-tabs-mode: t; tab-width: 2; -*- +// +// Copyright (C) 2003 Grzegorz Jaskiewicz <gj at pointblue.com.pl> +// Copyright (C) 2002-2003 Zack Rusin <zack@kde.org> +// +// gaducontact.h +// +// 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. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +// 02111-1307, USA. + +#ifndef GADUCONTACT_H +#define GADUCONTACT_H + +#include <qpoint.h> +#include <qhostaddress.h> + +#include "gaducontactlist.h" + +#include "kopeteaccount.h" +#include "kopetecontact.h" +#include "kopetemessage.h" + +#include <libgadu.h> + +class KAction; +class GaduAccount; +namespace Kopete { class Account; } +namespace Kopete { class ChatSession; } +class KGaduNotify; +class QString; +class QStringList; + +class GaduContact : public Kopete::Contact +{ + Q_OBJECT + +public: + GaduContact( unsigned int, const QString&, Kopete::Account*, Kopete::MetaContact* ); + + virtual bool isReachable(); + virtual void serialize( QMap<QString, QString>&, QMap<QString, QString>& ); + virtual QPtrList<KAction>* customContextMenuActions(); + virtual QString identityId() const; + + GaduContactsList::ContactLine* contactDetails(); + + // this one set's only: + // email, firstname, surname, phonenr, ignored, nickname + // uin is const for GaduContact, and displayname needs to be changed through metaContact + bool setContactDetails( const GaduContactsList::ContactLine* ); + + void setParentIdentity( const QString& ); + void setIgnored( bool ); + bool ignored(); + + static QString findBestContactName( const GaduContactsList::ContactLine* ); + void changedStatus( KGaduNotify* ); + + uin_t uin() const; + + QHostAddress& contactIp(); + unsigned short contactPort(); + +public slots: + void slotUserInfo(); + void deleteContact(); + void messageReceived( Kopete::Message& ); + void messageSend( Kopete::Message&, Kopete::ChatSession* ); + void messageAck(); + void slotShowPublicProfile(); + void slotEditContact(); + virtual void sendFile( const KURL &sourceURL = KURL(), + const QString &fileName = QString::null, uint fileSize = 0L ); + + +protected: + virtual Kopete::ChatSession* manager( Kopete::Contact::CanCreateFlags canCreate = Kopete::Contact::CanCreate ); + void initActions(); + +private: + const uin_t uin_; + bool ignored_; + + Kopete::ChatSession* msgManager_; + QString description_; + QString parentIdentity_; + GaduAccount* account_; + + KAction* actionSendMessage_; + KAction* actionInfo_; + KAction* actionRemove_; + + QPtrList<Kopete::Contact> thisContact_; + + + QHostAddress remote_ip; + unsigned int remote_port; + unsigned int version; + unsigned int image_size; + + +private slots: + void slotChatSessionDestroyed(); + +}; + +#endif |