InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
FindPresCriteria Struct Reference

#include <DocumentPresFindCriteria.h>

Static Public Attributes

static unary_presentation_predicate accept_all
 
static unary_presentation_predicate is_active
 
static unary_presentation_predicate is_frontmost_in_tabgroup
 
static unary_presentation_predicate is_layout
 
static unary_presentation_predicate is_floating
 
static unary_presentation_predicate is_minimized
 
static unary_presentation_predicate is_autonomous
 
static unary_presentation_predicate is_visible
 
static unary_presentation_predicate is_not_minimized
 
static unary_presentation_predicate IC_in_layoutmode
 
static unary_presentation_predicate IC_in_galleymode
 
static unary_presentation_predicate IC_in_storymode
 
static unary_presentation_predicate IC_in_galleyorstory
 
static
FindPresentation_PreferCriteria 
empty
 

Detailed Description

This file contains declarations of simple selector and comparison functions designed to be used with two methods from IDocumentUIUtils.

FindPresentationsForDocument: used to find and optionally order a subset of the presentations on a document (or on all documents)



FindRelatedPresentations: used to find and optionally order a subset of the presentations on a document (or on all documents) that are related to

    a particular presentation (most commonly are the presentations of the same type) 

The implementations of these functions are found in the WidgetBin shared library, so you cannot use them from a model only plugin. Should the need arise you can create local implementations, such as:

static bool private_is_active(IDocumentPresentation* p) { return p->IsActive(); } FindPresCriteria: are unary predicates (one parameter boolean functions) used to select and order the set of document presentations returned from IDocumentUIUtils::FindPresentationsForDocument.

Examples: Find all minimized presentations, ordered so that the layout presentations come before any story editors. whichDocument: NIL acceptCriteria: is_minimized preferCriteria: is_layout

Find all presentations, and order them loosely by activation (active one first followed by the frontmost ones in any tab groups, followed by the obscured ones in tab groups. whichDocument: NIL acceptCriteria: accept_all preferCriteria: is_active + is_frontmost_in_tabgroup

Find all floating presentations, and order them loosely by activation whichDocument: NIL acceptCriteria: is_floating preferCriteria: is_active + is_frontmost_in_tabgroup

Code snippet: PresentationSequence plist; FindPresentation_Criteria require = FindPresCriteria::is_floating; // only the floating ones FindPresentation_PreferCriteria prefer; prefer.push_back(FindPresCriteria::is_active); prefer.push_back(FindPresCriteria::is_frontmost_in_tabgroup); int32 count = Utils<IDocumentUIUtils>()->FindPresentationsForDocument(nil, plist, require, prefer);