SVN_SILENT made messages (.desktop file)
[kdeadmin.git] / kdat / BackupProfile.h
bloba3b6503419ee28c917abaca2abfdebf7c1749fa8
1 // KDat - a tar-based DAT archiver
2 // Copyright (C) 1998-2000 Sean Vyain, svyain@mail.tds.net
3 // Copyright (C) 2001-2002 Lawrence Widman, kdat@cardiothink.com
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef _BackupProfile_h_
20 #define _BackupProfile_h_
23 #include <q3strlist.h>
25 /**
26 * @short This class stores all the information necessary to perform a backup.
28 class BackupProfile {
29 QString _name;
30 QString _lastSavedName;
31 QString _archiveName;
32 QString _workingDirectory;
33 QStringList _relativeFiles;
34 QStringList _absoluteFiles;
35 bool _oneFilesystem;
36 bool _incremental;
37 QString _snapshotFile;
38 bool _removeSnapshot;
40 void calcRelativeFiles();
41 public:
42 /**
43 * Create a new backup profile.
45 BackupProfile();
47 /**
48 * Load the named backup profile from disk.
50 * @param name The name of the backup profile.
52 BackupProfile( const QString & name );
54 /**
55 * Destroy the backup profile.
57 ~BackupProfile();
59 /**
60 * Load the backup profile from disk.
62 void load();
64 /**
65 * Save the backup profile to disk. If the backup profile was renamed,
66 * the old backup profile will be removed.
68 void save();
70 /**
71 * Query the name of this backup profile.
73 * @return The name of this profile.
75 QString getName();
77 /**
78 * Query the name of the archive.
80 * @return The name of the new archive.
82 QString getArchiveName();
84 /**
85 * Query the working directory for the tar command.
87 * @return The working directory.
89 QString getWorkingDirectory();
91 /**
92 * Query the list of files to backup, relative to the working directory.
94 * @return The file list.
96 const QStringList& getRelativeFiles();
98 /**
99 * Query the list of files to backup, with their full paths.
101 * @return The file list.
103 const QStringList& getAbsoluteFiles();
106 * Query whether or not to cross filesystem boundaries when performing the
107 * backup.
109 * @return TRUE if the backup is restricted to a single filesystem, FALSE
110 * if the backup can cross filesystem boundaries.
112 bool isOneFilesystem();
115 * Query whether this is to be a GNU incremental backup.
117 * @return TRUE if incremental, otherwise FALSE.
119 bool isIncremental();
122 * Query the name of the snapshot file to use for an incremental backup.
124 * @return The name of the snapshot file.
126 QString getSnapshotFile();
129 * Query whether to remove the snapshot file before beginning an
130 * incremental backup. This has the effect of performing a full backup.
132 * @return TRUE if the snapshot file should be removed, otherwise FALSE.
134 bool getRemoveSnapshot();
137 * Set the name of this backup profile.
139 * @param name The name of this profile.
141 void setName( const QString & name );
144 * Set the name of the archive.
146 * @param archiveName The name of the new archive.
148 void setArchiveName( const QString & archiveName );
151 * Set the working directory for the tar command.
153 * @param workingDirectory The working directory.
155 void setWorkingDirectory( const QString & workingDirectory );
158 * Set the list of files to backup, with their full paths.
160 * @param files The file list.
162 void setAbsoluteFiles( const QStringList& files );
165 * Set whether or not to cross filesystem boundaries when performing the
166 * backup.
168 * @param oneFilesystem TRUE if the backup is restricted to a single
169 * filesystem, FALSE if the backup can cross
170 * filesystem boundaries.
172 void setOneFilesystem( bool oneFilesystem );
175 * Set whether this is to be a GNU incremental backup.
177 * @param incremental TRUE if incremental, otherwise FALSE.
179 void setIncremental( bool incremental );
182 * Set the name of the snapshot file to use for an incremental backup.
184 * @param snapshotFile The name of the snapshot file.
186 void setSnapshotFile( const QString & snapshotFile );
189 * Set whether to remove the snapshot file before beginning an
190 * incremental backup. This has the effect of performing a full backup.
192 * @param removeSnapshot TRUE if the snapshot file should be removed,
193 * otherwise FALSE.
195 void setRemoveSnapshot( bool removeSnapshot );
198 #endif