123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- /*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
- #pragma once
- #include <AudioControl.h>
- #include <AzCore/std/containers/map.h>
- #include <AzCore/std/containers/vector.h>
- #include <AzCore/std/smart_ptr/shared_ptr.h>
- #include <QATLControlsTreeModel.h>
- #include <Undo/IUndoObject.h>
- #include <Util/UndoUtil.h>
- #include <QAbstractItemModel>
- #include <QString>
- class QStandardItem;
- namespace AudioControls
- {
- typedef AZStd::vector<int> TPath;
- //-------------------------------------------------------------------------------------------//
- class IUndoControlOperation
- : public IUndoObject
- {
- protected:
- IUndoControlOperation() {}
- void AddStoredControl();
- void RemoveStoredControl();
- TPath m_path;
- CID m_id;
- AZStd::shared_ptr<CATLControl> m_pStoredControl;
- };
- //-------------------------------------------------------------------------------------------//
- class CUndoControlAdd
- : public IUndoControlOperation
- {
- public:
- explicit CUndoControlAdd(CID id);
- protected:
- int GetSize() override { return sizeof(*this); }
- void Undo(bool bUndo) override;
- void Redo() override;
- };
- //-------------------------------------------------------------------------------------------//
- class CUndoControlRemove
- : public IUndoControlOperation
- {
- public:
- explicit CUndoControlRemove(AZStd::shared_ptr<CATLControl>& pControl);
- protected:
- int GetSize() override { return sizeof(*this); }
- void Undo(bool bUndo) override;
- void Redo() override;
- };
- //-------------------------------------------------------------------------------------------//
- class IUndoFolderOperation
- : public IUndoObject
- {
- protected:
- explicit IUndoFolderOperation(QStandardItem* pItem);
- void AddFolderItem();
- void RemoveItem();
- TPath m_path;
- QString m_sName;
- };
- //-------------------------------------------------------------------------------------------//
- class CUndoFolderRemove
- : public IUndoFolderOperation
- {
- public:
- explicit CUndoFolderRemove(QStandardItem* pItem);
- protected:
- int GetSize() override { return sizeof(*this); }
- void Undo(bool bUndo) override;
- void Redo() override;
- };
- //-------------------------------------------------------------------------------------------//
- class CUndoFolderAdd
- : public IUndoFolderOperation
- {
- public:
- explicit CUndoFolderAdd(QStandardItem* pItem);
- protected:
- int GetSize() override { return sizeof(*this); }
- void Undo(bool bUndo) override;
- void Redo() override;
- };
- //-------------------------------------------------------------------------------------------//
- class CUndoFolderRename
- : public IUndoFolderOperation
- {
- public:
- explicit CUndoFolderRename(QStandardItem* pItem);
- protected:
- int GetSize() override { return sizeof(*this); }
- void Undo(bool bUndo) override;
- void Redo() override;
- void SwapNames();
- };
- //-------------------------------------------------------------------------------------------//
- class CUndoControlModified
- : public IUndoObject
- {
- public:
- explicit CUndoControlModified(CID id);
- protected:
- int GetSize() override { return sizeof(*this); }
- void SwapData();
- void Undo(bool bUndo) override;
- void Redo() override;
- CID m_id;
- AZStd::string m_name;
- AZStd::string m_scope;
- bool m_isAutoLoad;
- AZStd::vector<TConnectionPtr> m_connectedControls;
- };
- //-------------------------------------------------------------------------------------------//
- class CUndoItemMove
- : public IUndoObject
- {
- public:
- CUndoItemMove();
- protected:
- int GetSize() override { return sizeof(*this); }
- void Undo(bool bUndo) override;
- void Redo() override;
- void Copy(QStandardItem* pSource, QStandardItem* pDest);
- QATLTreeModel m_original;
- QATLTreeModel m_modified;
- bool bModifiedInitialised;
- };
- } //namespace AudioControls
|