Professional Documents
Culture Documents
Changes to the geometry of the text layout (such as resize and text inset) are observed using a
document observer.
Changes to character and text attributes are observed by attaching an observer to each text model of
interest.
Changes to text styles are observed by attaching observers to the style name tables in the workspace.
An optimal strategy is to be aware recomposition has occurred and not try to observe everything that
might happen.
Any change to text, attributes, styles, or layout that affects lines breaks causes damage. The change
counter on the frame list (IFrameList::GetChangeCounter) is incremented any time something happens
that requires recomposition. No notification is broadcast when the change counter is incremented, so you
cannot catch the change immediately. In general, though, immediate feedback is not needed; the fact that
something changed in a way that affects text needs to be determined only at fixed times.
For example, export a story from InDesign to a copy-editor application. When the story is imported back
into InDesign, you may want to tell the user about changes to the layout or text styling that were made
through InDesign. To arrange this, cache the value of IFrameList::GetChangeCounter when you export the
story. You can then compare this cached value to the actual value when the story is imported. To notify
users when layout changes are made that affect text, check IFrameList::GetChangeCounter using an idle
task.