~ubuntu-branches/ubuntu/karmic/psi/karmic

« back to all changes in this revision

Viewing changes to cutestuff/network/ndns.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-04-14 18:57:30 UTC
  • mfrom: (2.1.9 hardy)
  • Revision ID: james.westby@ubuntu.com-20080414185730-528re3zp0m2hdlhi
Tags: 0.11-8
* added CONFIG -= link_prl to .pro files and removed dependencies
  which are made unnecessary by this change
* Fix segfault when closing last chat tab with qt4.4
  (This is from upstream svn, rev. 1101) (Closes: Bug#476122)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * ndns.h - native DNS resolution
3
 
 * Copyright (C) 2001, 2002  Justin Karneges
4
 
 *
5
 
 * This library is free software; you can redistribute it and/or
6
 
 * modify it under the terms of the GNU Lesser General Public
7
 
 * License as published by the Free Software Foundation; either
8
 
 * version 2.1 of the License, or (at your option) any later version.
9
 
 *
10
 
 * This library is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 
 * Lesser General Public License for more details.
14
 
 *
15
 
 * You should have received a copy of the GNU Lesser General Public
16
 
 * License along with this library; if not, write to the Free Software
17
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
 
 *
19
 
 */
20
 
 
21
 
#ifndef CS_NDNS_H
22
 
#define CS_NDNS_H
23
 
 
24
 
#include<qobject.h>
25
 
#include<qcstring.h>
26
 
#include<qthread.h>
27
 
#include<qmutex.h>
28
 
#include<qhostaddress.h>
29
 
 
30
 
// CS_NAMESPACE_BEGIN
31
 
 
32
 
class NDnsWorker;
33
 
class NDnsManager;
34
 
 
35
 
class NDns : public QObject
36
 
{
37
 
        Q_OBJECT
38
 
public:
39
 
        NDns(QObject *parent=0);
40
 
        ~NDns();
41
 
 
42
 
        void resolve(const QString &);
43
 
        void stop();
44
 
        bool isBusy() const;
45
 
 
46
 
        uint result() const;
47
 
        QString resultString() const;
48
 
 
49
 
signals:
50
 
        void resultsReady();
51
 
 
52
 
private:
53
 
        QHostAddress addr;
54
 
 
55
 
        friend class NDnsManager;
56
 
        void finished(const QHostAddress &);
57
 
};
58
 
 
59
 
class NDnsManager : public QObject
60
 
{
61
 
        Q_OBJECT
62
 
public:
63
 
        ~NDnsManager();
64
 
        class Item;
65
 
 
66
 
//! \if _hide_doc_
67
 
protected:
68
 
        bool event(QEvent *);
69
 
//! \endif
70
 
 
71
 
private slots:
72
 
        void app_aboutToQuit();
73
 
 
74
 
private:
75
 
        class Private;
76
 
        Private *d;
77
 
 
78
 
        friend class NDns;
79
 
        NDnsManager();
80
 
        void resolve(NDns *self, const QString &name);
81
 
        void stop(NDns *self);
82
 
        bool isBusy(const NDns *self) const;
83
 
        void tryDestroy();
84
 
};
85
 
 
86
 
// CS_NAMESPACE_END
87
 
 
88
 
#endif