InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
PMTextUtils.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Eric_Menninga
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 // There already is a TextUtils.h in the MacOS interfaces
24 //
25 //========================================================================================
26 
27 #ifndef __PMTextUtils__
28 #define __PMTextUtils__
29 
30 #include "ITextUtils.h"
31 #include "Utils.h"
32 #include "ICharFilters.h" // for PMCharFilters
33 #include "RangeData.h" // for StoryRange
34 
35 
36 // BP 4/17/97: The TextOffscreen is a TextEditor service. It will be cached in PMTextUtils.cpp.
37 // Please do not use SetTextOffscreen(). This function shall only be called by ITextOffscreen itself.
38 // Since text redraw is very time critical we have to do some ugly optimization tricks...
39 class ITextOffscreen;
40  ITextOffscreen *QueryTextOffscreen();
41  void SetTextOffscreen( ITextOffscreen *pOffscreen );
42 
43 // This is the new direction
44 namespace Text {
45  // use these functions instead of PMString("RomanRegularBookPlainMedium").Cointain();
46  inline bool16 IsPlainStyleName( const PMString &styleName )
47  { return Utils<ITextUtils>()->IsPlainStyleName( styleName ); }
48 
49  inline bool16 IsItalicStyleName( const PMString &styleName )
50  { return Utils<ITextUtils>()->IsItalicStyleName( styleName ); }
51 
52  inline bool16 IsBoldStyleName( const PMString &styleName )
53  { return Utils<ITextUtils>()->IsBoldStyleName( styleName ); }
54 
55  inline bool16 IsBoldItalicStyleName( const PMString &styleName )
56  { return Utils<ITextUtils>()->IsBoldItalicStyleName( styleName ); }
57 }
58 
59 namespace PMCharFilters
60 {
61  inline bool16 SpellingIsWordChar( const UTF32TextChar& aStart, const UTF32TextChar& aEnd )
62  { return Utils<ICharFilters>()->SpellingIsWordChar( aStart, aEnd ); }
63 
64  inline bool16 SpellingIsWordCharNoPeriod( const UTF32TextChar& aStart, const UTF32TextChar& aEnd )
65  { return Utils<ICharFilters>()->SpellingIsWordCharNoPeriod( aStart, aEnd ); }
66 
67  inline bool16 DefaultIsWordChar( const UTF32TextChar& aStart, const UTF32TextChar& aEnd )
68  { return Utils<ICharFilters>()->DefaultIsWordChar( aStart, aEnd ); }
69 
70  inline bool16 TestIsSpace( const UTF32TextChar& aStart, const UTF32TextChar& aEnd )
71  { return Utils<ICharFilters>()->TestIsSpace( aStart, aEnd ); }
72 
73  inline bool16 TestIsPunctuation( const UTF32TextChar& aStart, const UTF32TextChar& aEnd )
74  { return Utils<ICharFilters>()->TestIsPunctuation( aStart, aEnd ); }
75 
76  inline bool16 LanguageIsWordChar( const UTF32TextChar& aStart, const UTF32TextChar& aEnd )
77  { return Utils<ICharFilters>()->LanguageIsWordChar( aStart, aEnd ); }
78 
79  inline bool16 SpellingIsWordCharNoPunctuation( const UTF32TextChar& aStart, const UTF32TextChar& aEnd )
80  { return Utils<ICharFilters>()->SpellingIsWordCharNoPunctuation( aStart, aEnd ); }
81 
82  inline bool16 SpellingIsUserDictChar( const UTF32TextChar& aStart, const UTF32TextChar& aEnd )
83  { return Utils<ICharFilters>()->SpellingIsUserDictChar( aStart, aEnd ); }
84 
85  inline bool16 TextMacroCodeIsWordChar( const UTF32TextChar& aStart, const UTF32TextChar& aEnd )
86  { return Utils<ICharFilters>()->TextMacroCodeIsWordChar( aStart, aEnd ); }
87 }
88 
89 #endif
90  // __PMTextUtils__