InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IAppearanceSuite Class Referenceabstract

#include <IAppearanceSuite.h>

Inheritance diagram for IAppearanceSuite:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IAPPEARANCESUITE }
 
enum  HowToAddStates { kAddItemsAsIndividualStates, kAddAllItemsToOneNewState, kAddItemsToActiveState }
 
enum  { kInvalidIndex = -1 }
 
enum  MultiItemSelectionPolicy { kHandleItemsAsAGroup, kHandleItemsIndividually }
 

Public Member Functions

virtual Form::AppearanceState GetActiveState () const =0
 
virtual ErrorCode SetActiveState (Form::AppearanceState inState) const =0
 
virtual void SelectActiveState () const =0
 
virtual Form::AppearanceState GetNthState (int32 inStateIndex) const =0
 
virtual bool16 GetAppearance (Form::AppearanceState inState, Form::Appearance *outAppearance) const =0
 
virtual bool16 HasAppearance (Form::AppearanceState inState) const =0
 
virtual bool16 HasAppearanceContent (Form::AppearanceState inState) const =0
 
virtual ErrorCode SetAppearance (Form::AppearanceState inState, Form::AppearanceState inNewState, const Form::Appearance &inAppearance) const =0
 
virtual ErrorCode NewState (Form::AppearanceState inState, int32 inPosition=IAppearanceList::kLastInOrder) const =0
 
virtual ErrorCode DeleteState (Form::AppearanceState inState) const =0
 
virtual ErrorCode DeleteStateContent (Form::AppearanceState inState) const =0
 
virtual Form::AppearanceState GetNewState () const =0
 
virtual bool16 CanAddState (Form::AppearanceState inState) const =0
 
virtual ErrorCode GetAppearanceThumbnail (Form::AppearanceState inState, int32 inMaxWidth, int32 inMaxHeight, AGMImageAccessor **pOutAGMImage) const =0
 
virtual ErrorCode SetAppearanceStyle (ILibrary *inLibrary, int32 inStyleIndex) const =0
 
virtual ErrorCode RemoveAppearances () const =0
 
virtual int32 NumStates () const =0
 
virtual bool16 SelectionHasContentInAnyState () const =0
 
virtual bool16 SelectionHasContentInActiveState () const =0
 
virtual bool16 SelectionHasContentInState (Form::AppearanceState inState) const =0
 
virtual bool16 HasStates () const =0
 
virtual PMString GetStateName (Form::AppearanceState inState) const =0
 
virtual bool GetName (PMString &name) const =0
 
virtual bool GetNameOfOnlyItemOfClass (PMString &name, const ClassID &classID) const =0
 
virtual ErrorCode SetName (const PMString &newName) const =0
 
virtual ErrorCode SetStateName (Form::AppearanceState state, const PMString &newName) const =0
 
virtual ErrorCode CreateAppearanceItem (const ClassID &formFieldType, MultiItemSelectionPolicy multiItemSelectionPolicy=kHandleItemsIndividually) const =0
 
virtual ErrorCode MoveState (Form::AppearanceState state, int32 position) const =0
 
virtual ErrorCode DeleteAppearance (Form::AppearanceState state) const =0
 
virtual ErrorCode ReleaseAppearanceAsObject (Form::AppearanceState state) const =0
 
virtual ErrorCode ReleaseAllAppearancesAsObjects () const =0
 
virtual int32 GetStatePosition (Form::AppearanceState state) const =0
 
virtual bool16 CanPasteIntoState (const ClassID inAppearanceItemClass) const =0
 
virtual ErrorCode PasteIntoState (const ClassID inAppearanceItemClass, Form::AppearanceState inState) const =0
 
virtual ErrorCode SetIsInitiallyHidden (bool16 inHidden) const =0
 
virtual bool16 GetIsInitiallyHidden () const =0
 
virtual bool16 IsAppearanceItemOfTypeSelected (const ClassID inAppearanceItemClass) const =0
 
virtual ErrorCode SelectAssociatedAppearanceItemOfType (const ClassID inAppearanceItemClass)=0
 
virtual bool16 IsActiveStateOfAppearanceItemOfTypeSelected (const ClassID inAppearanceItemClass) const =0
 
virtual bool16 CanAddItemsAsStates (const ClassID &inClassToAddTo) const =0
 
virtual ErrorCode AddItemsAsStates (const ClassID &inClassToAddTo, HowToAddStates inHowToAddStates) const =0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

Selection suite for manipulating appearances on page items that have appearances (form fields

This is currently implemented only for concrete selections (page items). There isn't

a default selection suite for Appearances.



This suite also doesn't operate on multiple selections.



Most of these methods call through to IAppearanceList (GetActiveState, GetNthState, GetAppearance,

HasAppearance, etc) or call an appearance state-related

command (SetActiveState, NewState, DeleteState, RemoveAppearances, SetAppearanceStyle)

See Also
IAppearanceList

Member Function Documentation

virtual ErrorCode IAppearanceSuite::AddItemsAsStates (const ClassIDinClassToAddTo,
HowToAddStates inHowToAddStates 
) const
pure virtual

Finds a unique appearance item of class inClassToAddTo in the selection, and then adds all of the other items in the selection to one or more of that item's states.

Parameters
inClassToAddTo[IN]: the class of the appearance item
inHowToAddStates[IN]: how to add the non-appearance items to the appearance item
Returns
kSuccess or an error
virtual bool16 IAppearanceSuite::CanAddItemsAsStates (const ClassIDinClassToAddTo) const
pure virtual

Determines if there is a unique appearance item in the selection of class inClassToAddTo, and if all of the other items can be placed into one of that item's states.

Parameters
inClassToAddTo[IN]: the class of the appearance item
Returns
whether the items in the selection can be added to the only item of inAppearanceItemClass
virtual bool16 IAppearanceSuite::CanAddState (Form::AppearanceState inState) const
pure virtual
Returns
kTrue if selection supports appearances, and inState doesn't already exist
virtual bool16 IAppearanceSuite::CanPasteIntoState (const ClassID inAppearanceItemClass) const
pure virtual

Determine whether the current contents of the clipboard can be pasted into the selected item of the specified class. This will return false if there are more than one item in the current selection.

Parameters
inAppearanceItemClass[IN]: the class of the appearance item of interest
Returns
whether the clipboard contents can be pasted
virtual ErrorCode IAppearanceSuite::DeleteAppearance (Form::AppearanceState state) const
pure virtual

Move the state of an item to a new position in the item's state ordering.

Parameters
state[IN]: The state to move.
position[IN]: The new position for the state.
Returns
kSuccess or an error.
virtual ErrorCode IAppearanceSuite::DeleteState (Form::AppearanceState inState) const
pure virtual

Remove a state from the selection

Parameters
inStateState to remove
virtual ErrorCode IAppearanceSuite::DeleteStateContent (Form::AppearanceState inState) const
pure virtual

Remove the state content from the selection

Parameters
inStateState to remove content
virtual Form::AppearanceState IAppearanceSuite::GetActiveState () const
pure virtual

return active state of selection, kStateInvalid if selection doesn't have appearances or is multiple selection

virtual bool16 IAppearanceSuite::GetAppearance (Form::AppearanceState inState,
Form::AppearanceoutAppearance 
) const
pure virtual

Get parameters for inState

Parameters
inStateState to get
outAppearancePoints to inState appearance params on exit
virtual ErrorCode IAppearanceSuite::GetAppearanceThumbnail (Form::AppearanceState inState,
int32 inMaxWidth,
int32 inMaxHeight,
AGMImageAccessor ** pOutAGMImage 
) const
pure virtual

Get rendered appearance of an appearance state

Parameters
inStateState to get
inMaxWidthMaximum width of returned bitmap
inMaxHeightMaximum height of returned bitmap
pOutAGMImage[OUT]: On exit, points to address of a newly allocated AGMImageAccessor, which must be deleted by the client. The AGMImageAccessor contains the rendered appearance.
virtual bool16 IAppearanceSuite::GetIsInitiallyHidden () const
pure virtual

Determines whether the selected appearance item is hidden until triggered on export.

Returns
whether the selected appearance item is hidden until triggered on export
virtual bool IAppearanceSuite::GetName (PMStringname) const
pure virtual

Get the name of the currently selected Field.

Parameters
name[OUT]: User-readable name of the selected Field/Page Item.
Returns
'true' if successful, 'false' otherwise.
virtual bool IAppearanceSuite::GetNameOfOnlyItemOfClass (PMStringname,
const ClassIDclassID 
) const
pure virtual

Gets the name of the only page item with the specified class in the current selection.

Parameters
name[OUT]: User-readable name of the selected Field/Page Item of the specified class.
classIDclass of the item whose name to retrieve
Returns
'true' if there is only one page item in the current selection of the specified class and its name was successfully retrieved, 'false' otherwise.
virtual Form::AppearanceState IAppearanceSuite::GetNewState () const
pure virtual
Returns
The next state that can be added (in order of the AppearanceState enum)
virtual Form::AppearanceState IAppearanceSuite::GetNthState (int32 inStateIndex) const
pure virtual
Returns
'inStateIndexth' zero indexed state in selection. Useful for enumerating states. kStateInvalid if inStateIndex >= NumStates()
virtual PMString IAppearanceSuite::GetStateName (Form::AppearanceState inState) const
pure virtual
Returns
User-readable name for inState e.g. "Normal", "Over", "Down", etc.
virtual int32 IAppearanceSuite::GetStatePosition (Form::AppearanceState state) const
pure virtual

Get the index of the specified state in the selected object's state ordering.

Parameters
state[IN]: the state whose position will be returned
Returns
if the current selection is an appearance item and the state exists, the index of the state is returned; otherwise, kInvalidIndex
virtual bool16 IAppearanceSuite::HasAppearance (Form::AppearanceState inState) const
pure virtual
Returns
kTrue if inState is a valid appearance in the selection
virtual bool16 IAppearanceSuite::HasAppearanceContent (Form::AppearanceState inState) const
pure virtual
Returns
kTrue if inState has content in the selection
virtual bool16 IAppearanceSuite::HasStates () const
pure virtual
Returns
kTrue if the selection supports appearance states. i.e. has an IAppearanceList interface
virtual bool16 IAppearanceSuite::IsActiveStateOfAppearanceItemOfTypeSelected (const ClassID inAppearanceItemClass) const
pure virtual

Returns whether the group that wraps the active states for the specified appearance item class in the selection is selected.

Parameters
inAppearanceItemClass[IN]: The desired appearance item class.
virtual bool16 IAppearanceSuite::IsAppearanceItemOfTypeSelected (const ClassID inAppearanceItemClass) const
pure virtual

Examines the selected item for the specified appearance item class.

Parameters
inAppearanceItemClass[IN]: The desired appearance item class.
Returns
bool16 kTrue if the item is of the specified appearance item class, kFalse otherwise.
virtual ErrorCode IAppearanceSuite::MoveState (Form::AppearanceState state,
int32 position 
) const
pure virtual

Move the state of an item to a new position in the item's state ordering.

Parameters
state[IN]: The state to move.
position[IN]: The new position for the state.
Returns
kSuccess or an error.
virtual ErrorCode IAppearanceSuite::NewState (Form::AppearanceState inState,
int32 inPosition = IAppearanceList::kLastInOrder 
) const
pure virtual

Add a new state to selection

Parameters
inStateState to add
inPositionPosition in the appearance list to add the state
virtual int32 IAppearanceSuite::NumStates () const
pure virtual
Returns
number of appearance states in the selection
virtual ErrorCode IAppearanceSuite::PasteIntoState (const ClassID inAppearanceItemClass,
Form::AppearanceState inState 
) const
pure virtual

Paste the contents of the clipboard into the specified state of an appearance item in the current selection.

Parameters
inAppearanceItemClass[IN]: the class of the appearance item to paste into
inState[IN]: the state of the appearance item to paste into
Returns
kSuccess or an error
virtual ErrorCode IAppearanceSuite::ReleaseAllAppearancesAsObjects () const
pure virtual

Release all of the objects that represent the appearances of each of the selected item's states to be children of the spread, and then delete the appearance item.

Returns
kSuccess or an error.
virtual ErrorCode IAppearanceSuite::ReleaseAppearanceAsObject (Form::AppearanceState state) const
pure virtual

Release objects that represent the appearance of the selected item's specified state to be children of the spread, and then delete the state.

Parameters
state[IN]: The state to release
Returns
kSuccess or an error.
virtual ErrorCode IAppearanceSuite::RemoveAppearances () const
pure virtual

Remove all page item children of all the states (but retain the states themselves)

virtual void IAppearanceSuite::SelectActiveState () const
pure virtual

Selects the group that wraps the active states of appearance items in the selection

virtual ErrorCode IAppearanceSuite::SelectAssociatedAppearanceItemOfType (const ClassID inAppearanceItemClass)
pure virtual

Selects the appearance item that is associated with the current selection.

Parameters
inAppearanceItemClass[IN]: The desired appearance item class.
Returns
kSuccess or an error
virtual bool16 IAppearanceSuite::SelectionHasContentInActiveState () const
pure virtual
Returns
kTrue if the selection has content in its active appearance state.
virtual bool16 IAppearanceSuite::SelectionHasContentInAnyState () const
pure virtual
Returns
kTrue if the selection has content in any of its appearance states.
virtual bool16 IAppearanceSuite::SelectionHasContentInState (Form::AppearanceState inState) const
pure virtual
Parameters
inStatethe state to check for seleciton
Returns
kTrue if the selection has content in the specified state, kFalse otherwise or if selections in multiple appearance items.
virtual ErrorCode IAppearanceSuite::SetActiveState (Form::AppearanceState inState) const
pure virtual

Perform kChangeActiveStateCmdBoss command on the selection

virtual ErrorCode IAppearanceSuite::SetAppearance (Form::AppearanceState inState,
Form::AppearanceState inNewState,
const Form::AppearanceinAppearance 
) const
pure virtual

Change parameters for state inState

Parameters
inStateState to change
inNewStateState to change it to (may be == inState)
inAppearanceNew parameters for state
virtual ErrorCode IAppearanceSuite::SetAppearanceStyle (ILibraryinLibrary,
int32 inStyleIndex 
) const
pure virtual

Set form field appearance from an Assert in an Asset Library All of the page item children from the asset are copied over, as well as the Form Field related graphic attributes (read only, export, etc.) i.e. all the attributes that can be set in the Form Field Properties dialog The size, and transform, and non form field graphic attributes are preserved.

Parameters
inLibraryAsset library to use
Whichasset to use in inLibrary
virtual ErrorCode IAppearanceSuite::SetIsInitiallyHidden (bool16 inHidden) const
pure virtual

Set whether the selected appearance item is hidden until triggered on export.

Returns
kSuccess or an error
virtual ErrorCode IAppearanceSuite::SetName (const PMStringnewName) const
pure virtual

Set the name of the selected field.

Parameters
newName[IN]: The name to assign to the button/field.
Returns
kSuccess or an error.
virtual ErrorCode IAppearanceSuite::SetStateName (Form::AppearanceState state,
const PMStringnewName 
) const
pure virtual

Set the name of the specified state for the selected field.

Parameters
state[IN]: The state to rename.
newName[IN]: The name to assign to the state.
Returns
kSuccess or an error.