1 /* copyorder.hh
2  * This file belongs to Worker, a file manager for UN*X/X11.
3  * Copyright (C) 2013-2017 Ralf Hoffmann.
4  * You can contact me at: ralf@boomerangsworld.de
5  *   or http://www.boomerangsworld.de/worker
6  *
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.
11  *
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.
16  *
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 St, Fifth Floor, Boston, MA  02110-1301  USA
20  */
21 
22 #ifndef COPYORDER_HH
23 #define COPYORDER_HH
24 
25 #include "wdefines.h"
26 #include <list>
27 #include <string>
28 
29 #include "copy_parameters.hh"
30 
31 class NM_specialsourceExt;
32 class CopyOpWin;
33 
34 struct copyorder {
35     copyorder();
36     ~copyorder();
37 
38     std::string destdir;
39     enum { COPY_ALLENTRIES, COPY_ONLYACTIVE, COPY_SPECIAL } source;
40     std::list<NM_specialsourceExt*> sources;
41     // modes:
42     bool move; // true = move, false = copy
43     bool follow_symlinks;
44     bool do_rename;
45     bool preserve_attr;
46     bool vdir_preserve_dir_structure;
47     enum { COPY_OVERWRITE_NORMAL, COPY_OVERWRITE_ALWAYS, COPY_OVERWRITE_NEVER } overwrite;
48     /* _NORMAL: Request what to do
49        _ALWAYS: overwrite without request
50        _NEVER: no overwriting */
51 
52     enum { COPY_ADJUST_SYMLINK_NEVER,
53            COPY_ADJUST_SYMLINK_OUTSIDE,
54            COPY_ADJUST_SYMLINK_ALWAYS
55     } adjust_relative_symlinks;
56 
57     CopyParams::EnsureFilePermissions ensure_file_permissions;
58 
59     CopyOpWin *cowin;
60 
61     int error;  // for returning an error
62     bool ignoreLosedAttr;  // true when the user don't want to get a requester
63     // when SUID/SGID bit couldn't be restored
64 };
65 
66 #endif
67