~ubuntu-branches/ubuntu/trusty/jreen/trusty

« back to all changes in this revision

Viewing changes to 3rdparty/icesupport/icetransport.h

  • Committer: Package Import Robot
  • Author(s): Prasad Murthy
  • Date: 2013-03-08 00:00:33 UTC
  • Revision ID: package-import@ubuntu.com-20130308000033-x8thp6syo1kkh63s
Tags: upstream-1.1.1
ImportĀ upstreamĀ versionĀ 1.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2010  Barracuda Networks, Inc.
 
3
 *
 
4
 * This library is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU Lesser General Public
 
6
 * License as published by the Free Software Foundation; either
 
7
 * version 2.1 of the License, or (at your option) any later version.
 
8
 *
 
9
 * This library is distributed in the hope that it will be useful,
 
10
 * but WITHANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
12
 * Lesser General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU Lesser General Public
 
15
 * License along with this library; if not, write to the Free Software
 
16
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 
17
 * 02110-1301  USA
 
18
 *
 
19
 */
 
20
 
 
21
#ifndef ICETRANSPORT_H
 
22
#define ICETRANSPORT_H
 
23
 
 
24
#include <QObject>
 
25
#include <QByteArray>
 
26
 
 
27
class QHostAddress;
 
28
 
 
29
namespace XMPP {
 
30
 
 
31
class IceTransport : public QObject
 
32
{
 
33
        Q_OBJECT
 
34
 
 
35
public:
 
36
        enum Error
 
37
        {
 
38
                ErrorGeneric,
 
39
                ErrorCustom
 
40
        };
 
41
 
 
42
        enum DebugLevel
 
43
        {
 
44
                DL_None,
 
45
                DL_Info,
 
46
                DL_Packet
 
47
        };
 
48
 
 
49
        IceTransport(QObject *parent = 0);
 
50
        ~IceTransport();
 
51
 
 
52
        virtual void stop() = 0;
 
53
 
 
54
        virtual bool hasPendingDatagrams(int path) const = 0;
 
55
        virtual QByteArray readDatagram(int path, QHostAddress *addr, int *port) = 0;
 
56
        virtual void writeDatagram(int path, const QByteArray &buf, const QHostAddress &addr, int port) = 0;
 
57
        virtual void addChannelPeer(const QHostAddress &addr, int port) = 0;
 
58
 
 
59
        virtual void setDebugLevel(DebugLevel level) = 0;
 
60
 
 
61
signals:
 
62
        void started();
 
63
        void stopped();
 
64
        void error(int e);
 
65
 
 
66
        void readyRead(int path);
 
67
        void datagramsWritten(int path, int count, const QHostAddress &addr, int port);
 
68
 
 
69
        // not DOR-SS/DS safe
 
70
        void debugLine(const QString &str);
 
71
};
 
72
 
 
73
}
 
74
 
 
75
#endif