Adobe.com
Contents Suites Classes Class Index Member Index

AIUndoSuite Struct Reference
[API Suite List]

This suites provides access to the Undo/Redo mechanism. More...

#include <AIUndo.h>

List of all members.

Public Attributes

AIAPI AIErr(* SetUndoTextUS )(const ai::UnicodeString &undoText, const ai::UnicodeString &redoText)
 Specifies the localizable text(Unicode String) for Undo and Redo menu items.
AIAPI AIErr(* UndoChanges )(void)
 Undoes changes in the current undo context.
AIAPI AIErr(* SetActionPaletteUndo )(void)
 Undoes changes in the Action palette.
AIAPI AIErr(* RevertAndForgetLastTransaction )(void)
 Undoes and forgets the last transaction.
AIAPI AIErr(* SetSilent )(AIBoolean silent)
 Marks or unmarks the current API context as being silent for undo purposes.
AIAPI AIErr(* SetKind )(ai::int32 kind)
 Sets the type of the current undo context, but only if the plug-in is not operating in a nested context (that is, a context created when another plug-in is executing).
AIAPI AIErr(* CountTransactions )(ai::int32 *past, ai::int32 *future)
 Counts the number of undo and redo transactions that a user can perform.
AIAPI AIErr(* IsSilent )(AIBoolean *silent)
 Reports whether the current API context is marked as silent for undo purposes.
AIAPI AIErr(* SetTagUS )(const ai::UnicodeString &tagString, ai::int32 tagInteger)
 Sets a Unicode tag string and integer for the undo transaction that is generated by the current API context.
AIAPI AIErr(* GetTagUS )(ai::UnicodeString &tagString, ai::int32 *tagInteger)
 Retrieves a Unicode tag string and integer for the undo transaction that is generated by the current API context.
AIAPI AIErr(* SetNthTransactionTagUS )(ai::int32 n, const ai::UnicodeString &tagString, ai::int32 tagInteger)
 Sets a transaction tag (a Unicode string) by position index for the current undo/redo context.
AIAPI AIErr(* GetNthTransactionTagUS )(ai::int32 n, ai::UnicodeString &tagString, ai::int32 *tagInteger)
 Retrieves a transaction tag (a Unicode string) by position index from the current undo/redo context.
AIAPI AIErr(* SetRecordingSuspended )(AIBoolean inSuspend)
 For internal use only.
AIAPI AIErr(* IsRecordingSuspended )(AIBoolean *outIsSuspended)
 For internal use only.

Detailed Description

This suites provides access to the Undo/Redo mechanism.

Use these functions to revert the artwork state to what it was when your plug-in was called, or to set the text of the Undo/Redo menus.

Undo API Contexts

The AIUndoSuite allows you to manipulate the undo context for your plug-in. Generally, each time Illustrator sends a plug-in a selector, it creates an undo context. The record is created before the plug-in is called and closed when the plug-in finishes running. The changes made by the plug-in are accumulated in this record and make up the undo context. When the user chooses Undo from the Edit menu, the changes of the last complete context are undone. Redo restores the context changes.

You can use UndoChanges() to programmatically undo the changes within the context Illustrator has made for your plug-in. It cannot undo changes outside of this context.

For plug-in tools, Illustrator handles undo contexts a little differently. Instead of generating a context for each selector, it bundles the mouse selectors into a single context. This allows a plug-in to undo changes it made last time and then modify the document in response to the current mouse position. Illustrator then redraws the document when the plug-in returns control.

There are three types of undo context, defined by AIUndoContextKind. Illustrator normally establishes a kAIStandardUndoContext, but notifications are sent in a kAISilentUndoContext. A plug-in can change the undo context type with SetSilent() and SetKind(), but only if the plug-in is not operating in a nested context (that is, a context created when another plug-in is executing). This prevents a plug-in in a nested context from modifying the behavior of the outer context.

Undo entries can be tagged with a string and/or an integer. Only standard contexts can be tagged.


Member Data Documentation

AIAPI AIErr(* AIUndoSuite::CountTransactions)(ai::int32 *past, ai::int32 *future)

Counts the number of undo and redo transactions that a user can perform.

Does not count silent or appended transactions. Use with GetNthTransactionTag() to iterate through transactions in the current undo context.

Parameters:
past [out] A buffer in which to return the number of undo transactions.
future [out] A buffer in which to return the number of redo transactions.
AIAPI AIErr(* AIUndoSuite::GetNthTransactionTagUS)(ai::int32 n, ai::UnicodeString &tagString, ai::int32 *tagInteger)

Retrieves a transaction tag (a Unicode string) by position index from the current undo/redo context.

Use with CountTransactions() to iterate through transactions in the current standard undo context.

Parameters:
n The position index. Positive values indicate redo transactions, negative values indicate undo transactions. No transaction is at index 0.
tagString [out] A buffer in which to return the descriptive Unicode string.
tagInteger [out] A buffer in which to return the identifying number.
AIAPI AIErr(* AIUndoSuite::GetTagUS)(ai::UnicodeString &tagString, ai::int32 *tagInteger)

Retrieves a Unicode tag string and integer for the undo transaction that is generated by the current API context.

Works only standard undo contexts; see Undo API Contexts.

Parameters:
tagString [out] A buffer in which to return the descriptive Unicode string.
tagInteger [out] A buffer in which to return the identifying number.

For internal use only.

Reports if undo recording is suspended.

Reports whether the current API context is marked as silent for undo purposes.

If the current context is nested, this can return true while the outer context is not silent. See Undo API Contexts.

Parameters:
silent [out] A buffer in which to return true if the current undo context is silent.

Undoes and forgets the last transaction.

Any redos available at this point are also forgotten. This decreases the available undo transactions by one. Changes made in the last transaction are no longer available for redo.

Undoes changes in the Action palette.

Clears any changes made to the Action palette since the undo context of the plug-in was created.

AIAPI AIErr(* AIUndoSuite::SetKind)(ai::int32 kind)

Sets the type of the current undo context, but only if the plug-in is not operating in a nested context (that is, a context created when another plug-in is executing).

See Undo API Contexts.

Parameters:
kind The new context type, an AIUndoContextKind constant.
AIAPI AIErr(* AIUndoSuite::SetNthTransactionTagUS)(ai::int32 n, const ai::UnicodeString &tagString, ai::int32 tagInteger)

Sets a transaction tag (a Unicode string) by position index for the current undo/redo context.

Use with CountTransactions() to iterate through transactions in the current standard undo context.

Parameters:
n The position index. Positive values indicate redo transactions, negative values indicate undo transactions. No transaction is at index 0.
tagString A descriptive Unicode string.
tagInteger An identifying number.

For internal use only.

Suspend/Resume undo recording.

Marks or unmarks the current API context as being silent for undo purposes.

See Undo API Contexts.

Parameters:
silent True to set the context to kAISilentUndoContext, false to set it to kAIStandardUndoContext.
AIAPI AIErr(* AIUndoSuite::SetTagUS)(const ai::UnicodeString &tagString, ai::int32 tagInteger)

Sets a Unicode tag string and integer for the undo transaction that is generated by the current API context.

Affects only standard undo contexts; see Undo API Contexts.

Parameters:
tagString A descriptive Unicode string.
tagInteger An identifying number.
AIAPI AIErr(* AIUndoSuite::SetUndoTextUS)(const ai::UnicodeString &undoText, const ai::UnicodeString &redoText)

Specifies the localizable text(Unicode String) for Undo and Redo menu items.

Illustrator uses these strings for the menus as needed.

Note:
Illustrator automatically handles the undo mechanism for plug-in filters. Filters should not use this function.
Parameters:
undoText Unicode String text for the Undo menu.
redoText Unicode String text for the Redo menu.

Undoes changes in the current undo context.

Clears any changes made to the artwork since the undo context of the plug-in was created.


The documentation for this struct was generated from the following file:


Contents Suites Classes Class Index Member Index
Adobe Solutions Network
 
Copyright © 2014 Adobe Systems Incorporated. All rights reserved.
Terms of Use Online Privacy Policy Adobe and accessibility Avoid software piracy Permissions and Trademarks