Data Type : Composite Data; Rich Text

CDPABDEFINITION - Defines a format for rich-text paragraphs.
----------------------------------------------------------------------------------------------------------


#include <editods.h>

Definition :

typedef struct {
  WSIG Header;        /* Used to quickly recognize structure type */
  WORD PABID;         /* ID of this PAB */
  WORD JustifyMode;   /* paragraph justification type */
  WORD LineSpacing;   /* (2*(Line Spacing-1)) (0:1,1:1.5,2:2,etc) */
  WORD ParagraphSpacingBefore; /* # LineSpacing units above para */
  WORD ParagraphSpacingAfter;  /* # LineSpacing units below para */
  WORD LeftMargin;    /* leftmost margin, twips rel to abs left */
                      /* (16 bits = about 44") */
  WORD RightMargin;   /* rightmost margin, twips rel to abs right */
                      /* (16 bits = about 44") */
                      /* Special value "0" means right margin */
                      /* will be placed 1" from right edge of */
                      /* paper, regardless of paper size. */
  WORD FirstLineLeftMargin; /* leftmost margin on first line */
                      /* (16 bits = about 44") */
  WORD Tabs;          /* number of tab stops in table */
  SWORD Tab[MAXTABS]; /* table of tab stop positions, negative */
                      /* value means decimal tab */
                      /* (15 bits = about 22") */
  WORD Flags;         /* paragraph attribute flags - PABFLAG_xxx */
  DWORD TabTypes;     /* 2 bits per tab */
  WORD Flags2;        /* extra paragraph attribute flags - PABFLAG2_xxx */

Description :

This structure specifies a format for paragraphs in a rich-text field. There may be more than one paragraph using the same paragraph format, but there may be no more than one CDPABDEFINITION with the same ID in a rich-text field.

Note: All units in the fields of this structure are in TWIPS (1/20 of a point). There are 72 points to an inch and 20 TWIPS to a point, and therefore there are 72 * 20 TWIPS to an inch. Use the #define ONEINCH to represent the number of TWIPS to an inch. For example:

.LeftMargin = ONEINCH/2, .RightMargin = ONEINCH, .FirstLineLeftMargin = (ONEINCH + ONEINCH/2), .TAB[0] = ONEINCH, .TAB[1] = 2*ONEINCH, etc.

Sample Usage :

/* Initialize a CDPABDEFINITION structure.  We use all defaults,
  except for centered justification.
*/

pabdef.Header.Signature = SIG_CD_PABDEFINITION;
pabdef.Header.Length = ODSLength( _CDPABDEFINITION );
pabdef.PABID = PARA_STYLE_ID;
pabdef.JustifyMode = JUSTIFY_CENTER;
pabdef.LineSpacing = DEFAULT_LINE_SPACING;
pabdef.ParagraphSpacingBefore = DEFAULT_ABOVE_PAR_SPACING;
pabdef.ParagraphSpacingAfter = DEFAULT_BELOW_PAR_SPACING;
pabdef.LeftMargin = DEFAULT_LEFT_MARGIN;
pabdef.RightMargin = DEFAULT_RIGHT_MARGIN;
pabdef.FirstLineLeftMargin = DEFAULT_FIRST_LEFT_MARGIN;
pabdef.Tabs = DEFAULT_TABS;
pabdef.Tab[0] = DEFAULT_TAB_INTERVAL;
pabdef.Flags = 0;

pabdef.TabTypes = TAB_DEFAULT;
pabdef.Flags2 = DEFAULT_FLAGS2;


/* Call ODSWriteMemory to convert the CDPABDEFINITION structure to
  Domino canonical format and write the converted structure into
  the buffer at location buff_ptr. This advances buff_ptr to the
  next byte in the buffer after the canonical format strucure.
*/
   
ODSWriteMemory( &buff_ptr, _CDPABDEFINITION, &pabdef, 1 );


See Also :

CDPABREFERENCE
----------------------------------------------------------------------------------------------------------