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

#include <ITextAttrUtils.h>

Inheritance diagram for ITextAttrUtils:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ITEXTATTRUTILS }
 

Public Member Functions

virtual ICommandBuildApplyTextAttrCmd (ITextModel *model, TextIndex start, uint32 len, const IPMUnknown *attr, const ClassID &which)=0
 
virtual ICommandBuildApplyTextAttrCmd (ITextModel *model, const RangeData &range, const IPMUnknown *attr, const ClassID &which)=0
 
virtual ICommandBuildApplyTextAttrCmd (ITextModel *model, TextIndex start, uint32 len, const ClassID &which, const boost::shared_ptr< AttributeBossList > &attrList)=0
 
virtual ICommandBuildApplyTextAttrCmd (ITextModel *mod, const RangeData &range, const ClassID &which, const boost::shared_ptr< AttributeBossList > &attrList)=0
 
virtual ICommandBuildApplyUserTextAttrCmd (ITextModel *mod, TextIndex start, uint32 len, const IPMUnknown *attr, const ClassID &which)=0
 
virtual ICommandBuildApplyUserTextAttrCmd (ITextModel *mod, const RangeData &range, const IPMUnknown *attr, const ClassID &which)=0
 
virtual ICommandBuildClearTextAttrCmd (ITextModel *mod, TextIndex start, uint32 len, const ClassID &attrClass, const ClassID &which)=0
 
virtual ICommandBuildClearTextAttrCmd (ITextModel *mod, const RangeData &range, const ClassID &attrClass, const ClassID &which)=0
 
virtual ErrorCode ProcessScaleTextMeasures (ITextModel *model, TextIndex start, TextIndex endPosition, PMReal xScale, PMReal yScale)=0
 
virtual void GetTotalAttributesAtIndex (ITextModel *model, TextIndex index, bool16 includeTextState, bool16 leanleft, AttributeBossList &results, int32 *start=nil, int32 *end=nil, UID *paraStyle=nil, int32 *plen=nil, bool16 *paraStyleOverridden=nil, UID *charStyle=nil, int32 *clen=nil, bool16 *charStyleOverridden=nil, RunInStyleResult::CharStyleList *nestedStyles=nil, int32 *nestedStyleLen=nil, bool16 *nestedStyleOverridden=nil)=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

Utilities for getting and setting text attributes. e.g.

Utils<ITextAttrUtils>()->BuildApplyTextAttrCmd( ... ) ;

Member Function Documentation

virtual ICommand* ITextAttrUtils::BuildApplyTextAttrCmd (ITextModelmodel,
TextIndex start,
uint32 len,
const IPMUnknownattr,
const ClassIDwhich 
)
pure virtual

Builds and returns an apply text attributes command setup to apply the given text attribute to a range in a story. This is just a thin wrapper on ITextModelCmds::ApplyCmd().

Parameters
modelIN the text model to apply the attribute to.
startIN the starting TextIndex for the apply.
lenIN the length of the span of text to apply to.
attrIN an interface of the attribute to be applied.
whichIN the ClassID of the attribute strand to apply to (either kCharAttrStrandBoss or kParaAttrStrandBoss).
Returns
The built command.
virtual ICommand* ITextAttrUtils::BuildApplyTextAttrCmd (ITextModelmodel,
const RangeDatarange,
const IPMUnknownattr,
const ClassIDwhich 
)
pure virtual

Builds and returns an apply text attributes command setup to apply the given text attribute to a range in a story. This is just a thin wrapper on ITextModelCmds::ApplyCmd().

Parameters
modelIN the text model to apply the attribute to.
rangeIN the range of text in the story to apply to.
attrIN an interface of the attribute to be applied.
whichIN the ClassID of the attribute strand to apply to (either kCharAttrStrandBoss or kParaAttrStrandBoss).
Returns
The built command.
virtual ICommand* ITextAttrUtils::BuildApplyTextAttrCmd (ITextModelmodel,
TextIndex start,
uint32 len,
const ClassIDwhich,
const boost::shared_ptr< AttributeBossList > & attrList 
)
pure virtual

Builds and returns an apply text attributes command setup to apply the given text attributes to a range in a story. This is just a thin wrapper on ITextModelCmds::ApplyCmd().

Parameters
modelIN the text model to apply the attribute to.
startIN the starting TextIndex for the apply.
lenIN the length of the span of text to apply to.
whichIN the ClassID of the attribute strand to apply to (either kCharAttrStrandBoss or kParaAttrStrandBoss).
attrListthe list of text attributes to be applied. These must either all be character attributes or all be paragraph attributes.
Returns
The built command.
virtual ICommand* ITextAttrUtils::BuildApplyTextAttrCmd (ITextModelmod,
const RangeDatarange,
const ClassIDwhich,
const boost::shared_ptr< AttributeBossList > & attrList 
)
pure virtual

Builds and returns an apply text attributes command setup to apply the given text attributes to a range in a story. This is just a thin wrapper on ITextModelCmds::ApplyCmd().

Parameters
modelIN the text model to apply the attribute to.
rangeIN the range of text in the story to apply to.
whichIN the ClassID of the attribute strand to apply to (either kCharAttrStrandBoss or kParaAttrStrandBoss).
attrListthe list of text attributes to be applied. These must either all be character attributes or all be paragraph attributes.
Returns
The built command.
virtual ICommand* ITextAttrUtils::BuildApplyUserTextAttrCmd (ITextModelmod,
TextIndex start,
uint32 len,
const IPMUnknownattr,
const ClassIDwhich 
)
pure virtual

Builds and returns a user apply text attributes command setup to apply the given text attribute to a range in a story. This is just a thin wrapper on ITextModelCmds::UserApplyCmd(). NOTE: Unlike the BuildApplyTextAttrCmd and BuildApplyUserTextAttrCmd above, this method will return nil if the target story is locked.

Parameters
modelIN the text model to apply the attribute to.
startIN the starting TextIndex for the apply.
lenIN the length of the span of text to apply to.
attrIN an interface of the attribute to be applied.
whichIN the ClassID of the attribute strand to apply to (either kCharAttrStrandBoss or kParaAttrStrandBoss).
Returns
The built command. nil if the target ITextModel is locked.
virtual ICommand* ITextAttrUtils::BuildApplyUserTextAttrCmd (ITextModelmod,
const RangeDatarange,
const IPMUnknownattr,
const ClassIDwhich 
)
pure virtual

Builds and returns a user apply text attributes command setup to apply the given text attribute to a range in a story. This is just a thin wrapper on ITextModelCmds::UserApplyCmd(). NOTE: Unlike the BuildApplyTextAttrCmd and BuildApplyUserTextAttrCmd above, this method will return nil if the target story is locked.

Parameters
modelIN the text model to apply the attribute to.
rangeIN the range of text in the story to apply to.
attrIN an interface of the attribute to be applied.
whichIN the ClassID of the attribute strand to apply to (either kCharAttrStrandBoss or kParaAttrStrandBoss).
Returns
The built command. nil if the target ITextModel is locked.
virtual ICommand* ITextAttrUtils::BuildClearTextAttrCmd (ITextModelmod,
TextIndex start,
uint32 len,
const ClassIDattrClass,
const ClassIDwhich 
)
pure virtual

Builds and returns a clear text attributes command setup to clear the given text attribute over the given range of a story. This is just a thin wrapper on ITextModelCmds::ClearOverridesCmd().

Parameters
modelIN the text model to clear the attribute in.
startIN the starting TextIndex for the clear.
lenIN the length of the span of text to clear.
attrIN an interface of the attribute to be cleared.
whichIN the ClassID of the attribute strand to clear the attribute from (either kCharAttrStrandBoss or kParaAttrStrandBoss).
Returns
The built command.
virtual ICommand* ITextAttrUtils::BuildClearTextAttrCmd (ITextModelmod,
const RangeDatarange,
const ClassIDattrClass,
const ClassIDwhich 
)
pure virtual

Builds and returns a clear text attributes command setup to clear the given text attribute over the given range of a story. This is just a thin wrapper on ITextModelCmds::ClearOverridesCmd().

Parameters
modelIN the text model to clear the attribute in.
rangeIN the range of text in the story to apply to.
attrIN an interface of the attribute to be cleared.
whichIN the ClassID of the attribute strand to clear the attribute from (either kCharAttrStrandBoss or kParaAttrStrandBoss).
Returns
The built command.
virtual void ITextAttrUtils::GetTotalAttributesAtIndex (ITextModelmodel,
TextIndex index,
bool16 includeTextState,
bool16 leanleft,
AttributeBossListresults,
int32 * start = nil,
int32 * end = nil,
UIDparaStyle = nil,
int32 * plen = nil,
bool16 * paraStyleOverridden = nil,
UIDcharStyle = nil,
int32 * clen = nil,
bool16 * charStyleOverridden = nil,
RunInStyleResult::CharStyleListnestedStyles = nil,
int32 * nestedStyleLen = nil,
bool16 * nestedStyleOverridden = nil 
)
pure virtual

Fills results with the total attributes at index, accounting for story thread attributes, paragraph styles, paragaph overrides, nested styles, character styles, and character overrides. Returns additional information in optional variables.

Parameters
modelIN relevant text model.
indexIN position in model we want the attribute for.
includeTextStateIN should we use the text state.
leanleftIN gather attributes to the left of the index.
resultsOUT effective attributes.
startOUT If non-nil returns starting index for the resulting run.
endOUT If non-nil returns ending index for the resulting run.
paraStyleOUT If non-nil returns the paragraph style applied to this run.
plenOUT If non-nil returns the remaining text the paragraph style is applied to.
paraStyleOverriddenOUT If non-nil returns kTrue if this paragraph style been overridden.
charStyleOUT If non-nil returns character style applied to this run.
clenOUT If non-nil returns the remaining text the character style is applied to.
charStyleOverriddenOUT If non-nil returns kTrue if this character style been overridden.
nestedStyleOUT If non-nil returns character style applied via nested style.
nestedStyleLenOUT If non-nil returns the remaining text the nested character style is applied to.
nestedStyleOverriddenOUT If non-nil returns kTrue if the nested style is overridden by character attributes applied directly to the text or by attributes of the character style of the text.
Precondition
model must be a non-nil ITextModel.
index must be a valid position in the model.
Returns
void
virtual ErrorCode ITextAttrUtils::ProcessScaleTextMeasures (ITextModelmodel,
TextIndex start,
TextIndex endPosition,
PMReal xScale,
PMReal yScale 
)
pure virtual

Generates and processes all the commands necessary to scale the text attributes of the given range of text by the given x and y scale factors. All the commands are incapsulated in a single command sequence. NOTE: It is the callers responsibility to ensure the range of text is fully composed before calling this method. (In some cases the composed state of the text must be known in order to correctly apply scaling.)

Parameters
modelIN the story containing the text to be scaled.
startIN the starting index of the text to be scaled.
endPositionIN the ending index of the text to be scaled. (One beyond the last character to be scaled.)
xScaleIN the horizontal scaling percentage to apply.
yScaleIN the vertical scaling percentage to apply.
Returns
errCode kSuccess, or a failure code if one of the subcommands failed (in which case all other commands would have been rolled back).