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

#include <IAppearanceList.h>

Inheritance diagram for IAppearanceList:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IAPPEARANCELIST }
 
enum  { kInvalidate = kTrue, kDontInvalidate = kFalse, kInvalidStateID = -1, kLastInOrder = -1 }
 
typedef int32 StateID
 

Public Member Functions

virtual Form::AppearanceState GetActiveState () const =0
 
virtual StateID GetStateID (Form::AppearanceState inState) const =0
 
virtual StateID GetActiveStateID () const =0
 
virtual Form::AppearanceState GetIDState (IAppearanceList::StateID inStateID) const =0
 
virtual void SetActiveState (Form::AppearanceState inState)=0
 
virtual Form::AppearanceState GetChildState (const UID &inChildUID) const =0
 
virtual Form::AppearanceState GetActiveStateTemp () const =0
 
virtual Form::AppearanceState GetStateFromName (const PMString &name) const =0
 
virtual Form::AppearanceState GetNextAvailableState () const =0
 
virtual void SetActiveStateTemp (Form::AppearanceState inState, bool16 inInvalCaches=IAppearanceList::kInvalidate)=0
 
virtual int32 NumStates () const =0
 
virtual bool16 HasAppearance (Form::AppearanceState inState) const =0
 
virtual void AddAppearance (Form::AppearanceState inState, const Form::Appearance &inAppearance, int32 position=kLastInOrder)=0
 
virtual void RemoveAppearance (Form::AppearanceState inState, Form::Appearance *outRemovedAppearance)=0
 
virtual void ChangeState (Form::AppearanceState inState, Form::AppearanceState inNewState)=0
 
virtual void Move (Form::AppearanceState inState, int32 inPosition)=0
 
virtual bool16 CanAddState (Form::AppearanceState inState) const =0
 
virtual bool16 GetAppearance (Form::AppearanceState inState, Form::Appearance *outAppearance) const =0
 
virtual void SetAppearance (Form::AppearanceState inState, const Form::Appearance &inAppearance)=0
 
virtual Form::AppearanceState GetNthState (int32 inStateIndex) const =0
 
virtual int32 GetStatePosition (Form::AppearanceState inState) const =0
 
virtual void Clear ()=0
 
virtual ErrorCode GetThumbnail (Form::AppearanceState inState, int32 inMaxWidth, int32 inMaxHeight, AGMImageRecord *outAGMRecord)=0
 
virtual void InvalidateThumbnail (Form::AppearanceState inState)=0
 
virtual void DisposeThumbnail (Form::AppearanceState inState)=0
 
virtual void ForceRemoveAppearance (Form::AppearanceState inState, Form::Appearance *outRemovedAppearance)=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

A list of alternate appearances (states) for a page item.  Each state consists

of a state type, and a list of children (which are accessed via IHierarchy). You may add/delete states, and set an active state. The currently active state determines which children of the page item are exposed via IHierarchy. The children belonging to inactive states are hidden, and are only accessible when their state becomes the active state.

The implementation of IHierarchy for a page item with an IAppearanceLIst interface uses the active state in IAppearanceList so that it only presents the children of the active state.

See Also
IHierarchy

Member Function Documentation

virtual void IAppearanceList::AddAppearance (Form::AppearanceState inState,
const Form::AppearanceinAppearance,
int32 position = kLastInOrder 
)
pure virtual

Add a new appearance state to the list. Better to use kNewStateCmdBoss command, which handles necessary maintenance to IHierarchy, than to call this directly.

Parameters
inStateThe state to add
inAppearanceParameters for the new state
See Also
kNewStateCmdBoss
virtual bool16 IAppearanceList::CanAddState (Form::AppearanceState inState) const
pure virtual

Determine if a particular state is present in this IAppearanceList.

Returns
true if inState is a supported state, and it doesn't already exist.
virtual void IAppearanceList::ChangeState (Form::AppearanceState inState,
Form::AppearanceState inNewState 
)
pure virtual

Change an appearance state in the list. Doesn't change page item children for state. Use IHierarchy for that

Parameters
inStateThe state to change
inNewStateThe state to change inState to.
virtual void IAppearanceList::Clear ()
pure virtual

Delete all states in the appearance list. This should not be called directly, as an AppearanceList is supposed to always contain one or more normal states. This method is only used internally when copying page items with IAppearanceLists. This does not removed the children in IHierarchy.

See Also
kDeleteStateCmdBoss
virtual void IAppearanceList::DisposeThumbnail (Form::AppearanceState inState)
pure virtual

Throw away any cached thumbnails for state inState.

virtual void IAppearanceList::ForceRemoveAppearance (Form::AppearanceState inState,
Form::AppearanceoutRemovedAppearance 
)
pure virtual

Internal Use Only. Before one try to remove any appearance, it checks whether it can actually remove it or not. This API eliminates this check & just go ahead and delete appearence

Parameters
inStateThe state to remove
outRemovedAppearanceIf non-nil, returns the parameters for the deleted state, Pass nil if you don't need this information.
See Also
kDeleteStateCmdBoss

WARNING : If not used in appropriate senario, it would lead to undesirable results.

virtual Form::AppearanceState IAppearanceList::GetActiveState () const
pure virtual

Return the active state.

Returns
value of last call to SetActiveStateTemp if not kInvalidState, otherwise value of last call to SetActiveState value
virtual StateID IAppearanceList::GetActiveStateID () const
pure virtual
Returns
the unique id for the active state.
virtual Form::AppearanceState IAppearanceList::GetActiveStateTemp () const
pure virtual

Get the "temp" active state, which is the last value set by SetActiveStateTemp Shouldn't need to call this directly. Use StSetStateTemp instead.

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

Get parameters for state. For now, this only consisted of the "enabled" property. Enabled says whether the state will be exported in the PDF for the page item (form field).

Returns
true if inState exists, false otherwise
virtual Form::AppearanceState IAppearanceList::GetChildState (const UIDinChildUID) const
pure virtual

Get the state that contains inChild.

Parameters
inChilda valid child in this items IHierarchy (may be in an inactive state, and may not be immediate child)
Returns
If inChildUID is in IAppearanceList, returns the state, else kStateInvalid
virtual Form::AppearanceState IAppearanceList::GetIDState (IAppearanceList::StateID inStateID) const
pure virtual
Returns
the state that has inStateID.
virtual Form::AppearanceState IAppearanceList::GetNextAvailableState () const
pure virtual

Get the first supported state that does not have an appearance associated with it. Specifically useful for creating states on form fields that do not use the states defined in Form::DefinedAppearanceState

Returns
if there is an unused supported state available, returns the state - otherwise, kStateInvalid
virtual Form::AppearanceState IAppearanceList::GetNthState (int32 inStateIndex) const
pure virtual

Get the inStateIndexth state that is the IAppearanceList. Used to iterate through all the states.

Returns
nth state in this IAppearanceList
virtual Form::AppearanceState IAppearanceList::GetStateFromName (const PMStringname) const
pure virtual

Get the appearance state whose name matches the specified name.

virtual StateID IAppearanceList::GetStateID (Form::AppearanceState inState) const
pure virtual

Return the unique id an appearance state. Each state has an id that remains the same for the life of the appearance, which is unique from any other existing appearance. This id may be used to id/find/track the appearance regardless of any changes made to the appearance

Returns
the unique id for inState.
virtual int32 IAppearanceList::GetStatePosition (Form::AppearanceState inState) const
pure virtual

Returns the index of inState IAppearanceList.

Returns
the index of inState in IAppearanceList, -1 if inState is not in the list
virtual ErrorCode IAppearanceList::GetThumbnail (Form::AppearanceState inState,
int32 inMaxWidth,
int32 inMaxHeight,
AGMImageRecordoutAGMRecord 
)
pure virtual

Return a bitmap of size inMaxWidth x inMaxHeight (at most) that is the rendered appearance of inState. Used to draw thumbnails in appearance palette.

Parameters
inStatestate of thumbnail to get
inMaxWidthmax width of thumbnail. Thumb is either inMaxWidth or the actual width of the appearance.
inMaxHeightmax height of thumbnail. Thumb is either inMaxHeight or the actual height of the appearance.
outAGMRecordthumbnail is returned here. Do not allocate or release the pixels. They are owned by the thumbnail. outAGMRecord is only valid while IAppearanceList is valid, and there are no operations that change the appearance of any of the IAppearanceList states.
virtual bool16 IAppearanceList::HasAppearance (Form::AppearanceState inState) const
pure virtual
Returns
true if inState has been added to this IAppearanceList
virtual void IAppearanceList::InvalidateThumbnail (Form::AppearanceState inState)
pure virtual

Invalidate any cached thumbnails for state inState, used when anything effecting the appearance of the state is changed.

virtual void IAppearanceList::Move (Form::AppearanceState inState,
int32 inPosition 
)
pure virtual

Move a state to a specific position in the state-ordering.

Parameters
inStateThe state to move
inPositionThe position in the state-ordering to move the state to
virtual int32 IAppearanceList::NumStates () const
pure virtual
Returns
number of valid appearance states in the IAppearanceList
virtual void IAppearanceList::RemoveAppearance (Form::AppearanceState inState,
Form::AppearanceoutRemovedAppearance 
)
pure virtual

Removes a appearance state from the list. This does not removed the children in IHierarchy use kDeleteStateCmdBoss command to handle the deletion of children and other housekeeping.

Parameters
inStateThe state to remove
outRemovedAppearanceIf non-nil, returns the parameters for the deleted state, Pass nil if you don't need this information.
See Also
kDeleteStateCmdBoss
virtual void IAppearanceList::SetActiveState (Form::AppearanceState inState)
pure virtual

Set the active state.

Parameters
inStatea valid state in IAppearanceList that will become the active state
virtual void IAppearanceList::SetActiveStateTemp (Form::AppearanceState inState,
bool16 inInvalCaches = IAppearanceList::kInvalidate 
)
pure virtual

Sets a alternate, temp state, separate from GetActiveState and SetActiveState, which doesn't not dirty the interface. Used when drawing thumbnails. shouldn't be called directly, use StSetStateTemp instead

Parameters
inStateThe state that should become the active state
inInvalCachesWhether or not the thumbnails need to be invalidated, If you are sure the state is not going to be changed, pass IAppearanceList::kDontInvalidate
virtual void IAppearanceList::SetAppearance (Form::AppearanceState inState,
const Form::AppearanceinAppearance 
)
pure virtual

Set parameters for state. For now, this only consisted of the "enabled" property. Enabled says whether the state will be exported in the PDF for the page item (form field).