![]() | InDesign SDK 20.5 |
#include <IConditionalTextFacade.h>

Public Types | |
| enum | { kDefaultIID = IID_ICONDITIONALTEXTFACADE } |
| typedef std::pair< UID, bool > | ConditionSetElement |
| typedef std::vector < ConditionSetElement > | ConditionSetElementList |
Public Member Functions | |
| virtual ErrorCode | CreateCondition (IWorkspace *ws, UID *newConditionUID=nil, const WideString &name=WideString(""), UID colorUID=kInvalidUID, IConditionTag::IndicatorMethod method=IConditionTag::kUnderline, IConditionTag::UnderlineIndicatorAppearance appearance=IConditionTag::kSingleWavy, bool16 visibleState=kTrue)=0 |
| virtual ErrorCode | DeleteConditions (const UIDList &conditionsToDelete, UID conditionToReplaceWith=kInvalidUID)=0 |
| virtual ErrorCode | SetConditionName (const UIDRef &conditionRef, const WideString &name)=0 |
| virtual ErrorCode | GetConditionName (const UIDRef &conditionRef, WideString &name) const =0 |
| virtual ErrorCode | SetConditionColor (const UIDRef &conditionRef, UID colorUID)=0 |
| virtual ErrorCode | GetConditionColor (const UIDRef &conditionRef, UID &colorUID) const =0 |
| virtual ErrorCode | SetConditionMethod (const UIDRef &conditionRef, IConditionTag::IndicatorMethod newMethod)=0 |
| virtual ErrorCode | GetConditionMethod (const UIDRef &conditionRef, IConditionTag::IndicatorMethod &method) const =0 |
| virtual ErrorCode | SetConditionAppearance (const UIDRef &conditionRef, IConditionTag::UnderlineIndicatorAppearance newAppearance)=0 |
| virtual ErrorCode | GetConditionAppearance (const UIDRef &conditionRef, IConditionTag::UnderlineIndicatorAppearance &appearance) const =0 |
| virtual ErrorCode | SetConditionOptions (const UIDRef &conditionRef, const WideString &newName, UID newColorUID, IConditionTag::IndicatorMethod newMethod, IConditionTag::UnderlineIndicatorAppearance newAppearance)=0 |
| virtual ErrorCode | GetConditionOptions (const UIDRef &conditionRef, WideString &name, UID &colorUID, IConditionTag::IndicatorMethod &method, IConditionTag::UnderlineIndicatorAppearance &appearance) const =0 |
| virtual ErrorCode | SetConditionVisibleState (const UIDRef &conditionRef, bool16 visibleState)=0 |
| virtual ErrorCode | GetConditionVisibleState (const UIDRef &conditionRef, bool16 &visibleState) const =0 |
| virtual ErrorCode | ApplyConditionsToText (const UIDRef &textModelRef, TextIndex start, int32 len, const K2Vector< UID > &conditionsToApply, bool16 removeExisting=kFalse)=0 |
| virtual ErrorCode | RemoveConditionsFromText (const UIDRef &textModelRef, TextIndex start, int32 len, const K2Vector< UID > &conditionsToRemove)=0 |
| virtual K2Vector< UID > | GetAppliedConditions (const UIDRef &textModelRef, TextIndex startPosition, TextIndex endPosition, int32 *length=nil)=0 |
| virtual ErrorCode | GetAppliedConditions (const UIDRef &textModelRef, const RangeData &rangeData, UIDList &appliedToAllChars, UIDList &appliedToSomeChars, bool16 *rangeHasUnconditionalChars=nil)=0 |
| virtual void | GetFirstAvailableDefaultConditionName (IWorkspace *ws, WideString &newName)=0 |
| virtual void | GetNextDefaultConditionColor (IWorkspace *ws, UID &newColor)=0 |
| virtual ErrorCode | FindCondition (IWorkspace *ws, const WideString &name, UID &conditionUID)=0 |
| virtual IConditionTagList * | QueryActiveConditionList (IActiveContext *ac)=0 |
| virtual IConditionTagList * | QueryConditionList (IDataBase *db)=0 |
| virtual ErrorCode | SetShowConditionIndicators (IWorkspace *ws, IConditionalTextOptions::ConditionIndicatorsMode showIndicatorsMode)=0 |
| virtual ErrorCode | ShowAllConditions (IWorkspace *ws, bool16 showConditions)=0 |
| virtual ErrorCode | LoadConditions (IWorkspace *ws, const IDFile &sourceFile, bool16 loadConditionSets)=0 |
| virtual ErrorCode | CreateConditionSet (IWorkspace *ws, const WideString &name, const ConditionSetElementList &conditionSetElements, UID *newConditionSetUID)=0 |
| virtual ErrorCode | DeleteConditionSet (const UIDRef &conditionSetRef)=0 |
| virtual ErrorCode | GetAllConditionSets (IWorkspace *ws, UIDList *conditionSets)=0 |
| virtual ErrorCode | GetActiveConditionSet (IWorkspace *ws, UID &activeConditionSetUID)=0 |
| virtual ErrorCode | SetActiveConditionSet (IWorkspace *ws, UID activeConditionSetUID)=0 |
| virtual ErrorCode | GetConditionsInConditionSet (const UIDRef &conditionSetRef, ConditionSetElementList &conditionSetElements)=0 |
| virtual ErrorCode | RedefineConditionSet (const UIDRef &conditionSetRef, const ConditionSetElementList &conditionSetElements)=0 |
| virtual ErrorCode | SetConditionSetName (const UIDRef &conditionSetRef, const WideString &name)=0 |
| virtual ErrorCode | GetConditionSetName (const UIDRef &conditionSetRef, WideString &name)=0 |
| virtual ErrorCode | FindConditionSet (IWorkspace *ws, const WideString &name, UID &conditionSetUID)=0 |
| virtual ErrorCode | GetFirstAvailableDefaultConditionSetName (IWorkspace *ws, WideString &newName)=0 |
| virtual IConditionTagSetList * | QueryActiveConditionSetList (IActiveContext *ac)=0 |
| virtual IConditionTagSetList * | QueryConditionSetList (IDataBase *db)=0 |
| virtual ErrorCode | LoadConditions (IWorkspace *ws, const std::string &sourceFile, bool16 loadConditionTagSets)=0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
The IConditionalTextFacade provides high-level access to conditions, condition sets and conditional text operations. Please use the IConditionalTextFacade directly via the UtilsBoss if possible, see Utils.h: Utils<Facade::IConditionalTextFacade>()->method( params,... );
Conditions are UID based objects that have a name, drawing options, and visibility sate. They are maintained in a list on the application and document workspaces respectively. They can be applied to text ranges and are represented as a style override, see for kConditionalTextAttributeBoss. Multiple conditions may be applied to the same text.
When a condition's visible state is changed to false, text with that condition applied is hidden if there are no other conditions applied that are visible. Likewise, when a condition's visible state is change to true, hidden text with that condition applied is shown. Hidden text is not searchable.
Condition sets are UID based objects that capture visibility states for each condition. These are maintained in lists on the application and document workspaces. Visibilities for condition(s) created after a set is created do not change when a set is made active. A set may be redefined to capture the visibilites for those conditions.
Settings for conditional text options that are maintained at the document and application workspace include show/hide condition indicators on the text and the active set.
| typedef std::pair<UID, bool> Facade::IConditionalTextFacade::ConditionSetElement |
Typedef defining a condition set element, the first item in the pair is a UID of the condition and second item is the condition's saved visible state.
| typedef std::vector< ConditionSetElement > Facade::IConditionalTextFacade::ConditionSetElementList |
Typedef of a vector of ConditionSetElement(s).
| pure virtual |
Apply the condition to the specified text range. Conditions already applied are replaced unless otherwise specified. All applied conditions can be removed by passing an empty list of condition UIDs.
| textModelRef | IN The text model containing the text to apply the condition. |
| start | IN The text index for the start of the text range. |
| len | IN The length of the text range. |
| conditionsToApply | IN The list of condition UIDs to apply to the text range. |
| removeExisting | IN Whether or not conditions already applied are removed. |
| pure virtual |
Creates a new condition on the workspace provided with the options and visible state specified.
| ws | IN Workspace where to create the condition. |
| newConditionUID | OUT The UID of newly created condition if successful. |
| name | IN The name of the new condition. If empty, uses next available name (i.e. Condition 1, Condition 2) |
| colorUID | IN The UID of the color for the new condition. If kInvalidUID, uses next available color. |
| method | IN The indicator method. |
| appearance | IN The underline indicator appearance. |
| visibleState | IN The visiblity for the new condition. |
| pure virtual |
Creates a new condition set on the workspace provided with the name specified.
| ws | IN Workspace where to create the condition set. |
| name | IN The name of the new condition set. |
| conditionSetElements | IN A list of conditions and their visibility states to create a set from. |
| newConditionSetUID | OUT The UID of newly created condition set if successful. |
| pure virtual |
Deletes a condition on the workspace provided and replace with the specified conditon (if any).
| conditionsToDelete | IN A UIDList of conditions to delete. |
| conditionToReplaceWith | IN The UID of the condition to replace with. |
| pure virtual |
Deletes a condition set on the workspace provided.
| conditionSetRef | IN The UIDRef of the condition set to delete. |
| pure virtual |
Find the uid of a condition by the name.
| ws | IN Workspace to get the name of the uid from. |
| name | IN name of the to find. |
| conditionUID | OUT The UID of the condition matching the name passed in. |
| pure virtual |
Find the uid of a condition set by the set name.
| ws | IN Workspace to get the name of the condition set uid from. |
| name | IN name of the condition set to find. |
| conditionSetUID | OUT The UID of the condition set matching the name passed in. |
| pure virtual |
Get the condition set currently applied to the workspace provided
| ws | IN Workspace where to get the active set from. |
| activeConditionSetUID | OUT UID of the active condition set or kInvalidUID if no set is active. |
| pure virtual |
Get a uid list of all condition sets in a specific workspace
| ws | IN Workspace where to get the set list from. |
| conditionSets | OUT A UIDList of sets. |
| pure virtual |
Get the condition(s) applied at startPosition. Will join runs when this attribute is unchanged until endPosition. See kConditionalTextAttributeBoss.
| textModelRef | IN The text model to examine. |
| startPosition | IN The initial text location to start from. |
| endPosition | IN The text location to not bother looking beyond. |
| length | OUT A pointer to value that will contain the number of characters after startPosition that share the same attribute value. |
| pure virtual |
Get the condition(s) applied for the range of text specified and return them in the specified lists. See kConditionalTextAttributeBoss.
| textModelRef | IN The text model to examine. |
| rangeData | IN The range to get applied conditions for. |
| appliedToAllChars | OUT The conditions applied to all of the characters in the range specified. |
| appliedToSomeChars | OUT The conditions applied to some of the characters in the range specified. |
| rangeHasUnconditionalChars | OUT A pointer to bool for whether or not the range has characters that are unconditional. |
| pure virtual |
Gets the color for a condition on the workspace provided.
| conditionRef | IN The UIDRef of the condition. |
| appearance | OUT The new underline indicator appearance for the condition. |
| pure virtual |
Gets the color for a condition on the workspace provided.
| conditionRef | IN The UIDRef of the condition. |
| colorUID | OUT The color UID for the condition. |
| pure virtual |
Gets the indicator method for a condition on the workspace provided.
| conditionRef | IN The UIDRef of the condition. |
| method | OUT The indicator method for the condition. |
| pure virtual |
Gets the name for a condition on the workspace provided.
| ws | IN Workspace where to find the condition. |
| conditionRef | IN The UIDRef of the condition. |
| name | OUT The name condition. |
| pure virtual |
Gets the options for a condition on the workspace provided.
| conditionRef | IN The UIDRef of the condition. |
| name | IN The name for the condition. |
| colorUID | IN The color UID for the condition. IN The indicator method for the condition. |
| appearance | IN The underline indicator appearance for the condition. |
| pure virtual |
Sets the name for a condition set on the workspace provided.
| conditionSetRef | IN The UIDRef of the condition set to get the name of. |
| name | OUT The name of the condition set. |
| pure virtual |
Given a single condition set uid this will return a list of all conditions within that set.
| conditionSetRef | IN The UIDRef of the condition set to get individual conditions of. |
| conditionSetElements | OUT a list of conditions in the set and their associated visiblity states. |
| pure virtual |
Gets the visible state for a condition on the workspace provided.
| conditionRef | IN The UIDRef of the condition. |
| visibleState | OUT The visible state for the condition. |
| pure virtual |
Returns the first available default condition name (Condition 1, Condition 2, etc) on the workspace provided. This name is unique with respect to existing conditions' names and can be used to create a new condition with out conflict.
| ws | IN Workspace where to create the condition. |
| newName | OUT The unique name generated. |
| pure virtual |
Returns a default condition set name (Condition Set 1, Condition Set 2, etc) on the workspace provided that is unique.
| ws | IN Workspace where to create the paragraph style. |
| newName | OUT The unique name generated. |
| pure virtual |
Returns the next default color to use for a new condition on the workspace provided. See .
| ws | IN Workspace where to create the condition. |
| colorUID | OUT The color UID for the condition. |
| pure virtual |
Loads the conditions into the specified workspace from the specified file. Optionally, loads the condition sets.
| ws | IN Workspace to load the conditions and optionally the sets to. |
| sourceFile | IN The file to load the conditions from. |
| loadConditionSets | IN If kTrue then loads the condition sets; otherwise, only loads the conditions. |
| pure virtual |
Loads the condition from a cloud asset represented by sourceFile
| ws | IN Workspace to get the name of the condition set uid from. |
| sourceFile | IN cloud asset of the document. |
| loadConditionTagSets | IN If kTrue then loads the condition sets; otherwise, only loads the conditions. |
| pure virtual |
Query for the list of conditions in the specified active context.
| ac | IN The active context to use. |
| pure virtual |
Query for the current active condition set list in the specified context.
| ac | IN The active context to use. |
| pure virtual |
Query for the list of conditions for the given database.
| db | IN The database to use. |
| pure virtual |
Query for the condition set list of the given database.
| db | IN The database to use. |
| pure virtual |
Given a single condition set uid this redefines the list of conditions of the set.
| conditionSetRef | IN The UIDRef of the condition set to set individual conditions for. |
| conditionSetElements | IN a list of conditions to set and their associated visiblity states. |
| pure virtual |
Remove the specified conditions from the specified text range.
| textModelRef | IN The text model containing the text to apply the condition. |
| start | IN The text index for the start of the text range. |
| len | IN The length of the text range. |
| conditionsToUnapply | IN The list of condition UIDs to remove from the text range. |
| pure virtual |
Set the active condition set for the workspace.
| ws | IN Workspace where to set the active condition set on. |
| activeConditionSetUID | IN UID of the condition set to activate. |
| pure virtual |
Sets the color for a condition on the workspace provided.
| conditionRef | IN The UIDRef of the condition to edit. |
| newAppearance | IN The new underline indicator appearance for the condition. |
| pure virtual |
Sets the color for a condition on the workspace provided.
| conditionRef | IN The UIDRef of the condition to edit. |
| colorUID | IN The new color UID for the condition. |
| pure virtual |
Sets the indicator method for a condition on the workspace provided.
| conditionRef | IN The UIDRef of the condition to edit. |
| newMethod | IN The new indicator method for the condition. |
| pure virtual |
Sets the name for a condition on the workspace provided.
| conditionRef | IN The UIDRef of the condition to edit. |
| name | IN The new name condition. |
| pure virtual |
Sets the options for a condition on the workspace provided.
| 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. |
| newAppearance | IN The new underline indicator appearance for the condition. |
| pure virtual |
Sets the name for a condition set on the workspace provided.
| conditionSetRef | IN The UIDRef of the condition set to edit. |
| name | IN The new name condition set. |
| pure virtual |
Sets the visible state for a condition on the workspace provided. Will hide or show conditional text appropriately.
| conditionRef | IN The UIDRef of the condition to edit. |
| visibleState | IN The new visible state for the condition; kTrue to show or kFalse to hide. |
| pure virtual |
Set the conditional text option for show condition indicators on the workspace provided.
| ws | IN Workspace where to set the option. |
| showIndicatorsMode | IN The new setting for the show condition indications option. |
| pure virtual |
Shows or hides all of the conditions in the specified workspace based on the specified flag.
| ws | IN Workspace containing the conditions to show/hide. |
| showConditions | IN The new setting for the conditions visible states; kTrue to show or kFalse to hide. |