![]() | InDesign SDK 20.5 |
Public Member Functions | |
| SnpInspectLayoutModel () | |
| virtual | ~SnpInspectLayoutModel () |
| void | ReportItems (const UIDList &itemList) |
| void | ReportDocument (const UIDRef &docUIDRef) |
| void | ReportDocumentByHierarchy (const UIDRef &docUIDRef) |
| void | ReportDocumentByDocumentLayer (const UIDRef &docUIDRef) |
| void | ReportDocumentGeometry (const UIDRef &docUIDRef) |
| void | ReportDocumentByHierarchyOfInlines (const UIDRef &docUIDRef) |
| void | InspectStoryInlines (const UIDRef &storyUIDRef, void(*Callback)(IHierarchy *)) |
| void | TraverseIHierarchy (IHierarchy *parent, void(*Callback)(IHierarchy *)) |
| void | InspectSpreadByDocumentLayer (ISpread *spread) |
| void | TraceSpreadGeometry (const UIDRef &objectUIDRef) |
| static void | Indent (int32 level) |
| static void | TraceNode (IHierarchy *node) |
| static void | TraceNodeGeometryAndTransform (IHierarchy *node) |
| static int32 | TraceBoss (IPMUnknown *unknown) |
| static int32 | TraceBoss (IDataBase *database, const UID &uid) |
| static void | TraceLayerName (const char *msg, IHierarchy *spreadLayer) |
| static void | TracePMMatrix (const char *msg, const PMMatrix &m) |
| static void | TracePMRect (const char *msg, const PMRect &bBox) |
| static void | TraceGeometry (IGeometry *geometry) |
| static void | TraceTransform (ITransform *transform) |
| static void | TracePageNode (IHierarchy *node) |
| static UIDRef | GetDocumentUIDRef (IPMUnknown *unknown) |
| static IDocument * | QueryDocument (IPMUnknown *unknown) |
Reports the organisation and geometry of layout content in a document or in a selection of items. To inspect the entire document run the snippet with nothing selected. To inspect specific items select them then run the snippet.
Documents are made up of one or more spreads(ISpreadList). Each spread(ISpread) contains one or more pages. A document has a list(ILayerList) of document layers(IDocumentLayer) that can be shown, hidden, locked, unlocked and arranged in their z-order.
Each spread has a set of spread layers(ISpreadLayer) that map to their corresponding document layer. The spread has a tree structure (accessed via interface IHierarchy) whose children are spread layers. The children of each of the spread layers are the frames (IGraphicFrameData) that contain pictorial or textual content and guides. The children of the frames vary depending on what the frame contains. For example an EPS image would be have a kEPSItem child. A text frame would have a kMultiColumnItemBoss which on turn would have one or more kFrameItemBoss objects (one per column).
The methods in this snippet navigate the IHierarchy tree and report on the objects they discover.
Document layers are the layers the user sees in the layers panel. In addition there is a special layer, the pages layer, which is not displayed in the layer panel. This layer is where the page objects live that draw the outline of each page and its drop shadow. The page object also maintains a reference to its associated master page.
For each document layer there are two spread layers, one that owns the layer's frames and another that owns the layer's guides.
Content and guides are owned by spread layers not by pages (when executing page operations the application considers whether a page item lies within the page area by comparing the bounding box of the item and the bounding box of the page).
Stories can contain inline frames (IInlineData) embedded in the text. The child of an inline frame is a regular graphic frame (IGraphicFrameData), normally a kSplineItemBoss, that contains a picture or other text. Like other layout objects inline frames have an IHierarchy but instead of being rooted on a spread they are rooted on a kInlineBoss that is an owned item in a story.
| inline |
Constructor.
| inlinevirtual |
Destructor.
| static |
Callback functions used to generate reports as the page item hierarchy is traversed. These methods are all declared as static so they can be used as callback functions with TraverseIHierarchy.
| void SnpInspectLayoutModel::InspectSpreadByDocumentLayer | ( | ISpread * | spread | ) |
Iterates over each document layer and reports the objects found on its associated content and guide spread layers of the given spread.
| void SnpInspectLayoutModel::InspectStoryInlines | ( | const UIDRef & | storyUIDRef, |
| void(*)(IHierarchy *) | Callback | ||
| ) |
Iterate the owned items in the given story and report the inline frames (IInlineData) by traversing their hierarchy (IHierarchy).
| storyUIDRef | |
| Callback | that will report on each IHierarchy node. |
| void SnpInspectLayoutModel::ReportDocument | ( | const UIDRef & | docUIDRef | ) |
Inspect the layout model of the entire document.
| void SnpInspectLayoutModel::ReportDocumentByDocumentLayer | ( | const UIDRef & | docUIDRef | ) |
Iterates each spread and master spread in the document and reports the page items associated with each document layer.
Document layers are the layers the user sees in the layers panel. In addition there is a special layer, the pages layer, which is not displayed in the layer panel. This layer is where kPageBoss objects live. The pages layer is always at index 0 in the document's ILayerList.
For each document layer there are two corresponding spread layers. One for content and one for guides.
| void SnpInspectLayoutModel::ReportDocumentByHierarchy | ( | const UIDRef & | docUIDRef | ) |
Traverses the hierarchy(IHierarchy) for each spread and master spread in the document and reports the page items.
| void SnpInspectLayoutModel::ReportDocumentByHierarchyOfInlines | ( | const UIDRef & | docUIDRef | ) |
Iterate the stories in the document and report each inline (kInlineBoss) anchored in the text.
| void SnpInspectLayoutModel::ReportDocumentGeometry | ( | const UIDRef & | docUIDRef | ) |
Iterate over the spreads in the document and traverse each spread's hierarchy of page items reporting their geometry and transformation matrix.
| void SnpInspectLayoutModel::ReportItems | ( | const UIDList & | itemList | ) |
Inspect the layout model by traversing the hierarchy(IHierarchy) of the given items.
| itemList | items to report on. |
| void SnpInspectLayoutModel::TraceSpreadGeometry | ( | const UIDRef & | objectUIDRef | ) |
Reported spread geometry.
| objectUIDRef |
| void SnpInspectLayoutModel::TraverseIHierarchy | ( | IHierarchy * | parent, |
| void(*)(IHierarchy *) | Callback | ||
| ) |
Recursive method that visits each node in the given hierarchy and calls the supplied Callback method.
| parent | hierarchy |
| Callback | that reports each node. |