summaryrefslogtreecommitdiff
path: root/StructEnumDefinition.h
blob: b275c365e4e98d94c648bd6d4378b9d9bbed53a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/** \file StructEnumDefinition.h
\brief Define the structure and enumeration used in ultracopier or into the plugin
\author alpha_one_x86
\licence GPL3, see the file COPYING */

#include <string>
#include <stdint.h>

#ifndef STRUCTDEF_H
#define STRUCTDEF_H

namespace Ultracopier {
/// \brief Define the mode of the copy window/request, if need be copy or move
enum CopyMode : uint8_t
{
    Copy=0x00,
    Move=0x01
};

enum RemainingTimeAlgo : uint8_t
{
    RemainingTimeAlgo_Traditional=0x00,
    RemainingTimeAlgo_Logarithmic=0x01
};

/// \brief Define the catching state, if the copy is totally catch of the explorer, partially or nothing
enum CatchState : uint8_t
{
    Uncaught=0x00,
    Semiuncaught=0x01,
    Caught=0x02
};

/// \brief Define the listening state
enum ListeningState : uint8_t
{
    NotListening=0x00,///< 0 listener is listening
    SemiListening=0x01,///< only part of listeners are listening
    FullListening=0x02///< all the listeners are listening
};

/// \brief Define the copy type, if folder, file or both
enum CopyType : uint8_t
{
    File			= 0x01,
    FileAndFolder		= 0x02
};

/// \brief transfer list operation, can define nothing, the import/export or both
enum TransferListOperation : uint8_t
{
    TransferListOperation_None		= 0x00,
    TransferListOperation_Import		= 0x01,
    TransferListOperation_Export		= 0x02,
    TransferListOperation_ImportExport	= TransferListOperation_Import | TransferListOperation_Export
};

enum EngineActionInProgress : uint8_t
{
    Idle			= 0x00,
    Listing			= 0x01,
    Copying			= 0x02,
    CopyingAndListing	= Listing | Copying
};

/// \brief the level of information
enum DebugLevel : uint8_t
{
    DebugLevel_Information=0x01,	///< Information like the compiler, OS, Qt version, all to know in witch condition ultracopier is launched
    DebugLevel_Critical=0x02,		///< Critical error, where it don't know how skip it
    DebugLevel_Warning=0x03,		///< Error, but have way to skip it
    DebugLevel_Notice=0x04		///< General information to debug, what file is open, what event is received, ...
};

enum SizeUnit : uint8_t
{
    SizeUnit_byte=0x00,
    SizeUnit_KiloByte=0x01,
    SizeUnit_MegaByte=0x02,
    SizeUnit_GigaByte=0x03,
    SizeUnit_TeraByte=0x04,
    SizeUnit_PetaByte=0x05,
    SizeUnit_ExaByte=0x06,
    SizeUnit_ZettaByte=0x07,
    SizeUnit_YottaByte=0x08
};

/// \brief structure for decompossed time
struct TimeDecomposition
{
    uint16_t second;
    uint16_t minute;
    uint16_t hour;
};

//////////////////////////// Return list //////////////////////////////
enum ActionTypeCopyList : uint8_t
{
    //playlist action
    MoveItem=0x00,
    RemoveItem=0x01,
    AddingItem=0x02,
    //Item action, to inform the stat of one entry
    PreOperation=0x03,
    Transfer=0x04,//need send PreOperation before
    PostOperation=0x05,
    CustomOperation=0x06 /// \note this need be used after preoperation and before postoperation
};

/// \brief structure for progression item
struct ProgressionItem
{
    uint64_t id;
    uint64_t currentRead;
    uint64_t currentWrite;
    uint64_t total;
};

/// \brief item to insert item in the interface
struct ItemOfCopyList
{
    uint64_t id;
    // if type == CustomOperation, then is the translated name of the operation
    std::string sourceFullPath;///< full path with file name: /foo/foo.txt
    std::string sourceFileName;///< full path with file name: foo.txt
    std::string destinationFullPath;///< full path with file name: /foo/foo.txt
    std::string destinationFileName;///< full path with file name: foo.txt
    // if type == CustomOperation, then 0 = without progression, 1 = with progression
    uint64_t size;
    CopyMode mode;
};

/// \brief The definition of no removing action on transfer list
struct ActionOnCopyList
{
    int position;
    // if type == MoveItem
    // if type == RemoveItem, then 0 = normal remove, 1 = skip
    int moveAt;
};

/// \brief action normal or due to interface query on copy list
struct ReturnActionOnCopyList
{
    ActionTypeCopyList type;
    ///< used if type == AddingItem || type == PreOperation (for interface without transfer list) || type == CustomOperation
    ItemOfCopyList addAction;
    ///< used if type != AddingItem
    ActionOnCopyList userAction;
};
}

#endif // STRUCTDEF_H