-/////////////////////////////////////////////////////////////////////////////
-// 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
*
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 */
};
class FileActionScript
{
public:
- typedef
FileActionScript();
~FileActionScript();
void SetParentWindow(HWND hWnd);
- void UseRecycleBin(BOOL bUseRecycleBin);
- BOOL Run();
+ void UseRecycleBin(bool bUseRecycleBin);
+ bool Run();
// Manipulate the FileActionList
size_t GetActionItemCount() const;
*/
FileActionItem GetHeadActionItem() const { return m_actions[0]; }
+ bool IsCanceled() const { return m_bCanceled; }
+
String m_destBase; /**< Base destination path for some operations */
protected:
- int VCSCheckOut(const String &path, BOOL &bApplyToAll);
int CreateOperationsScripts();
bool RunOp(ShellFileOperations *oplist, bool & userCancelled);
private:
std::vector<FileActionItem> m_actions; /**< List of all actions for this script. */
std::unique_ptr<ShellFileOperations> 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<ShellFileOperations> 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<ShellFileOperations> 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<ShellFileOperations> 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();
+}
+