summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/oscar/aim/aimprotocol.h
blob: 16c8860aa295a13db3076b66754c820ba69e3ab9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
 oscarprotocol.h  -  Oscar Protocol Plugin

 Copyright (c) 2002 by Tom Linsky <[email protected]>
 Copyright (c) 2005 by Matt Rogers <[email protected]>
 Kopete    (c) 2002 by the Kopete developers  <[email protected]>

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

#include "kopeteprotocol.h"
#include "kopetecontactproperty.h"
#include "kopetemimetypehandler.h"
#include "kopeteonlinestatus.h"

#include <tqmap.h>

namespace Kopete
{
class OnlineStatus;
}

class AIMProtocolHandler : public Kopete::MimeTypeHandler
{
public:
	AIMProtocolHandler();
	void handleURL( const KURL & url ) const;
};

class AIMProtocol : public Kopete::Protocol
{
	Q_OBJECT

public:
	AIMProtocol( TQObject *parent, const char *name, const TQStringList &args );
	virtual ~AIMProtocol();
	/**
	 * Return the active instance of the protocol
	 * because it's a singleton, can only be used inside AIM classes, not in oscar lib
	 */
	static AIMProtocol *protocol();

	bool canSendOffline() const { return false; }

	virtual Kopete::Contact *deserializeContact( Kopete::MetaContact *metaContact,
	                                             const TQMap<TQString, TQString> &serializedData,
	                                             const TQMap<TQString, TQString> &addressBookData );
	
	AddContactPage*createAddContactWidget( TQWidget *parent, Kopete::Account *account );
	KopeteEditAccountWidget* createEditAccountWidget( Kopete::Account *account, TQWidget *parent );
	Kopete::Account* createNewAccount( const TQString &accountId );

	/**
	 * The set of online statuses that AIM contacts can have
	 */
	const Kopete::OnlineStatus statusOnline;
	const Kopete::OnlineStatus statusOffline;
	const Kopete::OnlineStatus statusAway;
	const Kopete::OnlineStatus statusWirelessOnline;
	const Kopete::OnlineStatus statusWirelessAway;
	const Kopete::OnlineStatus statusConnecting;

	const Kopete::ContactPropertyTmpl awayMessage;
	const Kopete::ContactPropertyTmpl clientFeatures;
	const Kopete::ContactPropertyTmpl clientProfile;
	const Kopete::ContactPropertyTmpl iconHash;

private:
	/** The active instance of oscarprotocol */
	static AIMProtocol *protocolStatic_;
	AIMProtocolHandler protohandler;
};

#endif 
//kate: tab-width 4; indent-mode csands;