addtoarchive.h 2.04 KB
Newer Older
1
2
3
4
/*
 * ark -- archiver for the KDE project
 *
 * Copyright (C) 2008 Harald Hvaal <haraldhv (at@at) stud.ntnu.no>
5
 * Copyright (C) 2009 Raphael Kubo da Costa <kubito@gmail.com>
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 *
 * 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.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 */

#ifndef ADDTOARCHIVE_H
#define ADDTOARCHIVE_H

26
#include "kerfuffle_export.h"
27

28
29
#include <KJob>
#include <KUrl>
30

31
32
33
34
35
36
37
38
39
40
41
/**
 * Compresses all input files into an archive.
 *
 * This is a job class that creates a compressed archive
 * with all the given input files.
 *
 * It provides the functionality for the --add command-line
 * option, and does not need the GUI to be running.
 *
 * @author Harald Hvaal <haraldhv@stud.ntnu.no>
 */
42
namespace Kerfuffle
43
{
44
45
46
class KERFUFFLE_EXPORT AddToArchive : public KJob
{
    Q_OBJECT
47

48
49
50
public:
    AddToArchive(QObject *parent = 0);
    ~AddToArchive();
51

52
53
    bool showAddDialog();
    void setPreservePaths(bool value);
54
    void setChangeToFirstPath(bool value);
55

56
57
public slots:
    bool addInput(const KUrl& url);
58
59
60
    void setAutoFilenameSuffix(const QString& suffix);
    void setFilename(const KUrl& path);
    void setMimeType(const QString & mimeType);
61
    void start();
62

63
64
private slots:
    void slotFinished(KJob*);
65

66
67
68
69
70
71
72
73
74
private:
    QString m_filename;
    QString m_strippedPath;
    QString m_autoFilenameSuffix;
    QString m_firstPath;
    QString m_mimeType;
    QStringList m_inputs;
    bool m_changeToFirstPath;
};
75
}
76
77
78

#endif // ADDTOARCHIVE_H