1 /* Copyright (c) Mark Harmstone 2016-17 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 #pragma once 19 20 #include <windows.h> 21 #ifndef __REACTOS__ 22 #include "../btrfsioctl.h" 23 #else 24 #include "btrfsioctl.h" 25 #endif 26 27 class BtrfsBalance { 28 public: 29 BtrfsBalance(WCHAR* drive, BOOL RemoveDevice = FALSE, BOOL ShrinkDevice = FALSE) { 30 removing = FALSE; 31 devices = NULL; 32 called_from_RemoveDevice = RemoveDevice; 33 called_from_ShrinkDevice = ShrinkDevice; 34 wcscpy(fn, drive); 35 } 36 37 void ShowBalance(HWND hwndDlg); 38 INT_PTR CALLBACK BalanceDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); 39 INT_PTR CALLBACK BalanceOptsDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); 40 41 private: 42 void ShowBalanceOptions(HWND hwndDlg, UINT8 type); 43 void SaveBalanceOpts(HWND hwndDlg); 44 void StartBalance(HWND hwndDlg); 45 void RefreshBalanceDlg(HWND hwndDlg, BOOL first); 46 void PauseBalance(HWND hwndDlg); 47 void StopBalance(HWND hwndDlg); 48 49 UINT32 balance_status; 50 btrfs_balance_opts data_opts, metadata_opts, system_opts; 51 UINT8 opts_type; 52 btrfs_query_balance bqb; 53 BOOL cancelling; 54 BOOL removing; 55 BOOL shrinking; 56 WCHAR fn[MAX_PATH]; 57 btrfs_device* devices; 58 BOOL readonly; 59 BOOL called_from_RemoveDevice, called_from_ShrinkDevice; 60 }; 61