xref: /reactos/dll/shellext/shellbtrfs/send.h (revision c2c66aff)
1 /* Copyright (c) Mark Harmstone 2017
2  *
3  * This file is part of WinBtrfs.
4  *
5  * WinBtrfs is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public Licence as published by
7  * the Free Software Foundation, either version 3 of the Licence, or
8  * (at your option) any later version.
9  *
10  * WinBtrfs is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public Licence for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public Licence
16  * along with WinBtrfs.  If not, see <http://www.gnu.org/licenses/>. */
17 
18 #ifdef __REACTOS__
19 #include "btrfs.h"
20 #include <stdlib.h>
21 #else
22 #include "../btrfs.h"
23 #endif
24 #include <string>
25 #include <vector>
26 
27 class BtrfsSend {
28 public:
29     BtrfsSend() {
30         started = FALSE;
31         file[0] = 0;
32         dirh = INVALID_HANDLE_VALUE;
33         stream = INVALID_HANDLE_VALUE;
34         subvol = L"";
35         buf = NULL;
36         incremental = FALSE;
37     }
38 
39     ~BtrfsSend() {
40         if (buf)
41             free(buf);
42     }
43 
44     void Open(HWND hwnd, WCHAR* path);
45     INT_PTR SendDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
46     DWORD Thread();
47 
48 private:
49     void StartSend(HWND hwnd);
50     void Browse(HWND hwnd);
51     void BrowseParent(HWND hwnd);
52     void AddClone(HWND hwnd);
53     void RemoveClone(HWND hwnd);
54     void ShowSendError(UINT msg, ...);
55 
56     BOOL started;
57     BOOL incremental;
58     WCHAR file[MAX_PATH], closetext[255];
59     HANDLE thread, dirh, stream;
60     HWND hwnd;
61     std::wstring subvol;
62     char* buf;
63     std::vector <std::wstring> clones;
64 };
65