~ubuntu-branches/ubuntu/intrepid/gwenview/intrepid

« back to all changes in this revision

Viewing changes to src/fileopobject.h

  • Committer: Bazaar Package Importer
  • Author(s): Christopher Martin
  • Date: 2005-04-06 11:33:06 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050406113306-7zovl7z0io5bacpd
Tags: 1.2.0-1
* New upstream release.
  + Fixes crashes when using "Back" to navigate. (Closes: #301811)
* Enable KIPI support.
* Add a doc-base file for the handbook.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// vim: set tabstop=4 shiftwidth=4 noexpandtab
 
2
/*
 
3
Gwenview - A simple image viewer for KDE
 
4
Copyright 2000-2004 Aur�lien G�teau
 
5
 
 
6
This program is free software; you can redistribute it and/or
 
7
modify it under the terms of the GNU General Public License
 
8
as published by the Free Software Foundation; either version 2
 
9
of the License, or (at your option) any later version.
 
10
 
 
11
This program is distributed in the hope that it will be useful,
 
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
GNU General Public License for more details.
 
15
 
 
16
You should have received a copy of the GNU General Public License
 
17
along with this program; if not, write to the Free Software
 
18
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
19
 
 
20
*/
 
21
#ifndef FILEOPOBJECT_H
 
22
#define FILEOPOBJECT_H
 
23
 
 
24
// Qt includes
 
25
#include <qobject.h>
 
26
#include <qstring.h>
 
27
 
 
28
// KDE includes
 
29
#include <kio/job.h>
 
30
#include <kurl.h>
 
31
 
 
32
class QWidget;
 
33
 
 
34
 
 
35
/**
 
36
 * This class is a base class for wrappers to KIO slaves asynchronous
 
37
 * file operations. These classes handle all steps of a file operation :
 
38
 * - asking the user what to do with a file
 
39
 * - performing the operation
 
40
 * - showing result dialogs
 
41
 *
 
42
 * All these classes are used by the @FileOperation namespace-like class
 
43
 */
 
44
class FileOpObject : public QObject {
 
45
Q_OBJECT
 
46
public:
 
47
        FileOpObject(const KURL&,QWidget* parent=0L);
 
48
        FileOpObject(const KURL::List&,QWidget* parent=0L);
 
49
        virtual void operator()()=0;
 
50
 
 
51
signals:
 
52
        void success();
 
53
 
 
54
protected slots:
 
55
        virtual void slotResult(KIO::Job*);
 
56
 
 
57
protected:
 
58
        QWidget* mParent;
 
59
        KURL::List mURLList;
 
60
};
 
61
 
 
62
 
 
63
class FileOpCopyToObject : public FileOpObject {
 
64
Q_OBJECT
 
65
public:
 
66
        FileOpCopyToObject(const KURL& url,QWidget* parent=0L) : FileOpObject(url,parent) {}
 
67
        FileOpCopyToObject(const KURL::List& urlList,QWidget* parent=0L) : FileOpObject(urlList,parent) {}
 
68
        void operator()();
 
69
};
 
70
 
 
71
 
 
72
class FileOpMoveToObject : public FileOpObject {
 
73
Q_OBJECT
 
74
public:
 
75
        FileOpMoveToObject(const KURL& url,QWidget* parent=0L) : FileOpObject(url,parent) {}
 
76
        FileOpMoveToObject(const KURL::List& urlList,QWidget* parent=0L) : FileOpObject(urlList,parent) {}
 
77
        void operator()();
 
78
};
 
79
 
 
80
 
 
81
class FileOpTrashObject : public FileOpObject {
 
82
Q_OBJECT
 
83
public:
 
84
        FileOpTrashObject(const KURL& url,QWidget* parent=0L) : FileOpObject(url,parent) {}
 
85
        FileOpTrashObject(const KURL::List& urlList,QWidget* parent=0L) : FileOpObject(urlList,parent) {}
 
86
        void operator()();
 
87
};
 
88
 
 
89
 
 
90
class FileOpRealDeleteObject : public FileOpObject {
 
91
Q_OBJECT
 
92
public:
 
93
        FileOpRealDeleteObject(const KURL& url,QWidget* parent=0L) : FileOpObject(url,parent) {}
 
94
        FileOpRealDeleteObject(const KURL::List& urlList,QWidget* parent=0L) : FileOpObject(urlList,parent) {}
 
95
        void operator()();
 
96
};
 
97
 
 
98
 
 
99
class FileOpRenameObject : public FileOpObject {
 
100
Q_OBJECT
 
101
public:
 
102
        FileOpRenameObject(const KURL& url,QWidget* parent=0L) : FileOpObject(url,parent) {}
 
103
        void operator()();
 
104
 
 
105
signals:
 
106
        void renamed(const QString& newName);
 
107
 
 
108
protected slots:
 
109
        virtual void slotResult(KIO::Job*);
 
110
 
 
111
private:
 
112
        QString mNewFilename;
 
113
};
 
114
 
 
115
 
 
116
#endif