![]() | InDesign SDK 20.5 |
Public Member Functions | |
| SnpManipulateConditionalText () | |
| virtual | ~SnpManipulateConditionalText () |
| void | OutputConditionInfo (const UIDRef conditionRef, bool16 nameOnly=kFalse) const |
| void | OutputSetInfo (const UIDRef setRef, bool16 nameOnly=kFalse) const |
| ErrorCode | ListAllConditionInfo () const |
| ErrorCode | ListAllConditionSetInfo () const |
| ErrorCode | ListActiveConditionInfo (const IActiveContext *ac) const |
| ErrorCode | ListActiveConditionSetInfo (const IActiveContext *ac) const |
| ErrorCode | ListAllWorkspaceConditionInfo (const IWorkspace *ws) const |
| ErrorCode | ListAllWorkspaceConditionSetInfo (const IWorkspace *ws) const |
| ErrorCode | CreateDefaultCondition (const IActiveContext *ac) const |
| ErrorCode | CreateCondition (IWorkspace *ws, const WideString &name, const UID colorUID, IConditionTag::IndicatorMethod method, IConditionTag::UnderlineIndicatorAppearance appearance, const bool16 visibleState, UID *newConditionTagUID) const |
| ErrorCode | DeleteCondition (const UIDRef &conditionRef, const UIDRef &replacementRef) const |
| ErrorCode | SetConditionOptions (const UIDRef &conditionRef, const WideString &newName, UID newColorUID, IConditionTag::IndicatorMethod newMethod, IConditionTag::UnderlineIndicatorAppearance newAppearance, bool16 newVisibleState) const |
| ErrorCode | SetConditionName (const UIDRef &conditionRef, const PMString &newName) const |
| ErrorCode | SetConditionVisibleState (const UIDRef &conditionRef, const bool16 &newVisibleState) const |
| ErrorCode | SetConditionColor (const UIDRef &conditionRef, const UID &newColorUID) const |
| ErrorCode | SetConditionMethod (const UIDRef &conditionRef, const IConditionTag::IndicatorMethod &method) const |
| ErrorCode | SetConditionAppearance (const UIDRef &conditionRef, const IConditionTag::UnderlineIndicatorAppearance &appearance) const |
| ErrorCode | ApplyConditions (const UIDRef &textModelRef, RangeData &rangeData, const K2Vector< UID > &conditionsToApply, bool16 removeExisting=kFalse) const |
| ErrorCode | RemoveConditionTags (const UIDRef &textModelRef, RangeData &rangeData, const K2Vector< UID > &conditionsToRemove, bool16 removeAll=kFalse) const |
| ErrorCode | ListAppliedConditionTags (const UIDRef &textModelRef, RangeData &rangeData) const |
| ErrorCode | SetShowConditionIndicators (IWorkspace *ws, IConditionalTextOptions::ConditionIndicatorsMode showIndicatorsMode) const |
| ErrorCode | LoadConditions (IWorkspace *ws, const IDFile &sourceFile, bool16 loadConditionSets) const |
| ErrorCode | CreateConditionSet (IWorkspace *ws, const WideString &name, UID *newConditionSetUID) const |
| ErrorCode | ShowAllConditionsInActiveSet (IWorkspace *ws, bool16 doShow) const |
| ErrorCode | DeleteConditionSet (const UIDRef &setRef) const |
| ErrorCode | SetActiveConditionSet (IWorkspace *ws, const UIDRef &setRef) const |
| ErrorCode | ModifyConditionSetName (const UIDRef &setRef, const WideString &newName) const |
| ErrorCode | RedefineActiveConditionSet (IWorkspace *ws) const |
| const K2Vector< PMString > & | QueryConditionIndicatorMethodNames () const |
| const K2Vector< PMString > & | QueryConditionIndicatorAppearanceNames () const |
| const K2Vector< PMString > & | QueryShowIndicatorsModeNames () const |
The SnpManipulateConditionalText snippet demonstrates the use of the ConditionalTextFacade (IConditionalTextFacade) to manipulate Conditions (kConditionTagBoss) and Condition Sets (kConditionTagSetBoss) in a workspace, and to apply conditions to text. The following functionality is demonstrated:
| SnpManipulateConditionalText::SnpManipulateConditionalText | ( | ) |
Constructor
| inlinevirtual |
Destructor
| ErrorCode SnpManipulateConditionalText::ApplyConditions | ( | const UIDRef & | textModelRef, |
| RangeData & | rangeData, | ||
| const K2Vector< UID > & | conditionsToApply, | ||
| bool16 | removeExisting = kFalse | ||
| ) | const |
Apply Conditions to text
| textModelRef | IN specifies text model ref on which to apply the condition |
| rangeData | IN location in the text model to apply the condition |
| conditionsToApply | IN uid list of the conditions to apply (can be empty and used with removeExisting to remove all conditions) |
| removeExisting | IN true to remove existing applied conditions |
| ErrorCode SnpManipulateConditionalText::CreateCondition | ( | IWorkspace * | ws, |
| const WideString & | name, | ||
| const UID | colorUID, | ||
| IConditionTag::IndicatorMethod | method, | ||
| IConditionTag::UnderlineIndicatorAppearance | appearance, | ||
| const bool16 | visibleState, | ||
| UID * | newConditionTagUID | ||
| ) | const |
Creates a new condition using the specified values
| ws | IN specifies the workspace in which the condition is to be created |
| name | IN the name of the condition |
| colorUID | IN the color of the condition |
| method | IN the indicator method used to specify how to draw the indicator (e.g. IConditionTag::kUnderline) |
| appearance | IN the underline indicator appearance (e.g. IConditionTag::kSingleWavy) |
| visibleState | IN whether the text associated with the condition is visible |
| newConditionTagUID | OUT the UID of the new condition |
| ErrorCode SnpManipulateConditionalText::CreateConditionSet | ( | IWorkspace * | ws, |
| const WideString & | name, | ||
| UID * | newConditionSetUID | ||
| ) | const |
Create a new condition set. For this example, all conditions in the specified workspace are added to the new set at their current visibility.
| ws | IN the workspace to create the set in |
| name | IN the name for the condition set |
| newConditionSetUID | OUT the UID of the new set |
| ErrorCode SnpManipulateConditionalText::CreateDefaultCondition | ( | const IActiveContext * | ac | ) | const |
Creates a new condition using the IConditionalTextFacade default values
| ac | IN specifies active context in which the condition is to be created |
| ErrorCode SnpManipulateConditionalText::DeleteCondition | ( | const UIDRef & | conditionRef, |
| const UIDRef & | replacementRef | ||
| ) | const |
Deletes a condition, and allows replacement of that condition with another condition (applies the replacement condition to the text model in the places where the deleted condition had been applied.)
| conditionRef | IN the UIDRef of the condition to delete |
| replacementRef | IN the UIDRef of the condition with which to replace the deleted condition |
| ErrorCode SnpManipulateConditionalText::DeleteConditionSet | ( | const UIDRef & | setRef | ) | const |
Delete a condition set.
| setRef | IN uid reference of the set to delete |
| ErrorCode SnpManipulateConditionalText::ListActiveConditionInfo | ( | const IActiveContext * | ac | ) | const |
Outputs information about the conditions in the active context's workspace
| ac | IN specifies active context to list conditions for |
| ErrorCode SnpManipulateConditionalText::ListActiveConditionSetInfo | ( | const IActiveContext * | ac | ) | const |
Outputs information about all the tags in the active context's workspace
| ac | IN specifies active context to list condition sets for |
| ErrorCode SnpManipulateConditionalText::ListAllConditionInfo | ( | ) | const |
Outputs information about all the Conditions in the session workspace and the open document(s) workspace
| ErrorCode SnpManipulateConditionalText::ListAllConditionSetInfo | ( | ) | const |
Outputs information about all the ConditionSets in the session workspace and the open document(s) workspace
| ErrorCode SnpManipulateConditionalText::ListAllWorkspaceConditionInfo | ( | const IWorkspace * | ws | ) | const |
Outputs information about all the Conditions in the specified workspace
| ws | IN specifies workspace to inspect |
| ErrorCode SnpManipulateConditionalText::ListAllWorkspaceConditionSetInfo | ( | const IWorkspace * | ws | ) | const |
Outputs information about all the ConditionSets in the specified workspace
| ws | IN specifies workspace to inspect |
| ErrorCode SnpManipulateConditionalText::ListAppliedConditionTags | ( | const UIDRef & | textModelRef, |
| RangeData & | rangeData | ||
| ) | const |
Display info about the applied Conditions in the specified text model range
| textModelRef | IN specifies text model ref on which to inspect applied conditions |
| rangeData | IN location in the text model to inspect applied conditions |
| ErrorCode SnpManipulateConditionalText::LoadConditions | ( | IWorkspace * | ws, |
| const IDFile & | sourceFile, | ||
| bool16 | loadConditionSets | ||
| ) | const |
Copy the conditions and condition sets from an InDesign file to the specified workspace.
| ws | IN workspace to copy the conditions and sets to. |
| sourceFile | IN the InDesign file to load the conditions from. |
| loadConditionSets | IN if kTrue then loads conditions and condition sets; otherwise, only loads the conditions. |
| ErrorCode SnpManipulateConditionalText::ModifyConditionSetName | ( | const UIDRef & | setRef, |
| const WideString & | newName | ||
| ) | const |
Modify the specified condition set's name
| setRef | IN uid reference to the set to modify |
| newName | IN the new name for the condition set |
| void SnpManipulateConditionalText::OutputConditionInfo | ( | const UIDRef | conditionRef, |
| bool16 | nameOnly = kFalse | ||
| ) | const |
Outputs information about a Condition
| conditionRef | IN specifies Condition to inspect |
| nameOnly | IN specifies to output only the condition's name |
| void SnpManipulateConditionalText::OutputSetInfo | ( | const UIDRef | setRef, |
| bool16 | nameOnly = kFalse | ||
| ) | const |
Outputs information about a ConditionSet
| setRef | IN the ConditionSet to inspect |
| nameOnly | IN specifies to output only the condition set's name |
| ErrorCode SnpManipulateConditionalText::RedefineActiveConditionSet | ( | IWorkspace * | ws | ) | const |
Redefine the active condition set. For this example, the set is redefined to contain all conditions in the specified workspace at their current visibility.
| ws | IN the workspace to get the active set from |
| ErrorCode SnpManipulateConditionalText::RemoveConditionTags | ( | const UIDRef & | textModelRef, |
| RangeData & | rangeData, | ||
| const K2Vector< UID > & | conditionsToRemove, | ||
| bool16 | removeAll = kFalse | ||
| ) | const |
Remove Condition Tag from text
| textModelRef | IN specifies text model ref on which to apply the condition |
| rangeData | IN location in the text model to apply the condition |
| conditionsToRemove | IN uid list of the conditions to remove (unapply) from the text |
| removeAll | IN true to remove all applied conditions from the text |
| ErrorCode SnpManipulateConditionalText::SetActiveConditionSet | ( | IWorkspace * | ws, |
| const UIDRef & | setRef | ||
| ) | const |
Set the active condition set
| ws | IN the workspace to create the set in |
| setRef | IN uid reference of the set to make active |
| ErrorCode SnpManipulateConditionalText::SetConditionAppearance | ( | const UIDRef & | conditionRef, |
| const IConditionTag::UnderlineIndicatorAppearance & | appearance | ||
| ) | const |
Set the appearance of a condition (has no effect if conditions's indicator method is kHighlight)
| conditionRef | IN the UIDRef of the condition to modify |
| appearance | IN the appearance to use when drawing the condition indicator (e.g. kSingleWavy) |
| ErrorCode SnpManipulateConditionalText::SetConditionColor | ( | const UIDRef & | conditionRef, |
| const UID & | newColorUID | ||
| ) | const |
Set the color of a condition
| conditionRef | IN the UIDRef of the condition to modify |
| newColorUID | IN the UID of the color to use when drawing the condition indicator |
| ErrorCode SnpManipulateConditionalText::SetConditionMethod | ( | const UIDRef & | conditionRef, |
| const IConditionTag::IndicatorMethod & | method | ||
| ) | const |
Set the method of a condition. The method is a constant specifying how to draw the condition indicator.
| conditionRef | IN the UIDRef of the condition to modify |
| method | IN the method to use when drawing the condition indicator (e.g. kHighlight) |
| ErrorCode SnpManipulateConditionalText::SetConditionName | ( | const UIDRef & | conditionRef, |
| const PMString & | newName | ||
| ) | const |
Rename a condition
| conditionRef | IN the UIDRef of the condition to modify |
| newName | IN the new name for the condition |
| ErrorCode SnpManipulateConditionalText::SetConditionOptions | ( | const UIDRef & | conditionRef, |
| const WideString & | newName, | ||
| UID | newColorUID, | ||
| IConditionTag::IndicatorMethod | newMethod, | ||
| IConditionTag::UnderlineIndicatorAppearance | newAppearance, | ||
| bool16 | newVisibleState | ||
| ) | const |
Set the options for an existing condition
| conditionRef | IN The UIDRef of the condition to edit. |
| newName | IN The new name condition. |
| newColorUID | IN The new color UID for the condition. |
| newMethod | IN The new indicator method for the condition (e.g. kHighlight). |
| newAppearance | IN The new underline indicator appearance for the condition (e.g. kSingleWavy). |
| newVisibleState | IN The new visible state for the condition. |
| ErrorCode SnpManipulateConditionalText::SetConditionVisibleState | ( | const UIDRef & | conditionRef, |
| const bool16 & | newVisibleState | ||
| ) | const |
Set the visibility of a condition
| conditionRef | IN the UIDRef of the condition to modify |
| newVisibleState | IN the new visibility setting for the condition |
| ErrorCode SnpManipulateConditionalText::SetShowConditionIndicators | ( | IWorkspace * | ws, |
| IConditionalTextOptions::ConditionIndicatorsMode | showIndicatorsMode | ||
| ) | const |
Show or hide the conditional text indicators. Indicators are drawn on text that has a condition applied.
| ws | IN specifies workspace to modify |
| showIndicatorsMode | IN show, show and print, or hide indicators |
| ErrorCode SnpManipulateConditionalText::ShowAllConditionsInActiveSet | ( | IWorkspace * | ws, |
| bool16 | doShow | ||
| ) | const |
Show or Hide all the conditions present in the active condition set
| ws | IN the workspace to get the active set from |
| doShow | IN defines whether to show or hide the conditions |