InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SnpModifyLayoutGrid Class Reference

Public Member Functions

 SnpModifyLayoutGrid ()
 
virtual ~SnpModifyLayoutGrid ()
 
ErrorCode ModifyLayoutGrid (UIDRef &targetPageOrWorkspace, const SnpModLayoutGridParameters &parameters)
 
ErrorCode ModifyLayoutGridPage (UIDRef &targetPage, const SnpModLayoutGridParameters &parameters)
 
ErrorCode ModifyLayoutGridWorkspace (UIDRef &targetWorkspace, const SnpModLayoutGridParameters &parameters)
 
UIDRef GetFirstSelectedPageOrGlobalWorkspace (IActiveContext *activeContext)
 
const ErrorCode GetParameters (IDataBase *db, SnpModLayoutGridParameters &params)
 

Static Public Member Functions

static PMReal ConvertMillimetersToPoint (const PMReal &val)
 
static PMReal ConvertQToPoint (const PMReal &val)
 
static PMReal ConvertHaToPoint (const PMReal &val)
 

Detailed Description

  • How to modify the layout grid data for a page or the global workspace.

Constructor & Destructor Documentation

SnpModifyLayoutGrid::SnpModifyLayoutGrid ()
inline

Constructor.

virtual SnpModifyLayoutGrid::~SnpModifyLayoutGrid ()
inlinevirtual

Destructor.

Member Function Documentation

PMReal SnpModifyLayoutGrid::ConvertHaToPoint (const PMRealval)
static

Convert Ha into point.

Parameters
valValue in Ha to be converted.
PMReal SnpModifyLayoutGrid::ConvertMillimetersToPoint (const PMRealval)
static

Convert millimeters into point.

Parameters
val(in) Value in millimeters to be converted.
PMReal SnpModifyLayoutGrid::ConvertQToPoint (const PMRealval)
static

Convert Q (kyu) into point.

Parameters
valValue in Q to be converted.
UIDRef SnpModifyLayoutGrid::GetFirstSelectedPageOrGlobalWorkspace (IActiveContextactiveContext)

Gets the first visible and selected page, or if there are no pages selected, returns the global workspace.

Parameters
activeContext(in) The current active context.
Returns
UIDRef of the first selected page or global workspace
const ErrorCode SnpModifyLayoutGrid::GetParameters (IDataBasedb,
SnpModLayoutGridParametersparams 
)

Gets arguments and puts the values into a parameter structure. Also set hardcoded default values for other parameters that are not specified as sniprun arguments. NOTE: You can experiment by changing some of the hardcoded parameters inside this method to see what happens!

Parameters
db(in) The database to get the preferences from.
params(out) The parsed and preset parameters.
Returns
kSuccess on success, kFailure otherwise.
ErrorCode SnpModifyLayoutGrid::ModifyLayoutGrid (UIDReftargetPageOrWorkspace,
const SnpModLayoutGridParametersparameters 
)

The main method that modifies a layout grid, either on a page or a global workspace. Note that layout grid data exists for both a page and a global workspace. Also, a page may be using a layout grid from a master page (and that master page may be based on another master page...)

Parameters
targetPageOrWorkspace(in) UIDRef to a page or workspace. A page has IMasterPage, IColumns, IMargins. If a page is selected, the UIDRef will be that of a page (kPageBoss). A workspace has ICJKLayoutGridDefaults. If no document is open at the moment, the UIDRef should be that of a workspace (kWorkspaceBoss)
parameters(in) A structure that contains all of the layout grid parameters to use.
Returns
kSuccess on success, kFailure otherwise.
ErrorCode SnpModifyLayoutGrid::ModifyLayoutGridPage (UIDReftargetPage,
const SnpModLayoutGridParametersparameters 
)

Modifies layout grid defaults on a page.

Parameters
targetPage(in) As long as this is a valid page, the view is not required.
parameters(in) A structure that contains all of the layout grid parameters to use.
Returns
kSuccess on success, kFailure otherwise.
See Also
ModifyLayoutGrid()
ErrorCode SnpModifyLayoutGrid::ModifyLayoutGridWorkspace (UIDReftargetWorkspace,
const SnpModLayoutGridParametersparameters 
)

Modifies layout grid defaults on a workspace. Note that this method sets the defaults on the workspace. To restore original defaults, delete your "InDesign Defaults" file. This method is verified to work on the global workspace, although you could probably use this on the document workspace as well.

Parameters
targetWorkspace(in) The workspace to target.
parameters(in) A structure that contains all of the layout grid parameters to use.
Returns
kSuccess on success, kFailure otherwise.
See Also
ModifyLayoutGrid() method.