3 Copyright (C) 2001 The Kompany
4 2001-2003 Ilya Konstantinov <kde-devel@future.shiny.co.il>
5 2001-2007 Marcus Meissner <marcus@jet.franken.de>
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26 #include <kio/slavebase.h>
31 class KameraProtocol
: public KIO::SlaveBase
34 KameraProtocol(const QByteArray
&pool
, const QByteArray
&app
);
35 virtual ~KameraProtocol();
37 virtual void get(const KUrl
&url
);
38 virtual void stat(const KUrl
&url
);
39 virtual void del(const KUrl
&url
, bool isFile
);
40 virtual void setHost(const QString
& host
, quint16 port
, const QString
& user
, const QString
& pass
);
41 virtual void listDir(const KUrl
&url
);
42 virtual void special(const QByteArray
&data
);
44 CameraFile
*getFile() { return m_file
; }
45 int getFileSize() { return m_fileSize
; }
46 void setFileSize(int newfs
) { m_fileSize
= newfs
; }
50 CameraAbilities m_abilities
;
55 void reparseConfiguration(void);
56 bool openCamera(QString
& str
);
57 bool openCamera(void ) {
59 return openCamera(errstr
);
61 void closeCamera(void);
64 void statRegular(const KUrl
&url
);
65 void translateTextToUDS(KIO::UDSEntry
&udsEntry
, const QString
&info
, const char *txt
);
66 void translateFileToUDS(KIO::UDSEntry
&udsEntry
, const CameraFileInfo
&info
, QString name
);
67 void translateDirectoryToUDS(KIO::UDSEntry
&udsEntry
, const QString
&dirname
);
68 bool cameraSupportsPreview(void);
69 bool cameraSupportsDel(void);
70 bool cameraSupportsPut(void);
71 int readCameraFolder(const QString
&folder
, CameraList
*dirList
, CameraList
*fileList
);
78 bool actiondone
, cameraopen
;