forked from JonathanBeck/kio_afc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kio_afc.h
70 lines (51 loc) · 2.12 KB
/
kio_afc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/***************************************************************************
* Copyright (C) 2010 by Jonathan Beck <[email protected]> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef __kio_afc_h__
#define __kio_afc_h__
#include <kio/global.h>
#include <kio/slavebase.h>
#include <QtCore/QObject>
#include <QtCore/QHash>
#include <QtCore/QString>
#include "afcdevice.h"
#include "afcpath.h"
#include <libimobiledevice/libimobiledevice.h>
class AfcProtocol : public QObject, public KIO::SlaveBase
{
Q_OBJECT
public:
AfcProtocol( const QByteArray &pool, const QByteArray &app);
virtual ~AfcProtocol();
void ProcessEvent(const idevice_event_t *event);
AfcPath checkURL( const KUrl& url );
virtual void stat( const KUrl& url );
virtual void get( const KUrl& url );
virtual void put( const KUrl& url, int _mode,
KIO::JobFlags _flags );
virtual void rename( const KUrl &src, const KUrl &dest,
KIO::JobFlags flags );
virtual void symlink( const QString &target, const KUrl &dest,
KIO::JobFlags flags );
virtual void listDir( const KUrl& url );
virtual void mkdir( const KUrl& url, int permissions );
virtual void setModificationTime( const KUrl& url, const QDateTime& mtime );
virtual void del( const KUrl& url, bool isfile);
virtual void open( const KUrl &url, QIODevice::OpenMode mode );
virtual void read( KIO::filesize_t size );
virtual void write( const QByteArray &data );
virtual void seek( KIO::filesize_t offset );
virtual void close();
//cached user and group
static QString m_user;
static QString m_group;
private:
QHash<QString, AfcDevice*> _devices;
AfcDevice* _opened_device;
};
#endif