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

#include <IActiveTopicListContext.h>

Inheritance diagram for IActiveTopicListContext:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IACTIVETOPICLISTCONTEXT }
 
enum  UpdateReason {
  kActiveDocumentChange = 0, kDocumentClosed = 1, kActiveBookChange = 2, kBookContentChange = 3,
  kTopicListCreation = 4, kTopicListDeletion = 5, kAppShutDown = 6, kDocumentWorkspaceLanguageChanged = 7
}
 

Public Member Functions

virtual const IIndexOptions::Scope GetScope () const =0
 
virtual void SetScope (const IIndexOptions::Scope scope)=0
 
virtual const UIDRefGetActiveTopicList (bool16 buildIfNeeded=kTrue, bool16 *pIsBuiltByActiveContext=NULL)=0
 
virtual UIDRef GetDefaultTopicList (const UIDRef &docRef) const =0
 
virtual void GetActiveBookName (PMString &bookName)=0
 
virtual UIDRef GetActiveDocument () const =0
 
virtual UIDRef GetActiveBook () const =0
 
virtual void GetOpenedDocListFromActiveBook (K2Vector< UIDRef > &docList) const =0
 
virtual UIDRef GetActiveTopicListFromActiveDocument () const =0
 
virtual const bool16 IsBookAble ()=0
 
virtual int32 GetNumActiveComponents () const =0
 
virtual UIDRef GetNthActiveComponent (int32 nth) const =0
 
virtual void UpdateContext (IActiveTopicListContext::UpdateReason reason, const UIDRef &updaterRef, bool16 doNotify=kTrue)=0
 
virtual void OnTopicListModification (const ClassID &theChange, ISubject *theSubject, const PMIID &protocol, void *changedBy, UIDRef *topicListRef=NULL, bool16 doNotify=kTrue)=0
 
virtual void InvalidateActiveTopicList ()=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

Interface implemented by the active topic list context. The active topic list context is a singleton that sits on the session boss and keeps track of the current topic list. In case of books, there are multiple topic lists (one in each document) and the active context builds\ a composed topic list from all the docs in the book when the scope is "book" (

See Also
GetScope/SetScope below).

Member Function Documentation

virtual UIDRef IActiveTopicListContext::GetActiveBook () const
pure virtual

Retrieves the currently active book.

Returns
UIDRef of the active book.
virtual void IActiveTopicListContext::GetActiveBookName (PMStringbookName)
pure virtual

Retrieves the name of the current active book.

Parameters
bookName[OUT] - name of the currently active book.
virtual UIDRef IActiveTopicListContext::GetActiveDocument () const
pure virtual

Retrieves the currently active document.

Returns
UIDRef of the active document.
virtual const UIDRef& IActiveTopicListContext::GetActiveTopicList (bool16 buildIfNeeded = kTrue,
bool16 * pIsBuiltByActiveContext = NULL 
)
pure virtual

Retrieves the UIRef of the current topic list for the active context. If the context is 'document' than the current topic list will be the topic list of the current active document.

Parameters
buildIfNeeded[IN, OPTIONAL] - usually used when the context is book, specifies if the active context should built the topic list if needed.
pIsBuiltByActiveContext[IN, OPTIONAL] - if not nill, it will be set on return if the active context had to build the active topic list.
Returns
the UIDRef of the current topic list.
virtual UIDRef IActiveTopicListContext::GetActiveTopicListFromActiveDocument () const
pure virtual

Gets the default topic list of the active document. Similar to calling GetDefaultTopicList(GetActiveDocument()).

Returns
UIDRef of the default topic list of the active document.
virtual UIDRef IActiveTopicListContext::GetDefaultTopicList (const UIDRefdocRef) const
pure virtual

Gets the default topic list for the specified document. NOTE: this function will be moved out as a separate utility function in a future version.

Parameters
docRef[IN] - UIDRef of the document for which we want to retrieve the topic list.
Returns
UIDRef of the default topic list of the specified document.
virtual UIDRef IActiveTopicListContext::GetNthActiveComponent (int32 nth) const
pure virtual

Returns the UIDRef of the component (topic list) at the specified index.

See Also
GetNumActiveComponents.
Returns
UIDRef of the specified component.
virtual int32 IActiveTopicListContext::GetNumActiveComponents () const
pure virtual

Returns the number of components (topic lists) from the current active topic list.

See Also
GetActiveTopicList. When the context is book, the composed topic list will contain all the topic lists from the documents that belong to the book.
Returns
number of components for the active topic list.
virtual void IActiveTopicListContext::GetOpenedDocListFromActiveBook (K2Vector< UIDRef > & docList) const
pure virtual

Retrieves the list of the open documents from the currently active book.

Parameters
docList[IN] - array of UIDRefs of the open documents that belong to the active book.
virtual const IIndexOptions::Scope IActiveTopicListContext::GetScope () const
pure virtual

Gets the current scope for the context.

See Also
IIndexOptions::Scope enum.
Returns
the current scope for the active context.
virtual void IActiveTopicListContext::InvalidateActiveTopicList ()
pure virtual

Invalidates the active topic list. Used by the inval handler to refresh the active topic list when undo/redo happens.

virtual const bool16 IActiveTopicListContext::IsBookAble ()
pure virtual

Checks if the active document belongs to the active book.

Returns
true if the active document belongs to the active book.
virtual void IActiveTopicListContext::OnTopicListModification (const ClassIDtheChange,
ISubjecttheSubject,
const PMIIDprotocol,
void * changedBy,
UIDReftopicListRef = NULL,
bool16 doNotify = kTrue 
)
pure virtual

Notifies the active context that a topic list has changed. Called by the document observers to update the active context.

Parameters
theChange[IN] - ClassID of the notification.
theSubject[IN] - the subject.
protocol[IN] - PMIID of the protocol.
changedBy[IN] - generic pointer to the object that caused the change, usually a pointer to a command object.
topicListRef[IN, OPTIONAL] - UIDRef of the affected topic list.
doNotify[IN, OPTIONAL] - if the context should broadcast the changes for the other observers.
virtual void IActiveTopicListContext::SetScope (const IIndexOptions::Scope scope)
pure virtual

Sets the current scope for the context.

See Also
IIndexOptions::Scope enum.
Parameters
scope[IN] - the current scope for the active context.
virtual void IActiveTopicListContext::UpdateContext (IActiveTopicListContext::UpdateReason reason,
const UIDRefupdaterRef,
bool16 doNotify = kTrue 
)
pure virtual

Updates the state of the active context. Called by the document and book observers to update the state of the active context.

Parameters
reason[IN] - reason for update.
updaterRef[IN] - the subject who notifies the context (usually the document).
doNotify[IN, OPTIONAL] - if the context should broadcast the changes for the other observers.