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

#include <IFocusCache.h>

Inheritance diagram for IFocusCache:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IFOCUSCACHE }
 

Public Member Functions

virtual int32 CountParagraphStyles () const =0
 
virtual int32 CountCharacterStyles () const =0
 
virtual int32 CountCharacterStylesFromRunIns () const =0
 
virtual UID GetNthParagraphStyle (int32 n) const =0
 
virtual UID GetNthCharacterStyle (int32 n) const =0
 
virtual UID GetNthCharacterStyleFromRunIn (int32 n) const =0
 
virtual bool16 IsStyleOverridden (UID style) const =0
 
virtual int32 CountSelectedRuns () const =0
 
virtual int32 CountAttributes (const ClassID &attr) const =0
 
virtual const IPMUnknownQueryAttributeN (int32 which, const ClassID &attr, const PMIID &interfaceID) const =0
 
virtual int32 CountFonts (ClassID fontUIDBoss=kTextAttrFontUIDBoss) const =0
 
virtual UID GetNthFamilyUIDAndFace (int32 nthFont, PMString *faceName, ClassID fontUIDBoss=kTextAttrFontUIDBoss) const =0
 
virtual const PMStringGetNthFont (int32 nthFont, bool16 *incorrectFace=nil, ClassID fontUIDBoss=kTextAttrFontUIDBoss) const =0
 
virtual const Fixed * GetNthMMAxes (int32 nthFont, int32 *numaxes) const =0
 
virtual bool16 GetOverrideList (K2Vector< PMString > &overrideStrings, bool16 getForParaStyle) const =0
 
virtual void InvalidateCache ()=0
 
virtual void ResetCache_NoNotify ()=0
 
virtual void Inserted (TextIndex where, int32 howmuch)=0
 
virtual void Deleted (TextIndex where, int32 howmuch)=0
 
virtual void FocusWasMoved (const ITextModel *model, TextIndex start, TextIndex end, bool16 excludeCacheEnd=kTrue)=0
 
virtual bool16 CacheAlreadyBuilt () const =0
 
virtual uint32 GetTimeStamp () const =0
 
virtual void CopyToAttributeLists (AttributeBossList *attrList, AttributeBossList *mixedList=nil) const =0
 
virtual bool16 IsRubyApplied () const =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

A text range that is active (selected) with an ITextFocus on it has the FocusCache interface that can report back the attributes within the range. Efficient for all attributes, but not the best for just checking one.

See Also
IComposeScanner

Member Function Documentation

virtual bool16 IFocusCache::CacheAlreadyBuilt () const
pure virtual

lets you check if the cache needs building (which is expensive)

virtual void IFocusCache::CopyToAttributeLists (AttributeBossListattrList,
AttributeBossListmixedList = nil 
) const
pure virtual

copies the attributes into attribute boss lists.

Parameters
attrListattributes that are NOT-MIXED are added to this list
mixedListif non-nil, the first value of mixed attributes are added to this list.
virtual int32 IFocusCache::CountAttributes (const ClassIDattr) const
pure virtual

How many different values for a particular attribute exist? More than one indicate a mixed selection.

Parameters
attrspecifies which text attribute.
Returns
the number of different values for the attribute.
virtual int32 IFocusCache::CountCharacterStyles () const
pure virtual

How many different character styles are selected?

Returns
the number of different styles.
virtual int32 IFocusCache::CountCharacterStylesFromRunIns () const
pure virtual

How many different character styles that came from run-in style attributes are selected?

Returns
the number of different styles.
virtual int32 IFocusCache::CountFonts (ClassID fontUIDBoss = kTextAttrFontUIDBoss) const
pure virtual

Return the number of different fonts in the selection. These will not necessarily be in any particular order.

Parameters
fontUIDBosswhich boss (default is kTextAttrFontUIDBoss).
Returns
how many fonts are applied to the range?
virtual int32 IFocusCache::CountParagraphStyles () const
pure virtual

How many different paragraph styles are selected?

Returns
the number of different styles.
virtual int32 IFocusCache::CountSelectedRuns () const
pure virtual

How many different attribute runs were in the selection?

Returns
the number of attribute runs.
virtual void IFocusCache::Deleted (TextIndex where,
int32 howmuch 
)
pure virtual

text was deleted fromt the model; may invalidate the cache; shouldn't be necessary to call.

Parameters
whereis the position.
howmuchspecifies how many characters were deleted.
virtual void IFocusCache::FocusWasMoved (const ITextModelmodel,
TextIndex start,
TextIndex end,
bool16 excludeCacheEnd = kTrue 
)
pure virtual

called automatically when the focus was adjusted, maybe cache needs to be invalidated, maybe not.

Parameters
modelis the story.
startis the new beginning of the selection.
endis the end of the new selection.
excludeCacheEndspecifies whether the very end of the selection should cause a recalculation of attributes.
virtual UID IFocusCache::GetNthCharacterStyle (int32 n) const
pure virtual

Get the Nth different character style in the selection. Not necessarily in any order.

Parameters
nspecifies which character style.
Returns
the style UID.
virtual UID IFocusCache::GetNthCharacterStyleFromRunIn (int32 n) const
pure virtual

Get the Nth different character style in the selection that came from run-in styles. Not necessarily in any order.

Parameters
nspecifies which character style from the run-in style paragraph attributes.
Returns
the style UID.
virtual UID IFocusCache::GetNthFamilyUIDAndFace (int32 nthFont,
PMStringfaceName,
ClassID fontUIDBoss = kTextAttrFontUIDBoss 
) const
pure virtual

Get InDesign font data for the nth font in the selection.

Parameters
nthFontspecifies which font.
faceNameis set to the Nth selected font's face name
fontUIDBosswhich boss (default is kTextAttrFontUIDBoss).
Returns
the font family UID for the Nth selected font.
virtual const PMString& IFocusCache::GetNthFont (int32 nthFont,
bool16 * incorrectFace = nil,
ClassID fontUIDBoss = kTextAttrFontUIDBoss 
) const
pure virtual

Get postscript font name information about the nth font in the selection.

Parameters
nthFontwhich font in the selection is being asked about?
incorrectFacewas the applied face correct for this postscript font name? If the face is incorrect (e.g. family = Times, face = "Ornaments") the postscript name will be what was used (e.g. Times-Roman).
fontUIDBosswhich boss (default is kTextAttrFontUIDBoss).
Returns
the postscript name of the Nth font.
virtual const Fixed* IFocusCache::GetNthMMAxes (int32 nthFont,
int32 * numaxes 
) const
pure virtual

Return the multiple-master data for the font.

Parameters
nthFontwhich font?
numaxesreturns how many axes?
Returns
the multi-master axis array for the Nth font
virtual UID IFocusCache::GetNthParagraphStyle (int32 n) const
pure virtual

Get the Nth different paragraph style in the selection. Not necessarily in any order.

Parameters
nspecifies which paragraph style.
Returns
the style UID.
virtual bool16 IFocusCache::GetOverrideList (K2Vector< PMString > & overrideStrings,
bool16 getForParaStyle 
) const
pure virtual

Get the list of overrides descriptions applied to the selection.

Parameters
overrideList,:the list of overrides in the selection.
getForParaStylekTrue get for the paragraph style, kFalse, get for the character style.
Returns
kTrue if the overrides are mixed.
virtual uint32 IFocusCache::GetTimeStamp () const
pure virtual
Returns
the time stamp when the cache was built, may build the cache if not already built.
virtual void IFocusCache::Inserted (TextIndex where,
int32 howmuch 
)
pure virtual

text was inserted in the model; may invalidate the cache; shouldn't be necessary to call.

Parameters
whereis the location of the insert.
howmuchis the number of characters inserted.
virtual void IFocusCache::InvalidateCache ()
pure virtual

invalidate the cache (called by setting attributes for instance) shouldn't be necessary to call

virtual bool16 IFocusCache::IsRubyApplied () const
pure virtual

checks Ruby Strand for presence of ruby, caches value.

Returns
kTrue if ruby is applied.
virtual bool16 IFocusCache::IsStyleOverridden (UID style) const
pure virtual

Does the specified style have "overrides" applied? The definition of overrides is different for character & paragraph styles, but this routine handles both.

Parameters
styleis the style in question.
Returns
kTrue if the style has overrides.
virtual const IPMUnknown* IFocusCache::QueryAttributeN (int32 which,
const ClassIDattr,
const PMIIDinterfaceID 
) const
pure virtual

Return a specific text attribute applied to the selection. Doesn't tunnel into styles.

Parameters
whichspecifies which of all values for the same attribute should be returned.
attrspecifies which text attribute.
interfaceIDspecifies which interface to return.
Returns
an addref'd attribute.
virtual void IFocusCache::ResetCache_NoNotify ()
pure virtual

invalidate the cache (called by setting attributes for instance) used by selection sub-system shouldn't be necessary to call from public api