there is no moc file generated for this class
[kdegraphics.git] / kamera / kioslave / kamera.h
blob3b42ccb30ccece7f957ffff40bc8cc3ec70e6fcd
1 /*
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.
23 #ifndef __kamera_h__
24 #define __kamera_h__
26 #include <kio/slavebase.h>
27 #include <gphoto2.h>
29 class KConfig;
31 class KameraProtocol : public KIO::SlaveBase
33 public:
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; }
48 private:
49 Camera *m_camera;
50 CameraAbilities m_abilities;
51 KConfig *m_config;
53 GPContext *m_context;
55 void reparseConfiguration(void);
56 bool openCamera(QString& str);
57 bool openCamera(void ) {
58 QString errstr;
59 return openCamera(errstr);
61 void closeCamera(void);
63 void statRoot(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);
73 QString m_lockfile;
74 int idletime;
76 int m_fileSize;
77 CameraFile *m_file;
78 bool actiondone, cameraopen;
80 #endif