1370b324cSopenharmony_ci// UpdateProduce.h
2370b324cSopenharmony_ci
3370b324cSopenharmony_ci#ifndef ZIP7_INC_UPDATE_PRODUCE_H
4370b324cSopenharmony_ci#define ZIP7_INC_UPDATE_PRODUCE_H
5370b324cSopenharmony_ci
6370b324cSopenharmony_ci#include "UpdatePair.h"
7370b324cSopenharmony_ci
8370b324cSopenharmony_cistruct CUpdatePair2
9370b324cSopenharmony_ci{
10370b324cSopenharmony_ci  bool NewData;
11370b324cSopenharmony_ci  bool NewProps;
12370b324cSopenharmony_ci  bool UseArcProps; // if (UseArcProps && NewProps), we want to change only some properties.
13370b324cSopenharmony_ci  bool IsAnti; // if (!IsAnti) we use other ways to detect Anti status
14370b324cSopenharmony_ci
15370b324cSopenharmony_ci  int DirIndex;
16370b324cSopenharmony_ci  int ArcIndex;
17370b324cSopenharmony_ci  int NewNameIndex;
18370b324cSopenharmony_ci
19370b324cSopenharmony_ci  bool IsMainRenameItem;
20370b324cSopenharmony_ci  bool IsSameTime;
21370b324cSopenharmony_ci
22370b324cSopenharmony_ci  void SetAs_NoChangeArcItem(unsigned arcIndex) // int
23370b324cSopenharmony_ci  {
24370b324cSopenharmony_ci    NewData = NewProps = false;
25370b324cSopenharmony_ci    UseArcProps = true;
26370b324cSopenharmony_ci    IsAnti = false;
27370b324cSopenharmony_ci    ArcIndex = (int)arcIndex;
28370b324cSopenharmony_ci  }
29370b324cSopenharmony_ci
30370b324cSopenharmony_ci  bool ExistOnDisk() const { return DirIndex != -1; }
31370b324cSopenharmony_ci  bool ExistInArchive() const { return ArcIndex != -1; }
32370b324cSopenharmony_ci
33370b324cSopenharmony_ci  CUpdatePair2():
34370b324cSopenharmony_ci      NewData(false),
35370b324cSopenharmony_ci      NewProps(false),
36370b324cSopenharmony_ci      UseArcProps(false),
37370b324cSopenharmony_ci      IsAnti(false),
38370b324cSopenharmony_ci      DirIndex(-1),
39370b324cSopenharmony_ci      ArcIndex(-1),
40370b324cSopenharmony_ci      NewNameIndex(-1),
41370b324cSopenharmony_ci      IsMainRenameItem(false),
42370b324cSopenharmony_ci      IsSameTime(false)
43370b324cSopenharmony_ci      {}
44370b324cSopenharmony_ci};
45370b324cSopenharmony_ci
46370b324cSopenharmony_ciZ7_PURE_INTERFACES_BEGIN
47370b324cSopenharmony_ci
48370b324cSopenharmony_ciDECLARE_INTERFACE(IUpdateProduceCallback)
49370b324cSopenharmony_ci{
50370b324cSopenharmony_ci  virtual HRESULT ShowDeleteFile(unsigned arcIndex) = 0;
51370b324cSopenharmony_ci};
52370b324cSopenharmony_ciZ7_PURE_INTERFACES_END
53370b324cSopenharmony_ci
54370b324cSopenharmony_civoid UpdateProduce(
55370b324cSopenharmony_ci    const CRecordVector<CUpdatePair> &updatePairs,
56370b324cSopenharmony_ci    const NUpdateArchive::CActionSet &actionSet,
57370b324cSopenharmony_ci    CRecordVector<CUpdatePair2> &operationChain,
58370b324cSopenharmony_ci    IUpdateProduceCallback *callback);
59370b324cSopenharmony_ci
60370b324cSopenharmony_ci#endif
61