#include <ITextAttrUtils.h>
|
| enum | { kDefaultIID = IID_ITEXTATTRUTILS } |
| |
|
| virtual ICommand * | BuildApplyTextAttrCmd (ITextModel *model, TextIndex start, uint32 len, const IPMUnknown *attr, const ClassID &which)=0 |
| |
| virtual ICommand * | BuildApplyTextAttrCmd (ITextModel *model, const RangeData &range, const IPMUnknown *attr, const ClassID &which)=0 |
| |
| virtual ICommand * | BuildApplyTextAttrCmd (ITextModel *model, TextIndex start, uint32 len, const ClassID &which, const boost::shared_ptr< AttributeBossList > &attrList)=0 |
| |
| virtual ICommand * | BuildApplyTextAttrCmd (ITextModel *mod, const RangeData &range, const ClassID &which, const boost::shared_ptr< AttributeBossList > &attrList)=0 |
| |
| virtual ICommand * | BuildApplyUserTextAttrCmd (ITextModel *mod, TextIndex start, uint32 len, const IPMUnknown *attr, const ClassID &which)=0 |
| |
| virtual ICommand * | BuildApplyUserTextAttrCmd (ITextModel *mod, const RangeData &range, const IPMUnknown *attr, const ClassID &which)=0 |
| |
| virtual ICommand * | BuildClearTextAttrCmd (ITextModel *mod, TextIndex start, uint32 len, const ClassID &attrClass, const ClassID &which)=0 |
| |
| virtual ICommand * | BuildClearTextAttrCmd (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 |
| |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| |
| virtual void | AddRef () const =0 |
| |
| virtual void | Release () const =0 |
| |
Utilities for getting and setting text attributes. e.g.
Utils<ITextAttrUtils>()->BuildApplyTextAttrCmd( ... ) ;
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
| model | IN the text model to apply the attribute to. |
| start | IN the starting TextIndex for the apply. |
| len | IN the length of the span of text to apply to. |
| attr | IN an interface of the attribute to be applied. |
| which | IN the ClassID of the attribute strand to apply to (either kCharAttrStrandBoss or kParaAttrStrandBoss). |
- Returns
- The built command.
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
| model | IN the text model to apply the attribute to. |
| range | IN the range of text in the story to apply to. |
| attr | IN an interface of the attribute to be applied. |
| which | IN the ClassID of the attribute strand to apply to (either kCharAttrStrandBoss or kParaAttrStrandBoss). |
- Returns
- The built command.
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
| model | IN the text model to apply the attribute to. |
| start | IN the starting TextIndex for the apply. |
| len | IN the length of the span of text to apply to. |
| which | IN the ClassID of the attribute strand to apply to (either kCharAttrStrandBoss or kParaAttrStrandBoss). |
| attrList | the list of text attributes to be applied. These must either all be character attributes or all be paragraph attributes. |
- Returns
- The built command.
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
| model | IN the text model to apply the attribute to. |
| range | IN the range of text in the story to apply to. |
| which | IN the ClassID of the attribute strand to apply to (either kCharAttrStrandBoss or kParaAttrStrandBoss). |
| attrList | the list of text attributes to be applied. These must either all be character attributes or all be paragraph attributes. |
- Returns
- The built command.
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
| model | IN the text model to apply the attribute to. |
| start | IN the starting TextIndex for the apply. |
| len | IN the length of the span of text to apply to. |
| attr | IN an interface of the attribute to be applied. |
| which | IN the ClassID of the attribute strand to apply to (either kCharAttrStrandBoss or kParaAttrStrandBoss). |
- Returns
- The built command. nil if the target ITextModel is locked.
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
| model | IN the text model to apply the attribute to. |
| range | IN the range of text in the story to apply to. |
| attr | IN an interface of the attribute to be applied. |
| which | IN the ClassID of the attribute strand to apply to (either kCharAttrStrandBoss or kParaAttrStrandBoss). |
- Returns
- The built command. nil if the target ITextModel is locked.
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
| model | IN the text model to clear the attribute in. |
| start | IN the starting TextIndex for the clear. |
| len | IN the length of the span of text to clear. |
| attr | IN an interface of the attribute to be cleared. |
| which | IN the ClassID of the attribute strand to clear the attribute from (either kCharAttrStrandBoss or kParaAttrStrandBoss). |
- Returns
- The built command.
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
| model | IN the text model to clear the attribute in. |
| range | IN the range of text in the story to apply to. |
| attr | IN an interface of the attribute to be cleared. |
| which | IN the ClassID of the attribute strand to clear the attribute from (either kCharAttrStrandBoss or kParaAttrStrandBoss). |
- Returns
- The built command.
| virtual void ITextAttrUtils::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 | | ) | | |
| 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
| model | IN relevant text model. |
| index | IN position in model we want the attribute for. |
| includeTextState | IN should we use the text state. |
| leanleft | IN gather attributes to the left of the index. |
| results | OUT effective attributes. |
| start | OUT If non-nil returns starting index for the resulting run. |
| end | OUT If non-nil returns ending index for the resulting run. |
| paraStyle | OUT If non-nil returns the paragraph style applied to this run. |
| plen | OUT If non-nil returns the remaining text the paragraph style is applied to. |
| paraStyleOverridden | OUT If non-nil returns kTrue if this paragraph style been overridden. |
| charStyle | OUT If non-nil returns character style applied to this run. |
| clen | OUT If non-nil returns the remaining text the character style is applied to. |
| charStyleOverridden | OUT If non-nil returns kTrue if this character style been overridden. |
| nestedStyle | OUT If non-nil returns character style applied via nested style. |
| nestedStyleLen | OUT If non-nil returns the remaining text the nested character style is applied to. |
| nestedStyleOverridden | OUT 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 | ( | ITextModel * | model, | | | 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
| model | IN the story containing the text to be scaled. |
| start | IN the starting index of the text to be scaled. |
| endPosition | IN the ending index of the text to be scaled. (One beyond the last character to be scaled.) |
| xScale | IN the horizontal scaling percentage to apply. |
| yScale | IN 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).