InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ICJKGridUtils Class Referenceabstract

#include <ICJKGridUtils.h>

Inheritance diagram for ICJKGridUtils:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ICJKGRIDUTILS }
 
enum  WhichAttributes { kParaAttributes = 1, kCharAttributes = 2, kAllAttributes = 3 }
 

Public Member Functions

virtual IPMUnknownQueryLayoutGrid (const IPMUnknown *thePage, PMIID iid=IID_ICJKLAYOUTGRIDDATA)=0
 
virtual ICJKGridManagerQueryLayoutGridManager (const IPMUnknown *thePage)=0
 
virtual void DrawCirclePath (IGraphicsPort *gPort, const PMRect &bounds)=0
 
virtual bool16 MoveAcrossSingleColumn (PMReal &newCord, PMReal colStart, const PMReal &colEnd, const PMReal &spacing, bool16 onlyAdvance, const PMReal &extra)=0
 
virtual UID ConvertFontUID (UID sourceUID, IDataBase *srcDB, IDataBase *destDB)=0
 
virtual PMPoint MeasureString (const PMString &str, const PMReal &fontSize, const PMReal &scaleX, const PMReal &scaleY)=0
 
virtual PMReal CJKGridGetQTextSize ()=0
 
virtual bool16 TextFrameDrawsCJKCharCount (const IPMUnknown *obj)=0
 
virtual void ApplyAttributesToGridData (const AttributeBossList &attributeBossList, ICJKGridData *cjkGridData, bool16 isVertical)=0
 
virtual void ApplyGridLeadingToAttributes (const ICJKGridData *gridData, AttributeBossList *attrBossList, bool16 isVertical)=0
 
virtual void ApplyGridDataToAttributes (const ICJKGridData *cjkGridData, AttributeBossList *attributeBossList, ICJKGridUtils::WhichAttributes whichAttributes=ICJKGridUtils::kAllAttributes)=0
 
virtual ErrorCode ApplyGridDataToAttributeLists (const UIDList &itemList)=0
 
virtual IPMFontQueryCharacterCountFont ()=0
 
virtual void SetupSetCJKGridDataCmd (UID namedGridUID, ICJKGridData *gridData, UIDList &itemList, ICommand *cmd)=0
 
virtual void AdjustFrameEndPoint (const UIDRef &parent, const bool16 &bVertical, const PMPoint &location, PMPoint &defaultEndPoint, int32 &xUnits, int32 &yUnits)=0
 
virtual void CalcCJKGridMetrics (const UIDRef &parent, const PBPMPoint &pt, const bool16 &bVertical, PMReal &lineOkuri, PMReal &charOkuri, PMReal &lineAki, PMReal &charAki)=0
 
virtual void GetCJKGridMetrics (const UIDRef &parent, const PBPMPoint &pt, PMReal &textSize, PMReal &charAki, PMReal &lineAki, PMReal &hScale, PMReal &vScale)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

ICJKGridUtils is the interface for utilities related to the CJK grid.

Member Function Documentation

virtual void ICJKGridUtils::AdjustFrameEndPoint (const UIDRefparent,
const bool16 & bVertical,
const PMPointlocation,
PMPointdefaultEndPoint,
int32 & xUnits,
int32 & yUnits 
)
pure virtual

Adjust the right bottom point of the newly created frame grid which holds the passed in story.

Parameters
parentIN the parent object where the frame is in.
bVerticalIN the direction of the frame.
locationIN the left top point of the frame.
defaultEndPointOUT the right bottom point of the frame.
xUnitsOUT x units for adjusting defaultEndPoint.X().
yUnitsOUT y units for adjusting defaultEndPoint.Y().
virtual void ICJKGridUtils::ApplyAttributesToGridData (const AttributeBossListattributeBossList,
ICJKGridDatacjkGridData,
bool16 isVertical 
)
pure virtual

Applies to cjkGridData based on the attributes passed in.

Parameters
attributeBossListIN Attributes that will be used to determine ICJKGridData.
cjkGridDataOUT The ICJKGridData you want filled out.
Precondition
attributeBossList should be complete.
virtual ErrorCode ICJKGridUtils::ApplyGridDataToAttributeLists (const UIDListitemList)
pure virtual

Applies an objects grid data to its attribute list by callling kApplytoAttributeListCmdBoss 1 or more times.

Parameters
itemListIN DESCRIPTION.
Precondition
itemList should contain UIDs for objects that support ITextAttributes and ICJKGridData
Returns
ErrorCode of first command to fail or kSuccess.
virtual void ICJKGridUtils::ApplyGridDataToAttributes (const ICJKGridDatacjkGridData,
AttributeBossListattributeBossList,
ICJKGridUtils::WhichAttributes whichAttributes = ICJKGridUtils::kAllAttributes 
)
pure virtual

Applies to attributeBossList based on ICJKGridData

Parameters
cjkGridDataIN The ICJKGridData you want attributes for.
attributeBossListOUT The list to apply to.
isVerticalIN Whether or not object containing attributes is of the vertical writing direction.
virtual void ICJKGridUtils::ApplyGridLeadingToAttributes (const ICJKGridDatagridData,
AttributeBossListattrBossList,
bool16 isVertical 
)
pure virtual

Applies auto leading at some percent that matches the line okuri of the grid.

Parameters
gridDataIN The ICJKGridData to pull line okuri from.
*attrBossListOUT The attributes we are applying to.
virtual void ICJKGridUtils::CalcCJKGridMetrics (const UIDRefparent,
const PBPMPointpt,
const bool16 & bVertical,
PMReallineOkuri,
PMRealcharOkuri,
PMReallineAki,
PMRealcharAki 
)
pure virtual

Calculate the CJK grid metric.

Parameters
parentIN the parent object where the frame is.
ptIN the click point on the layout in PasteBoard coordinates
bVerticalIN the direction of the frame.
lineOkuriOUT Okuri for line.
charOkuriOUT Okuri for char.
lineAkiOUT x Aki for line.
charAkiOUT y Aki for char.
virtual PMReal ICJKGridUtils::CJKGridGetQTextSize ()
pure virtual
Returns
default 13Q in points.
virtual UID ICJKGridUtils::ConvertFontUID (UID sourceUID,
IDataBasesrcDB,
IDataBasedestDB 
)
pure virtual

Converts sourceUID from srcDB to destDB, creating it if it doesn't exist.

Parameters
sourceUIDIN Source font UID.
srcDBIN Source database.
destDBIN Destination database.
Returns
UID for font in destDB.
virtual void ICJKGridUtils::DrawCirclePath (IGraphicsPortgPort,
const PMRectbounds 
)
pure virtual

Puts the path of a circle into the gPort

Parameters
gPortIN The IGraphicsPort you want to draw the circle into.
boundsIN The rectangular bounds of the circle.
virtual void ICJKGridUtils::GetCJKGridMetrics (const UIDRefparent,
const PBPMPointpt,
PMRealtextSize,
PMRealcharAki,
PMReallineAki,
PMRealhScale,
PMRealvScale 
)
pure virtual

Calculate the CJK grid metric.

Parameters
parentIN the parent object where the frame is.
ptIN the click point on the layout in PasteBoard coordinates
textSizeOUT textSize for grid.
charAkiOUT x Aki for char.
lineAkiOUT y Aki for line.
hScaleOUT x scale.
vScaleOUT y scale
virtual PMPoint ICJKGridUtils::MeasureString (const PMStringstr,
const PMRealfontSize,
const PMRealscaleX,
const PMRealscaleY 
)
pure virtual
Parameters
strIN The string you want to measure.
fontSizeIN The font size.
scaleXIN The x scale factor.
scaleYIN The y scale factor.
Returns
Height in width in PMPoint x/y.
virtual bool16 ICJKGridUtils::MoveAcrossSingleColumn (PMRealnewCord,
PMReal colStart,
const PMRealcolEnd,
const PMRealspacing,
bool16 onlyAdvance,
const PMRealextra 
)
pure virtual

Moves newCord to the next closest grid boundary.

Parameters
newCordIN/OUT Coordinate you would like to move to the next closest grid boundary.
colStartIN Coordinate of column start.
colEndIN Coordinate of column end.
spacingIN Space between each grid boundary.
onlyAdvanceIN kTrue if newCord only advances and never moves back.
extraIN Any extra space that will be added after newCord is aligned to the next grid boundary.
Returns
kTrue when newCord is moved.
virtual IPMFont* ICJKGridUtils::QueryCharacterCountFont ()
pure virtual

Returns an IPMFont * for the character count adornment's font. This will be KozGoStd-Regular if available, or the default system font.

Returns
An IPMFont of the character count adornment's font.
Postcondition
Returned IPMFont must be released by the caller.
virtual IPMUnknown* ICJKGridUtils::QueryLayoutGrid (const IPMUnknownthePage,
PMIID iid = IID_ICJKLAYOUTGRIDDATA 
)
pure virtual

Queries the proper interface for thePage. The master page's instance is returned if a master is used.

Parameters
thePageIN An interface on the kPageBoss you want to query on.
iidIN The desired PMIID or IID_ICJKLAYOUTGRIDDATA by default.
Returns
A pointer to interface instance.
Postcondition
Caller must release returned interface.
virtual ICJKGridManager* ICJKGridUtils::QueryLayoutGridManager (const IPMUnknownthePage)
pure virtual

Queries the proper ICJKGridManager for thePage. The master page's instance is returned if a master is used and no column, margin, or grid overrides have taken place.

Parameters
thePageIN An interface on the kPageBoss you want to query on.
Returns
Pointer to ICJKGridManager or nil on failure.
Postcondition
Caller must release returned interface.
virtual void ICJKGridUtils::SetupSetCJKGridDataCmd (UID namedGridUID,
ICJKGridDatagridData,
UIDListitemList,
ICommandcmd 
)
pure virtual

Set up the command data for SetCJKGridDataCmd.

Parameters
namedGridUIDIN The UID of named grid may be used in the command data.
gridDataIN The gridData for the selected page.
itemListIN The items the command applies to.
cmdIN The command which the command data attached to.
virtual bool16 ICJKGridUtils::TextFrameDrawsCJKCharCount (const IPMUnknownobj)
pure virtual

Returns whether or not a text frame contains a characer count

Parameters
objIN Interface on text frame boss (kFrameItemBoss or kMultiColumnFrameBoss).
Returns
kTrue if it is an active frame grid with a visible character count