InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
TextAttrUtils.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: eric_kenninga
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __TextAttrUtils__
25 #define __TextAttrUtils__
26 
27 #include "ITextAttrUtils.h"
28 
29 // fill out the story, the range, an interface from the attribute, and the classID of the strand you're applying to: char, para, etc.
30 // char = kCharAttrStrandBoss, para = kParaAttrStrandBoss. If you want to apply more than 1 attr at a time, you can, but you must
31 // access the IApplyStyleData interface of the command you get back.
32 inline ICommand* BuildApplyTextAttrCmd(ITextModel *mod, TextIndex start, uint32 len, const IPMUnknown *attr, const ClassID& which)
33  { return Utils<ITextAttrUtils>()->BuildApplyTextAttrCmd( mod, start, len, attr, which ); }
34 
35 // The "attrList" is owned by the returned command.
36  inline ICommand* BuildApplyTextAttrCmd(ITextModel *mod, TextIndex start, uint32 len, const ClassID& which, const boost::shared_ptr<AttributeBossList>& attrList)
37  { return Utils<ITextAttrUtils>()->BuildApplyTextAttrCmd( mod, start, len, which, attrList ); }
38 
39 // Unlike BuildApplyTextAttrCmd, BuildApplyUserTextAttrCmd will first check to see if the text model content is locked and return nil if this is true.
40 inline ICommand* BuildApplyUserTextAttrCmd(ITextModel *mod, TextIndex start, uint32 len, const IPMUnknown *attr, const ClassID& which)
41  { return Utils<ITextAttrUtils>()->BuildApplyUserTextAttrCmd(mod, start, len, attr, which ); }
42 inline ICommand* BuildClearTextAttrCmd( ITextModel *mod, TextIndex start, uint32 len, const ClassID& attrClass, const ClassID& which )
43  { return Utils<ITextAttrUtils>()->BuildClearTextAttrCmd(mod, start, len, attrClass, which); }
44 
45  // NOTE: It is the responsibility of the caller to ensure that all Text
46  // within the range is fully composed as possible BEFORE calling. In
47  // practice the top level container, usually the MultiColumnFrame should
48  // be the only one required to force composition.
49 inline ErrorCode ProcessScaleTextMeasures( ITextModel *model, TextIndex start, TextIndex endPosition, PMReal xScale, PMReal yScale )
50  { return Utils<ITextAttrUtils>()->ProcessScaleTextMeasures( model, start, endPosition, xScale, yScale ); }
51 inline void GetTotalAttributesAtIndex(ITextModel * model, TextIndex index, bool16 includeTextState, bool16 leanleft,
52  AttributeBossList & results, int32 * start, int32 * end,
53  UID * paraStyle, int32 * plen, bool16 * paraStyleOverridden,
54  UID * charStyle, int32 * clen, bool16 * charStyleOverridden
55  )
56  { Utils<ITextAttrUtils>()->GetTotalAttributesAtIndex(model, index, includeTextState, leanleft, results, start, end, paraStyle, plen, paraStyleOverridden, charStyle, clen, charStyleOverridden); }
57 #endif // __TextAttrUtils__