~ubuntu-branches/ubuntu/saucy/kopete/saucy-proposed

« back to all changes in this revision

Viewing changes to protocols/yahoo/libkyahoo/stream.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2013-06-21 02:22:39 UTC
  • Revision ID: package-import@ubuntu.com-20130621022239-63l3zc8p0nf26pt6
Tags: upstream-4.10.80
ImportĀ upstreamĀ versionĀ 4.10.80

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    stream.h - Kopete Groupwise Protocol
 
3
 
 
4
    Copyright (c) 2004 Matt Rogers <matt.rogers@kdemail.net>
 
5
 
 
6
    Based on code copyright (c) 2004 SuSE Linux AG <http://www.suse.com>
 
7
    Based on Iris, Copyright (C) 2003  Justin Karneges <justin@affinix.com>
 
8
 
 
9
    Kopete (c) 2002-2004 by the Kopete developers <kopete-devel@kde.org>
 
10
 
 
11
    *************************************************************************
 
12
    *                                                                       *
 
13
    * This library is free software; you can redistribute it and/or         *
 
14
    * modify it under the terms of the GNU Lesser General Public            *
 
15
    * License as published by the Free Software Foundation; either          *
 
16
    * version 2 of the License, or (at your option) any later version.      *
 
17
    *                                                                       *
 
18
    *************************************************************************
 
19
*/
 
20
 
 
21
#include <qobject.h>
 
22
 
 
23
#ifndef YAHOO_STREAM_H
 
24
#define YAHOO_STREAM_H
 
25
 
 
26
class Transfer;
 
27
 
 
28
class Stream : public QObject
 
29
{
 
30
        Q_OBJECT
 
31
public:
 
32
        enum Error { ErrParse, ErrProtocol, ErrStream, ErrCustom = 10 };
 
33
        enum StreamCond
 
34
        {
 
35
                GenericStreamError,
 
36
                Conflict,
 
37
                ConnectionTimeout,
 
38
                InternalServerError,
 
39
                InvalidFrom,
 
40
/*#             InvalidXml,  // not required*/
 
41
                PolicyViolation,
 
42
                ResourceConstraint,
 
43
                SystemShutdown
 
44
        };
 
45
 
 
46
        Stream(QObject *parent=0);
 
47
        virtual ~Stream();
 
48
 
 
49
        virtual void close()=0;
 
50
        virtual int errorCondition() const=0;
 
51
        virtual QString errorText() const=0;
 
52
 
 
53
        /**
 
54
         * Are there any messages waiting to be read
 
55
         */
 
56
        virtual bool transfersAvailable() const = 0;    // adapt to messages
 
57
        /**
 
58
         * Read a message received from the server
 
59
         */
 
60
        virtual Transfer* read() = 0;
 
61
 
 
62
        /**
 
63
         * Send a message to the server
 
64
         */
 
65
        virtual void write( Transfer *request) = 0;
 
66
        
 
67
 
 
68
signals:
 
69
        void connectionClosed();
 
70
        void delayedCloseFinished();
 
71
        void readyRead();
 
72
//      void stanzaWritten();
 
73
        void error(int);
 
74
};
 
75
 
 
76
#endif