/********************************************************************/
/* Copyright (c) 2019 System fugen G.K. and Yuzi Mizuno          */
/* All rights reserved.                                             */
/********************************************************************/
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000

#include "Undo/ActionBase.h"

class fugenDoc;

/// @class CDocAction Action.h "Undo/Action.h"
/// ドキュメント要素変更アクションを表現するクラス。
class CDocAction : public CActionBase
{
public:
	CDocAction(
		fugenDoc* actionTarget=0,
		bool autoNotify = true
	);
	virtual ~CDocAction(){}

	virtual void Do();
	virtual void Redo();
	virtual void Undo();

	///Get the action target.
	fugenDoc* actionTarget();

	///Set target.
	void set_target(fugenDoc* target);

protected:

	//Update the views. This will be invoked by CDocAction::update_all_views,
	//when DO, Undo, or Redo operations are invoked.
	virtual void view_update(ACTION_TYPE at){;};

	//update all view.
	void update_all_views(ACTION_TYPE at);
};
