1
// -*- Mode: c++-mode; c-basic-offset: 2; indent-tabs-mode: t; tab-width: 2; -*-
3
// Copyright (C) 2003-2004 Grzegorz Jaskiewicz <gj at pointblue.com.pl>
4
// Copyright (C) 2003 Zack Rusin <zack@kde.org>
8
// This program is free software; you can redistribute it and/or
9
// modify it under the terms of the GNU General Public License
10
// as published by the Free Software Foundation; either version 2
11
// of the License, or (at your option) any later version.
13
// This program is distributed in the hope that it will be useful,
14
// but WITHOUT ANY WARRANTY; without even the implied warranty of
15
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
// GNU General Public License for more details.
18
// You should have received a copy of the GNU General Public License
19
// along with this program; if not, write to the Free Software
20
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
26
#include "kopetepasswordedaccount.h"
27
#include "kopeteonlinestatus.h"
28
#include "kopetecontact.h"
30
#include "gaducontactlist.h"
31
#include "gadusession.h"
35
#include <qhostaddress.h>
39
#include <kfiledialog.h>
41
class GaduAccountPrivate;
44
namespace Kopete { class Protocol; }
45
namespace Kopete { class Message; }
46
namespace Kopete { class StatusMessage; }
50
class GaduAccount : public Kopete::PasswordedAccount
55
GaduAccount( Kopete::Protocol*, const QString& accountID );
58
void setAway( bool isAway, const QString& awayMessage = QString() );
59
virtual void fillActionMenu( KActionMenu *actionMenu );
60
virtual bool hasCustomStatusMenu() const;
61
void dccRequest( GaduContact* );
62
void sendFile( GaduContact* , QString& );
64
enum tlsConnection{ TLS_ifAvaliable = 0, TLS_only, TLS_no };
65
unsigned int getPersonalInformation();
66
bool publishPersonalInformation( ResLine& d );
70
void connectWithPassword(const QString &password);
71
void disconnect( DisconnectReason );
73
void setOnlineStatus( const Kopete::OnlineStatus& status , const Kopete::StatusMessage &reason = Kopete::StatusMessage(),
74
const OnlineStatusOptions& options = None );
75
void setStatusMessage( const Kopete::StatusMessage& statusMessage );
78
void changeStatus( const Kopete::OnlineStatus& status, const QString& descr = QString() );
79
void slotLogin( int status = GG_STATUS_AVAIL, const QString& dscr = QString() );
83
void slotGoInvisible();
85
void slotDescription();
86
void slotSearch( int uin = 0);
88
void removeContact( const GaduContact* );
90
void addNotify( uin_t );
91
void notify( uin_t*, int );
93
void sendMessage( uin_t recipient, const Kopete::Message& msg,
94
int msgClass = GG_CLASS_CHAT );
96
void error( const QString& title, const QString& message );
101
// those two functions are connected straight to gadusession ones
102
// with the same names/params. This was the easiest way to
103
// make this interface public
104
unsigned int pubDirSearch( ResLine& query, int ageFrom, int ageTo, bool onlyAlive );
105
void pubDirSearchClose();
108
tlsConnection useTls();
109
void setUseTls( tlsConnection );
117
void setIgnoreAnons( bool );
119
// export list on change
120
bool exportListOnChange();
121
void setExportListOnChange( bool );
123
// import list on startup
124
bool importListOnLogin();
125
void setImportListOnLogin( bool );
128
bool loadFriendsMode();
129
void saveFriendsMode( bool );
132
void pubDirSearchResult( const SearchResult&, unsigned int );
136
bool createContact( const QString& contactId,
137
Kopete::MetaContact* parentContact );
138
bool loadImportListOnLogin();
139
bool loadExportListOnChange();
140
void userListNotification(QString what);
146
void messageReceived( KGaduMessage* );
147
void ackReceived( unsigned int );
148
void contactStatusChanged( KGaduNotify* );
149
void slotSessionDisconnect( Kopete::Account::DisconnectReason );
151
void slotExportContactsList();
152
void slotExportContactsListToFile();
153
void slotImportContactsFromFile();
154
void slotImportContactsList();
155
void slotDeleteContactsList();
156
void slotFriendsMode();
158
void userlist( const QString& contacts );
159
GaduContactsList* userlist();
160
void slotUserlistSynch();
162
void connectionFailed( gg_failure_t failure );
163
void connectionSucceed( );
165
void slotChangePassword();
167
void slotCommandDone( const QString&, const QString& );
168
void slotCommandError( const QString&, const QString& );
170
void slotSearchResult( const SearchResult& result, unsigned int seq );
171
void userListExportDone();
172
void userListDeleteDone();
174
void slotIncomingDcc( unsigned int );
177
void initConnections();
181
void userlistChanged();
183
GaduAccountPrivate* p;