1 // case - file manager for N900
2 // Copyright (C) 2010 Lukas Hrazky <lukkash@email.cz>
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef FILEOPERATOR_H
19 #define FILEOPERATOR_H
22 #include <QHBoxLayout>
24 #include "progressbar.h"
25 #include "operationthread.h"
28 typedef QList<QPair<OperationThread*, ProgressBar*> > OperationList;
30 class FileOperator : public QWidget {
34 FileOperator(QWidget *parent = 0);
36 void deleteFiles(const QFileInfoList &files);
37 void copyFiles(const QFileInfoList &files, QDir &destination);
38 void moveFiles(const QFileInfoList &files, QDir &destination);
41 void showErrorPrompt(OperationThread* op,
42 const QString &message,
43 const QString &fileName,
45 void showOverwritePrompt(OperationThread* op,
46 const QString &fileName,
47 const bool dirOverDir);
48 void showInputFilenamePrompt(OperationThread* op,
49 const QFileInfo &fileName,
50 const bool dirOverDir);
52 void remove(OperationThread* op);
54 void togglePauseOperation(ProgressBar* bar);
55 void abortOperation(ProgressBar* bar);
58 void initOperation(OperationThread *thread, ProgressBar *bar);
59 ProgressBar *get(OperationThread *op) const;
60 OperationThread *get(ProgressBar *bar) const;
61 void addBarToLayout(ProgressBar *bar);
62 void removeBarFromLayout(ProgressBar *bar);
64 bool checkMaxOpsNumber();
67 QPixmap deleteIcon, inverseDeleteIcon, copyIcon, inverseCopyIcon, moveIcon, inverseMoveIcon;
68 QHBoxLayout *topRow, *bottomRow;
71 #endif // FILEOPERATOR_H