|
|
#pragma once
|
|
|
#include "ActionItem.h"
|
|
|
|
|
|
namespace NAction
|
|
|
{
|
|
|
|
|
|
/**
|
|
|
* 组合 Action,支持将多个 Action 组装成一个,它还包含一些易用性包装,建议使用 CActionComboItem,它更加简单易用,容易理解
|
|
|
*/
|
|
|
class CActionListItem :
|
|
|
public CActionItem
|
|
|
{
|
|
|
public:
|
|
|
CActionListItem();
|
|
|
CActionListItem(CSigmaDoc * ppDoc, UINT actionType);
|
|
|
virtual ~CActionListItem(void);
|
|
|
|
|
|
std::string GetActionName() const override
|
|
|
{
|
|
|
return typeid(*this).name();
|
|
|
}
|
|
|
|
|
|
virtual void Undo(void);
|
|
|
virtual void Redo(void);
|
|
|
virtual void Finish(void);
|
|
|
|
|
|
void accept(CActionVisitor& visitor) override;
|
|
|
|
|
|
POSITION AddLayerAddItem(CLayer* pAddedLayer, const CString curLayerName);
|
|
|
|
|
|
POSITION AddChangeLayerItem(CPositionList& list, CString strOldLayer, CString strNewLayer);
|
|
|
|
|
|
friend class BlobSerializer;
|
|
|
|
|
|
protected:
|
|
|
CPtrList ActionList;
|
|
|
POSITION AddItem(CActionItem* pItem);
|
|
|
|
|
|
public:
|
|
|
void Clear();
|
|
|
int GetCount(void);
|
|
|
|
|
|
POSITION AddTailItem(CActionItem* pItem);
|
|
|
POSITION AddHeadItem(CActionItem* pItem);
|
|
|
|
|
|
POSITION AddAddItem(const CPositionList& AddList);
|
|
|
POSITION AddAddItem(COne* pOne);
|
|
|
POSITION AddDeleteItem(const CPositionList& DelList, BOOL bPerformOperation=FALSE);
|
|
|
POSITION AddDeleteItem(POSITION posElement);
|
|
|
/**
|
|
|
* 注意:曲线修改的 CActionModifiedItem 工作原理已经变为备份原始副本和新副本, 这个 api 已经无法正常工作,不要再使用它
|
|
|
*
|
|
|
* \param list
|
|
|
* \return
|
|
|
*/
|
|
|
POSITION AddModifiedItem(const CPositionList& list);
|
|
|
|
|
|
/**
|
|
|
* 注意:曲线修改的 CActionModifiedItem 工作原理已经变为备份原始副本和新副本, 这个 api 已经无法正常工作,不要再使用它
|
|
|
*
|
|
|
* \param posElement
|
|
|
* \param pOne
|
|
|
* \return
|
|
|
*/
|
|
|
POSITION AddModifiedItem(POSITION posElement, COne* pOne);
|
|
|
|
|
|
|
|
|
POSITION AddBackupItem(const CPositionList& bakList);
|
|
|
POSITION AddBackupItem(POSITION pos);
|
|
|
POSITION AddBackupItem(COne* pOne);
|
|
|
|
|
|
POSITION AddMarkAddItem(CXy* pxy);
|
|
|
POSITION AddMarkDeleteItem(CXy* pxy);
|
|
|
|
|
|
POSITION AddChangeNameItem(POSITION pos, CString oldName, CString newName);
|
|
|
};
|
|
|
|
|
|
};
|