InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SnpManipulateTextStyle Class Reference

Public Member Functions

ErrorCode CreateStyleFromSelection (const InterfacePtr< ITextFocus > iTextFocus, IActiveContext *activeContext)
 
ErrorCode ApplyStyle (ISnpRunnableContext *iSnpRunnableContext)
 
ErrorCode UpdateParaStyle (const InterfacePtr< ITextFocus > textFocus, IActiveContext *activeContext)
 
ErrorCode SetDefaultParaStyle (const InterfacePtr< ITextFocus > textFocus, IActiveContext *activeContext)
 
ErrorCode DeleteStyle (ISnpRunnableContext *iSnpRunnableContext)
 
ErrorCode ChooseStyle (ISnpRunnableContext *iSnpRunnableContext, UID &style, const char *action, PMIID *styleType=nil)
 

Detailed Description

Sample code snippet that shows how to create a new paragraph style, based on the text attributes of a text selection.

Member Function Documentation

ErrorCode SnpManipulateTextStyle::ApplyStyle (ISnpRunnableContextiSnpRunnableContext)

apply a style to the selection.

Parameters
activeContextIN our active context
Returns
kSuccess on success, other ErrorCode on failure.
ErrorCode SnpManipulateTextStyle::ChooseStyle (ISnpRunnableContextiSnpRunnableContext,
UIDstyle,
const char * action,
PMIIDstyleType = nil 
)

Drives the UI that allows a user to pick a style

Parameters
iSnpRunnableContextIN the active context
styleOUT the selected style
actionIN the verb that applies to this operation
styleTypeIN if nil, allows user to choose between para or char style. If non-nil either identifies whether the user should only be asked to choose between char/para styles, or if set to kInvalidInterfaceID, will return the type of style chosen.
Returns
kSuccess if a style is successfully picked
ErrorCode SnpManipulateTextStyle::CreateStyleFromSelection (const InterfacePtr< ITextFocusiTextFocus,
IActiveContextactiveContext 
)

Creates a new paragraph or character style, based on the current selection.

Parameters
iTextFocusIN the text focus used to create the new style.
activeContextIN our current context.
Returns
kSuccess is the style is successfully created, kFailure otherwise.
ErrorCode SnpManipulateTextStyle::DeleteStyle (ISnpRunnableContextiSnpRunnableContext)

Delete a style.

Parameters
activeContextIN our active context
Returns
kSuccess on success, other ErrorCode on failure.
ErrorCode SnpManipulateTextStyle::SetDefaultParaStyle (const InterfacePtr< ITextFocustextFocus,
IActiveContextactiveContext 
)

Set the paragraph style of the current text selection as default.

Parameters
textFocusdescribing text on which style is to be based
Returns
kSuccess on success, other ErrorCode on failure.
ErrorCode SnpManipulateTextStyle::UpdateParaStyle (const InterfacePtr< ITextFocustextFocus,
IActiveContextactiveContext 
)

update a paragraph style based on the selection.

Parameters
textFocusdescribing text on which style is to be based
Returns
kSuccess on success, other ErrorCode on failure.