gloox
1.0.9
Main Page
Related Pages
Namespaces
Classes
Files
File List
src
jinglefiletransfer.h
1
/*
2
Copyright (c) 2013 by Jakob Schroeter <js@camaya.net>
3
This file is part of the gloox library. http://camaya.net/gloox
4
5
This software is distributed under a license. The full license
6
agreement can be found in the file LICENSE in this distribution.
7
This software may not be copied, modified, sold or distributed
8
other than expressed in the named license agreement.
9
10
This software is distributed without any warranty.
11
*/
12
13
14
#ifndef JINGLEFILETRANSFER_H__
15
#define JINGLEFILETRANSFER_H__
16
17
#include "jingleplugin.h"
18
#include "tag.h"
19
20
#include <string>
21
#include <list>
22
23
namespace
gloox
24
{
25
26
namespace
Jingle
27
{
28
37
class
FileTransfer
:
public
Plugin
38
{
39
public
:
40
44
enum
Type
45
{
46
Offer
,
47
Request
,
48
Checksum
,
49
Abort
,
50
Received
,
51
Invalid
52
};
53
57
struct
File
58
{
59
std::string
name
;
60
std::string
date
;
61
std::string
desc
;
62
std::string
hash
;
63
std::string
hash_algo
;
64
long
int
size
;
65
bool
range
;
66
long
int
offset
;
67
};
68
70
typedef
std::list<File>
FileList
;
71
78
FileTransfer
(
Type
type
,
const
FileList
&
files
);
79
84
FileTransfer
(
const
Tag
*
tag
= 0 );
85
89
virtual
~FileTransfer
() {}
90
95
Type
type
()
const
{
return
m_type; }
96
101
const
FileList
&
files
()
const
{
return
m_files; }
102
103
// reimplemented from Plugin
104
virtual
const
StringList
features
()
const
;
105
106
// reimplemented from Plugin
107
virtual
const
std::string&
filterString
()
const
;
108
109
// reimplemented from Plugin
110
virtual
Tag
*
tag
()
const
;
111
112
// reimplemented from Plugin
113
virtual
Plugin
*
newInstance
(
const
Tag
*
tag
)
const
;
114
115
// reimplemented from Plugin
116
virtual
Plugin
*
clone
()
const
117
{
118
return
new
FileTransfer
( *
this
);
119
}
120
121
private
:
122
123
void
parseFileList(
const
TagList
&
files
);
124
125
Type
m_type;
126
FileList
m_files;
127
128
};
129
130
}
131
132
}
133
134
#endif // JINGLEFILETRANSFER_H__
Generated on Tue Oct 15 2013 19:25:20 for gloox by
1.8.1.2