/*
  icqaccount.h  -  ICQ Account Class Header

  Copyright (c) 2002 by Chris TenHarmsel            <tenharmsel@staticmethod.net>
  Copyright (c) 2004 by Richard Smith               <kde@metafoo.co.uk>
  Kopete    (c) 2002-2004 by the Kopete developers  <kopete-devel@kde.org>

  *************************************************************************
  *                                                                       *
  * 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 ICQACCOUNT_H
#define ICQACCOUNT_H

#include "oscaraccount.h"
#include "oscarmyselfcontact.h"

#include "icqpresence.h"
#include "oscartypeclasses.h"

class KAction;
namespace Kopete { class AwayAction; }
class ICQProtocol;
class ICQAccount;
class ICQMyselfContact : public OscarMyselfContact
{
Q_OBJECT
public:
	ICQMyselfContact( ICQAccount *acct );
	void userInfoUpdated();
	
public slots:
	void receivedShortInfo( const QString& );
	void fetchShortInfo();
};


class ICQAccount : public OscarAccount
{
Q_OBJECT
	
public:
	ICQAccount( Kopete::Protocol *parent, QString accountID, const char *name = 0L );
	virtual ~ICQAccount();
	
	ICQProtocol *protocol();
	
	// Accessor method for the action menu
	virtual KActionMenu* actionMenu();
	
	/** Reimplementation from Kopete::Account */
	void setOnlineStatus( const Kopete::OnlineStatus&, const QString& ) {}
	
	virtual void setAway( bool away, const QString &awayReason );
	
	void connectWithPassword( const QString &password );

	void setUserProfile( const QString &profile );
	
protected:
	virtual OscarContact *createNewContact( const QString &contactId, Kopete::MetaContact *parentContact, const SSI& ssiItem );

	virtual QString sanitizedMessage( const Oscar::Message& message );

protected slots:	
	virtual void disconnected( DisconnectReason reason );
	

private:
	// helpers for actionMenu()
	KAction* statusAction( const QString &name, ICQ::Presence::Type type, const char *slot );
	Kopete::AwayAction* statusActionAway( const QString &name, ICQ::Presence::Type type, const char *slot );
	
	ICQ::Presence presence();
	
	void setInvisible( ICQ::Presence::Visibility );
	void setPresenceType( ICQ::Presence::Type, const QString &awayMessage = QString::null );
	void setPresenceTarget( const ICQ::Presence &presence );
	
	//const unsigned long fullStatus( const unsigned long plainStatus );
	
private slots:
	// FIXME: this is also declared in OscarAccount as a public non-virtual slot.
	//        one or the other should be removed.
	void slotGoOnline();
	void slotGoAway( const QString & );
	void slotGoNA( const QString & );
	void slotGoOCC( const QString & );
	void slotGoFFC( const QString & );
	void slotGoDND( const QString & );
	void slotGoOffline();
	
	void slotToggleInvisible();
	
private:
	bool mWebAware;
	bool mHideIP;
};

#endif
//kate: indent-mode csands;
