1// -*- Mode: c++-mode; c-basic-offset: 2; indent-tabs-mode: t; tab-width: 2; -*-
2//
3// Copyright (C) 2004 Grzegorz Jaskiewicz <gj at pointblue.com.pl>
4//
5// gadurichtextformat.cpp
6//
7// This program is free software; you can redistribute it and/or
8// modify it under the terms of the GNU General Public License
9// as published by the Free Software Foundation; either version 2
10// of the License, or (at your option) any later version.
11//
12// This program is distributed in the hope that it will be useful,
13// but WITHOUT ANY WARRANTY; without even the implied warranty of
14// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15// GNU General Public License for more details.
16//
17// You should have received a copy of the GNU General Public License
18// along with this program; if not, write to the Free Software
19// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20// 02110-1301, USA.
21
22
23#ifndef GADUDCC_H
24#define GADUDCC_H
25
26#include <qobject.h>
27#include <QMap>
28
29class QString;
30class gg_dcc;
31class GaduDCCTransaction;
32class GaduAccount;
33class GaduDCCServer;
34
35class GaduDCC: public QObject {
36 Q_OBJECT
37public:
38 GaduDCC( QObject* parent = 0 );
39 ~GaduDCC();
40 bool unregisterAccount();
41 bool registerAccount( GaduAccount* );
42 unsigned int listeingPort();
43 void unset();
44 void execute();
45 GaduAccount* account( unsigned int );
46
47 QMap<unsigned int,QString> requests;
48signals:
49 void dccConnect( GaduDCCTransaction* dccTransaction );
50
51private slots:
52 void slotIncoming( gg_dcc*, bool& );
53
54private:
55 void closeDCC();
56 bool unregisterAccount( unsigned int );
57
58 unsigned int accountId;
59
60 static GaduDCCServer* dccServer;
61
62 static volatile unsigned int referenceCount;
63};
64
65#endif
66