LayerAV_Layer
ObjectAVUndo

The AVUndo object represents an undo record for a document. An undo record allows a client to associate private data with a particular AVDoc for the purpose of undoing and redoing changes to the document. The client provides private data that encapsulates the changes, and an AVUndoHandler that contains callbacks which interpret the data when Undo and Redo commands are issued.

The AVUndo object itself has an AVUndoNew() method, and methods such as AVUndoGetData() and AVUndoSetData() for getting and setting properties. However, you initiate and control an undo or redo operation from the document (which you can obtain with AVUndoGetAVDoc()), using methods such as AVDocBeginUndoOperation(), AVDocEndUndoOperation(), and AVDocClearUndos().



Typedef Summary
 Typedef
 AVUndo
An opaque data type to be used with AVUndo APIs.
 AVUndoHandler
 AVUndoHandlerData
Private data for use by callbacks in the AVUndoHandler.
 AVUndoHandlerRec
Structure Summary
 Structure
 _t_AVUndoHandler
Contains a callback procedure for an AVUndo record that performs the undo and redo operations.
Callback Summary
 Callback
 AVUndoBeginEndProc
A callback type for AVUndoHandler. The beginUndoRedo procedure is called when the user initiates an Undo or Redo command and the AVUndoVerifyProc() returns true. The endUndoRedo procedure is called when execution of the operation is complete. Use callbacks of this type to notify the handler that an undo or redo operation is beginning or ending.
 AVUndoExecuteProc
A callback for AVUndoHandler. It is called when the user initiates an Undo or Redo command and the AVUndoVerifyProc returns true. Use this to perform the requested operation.
 AVUndoGetTitleProc
A callback for AVUndoHandler. It is called when the user initiates an Undo or Redo command and the AVUndoVerifyProc() returns true. Use this to return the user interface title string for the undo record.
 AVUndoReleaseProc
A callback for AVUndoHandler. It is called when the undo object is no longer needed. Use this to free any dynamic data that was associated with the object by the handler.
 AVUndoVerifyProc
A callback for AVUndoHandler. It is called when the user initiates an Undo or Redo command. Use this to verify that the undo record is still valid and the operation can be performed.
Method Summary
 Method
 
Gets the document whose undo list contains the undo record.
 
AVUndoHandlerData AVUndoGetData(AVUndo undo)
Gets the client-defined private data for the undo record, as specified upon creation. The handler data can be accessed by any of the callbacks listed in the AVUndoHandler.
 
const char* AVUndoGetType(AVUndo undo)
Gets the type of the undo record, as specified in the AVUndoHandler. The type is a client-defined string that can be matched for retrieval by AVDocGetTopUndo().
 
AVUndo AVUndoNew(AVDoc doc, AVUndoHandler handler, AVUndoHandlerData undoData)
Creates a new AVUndo record for a document's undo list.
 
void AVUndoSetData(AVUndo undo, AVUndoHandlerData handlerData)
Sets or replaces the client-defined private data for the undo record. The handler data can be accessed by any of the callbacks listed in the AVUndoHandler.

Typedefs Detail
AVUndo 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef struct _t_AVUndo* AVUndo;

An opaque data type to be used with AVUndo APIs.


File: AVExpT.h
Line: 9774
AVUndoHandler 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef _t_AVUndoHandler AVUndoHandler;

File: AVExpT.h
Line: 9887
AVUndoHandlerData 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef void* AVUndoHandlerData;

Private data for use by callbacks in the AVUndoHandler.

See Also


File: AVExpT.h
Line: 9783
AVUndoHandlerRec 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

typedef _t_AVUndoHandler AVUndoHandlerRec;

File: AVExpT.h
Line: 9887


Structure Detail
_t_AVUndoHandler
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

struct _t_AVUndoHandler {
 ASSize_t size; 
 
 const char* type; 
 
 AVUndoVerifyProc VerifyUndo; 
 
 AVUndoExecuteProc Undo; 
 
 AVUndoVerifyProc VerifyRedo; 
 
 AVUndoExecuteProc Redo; 
 
 AVUndoGetTitleProc GetUndoTitle; 
 
 AVUndoGetTitleProc GetRedoTitle; 
 
 AVUndoReleaseProc Release; 
 
 AVUndoBeginEndProc BeginUndoRedo; 
 
 AVUndoBeginEndProc EndUndoRedo; 
}

Contains a callback procedure for an AVUndo record that performs the undo and redo operations.

See Also


File: AVExpT.h
Line: 9862

Elements
size  

The size of the data structure. It must be set to sizeof(AVUndoHandlerRec).

 
type  

The type of the undo record. It can be any client-defined string. It can be matched for retrieval by AVDocGetTopUndo().

 
Callbacks Detail
AVUndoBeginEndProc 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

void (*AVUndoBeginEndProc)(AVDoc doc, ASBool bUndo)

A callback type for AVUndoHandler. The beginUndoRedo procedure is called when the user initiates an Undo or Redo command and the AVUndoVerifyProc() returns true. The endUndoRedo procedure is called when execution of the operation is complete. Use callbacks of this type to notify the handler that an undo or redo operation is beginning or ending.

These callbacks are optional. They can be used to allocate and deallocate memory for the operations, for example, or, when grouping undo records, to suspend user interface updates during the operation.

See Also


File: AVExpT.h
Line: 9850
AVUndoExecuteProc 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool (*AVUndoExecuteProc)(AVUndo undo)

A callback for AVUndoHandler. It is called when the user initiates an Undo or Redo command and the AVUndoVerifyProc returns true. Use this to perform the requested operation.

See Also


File: AVExpT.h
Line: 9815
AVUndoGetTitleProc 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

void (*AVUndoGetTitleProc)(AVUndo undo, ASText title)

A callback for AVUndoHandler. It is called when the user initiates an Undo or Redo command and the AVUndoVerifyProc() returns true. Use this to return the user interface title string for the undo record.

See Also


File: AVExpT.h
Line: 9828
AVUndoReleaseProc 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

void (*AVUndoReleaseProc)(AVUndo undo)

A callback for AVUndoHandler. It is called when the undo object is no longer needed. Use this to free any dynamic data that was associated with the object by the handler.

See Also


File: AVExpT.h
Line: 9805
AVUndoVerifyProc 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

ASBool (*AVUndoVerifyProc)(AVUndo undo)

A callback for AVUndoHandler. It is called when the user initiates an Undo or Redo command. Use this to verify that the undo record is still valid and the operation can be performed.

See Also


File: AVExpT.h
Line: 9795

Method Detail
AVUndoGetAVDoc()
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

AVDoc AVUndoGetAVDoc(AVUndo undo)

Gets the document whose undo list contains the undo record.

Parameters

undo — 

The undo record whose document is obtained.

Returns

The AVDoc object.

See Also

Since

PI_ACROVIEW_VERSION >= 0x00060000

File: AVProcs.h
Line: 8666
AVUndoGetData() 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

AVUndoHandlerData AVUndoGetData(AVUndo undo)

Gets the client-defined private data for the undo record, as specified upon creation. The handler data can be accessed by any of the callbacks listed in the AVUndoHandler.

Parameters

undo — 

The undo record whose handler data is obtained.

Returns

The handler data.

See Also

Since

PI_ACROVIEW_VERSION >= 0x00060000

File: AVProcs.h
Line: 8652
AVUndoGetType() 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

const char* AVUndoGetType(AVUndo undo)

Gets the type of the undo record, as specified in the AVUndoHandler. The type is a client-defined string that can be matched for retrieval by AVDocGetTopUndo().

Parameters

undo — 

The undo record whose type is obtained.

Returns

The client-defined type string for the undo record.

See Also

Since

PI_ACROVIEW_VERSION >= 0x00060000

File: AVProcs.h
Line: 8679
AVUndoNew() 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

AVUndo AVUndoNew(AVDoc doc, AVUndoHandler handler, AVUndoHandlerData undoData)

Creates a new AVUndo record for a document's undo list.

Parameters

doc — 

The document whose undo list contains this undo record.

 
handler — 

The handler structure containing callbacks that perform the undo and redo operations.

 
undoData — 

Any private data needed by the handler callbacks.

Returns

The new AVUndo object.

See Also

Since

PI_ACROVIEW_VERSION >= 0x00060000

File: AVProcs.h
Line: 8628
AVUndoSetData() 
Product availability: Acrobat, Reader
Platform availability: Macintosh, Windows, UNIX

Syntax

void AVUndoSetData(AVUndo undo, AVUndoHandlerData handlerData)

Sets or replaces the client-defined private data for the undo record. The handler data can be accessed by any of the callbacks listed in the AVUndoHandler.

Parameters

undo — 

The undo record whose handler data is set.

 
handlerData — 

The client-defined private data to be set in the undo record.

See Also

Since

PI_ACROVIEW_VERSION >= 0x00060000

File: AVProcs.h
Line: 8640