4
Copyright (c) 2003 by Olivier Goffart <ogoffart @ kde.org>
6
Kopete (c) 2003 by the Kopete developers <kopete-devel@kde.org>
8
*************************************************************************
10
* This program is free software; you can redistribute it and/or modify *
11
* it under the terms of the GNU General Public License as published by *
12
* the Free Software Foundation; either version 2 of the License, or *
13
* (at your option) any later version. *
15
*************************************************************************
17
#ifndef MSNINVITATION_H
18
#define MSNINVITATION_H
22
#include "kopete_export.h"
27
* @author Olivier Goffart
29
* The invitation is the base class which handle an MSN invitation.
30
* The implemented class must to herits from QObject too.
31
* You can accept the invitation by catching @ref MSNProtocol::invitation() signals
32
* or create one and insert it to a kmm with @ref MSNChatSession::initInvitation()
33
* you can add action with @ref Kopete::Plugin::customChatActions()
35
class KOPETE_EXPORT MSNInvitation
40
* @param incoming say if it is an incoming invitation
41
* @param applicationID is the exadecimal id of the invitation
42
* @param applicationName is a i18n'ed string of the name of the application
44
MSNInvitation(bool incoming,const QString &applicationID , const QString &applicationName);
45
virtual ~MSNInvitation();
49
* it is a reject invitation because the invitation is not implemented
51
static QCString unimplemented(long unsigned int cookie);
54
* you can set manualy the cookie. note that a cookie is automatically generated when a new
55
* invitation is created, or in @ref parseInvitation
57
void setCookie( long unsigned int c ) { m_cookie = c; }
61
long unsigned int cookie() { return m_cookie; }
64
* @return true if it is an incommijng invitation
66
bool incoming() { return m_incoming; }
70
* reimplement this. this is the invitation string used in @ref MSNChatSession::initInvitation()
71
* the default implementation return the common begin.
72
* You can also set the state to Invited (the default implementation do that)
74
virtual QString invitationHead();
77
* This is the reject invitation string
78
* @param rejectcode is the code, it can be "REJECT" or "TIMEOUT"
80
QCString rejectMessage(const QString & rejectcode = "REJECT");
83
* reimplement this method. it is called when an invitation message with the invitation's cookie is received
84
* the default implementation parse the cookie, or the reject message
86
virtual void parseInvitation(const QString& invitation);
89
* return the qobject (this)
91
virtual QObject* object()=0;
94
* reimplement this as a signal, and emit it when the invitation has to be destroyed.
95
* don't delete the invitation yourself
97
virtual void done(MSNInvitation*)=0;
100
* This indiquate the state. it is going to be completed later
101
* - Nothing means than nothing has been done in the invitaiton (nothing has been sent/received)
102
* - Invited means than the invitaiton has been sent
104
enum State { Nothing=0 , Invited=1 };
106
* retrun the current state
110
* set the current State
112
void setState(State);
118
long unsigned int m_cookie;
119
QString m_applicationId;
120
QString m_applicationName;