📄 flexhistory.hpp
字号:
// Borland C++ Builder
// Copyright (c) 1995, 1999 by Borland International
// All rights reserved
// (DO NOT EDIT: machine generated header) 'FlexHistory.pas' rev: 5.00
#ifndef FlexHistoryHPP
#define FlexHistoryHPP
#pragma delphiheader begin
#pragma option push -w-
#pragma option push -Vx
#include <Classes.hpp> // Pascal unit
#include <SysInit.hpp> // Pascal unit
#include <System.hpp> // Pascal unit
//-- user supplied -----------------------------------------------------------
namespace Flexhistory
{
//-- type declarations -------------------------------------------------------
typedef TMetaClass*THistoryActionClass;
#pragma option push -b-
enum THistoryState { hsIdle, hsRecord, hsUndo, hsRedo };
#pragma option pop
class DELPHICLASS THistoryAction;
class DELPHICLASS THistory;
typedef void __fastcall (__closure *THistoryGetActionCaptionEvent)(System::TObject* Sender, THistoryAction*
Action, const System::TObject* Source, AnsiString &Caption);
typedef void __fastcall (__closure *THistoryGetActionSourceEvent)(System::TObject* Sender, THistoryAction*
Action, System::TObject* &Source, bool &Enabled);
typedef void __fastcall (__closure *THistorySetActionSourceEvent)(System::TObject* Sender, THistoryAction*
Action, const System::TObject* Source);
class DELPHICLASS THistoryGroup;
typedef void __fastcall (__closure *THistoryIsRecordableEvent)(System::TObject* Sender, TMetaClass*
&ActionClass, System::TObject* &Source, THistoryGroup* Parent, bool &IsRecordable);
typedef void __fastcall (__closure *THistoryIsSameEvent)(System::TObject* Sender, THistoryAction* ExistedAction
, TMetaClass* NewActionClass, const System::TObject* NewSource, bool &IsSame);
class PASCALIMPLEMENTATION THistory : public System::TObject
{
typedef System::TObject inherited;
private:
System::TObject* FOwner;
bool FActive;
Classes::TList* FActions;
int FActionIndex;
int FDepth;
Classes::TNotifyEvent FOnChange;
THistoryGetActionCaptionEvent FOnGetActionCaption;
THistoryGetActionSourceEvent FOnGetActionSource;
THistorySetActionSourceEvent FOnSetActionSource;
THistoryIsRecordableEvent FOnIsRecordable;
THistoryIsSameEvent FOnIsSame;
bool __fastcall GetInProcess(void);
THistoryAction* __fastcall GetInProcessAction(void);
System::TObject* __fastcall GetInProcessSource(void);
bool __fastcall GetIsRecordable(void);
AnsiString __fastcall GetCaption(int Index);
THistoryAction* __fastcall GetAction(int Index);
int __fastcall GetActionCount(void);
void __fastcall SetDepth(const int Value);
void __fastcall SetActive(const bool Value);
protected:
THistoryGroup* FGroup;
int FGroupLevel;
int FDisableLevel;
THistoryState FState;
System::TObject* FInProcessSource;
virtual void __fastcall ChangeState(THistoryState NewState);
void __fastcall DeleteActions(int FromIndex, int ToIndex);
int __fastcall Scroll(void);
virtual void __fastcall DoChange(void);
virtual System::TObject* __fastcall DoGetActionSource(THistoryAction* Action, bool &Enabled);
virtual void __fastcall DoSetActionSource(THistoryAction* Action, const System::TObject* Source);
virtual AnsiString __fastcall DoGetActionCaption(THistoryAction* Action, const System::TObject* Source
);
virtual bool __fastcall DoIsRecordable(TMetaClass* &ActionClass, System::TObject* &Source, THistoryGroup*
Parent);
virtual bool __fastcall DoIsSame(THistoryAction* ExistedAction, TMetaClass* NewActionClass, System::TObject*
NewSource);
public:
__fastcall THistory(System::TObject* AOwner);
__fastcall virtual ~THistory(void);
/* class method */ static void __fastcall RegisterAction(TMetaClass* vmt, TMetaClass* Action
);
void __fastcall Clear(void);
int __fastcall IndexOf(THistoryAction* Action);
THistoryAction* __fastcall BeginAction(TMetaClass* ActionClass, System::TObject* Source, int ATag,
bool DoRecord);
bool __fastcall EndAction(void);
bool __fastcall CancelAction(void);
THistoryAction* __fastcall RecordAction(TMetaClass* ActionClass, const System::TObject* Source, int
ATag);
bool __fastcall EraseAction(void);
THistoryGroup* __fastcall OpenLastGroup(void);
virtual bool __fastcall Undo(void);
virtual bool __fastcall Redo(void);
void __fastcall DisableRecording(void);
bool __fastcall EnableRecording(void);
__property bool Active = {read=FActive, write=SetActive, default=0};
__property System::TObject* Owner = {read=FOwner};
__property THistoryState State = {read=FState, nodefault};
__property int Depth = {read=FDepth, write=SetDepth, default=100};
__property int DisableLevel = {read=FDisableLevel, nodefault};
__property int GroupLevel = {read=FGroupLevel, nodefault};
__property int ActionCount = {read=GetActionCount, nodefault};
__property THistoryAction* Actions[int Index] = {read=GetAction/*, default*/};
__property int ActionIndex = {read=FActionIndex, nodefault};
__property bool IsRecordable = {read=GetIsRecordable, nodefault};
__property bool InProcess = {read=GetInProcess, nodefault};
__property THistoryAction* InProcessAction = {read=GetInProcessAction};
__property System::TObject* InProcessSource = {read=GetInProcessSource};
__property AnsiString Captions[int Index] = {read=GetCaption};
__property THistoryGetActionCaptionEvent OnGetActionCaption = {read=FOnGetActionCaption, write=FOnGetActionCaption
};
__property THistoryGetActionSourceEvent OnGetActionSource = {read=FOnGetActionSource, write=FOnGetActionSource
};
__property THistorySetActionSourceEvent OnSetActionSource = {read=FOnSetActionSource, write=FOnSetActionSource
};
__property THistoryIsRecordableEvent OnIsRecordable = {read=FOnIsRecordable, write=FOnIsRecordable}
;
__property THistoryIsSameEvent OnIsSame = {read=FOnIsSame, write=FOnIsSame};
__property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
};
class PASCALIMPLEMENTATION THistoryAction : public System::TObject
{
typedef System::TObject inherited;
private:
THistory* FOwner;
THistoryGroup* FParent;
AnsiString FCaption;
int FTag;
protected:
THistoryState FState;
bool FDestroyAfterEnd;
virtual void __fastcall ChangeState(THistoryState NewState);
virtual bool __fastcall BeginState(THistoryState NewState);
virtual bool __fastcall EndState(void);
#pragma option push -w-inl
/* virtual class method */ virtual bool __fastcall DoIsRecordable(System::TObject* Source, THistoryGroup*
Parent) { return DoIsRecordable(__classid(THistoryAction), Source, Parent); }
#pragma option pop
/* class method */ static bool __fastcall DoIsRecordable(TMetaClass* vmt, System::TObject*
Source, THistoryGroup* Parent);
virtual bool __fastcall DoIsSame(TMetaClass* ActionClass, System::TObject* Source);
virtual void __fastcall DoActionCaption(System::TObject* Source, AnsiString &ACaption);
virtual void __fastcall DoBeginAction(System::TObject* Source);
virtual void __fastcall DoEndAction(void);
virtual void __fastcall DoRecordAction(System::TObject* Source) = 0 ;
virtual void __fastcall DoUndo(System::TObject* Source) = 0 ;
virtual void __fastcall DoRedo(System::TObject* Source) = 0 ;
public:
__fastcall virtual THistoryAction(THistory* AOwner, THistoryGroup* AParent);
__property THistory* Owner = {read=FOwner};
__property AnsiString Caption = {read=FCaption, write=FCaption};
__property THistoryState State = {read=FState, nodefault};
__property THistoryGroup* Parent = {read=FParent};
__property bool DestroyAfterEnd = {read=FDestroyAfterEnd, nodefault};
__property int Tag = {read=FTag, write=FTag, nodefault};
public:
#pragma option push -w-inl
/* TObject.Destroy */ inline __fastcall virtual ~THistoryAction(void) { }
#pragma option pop
};
class DELPHICLASS THistoryStreamAction;
class PASCALIMPLEMENTATION THistoryStreamAction : public THistoryAction
{
typedef THistoryAction inherited;
protected:
Classes::TStream* FUndoStream;
Classes::TStream* FRedoStream;
virtual bool __fastcall ProcessSource(Classes::TStream* Stream, System::TObject* Source, bool DoLoad
) = 0 ;
virtual void __fastcall DoRecordAction(System::TObject* Source);
virtual void __fastcall DoUndo(System::TObject* Source);
virtual void __fastcall DoRedo(System::TObject* Source);
public:
__fastcall virtual ~THistoryStreamAction(void);
__property Classes::TStream* UndoStream = {read=FUndoStream};
__property Classes::TStream* RedoStream = {read=FRedoStream};
public:
#pragma option push -w-inl
/* THistoryAction.Create */ inline __fastcall virtual THistoryStreamAction(THistory* AOwner, THistoryGroup*
AParent) : THistoryAction(AOwner, AParent) { }
#pragma option pop
};
typedef TMetaClass*THistoryGroupClass;
class PASCALIMPLEMENTATION THistoryGroup : public THistoryAction
{
typedef THistoryAction inherited;
private:
Classes::TList* FActions;
int FInProcessIndex;
System::TObject* FInProcessSource;
THistoryAction* __fastcall GetAction(int Index);
int __fastcall GetActionCount(void);
protected:
bool FDestroyIfEmpty;
void __fastcall Clear(void);
virtual void __fastcall DoEndAction(void);
virtual void __fastcall DoUndo(System::TObject* Source);
virtual void __fastcall DoRedo(System::TObject* Source);
virtual void __fastcall DoRecordAction(System::TObject* Source);
THistoryAction* __fastcall BeginAction(TMetaClass* ActionClass, const System::TObject* Source, int
ATag);
bool __fastcall EndAction(void);
bool __fastcall EraseAction(void);
public:
__fastcall virtual THistoryGroup(THistory* AOwner, THistoryGroup* AParent);
__fastcall virtual ~THistoryGroup(void);
__property int ActionCount = {read=GetActionCount, nodefault};
__property THistoryAction* Actions[int Index] = {read=GetAction/*, default*/};
__property int InProcessIndex = {read=FInProcessIndex, nodefault};
__property System::TObject* InProcessSource = {read=FInProcessSource};
};
//-- var, const, procedure ---------------------------------------------------
static const Shortint DefaultHistoryDepth = 0x64;
} /* namespace Flexhistory */
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
using namespace Flexhistory;
#endif
#pragma option pop // -w-
#pragma option pop // -Vx
#pragma delphiheader end.
//-- end unit ----------------------------------------------------------------
#endif // FlexHistory
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -