X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=Src%2FFileActionScript.h;h=3912f58fb5f1cf05dfc9bee7865d016eaf4747c8;hb=d8b3c9e480e9b6d523947c19f78e4b51b4e157e2;hp=08a3e230206cb02fe06c0057a79cefec972c4190;hpb=3c782edde3b862a16ae7ea49f5b41876a8b3802d;p=winmerge-jp%2Fwinmerge-jp.git diff --git a/Src/FileActionScript.h b/Src/FileActionScript.h index 08a3e2302..3912f58fb 100644 --- a/Src/FileActionScript.h +++ b/Src/FileActionScript.h @@ -1,19 +1,4 @@ -///////////////////////////////////////////////////////////////////////////// -// License (GPLv2+): -// This program is free software; you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation; either version 2 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, but -// WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -///////////////////////////////////////////////////////////////////////////// +// SPDX-License-Identifier: GPL-2.0-or-later /** * @file FileActionScript.h * @@ -61,7 +46,7 @@ struct FileAction String src; /**< Source for action */ String dest; /**< Destination action */ - bool dirflag; /**< Is it directory? (TRUE means directory) */ + bool dirflag; /**< Is it directory? (`true` means directory) */ ACT_TYPE atype; /**< Action's type */ }; @@ -110,8 +95,8 @@ public: ~FileActionScript(); void SetParentWindow(HWND hWnd); - void UseRecycleBin(BOOL bUseRecycleBin); - BOOL Run(); + void UseRecycleBin(bool bUseRecycleBin); + bool Run(); // Manipulate the FileActionList size_t GetActionItemCount() const; @@ -130,6 +115,8 @@ public: */ FileActionItem GetHeadActionItem() const { return m_actions[0]; } + bool IsCanceled() const { return m_bCanceled; } + String m_destBase; /**< Base destination path for some operations */ protected: @@ -139,13 +126,42 @@ protected: private: std::vector m_actions; /**< List of all actions for this script. */ std::unique_ptr m_pCopyOperations; /**< Copy operations. */ - BOOL m_bHasCopyOperations; /**< flag if we've put anything into m_pCopyOperations */ + bool m_bHasCopyOperations; /**< flag if we've put anything into m_pCopyOperations */ std::unique_ptr m_pMoveOperations; /**< Move operations. */ - BOOL m_bHasMoveOperations; /**< flag if we've put anything into m_pMoveOperations */ + bool m_bHasMoveOperations; /**< flag if we've put anything into m_pMoveOperations */ std::unique_ptr m_pRenameOperations; /**< Rename operations. */ - BOOL m_bHasRenameOperations; /**< flag if we've put anything into m_pRenameOperations */ + bool m_bHasRenameOperations; /**< flag if we've put anything into m_pRenameOperations */ std::unique_ptr m_pDelOperations; /**< Delete operations. */ - BOOL m_bHasDelOperations; /**< flag if we've put anything into m_pDelOperations */ - BOOL m_bUseRecycleBin; /**< Use recycle bin for script actions? */ + bool m_bHasDelOperations; /**< flag if we've put anything into m_pDelOperations */ + bool m_bUseRecycleBin; /**< Use recycle bin for script actions? */ HWND m_hParentWindow; /**< Parent window for showing messages */ + bool m_bCanceled; }; + +/** + * @brief Set parent window used for showing MessageBoxes. + * @param [in] hWnd Handle to parent window. + */ +inline void FileActionScript::SetParentWindow(HWND hWnd) +{ + m_hParentWindow = hWnd; +} + +/** + * @brief Does user want to move deleted files to Recycle Bin? + * @param [in] bUseRecycleBin If `true` deleted files are moved to Recycle Bin. + */ +inline void FileActionScript::UseRecycleBin(bool bUseRecycleBin) +{ + m_bUseRecycleBin = bUseRecycleBin; +} + +/** + * @brief Return amount of actions (copy, move, etc) in script. + * @return Amount of actions. + */ +inline size_t FileActionScript::GetActionItemCount() const +{ + return m_actions.size(); +} +