1 // OverwriteDialog.h
2 
3 #ifndef __OVERWRITE_DIALOG_H
4 #define __OVERWRITE_DIALOG_H
5 
6 #include "../../../Windows/Control/Dialog.h"
7 
8 #include "DialogSize.h"
9 #include "OverwriteDialogRes.h"
10 
11 namespace NOverwriteDialog
12 {
13   struct CFileInfo
14   {
15     bool SizeIsDefined;
16     bool TimeIsDefined;
17     UInt64 Size;
18     FILETIME Time;
19     UString Name;
20 
SetTimeCFileInfo21     void SetTime(const FILETIME *t)
22     {
23       if (t == 0)
24         TimeIsDefined = false;
25       else
26       {
27         TimeIsDefined = true;
28         Time = *t;
29       }
30     }
SetSizeCFileInfo31     void SetSize(const UInt64 *size)
32     {
33       if (size == 0)
34         SizeIsDefined = false;
35       else
36       {
37         SizeIsDefined = true;
38         Size = *size;
39       }
40     }
41   };
42 }
43 
44 class COverwriteDialog: public NWindows::NControl::CModalDialog
45 {
46   bool _isBig;
47 
48   void SetFileInfoControl(int textID, int iconID, const NOverwriteDialog::CFileInfo &fileInfo);
49   virtual bool OnInit();
50   bool OnButtonClicked(int buttonID, HWND buttonHWND);
51   void ReduceString(UString &s);
52 
53 public:
54   INT_PTR Create(HWND parent = 0)
55   {
56     BIG_DIALOG_SIZE(280, 200);
57     #ifdef UNDER_CE
58     _isBig = isBig;
59     #else
60     _isBig = true;
61     #endif
62     return CModalDialog::Create(SIZED_DIALOG(IDD_OVERWRITE), parent);
63   }
64 
65   NOverwriteDialog::CFileInfo OldFileInfo;
66   NOverwriteDialog::CFileInfo NewFileInfo;
67 };
68 
69 #endif
70