![]() | InDesign SDK 20.5 |

Public Member Functions | |
| PstLstDocObserver (IPMUnknown *boss) | |
| virtual | ~PstLstDocObserver () |
| void | AutoAttach () |
| void | AutoDetach () |
| virtual void | Update (const ClassID &theChange, ISubject *theSubject, const PMIID &protocol, void *changedBy) |
Public Member Functions inherited from CObserver | |
| CObserver (IPMUnknown *boss, PMIID interfaceID=IID_IOBSERVER) | |
| IChangeManager * | GetChangeManager () const |
| virtual void | SetAttachIID (PMIID iid) |
| virtual PMIID | GetAttachIID () const |
| virtual void | SetEnabled (bool16 state) |
| virtual bool16 | IsEnabled () const |
| virtual void | LazyUpdate (ISubject *theSubject, const PMIID &protocol, const LazyNotificationData *data) |
Protected Member Functions | |
| void | AttachDocument (IDocument *iDocument) |
| void | DetachDocument (IDocument *iDocument) |
| void | HandlePageItemDeleted (void *changedBy) |
Additional Inherited Members | |
Public Types inherited from IObserver | |
| enum | { kDefaultIID = IID_IOBSERVER } |
Protected Attributes inherited from CObserver | |
| bool16 | fDetachSubjectsOnDelete |
| PMIID | fAttachIID |
| const UIDRef | fThisRef |
| bool16 | fEnabled |
This observer observes the front document's IID_IHIERARCHY_DOCUMENT protocol, so when a page item is deleted from the document, this observer will be notified. This is needed because we want to be notified Before the page item is about to be deleted so this implementation can have a chance to delete the instances of persistent list items associated with the said page item, otherwise if we wait until SelectionAttributeChanged of my CSB gets called, it's too late; The page item will have been deleted from the hierarchy, and all of instances of persistent list items will be left dangling somewhere in memory (= boss leaks)! This observer gets attached with the ISubject of kDocBoss when a document is opened or created, through the use of a open/new document responder, and this observer is detached when a document is closed, through the use of a close document responder.
| Binds the C implementation class onto its ImplementationID making the C code callable by the application * PstLstDocObserver::PstLstDocObserver | ( | IPMUnknown * | boss | ) |
Constructor.
| boss | IN interface ptr from boss object on which this interface is aggregated. |
| virtual |
Destructor.
| protected |
Attaches this observer to a document.
| iDocument | IN The document to which we want to attach. |
| virtual |
| virtual |
Called by the application to allow the observer to detach from the subjects being observed.
Reimplemented from CObserver.
| protected |
Detaches this observer from a document.
| iDocument | IN The document from which we want to detach. |
| protected |
The selected page items are about to be deleted, call IPstLstSuite's function to delete its associated IPstLstData objects. It is called when we get the pre-notification of deletion of page items.
| changedBy | IN points to additional data about the change. |
| virtual |
Update is called for all registered observers, and is the method through which changes are broadcast. In this case, the only things we are interested in are if the drop down list selection has changed and if a page item is deleted from the document.
| theChange | IN specifies the class ID of the change to the subject. Frequently this is a command ID. |
| theSubject | IN points to the ISubject interface for the subject that has changed. |
| protocol | IN specifies the ID of the changed interface on the subject boss. |
| changedBy | IN points to additional data about the change. Often this pointer indicates the class ID of the command that has caused the change. |
Implements IObserver.