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

#include <ILnkWtchCache.h>

Inheritance diagram for ILnkWtchCache:
IPMUnknownCPMUnknown< ILnkWtchCache >LnkWtchCache

Classes

struct  Entry
 

Public Types

enum  { kDefaultIID = IID_ILNKWTCHCACHE }
 
typedef struct ILnkWtchCache::Entry Entry
 
typedef K2Vector< EntryEntries
 

Public Member Functions

virtual const EntriesGet () const =0
 
virtual const PMString GetName (const Entry &entry, bool16 fullName=0) const =0
 
virtual void push_back (const Entry &entry)=0
 
virtual int32 Location (const Entry &entry)=0
 
virtual void MarkRemoved (const int32 pos, bool16 removed)=0
 
virtual void Delete (const int32 pos)=0
 
virtual void clear ()=0
 
virtual void Dump () const =0
 
virtual void NotifyCacheChanged ()=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

Cache that references all links added to the document since it was opened. Entries in the cache consist of a UID and a removed flag and are keyed by the UID of the link.

We must leave entries in the cache for removed links in order to distinguish a remove of a link that existed in the document when it was opened from a remove of a link that was added to the document. If we erased the cache entry for removed links completely we could not make this distinction. So we set a flag that indicates the added link has now been removed.

An add link operation records a new entry in the cache with the UID of the new link and the removed flag is false. Undo of the operation removes the entry from the cache.

A remove link operation leaves the entry in the cache with its removed flag set to true. Undo of the operation simply sets the removed flag to its previous state (false).

Member Typedef Documentation

A vector of entries.

An entry in the cache has a UID and a removed flag.

Member Enumeration Documentation

anonymous enum

kDefaultIID

Member Function Documentation

virtual void ILnkWtchCache::clear ()
pure virtual

Clear all entries in the cache.

Implemented in LnkWtchCache.

virtual void ILnkWtchCache::Delete (const int32 pos)
pure virtual

Delete the cache entry at the given index.

Parameters
posindex of entry to be cleared.

Implemented in LnkWtchCache.

virtual void ILnkWtchCache::Dump () const
pure virtual

Dump cache entries to trace.

Implemented in LnkWtchCache.

virtual const Entries& ILnkWtchCache::Get () const
pure virtual

Returns all entries in the cache.

Returns
all entries in the cache.

Implemented in LnkWtchCache.

virtual const PMString ILnkWtchCache::GetName (const Entryentry,
bool16 fullName = 0 
) const
pure virtual

Returns the name of the link associated with the given cache entry.

Parameters
entrythe cache entry hose name is required
fullNamekTrue to include the path, kFalse for the file name only.
Returns
the name of the link associated with the given cache entry

Implemented in LnkWtchCache.

virtual int32 ILnkWtchCache::Location (const Entryentry)
pure virtual

Return index in cache of the given entry if found, -1 otherwise.

Parameters
entry
Returns
index in cache of the given entry if found, -1 otherwise.

Implemented in LnkWtchCache.

virtual void ILnkWtchCache::MarkRemoved (const int32 pos,
bool16 removed 
)
pure virtual

Set the removed flag for the cache entry at the index given.

Parameters
posindex in the cache whose removed flag is to be changed.
removedkTrue to set flag , kFalse to clear

Implemented in LnkWtchCache.

virtual void ILnkWtchCache::NotifyCacheChanged ()
pure virtual

Broadcast notification that the cache has changed.

Implemented in LnkWtchCache.

virtual void ILnkWtchCache::push_back (const Entryentry)
pure virtual

Push an entry to into the cache.

Parameters
entry

Implemented in LnkWtchCache.