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

« back to all changes in this revision

Viewing changes to protocols/oscar/liboscar/tasks/icqtlvinforequesttask.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
  Kopete Oscar Protocol
 
3
  icqtlvinforequesttask.h - SNAC 0x15 parsing for full user info (TLV based)
 
4
 
 
5
  Copyright (c) 2007 Roman Jarosz <kedgedev@centrum.cz>
 
6
 
 
7
  Kopete (c) 2007 by the Kopete developers <kopete-devel@kde.org>
 
8
 
 
9
  *************************************************************************
 
10
  *                                                                       *
 
11
  * This library is free software; you can redistribute it and/or         *
 
12
  * modify it under the terms of the GNU Lesser General Public            *
 
13
  * License as published by the Free Software Foundation; either          *
 
14
  * version 2 of the License, or (at your option) any later version.      *
 
15
  *                                                                       *
 
16
  *************************************************************************
 
17
*/
 
18
 
 
19
#ifndef ICQTLVINFOREQUESTTASK_H
 
20
#define ICQTLVINFOREQUESTTASK_H
 
21
 
 
22
#include "icqtask.h"
 
23
#include "icquserinfo.h"
 
24
 
 
25
#include <QtCore/QMap>
 
26
 
 
27
class Transfer;
 
28
 
 
29
/**
 
30
 * @author Roman Jarosz
 
31
 */
 
32
class ICQTlvInfoRequestTask : public ICQTask
 
33
{
 
34
        Q_OBJECT
 
35
public:
 
36
        // Short TLVs: 60,85,150,160,170,180,190,200,250,260,280,390,400,410,420,430,440,450,460,470,480,490,500,505,510,520,530,540,550,560
 
37
        // Medium TLVs: Short + 50,70,85,100,110,120,130,140,300,310,320,330,340,350,360,370,380
 
38
        // Long TLVs: Medium + 270,290,291,292
 
39
 
 
40
        enum InfoType { Short = 0x0001, Medium = 0x0002, Long = 0x0003 };
 
41
        ICQTlvInfoRequestTask( Task* parent );
 
42
        ~ICQTlvInfoRequestTask();
 
43
 
 
44
        void setUser( const QString& contactId ) { m_userToRequestFor = contactId; }
 
45
        void setMetaInfoId( const QByteArray& id ) { m_metaInfoId = id; }
 
46
        void setType( InfoType type ) { m_type = type; }
 
47
 
 
48
        ICQFullInfo fullInfoFor( const QString& contact );
 
49
 
 
50
        virtual bool forMe( const Transfer* transfer ) const;
 
51
        virtual bool take( Transfer* transfer );
 
52
        virtual void onGo();
 
53
 
 
54
Q_SIGNALS:
 
55
        void receivedInfoFor( const QString& contact );
 
56
 
 
57
private:
 
58
        void parse( Oscar::DWORD seq, const QByteArray &data );
 
59
 
 
60
        QMap<QString, ICQFullInfo> m_fullInfoMap;
 
61
        QMap<int, QString> m_contactSequenceMap;
 
62
 
 
63
        QString m_userToRequestFor;
 
64
        InfoType m_type;
 
65
 
 
66
        QByteArray m_metaInfoId;
 
67
 
 
68
};
 
69
 
 
70
#endif
 
71