![]() | InDesign SDK 20.5 |
#include <IDatabaseObserver.h>

Public Types | |
| enum | Observable { kWatchDirties = 1, kWatchUIDCreationDestruction = 2, kWatchTransactions = 4, kWatchModified = 8, kWatchAll = 0xffffffff } |
Public Member Functions | |
| virtual void | SetDirty (IDataBase *db, UID id, ClassID clsID, ImplementationID tag, const bool16 dbModified)=0 |
| virtual void | NewUID (IDataBase *db, UID id, ClassID clsID)=0 |
| virtual void | DeleteUID (IDataBase *db, UID id, ClassID clsID)=0 |
| virtual void | UndeleteUID (IDataBase *db, UID id, ClassID clsID)=0 |
| virtual void | DestroyDeletedUID (IDataBase *db, UID id)=0 |
| virtual void | BeginTransaction (IDataBase *db)=0 |
| virtual void | EndTransaction (IDataBase *db)=0 |
| virtual void | SetModified (IDataBase *db, bool16 modified)=0 |
| virtual void | AttachedTo (IDataBase *db)=0 |
| virtual uint32 | GetEventClassesToObserve ()=0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
To find out when certain database actions happen, implement a DatabaseObserver and attach it to the database. The DatabaseObserver will get called by the database on interesting database events. This does not follow the normal subject/observer pattern. Each database maintains its own list of observers, so attach to the database you are interested in. Note that for ease of maintanence we strongly recommend you NOT inherit directly from IDatabaseObserver but rather from CDatabaseObserver instead.
To use this interface...
This enumeration describes the classes of events that a database observer is interested in seeing. In InDesign/InCopy CS and earlier, database observers would be called for everything, which could hurt performance. Now your GetEventClassesToObserver() will get called during attachment and must specify what classes of things it is interested in observing by combining together these Observable constants.
| Enumerator | |
|---|---|
| kWatchUIDCreationDestruction | Watch every DirtyObject call - expensive! |
| kWatchTransactions | Watch NewUID(), DLeteUID(), UndeleteUID(), DestoryDeletedUID() |
| kWatchModified | Watch BeginTransaction() and EndTransaction() |
| kWatchAll | Watch modification state of database |
| pure virtual |
Called by the database when the observer is attached.
| db | the database we're observing |
Implemented in CDatabaseObserver.
| pure virtual |
Called by the database when it gets an BeginTransaction.
| db | the database we're observing |
Implemented in CDatabaseObserver.
Called by the database when it gets a DeleteUID.
| db | the database we're observing |
| id | the UID that was deleted |
| clsID | the class of the deleted UID |
Implemented in CDatabaseObserver.
Called by the database when it gets an DestroyDeletedUID.
| db | the database we're observing |
| id | the UID that was destroyed |
Implemented in CDatabaseObserver.
| pure virtual |
Called by the database when it gets an EndTransaction.
| db | the database we're observing |
Implemented in CDatabaseObserver.
| pure virtual |
Called to discover which methods you are overriding and are interested in having called. a logically-ORed combination of IDatabaseObserver::Observable constants specifying what events this observer should be called for
Called by the database when it gets a NewUID.
| db | the database we're observing |
| id | the UID that was created |
| clsID | the class of the new UID |
Implemented in CDatabaseObserver.
| pure virtual |
Called by the database when it gets a DirtyObject.
| db | the database we're observing |
| id | the UID that was dirtied |
| tag | the ImplementationID that was dirtied |
| dbModified | kTrue if this dirty could have caused the database to be marked as modified |
Implemented in CDatabaseObserver.
| pure virtual |
Called by the database when the logical modified state of the database changes.
| db | the database we're observing |
| modified | is whether the database mofified state is set (e.g. file is dirty from the user's standpoint) |
Implemented in CDatabaseObserver.
Called by the database when it gets an UndeleteUID.
| db | the database we're observing |
| id | the UID that was restored |
| clsID | the class of that the UID was restored to |
Implemented in CDatabaseObserver.