File: OverwriteDialog.h

package info (click to toggle)
lzma 24.08%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,472 kB
  • sloc: cpp: 78,089; ansic: 26,903; asm: 4,195; cs: 3,846; java: 3,077; makefile: 1,010; sh: 74
file content (89 lines) | stat: -rw-r--r-- 1,943 bytes parent folder | download | duplicates (8)
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
// OverwriteDialog.h

#ifndef ZIP7_INC_OVERWRITE_DIALOG_H
#define ZIP7_INC_OVERWRITE_DIALOG_H

#include "../../../Windows/Control/Dialog.h"

#include "DialogSize.h"
#include "OverwriteDialogRes.h"

namespace NOverwriteDialog
{
  struct CFileInfo
  {
    bool Size_IsDefined;
    bool Time_IsDefined;
    bool Is_FileSystemFile;
    UInt64 Size;
    FILETIME Time;
    UString Path;

    void SetTime(const FILETIME &t)
    {
      Time = t;
      Time_IsDefined = true;
    }
    
    void SetTime2(const FILETIME *t)
    {
      if (!t)
        Time_IsDefined = false;
      else
        SetTime(*t);
    }

    void SetSize(UInt64 size)
    {
      Size = size;
      Size_IsDefined = true;
    }

    void SetSize2(const UInt64 *size)
    {
      if (!size)
        Size_IsDefined = false;
      else
        SetSize(*size);
    }

    CFileInfo():
      Size_IsDefined(false),
      Time_IsDefined(false),
      Is_FileSystemFile(false)
      {}
  };
}

class COverwriteDialog: public NWindows::NControl::CModalDialog
{
#ifdef UNDER_CE
  bool _isBig;
#endif

  void SetItemIcon(unsigned iconID, HICON hIcon);
  void SetFileInfoControl(const NOverwriteDialog::CFileInfo &fileInfo, unsigned textID, unsigned iconID, unsigned iconID_2);
  virtual bool OnInit() Z7_override;
  virtual bool OnDestroy() Z7_override;
  virtual bool OnButtonClicked(unsigned buttonID, HWND buttonHWND) Z7_override;
  void ReduceString(UString &s);

public:
  bool ShowExtraButtons;
  bool DefaultButton_is_NO;
  NOverwriteDialog::CFileInfo OldFileInfo;
  NOverwriteDialog::CFileInfo NewFileInfo;

  COverwriteDialog(): ShowExtraButtons(true), DefaultButton_is_NO(false) {}

  INT_PTR Create(HWND parent = NULL)
  {
#ifdef UNDER_CE
    BIG_DIALOG_SIZE(280, 200);
    _isBig = isBig;
#endif
    return CModalDialog::Create(SIZED_DIALOG(IDD_OVERWRITE), parent);
  }
};

#endif