Пример #1
0
class ITableStyleCommand(interfaces.IRMLDirectiveSignature):

    start = attr.Sequence(
        title=u'Start Coordinates',
        description=u'The start table coordinates for the style instruction',
        value_type=attr.Combination(
            value_types=(attr.Integer(),
                         attr.Choice(choices=interfaces.SPLIT_CHOICES))
            ),
        default=[0, 0],
        min_length=2,
        max_length=2,
        required=True)

    stop = attr.Sequence(
        title=u'End Coordinates',
        description=u'The end table coordinates for the style instruction',
        value_type=attr.Combination(
            value_types=(attr.Integer(),
                         attr.Choice(choices=interfaces.SPLIT_CHOICES))
            ),
        default=[-1, -1],
        min_length=2,
        max_length=2,
        required=True)
Пример #2
0
class IStrandLabelBase(ILabelBase):

    row = attr.Integer(title='Row',
                       description='The row of the strand label',
                       required=False)

    col = attr.Integer(title='Column',
                       description='The column of the strand label.',
                       required=False)

    format = attr.Text(title='Format',
                       description='The format string for the label.',
                       required=False)
Пример #3
0
class IOrderedListItem(IListItem):
    """An ordered list item."""

    value = attr.Integer(
        title='Bullet Value',
        description='The counter value.',
        required=False)
Пример #4
0
class IPreformatted(IMinimalParagraphBase):
    """A preformatted text, similar to the <pre> tag in HTML."""

    style = attr.Style(
        title=u'Style',
        description=(u'The paragraph style that is applied to the paragraph. '
                     u'See the ``paraStyle`` tag for creating a paragraph '
                     u'style.'),
        default=SampleStyleSheet['Code'],
        required=False)

    text = attr.RawXMLContent(
        title=u'Text',
        description=(u'The text that will be layed out.'),
        required=True)

    maxLineLength = attr.Integer(
        title=u'Max Line Length',
        description=(u'The maximum number of characters on one line.'),
        required=False)

    newLineChars = attr.Text(
        title=u'New Line Characters',
        description=u'The characters placed at the beginning of a wrapped line',
        required=False)
Пример #5
0
class ITextField(IField):
    """A text field within the PDF"""

    width = attr.Measurement(
        title=u'Width',
        description=u'The width of the text field.',
        required=True)

    height = attr.Measurement(
        title=u'Height',
        description=u'The height of the text field.',
        required=True)

    value = attr.Text(
        title=u'Value',
        description=u'The default text value of the field.',
        required=False)

    maxLength = attr.Integer(
        title=u'Maximum Length',
        description=u'The maximum amount of characters allowed in the field.',
        required=False)

    multiline = attr.Boolean(
        title=u'Multiline',
        description=u'A flag when set allows multiple lines within the field.',
        required=False)
Пример #6
0
class IBlockTable(interfaces.IRMLDirectiveSignature):
    """A typical block table."""
    occurence.containing(
        occurence.ZeroOrMore('tr', ITableRow),
        occurence.ZeroOrOne('bulkData', ITableBulkData),
        occurence.ZeroOrMore('blockTableStyle', stylesheet.IBlockTableStyle),
    )

    style = attr.Style(
        title=u'Style',
        description=(u'The table style that is applied to the table. '),
        required=False)

    rowHeights = attr.Sequence(
        title=u'Row Heights',
        description=u'A list of row heights in the table.',
        value_type=attr.Measurement(),
        required=False)

    colWidths = attr.Sequence(
        title=u'Column Widths',
        description=u'A list of column widths in the table.',
        value_type=attr.Measurement(allowPercentage=True, allowStar=True),
        required=False)

    repeatRows = attr.Integer(
        title=u'Repeat Rows',
        description=u'A flag to repeat rows upon table splits.',
        required=False)

    alignment = attr.Choice(title=u'Alignment',
                            description=u'The alignment of whole table.',
                            choices=interfaces.ALIGN_TEXT_CHOICES,
                            required=False)
Пример #7
0
class IValueAxis(IAxis):

    forceZero = attr.Boolean(
        title=u'Force Zero',
        description=u'When set, the range will contain the origin.',
        required=False)

    minimumTickSpacing = attr.Measurement(
        title=u'Minimum Tick Spacing',
        description=u'The minimum distance between ticks.',
        required=False)

    maximumTicks = attr.Integer(
        title=u'Maximum Ticks',
        description=u'The maximum number of ticks to be shown.',
        required=False)

    labelTextFormat = attr.String(
        title=u'Label Text Format',
        description=u'Formatting string for axis labels.',
        required=False)

    labelTextPostFormat = attr.Text(
        title=u'Label Text Post Format',
        description=u'An additional formatting string.',
        required=False)

    labelTextScale = attr.Float(
        title=u'Label Text Scale',
        description=u'The sclaing factor for the label tick values.',
        required=False)

    valueMin = attr.Float(title=u'Minimum Value',
                          description=u'The smallest value on the axis.',
                          required=False)

    valueMax = attr.Float(title=u'Maximum Value',
                          description=u'The largest value on the axis.',
                          required=False)

    valueStep = attr.Float(title=u'Value Step',
                           description=u'The step size between ticks',
                           required=False)

    valueSteps = attr.Sequence(
        title=u'Step Sizes',
        description=u'List of step sizes between ticks.',
        value_type=attr.Float(),
        required=False)

    rangeRound = attr.Choice(
        title=u'Range Round',
        description=u'Method to be used to round the range values.',
        choices=('none', 'both', 'ceiling', 'floor'),
        required=False)

    zrangePref = attr.Float(title=u'Zero Range Preference',
                            description=u'Zero range axis limit preference.',
                            required=False)
Пример #8
0
class IAddMapping(interfaces.IRMLDirectiveSignature):
    """Map various styles(bold, italic) of a font name to the actual ps fonts
    used."""

    faceName = attr.String(title=u'Name',
                           description=(u'The name of the font to be mapped'),
                           required=True)

    bold = attr.Integer(title=u'Bold', description=(u'Bold'), required=True)

    italic = attr.Integer(title=u'Italic',
                          description=(u'Italic'),
                          required=True)

    psName = attr.String(title=u'psName',
                         description=(u'Actual font name mapped'),
                         required=True)
Пример #9
0
class IStrandLabelBase(ILabelBase):

    _text = attr.TextNode(title=u'Text',
                          description=u'The label text of the strand.',
                          required=False)

    row = attr.Integer(title=u'Row',
                       description=u'The row of the strand label',
                       required=False)

    col = attr.Integer(title=u'Column',
                       description=u'The column of the strand label.',
                       required=False)

    format = attr.String(title=u'Format',
                         description=u'The format string for the label.',
                         required=False)
Пример #10
0
class IBaseListStyle(IMinimalListStyle):

    start = attr.Combination(
        title=u'Start Value',
        description=u'The counter start value.',
        value_types=(attr.Integer(),
                     attr.Choice(choices=interfaces.UNORDERED_BULLET_VALUES)),
        required=False)
Пример #11
0
class ITemplate(interfaces.IRMLDirectiveSignature):
    """Define a page template."""
    occurence.containing(occurence.OneOrMore('pageTemplate', IPageTemplate), )

    pagesize = attr.PageSize(title=u'Page Size',
                             description=u'The Page Size.',
                             required=False)

    rotation = attr.Integer(
        title=u'Rotation',
        description=u'The rotation of the page in multiples of 90 degrees.',
        required=False)

    leftMargin = attr.Measurement(
        title=u'Left Margin',
        description=u'The left margin of the template.',
        default=0,
        required=False)

    rightMargin = attr.Measurement(
        title=u'Right Margin',
        description=u'The right margin of the template.',
        default=0,
        required=False)

    topMargin = attr.Measurement(
        title=u'Top Margin',
        description=u'The top margin of the template.',
        default=0,
        required=False)

    bottomMargin = attr.Measurement(
        title=u'Bottom Margin',
        description=u'The bottom margin of the template.',
        default=0,
        required=False)

    showBoundary = attr.Boolean(
        title=u'Show Boundary',
        description=u'A flag to show the boundary of the template.',
        required=False)

    allowSplitting = attr.Boolean(
        title=u'Allow Splitting',
        description=u'A flag to allow splitting over multiple templates.',
        required=False)

    title = attr.Text(title=u'Title',
                      description=u'The title of the PDF document.',
                      required=False)

    author = attr.Text(title=u'Author',
                       description=u'The author of the PDF document.',
                       required=False)
Пример #12
0
class IPieChart(IChart):
    """A pie chart."""
    occurence.containing(occurence.One('data', ISingleData1D),
                         occurence.ZeroOrOne('slices', ISlices),
                         occurence.ZeroOrOne('labels', ISimpleLabels),
                         *IChart.queryTaggedValue('directives', ()))

    startAngle = attr.Integer(
        title=u'Start Angle',
        description=u'The start angle in the chart of the first slice '
        u'in degrees.',
        required=False)

    direction = attr.Choice(
        title=u'Direction',
        description=u'The direction in which the pie chart will be built.',
        choices=('clockwise', 'anticlockwise'),
        required=False)

    checkLabelOverlap = attr.Boolean(
        title=u'Check Label Overlap',
        description=(u'When true, check and attempt to fix standard '
                     u'label overlaps'),
        required=False)

    pointerLabelMode = attr.Choice(
        title=u'Pointer Label Mode',
        description=(u'The location relative to the slace the label should '
                     u'be placed.'),
        choices={
            'none': None,
            'leftright': 'LeftRight',
            'leftandright': 'LeftAndRight'
        },
        required=False)

    sameRadii = attr.Boolean(
        title=u'Same Radii',
        description=u'When true, make x/y radii the same.',
        required=False)

    orderMode = attr.Choice(title=u'Order Mode',
                            description=u'',
                            choices=('fixed', 'alternate'),
                            required=False)

    xradius = attr.Measurement(title=u'X-Radius',
                               description=u'The radius of the X-directions',
                               required=False)

    yradius = attr.Measurement(title=u'Y-Radius',
                               description=u'The radius of the Y-directions',
                               required=False)
Пример #13
0
class IMergePage(interfaces.IRMLDirectiveSignature):
    """Merges an existing PDF Page into the one to be generated."""

    filename = attr.File(
        title=u'File',
        description=(u'Reference to the PDF file to extract the page from.'),
        required=True)

    page = attr.Integer(
        title=u'Page Number',
        description=u'The page number of the PDF file that is used to merge..',
        required=True)
Пример #14
0
class IBaseListStyle(IMinimalListStyle):

    start = attr.Combination(
        title=u'Start Value',
        description=u'The counter start value.',
        value_types=(
            # Numeric start value.
            attr.Integer(),
            # Bullet types.
            attr.Choice(choices=interfaces.UNORDERED_BULLET_VALUES),
            # Arbitrary text.
            attr.String(),
        ),
        required=False)
Пример #15
0
class ILineStyle(ITableStyleCommand):
    """Define the border line style of each cell."""

    kind = attr.Choice(
        title=u'Kind',
        description=u'The kind of line actions to be taken.',
        choices=('GRID', 'BOX', 'OUTLINE', 'INNERGRID',
                 'LINEBELOW', 'LINEABOVE', 'LINEBEFORE', 'LINEAFTER'),
        required=True)

    thickness = attr.Measurement(
        title=u'Thickness',
        description=u'Line Thickness',
        default=1,
        required=True)

    colorName = attr.Color(
        title=u'Color',
        description=u'The color of the border line.',
        default=None,
        required=True)

    cap = attr.Choice(
        title=u'Cap',
        description=u'The cap at the end of a border line.',
        choices=interfaces.CAP_CHOICES,
        default=1,
        required=True)

    dash = attr.Sequence(
        title=u'Dash-Pattern',
        description=u'The dash-pattern of a line.',
        value_type=attr.Measurement(),
        default=[],
        required=False)

    join = attr.Choice(
        title=u'Join',
        description=u'The way lines are joined together.',
        choices=interfaces.JOIN_CHOICES,
        default=1,
        required=False)

    count = attr.Integer(
        title=u'Count',
        description=(u'Describes whether the line is a single (1) or '
                     u'double (2) line.'),
        default=1,
        required=False)
Пример #16
0
class TextAnnotation(CanvasRMLDirective):
    signature = ITextAnnotation
    factories = {'param': Param}

    paramTypes = {'escape': attr.Integer()}

    def process(self):
        contents = self.getAttributeValues(valuesOnly=True)[0]
        self.params = {}
        self.processSubDirectives()
        for name, type in self.paramTypes.items():
            if name in self.params:
                bound = type.bind(self)
                self.params[name] = bound.fromUnicode(self.params[name])
        canvas = attr.getManager(self, interfaces.ICanvasManager).canvas
        canvas.textAnnotation(contents, **self.params)
Пример #17
0
class IStartIndex(interfaces.IRMLDirectiveSignature):
    """Start a new index."""

    name = attr.Text(title='Name',
                     description='The name of the index.',
                     default='index',
                     required=True)

    offset = attr.Integer(title='Offset',
                          description='The counting offset.',
                          min=0,
                          required=False)

    format = attr.Choice(title='Format',
                         description=('The format the index is going to use.'),
                         choices=interfaces.LIST_FORMATS,
                         required=False)
Пример #18
0
class IPageTemplate(interfaces.IRMLDirectiveSignature):
    """Define a page template."""
    occurence.containing(
        occurence.OneOrMore('frame', IFrame),
        occurence.ZeroOrOne('pageGraphics', IPageGraphics),
    )

    id = attr.Text(title=u'Id',
                   description=u'The id of the template.',
                   required=True)

    pagesize = attr.PageSize(title=u'Page Size',
                             description=u'The Page Size.',
                             required=False)

    rotation = attr.Integer(
        title=u'Rotation',
        description=u'The rotation of the page in multiples of 90 degrees.',
        required=False)
Пример #19
0
class IOutlineAdd(interfaces.IRMLDirectiveSignature):
    """Add a new entry to the outline of the PDF."""

    title = attr.TextNode(title=u'Title',
                          description=u'The text displayed for this item.',
                          required=True)

    key = attr.String(title=u'Key',
                      description=u'The unique key of the item.',
                      required=False)

    level = attr.Integer(title=u'Level',
                         description=u'The level in the outline tree.',
                         required=False)

    closed = attr.Boolean(
        title=u'Closed',
        description=(u'A flag to determine whether the sub-tree is closed '
                     u'by default.'),
        required=False)
Пример #20
0
class IMinimalParagraphBase(interfaces.IRMLDirectiveSignature):

    style = attr.Style(
        title=u'Style',
        description=(u'The paragraph style that is applied to the paragraph. '
                     u'See the ``paraStyle`` tag for creating a paragraph '
                     u'style.'),
        required=False)

    bulletText = attr.String(
        title=u'Bullet Character',
        description=(u'The bullet character is the ASCII representation of '
                     u'the symbol making up the bullet in a listing.'),
        required=False)

    dedent = attr.Integer(
        title=u'Dedent',
        description=(u'Number of characters to be removed in front of every '
                     u'line of the text.'),
        required=False)
Пример #21
0
class ISpiderChart(IChart):
    """A spider chart."""
    occurence.containing(occurence.One('data', IData1D),
                         occurence.ZeroOrOne('strands', IStrands),
                         occurence.ZeroOrOne('strandLabels', IStrandLabels),
                         occurence.ZeroOrOne('spokes', ISpokes),
                         occurence.ZeroOrOne('spokeLabels', ISpokeLabels),
                         occurence.ZeroOrOne('labels', ISimpleLabels),
                         *IChart.queryTaggedValue('directives', ()))

    startAngle = attr.Integer(
        title='Start Angle',
        description='The start angle in the chart of the first strand '
        'in degrees.',
        required=False)

    direction = attr.Choice(
        title='Direction',
        description='The direction in which the spider chart will be built.',
        choices=('clockwise', 'anticlockwise'),
        required=False)
Пример #22
0
class IBarCodeBase(interfaces.IRMLDirectiveSignature):
    """Create a bar code."""

    code = attr.Choice(title=u'Code',
                       description=u'The name of the type of code to use.',
                       choices=reportlab.graphics.barcode.getCodeNames(),
                       required=True)

    value = attr.TextNode(title=u'Value',
                          description=u'The value represented by the code.',
                          required=True)

    width = attr.Measurement(title=u'Width',
                             description=u'The width of the barcode.',
                             required=False)

    height = attr.Measurement(title=u'Height',
                              description=u'The height of the barcode.',
                              required=False)

    barStrokeColor = attr.Color(
        title=u'Bar Stroke Color',
        description=(u'The color of the line strokes in the barcode.'),
        required=False)

    barStrokeWidth = attr.Measurement(
        title=u'Bar Stroke Width',
        description=u'The width of the line strokes in the barcode.',
        required=False)

    barFillColor = attr.Color(
        title=u'Bar Fill Color',
        description=(u'The color of the filled shapes in the barcode.'),
        required=False)

    gap = attr.Measurement(
        title=u'Gap',
        description=u'The width of the inter-character gaps.',
        required=False)

    # Bar code dependent attributes
    # I2of5, Code128, Standard93, FIM, POSTNET, Ean13B
    barWidth = attr.Measurement(
        title=u'Bar Width',
        description=u'The width of the smallest bar within the barcode',
        required=False)

    # I2of5, Code128, Standard93, FIM, POSTNET
    barHeight = attr.Measurement(title=u'Bar Height',
                                 description=u'The height of the symbol.',
                                 required=False)

    # I2of5
    ratio = attr.Float(
        title=u'Ratio',
        description=(u'The ratio of wide elements to narrow elements. '
                     u'Must be between 2.0 and 3.0 (or 2.2 and 3.0 if the '
                     u'barWidth is greater than 20 mils (.02 inch)).'),
        min=2.0,
        max=3.0,
        required=False)

    # I2of5
    # Should be boolean, but some code want it as int; will still work
    checksum = attr.Integer(
        title=u'Ratio',
        description=(u'A flag that enables the computation and inclusion of '
                     u'the check digit.'),
        required=False)

    # I2of5
    bearers = attr.Float(
        title=u'Bearers',
        description=(u'Height of bearer bars (horizontal bars along the top '
                     u'and bottom of the barcode). Default is 3 '
                     u'x-dimensions. Set to zero for no bearer bars.'
                     u'(Bearer bars help detect misscans, so it is '
                     u'suggested to leave them on).'),
        required=False)

    # I2of5, Code128, Standard93, FIM, Ean13
    quiet = attr.Boolean(
        title=u'Quiet Zone',
        description=(u'A flag to include quiet zones in the symbol.'),
        required=False)

    # I2of5, Code128, Standard93, FIM, Ean13
    lquiet = attr.Measurement(
        title=u'Left Quiet Zone',
        description=(u"Quiet zone size to the left of code, if quiet is "
                     u"true. Default is the greater of .25 inch or .15 times "
                     u"the symbol's length."),
        required=False)

    # I2of5, Code128, Standard93, FIM, Ean13
    rquiet = attr.Measurement(
        title=u'Right Quiet Zone',
        description=(u"Quiet zone size to the right of code, if quiet is "
                     u"true. Default is the greater of .25 inch or .15 times "
                     u"the symbol's length."),
        required=False)

    # I2of5, Code128, Standard93, FIM, POSTNET, Ean13
    fontName = attr.String(title=u'Font Name',
                           description=(u'The font used to print the value.'),
                           required=False)

    # I2of5, Code128, Standard93, FIM, POSTNET, Ean13
    fontSize = attr.Measurement(title=u'Font Size',
                                description=(u'The size of the value text.'),
                                required=False)

    # I2of5, Code128, Standard93, FIM, POSTNET, Ean13
    humanReadable = attr.Boolean(
        title=u'Human Readable',
        description=(u'A flag when set causes the value to be printed below '
                     u'the bar code.'),
        required=False)

    # I2of5, Standard93
    stop = attr.Boolean(
        title=u'Show Start/Stop',
        description=(u'A flag to specify whether the start/stop symbols '
                     u'are to be shown.'),
        required=False)

    # FIM, POSTNET
    spaceWidth = attr.Measurement(
        title=u'Space Width',
        description=u'The space of the inter-character gaps.',
        required=False)

    # POSTNET
    shortHeight = attr.Measurement(title=u'Short Height',
                                   description=u'The height of the short bar.',
                                   required=False)

    # Ean13
    textColor = attr.Color(title=u'Text Color',
                           description=(u'The color of human readable text.'),
                           required=False)

    # USPS4S
    routing = attr.String(title=u'Routing',
                          description=u'The routing information string.',
                          required=False)

    # QR
    barLevel = attr.Choice(
        title=u'Bar Level',
        description=u'The error correction level for QR code',
        choices=['L', 'M', 'Q', 'H'],
        required=False)

    barBorder = attr.Measurement(
        title=u'Bar Border',
        description=u'The width of the border around a QR code.',
        required=False)
Пример #23
0
class ITableCell(interfaces.IRMLDirectiveSignature):
    """A table cell within a table."""

    content = attr.RawXMLContent(
        title=u'Content',
        description=(u'The content of the cell; can be text or any flowable.'),
        required=True)

    fontName = attr.String(title=u'Font Name',
                           description=u'The name of the font for the cell.',
                           required=False)

    fontSize = attr.Measurement(
        title=u'Font Size',
        description=u'The font size for the text of the cell.',
        required=False)

    leading = attr.Measurement(
        title=u'Leading',
        description=(u'The height of a single text line. It includes '
                     u'character height.'),
        required=False)

    fontColor = attr.Color(
        title=u'Font Color',
        description=u'The color in which the text will appear.',
        required=False)

    leftPadding = attr.Measurement(
        title=u'Left Padding',
        description=u'The size of the padding on the left side.',
        required=False)

    rightPadding = attr.Measurement(
        title=u'Right Padding',
        description=u'The size of the padding on the right side.',
        required=False)

    topPadding = attr.Measurement(
        title=u'Top Padding',
        description=u'The size of the padding on the top.',
        required=False)

    bottomPadding = attr.Measurement(
        title=u'Bottom Padding',
        description=u'The size of the padding on the bottom.',
        required=False)

    background = attr.Color(
        title=u'Background Color',
        description=u'The color to use as the background for the cell.',
        required=False)

    align = attr.Choice(title=u'Text Alignment',
                        description=u'The text alignment within the cell.',
                        choices=interfaces.ALIGN_TEXT_CHOICES,
                        required=False)

    vAlign = attr.Choice(
        title=u'Vertical Alignment',
        description=u'The vertical alignment of the text within the cell.',
        choices=interfaces.VALIGN_TEXT_CHOICES,
        required=False)

    lineBelowThickness = attr.Measurement(
        title=u'Line Below Thickness',
        description=u'The thickness of the line below the cell.',
        required=False)

    lineBelowColor = attr.Color(
        title=u'Line Below Color',
        description=u'The color of the line below the cell.',
        required=False)

    lineBelowCap = attr.Choice(
        title=u'Line Below Cap',
        description=u'The cap at the end of the line below the cell.',
        choices=interfaces.CAP_CHOICES,
        required=False)

    lineBelowCount = attr.Integer(
        title=u'Line Below Count',
        description=(u'Describes whether the line below is a single (1) or '
                     u'double (2) line.'),
        required=False)

    lineBelowSpace = attr.Measurement(
        title=u'Line Below Space',
        description=u'The space of the line below the cell.',
        required=False)

    lineAboveThickness = attr.Measurement(
        title=u'Line Above Thickness',
        description=u'The thickness of the line above the cell.',
        required=False)

    lineAboveColor = attr.Color(
        title=u'Line Above Color',
        description=u'The color of the line above the cell.',
        required=False)

    lineAboveCap = attr.Choice(
        title=u'Line Above Cap',
        description=u'The cap at the end of the line above the cell.',
        choices=interfaces.CAP_CHOICES,
        required=False)

    lineAboveCount = attr.Integer(
        title=u'Line Above Count',
        description=(u'Describes whether the line above is a single (1) or '
                     u'double (2) line.'),
        required=False)

    lineAboveSpace = attr.Measurement(
        title=u'Line Above Space',
        description=u'The space of the line above the cell.',
        required=False)

    lineLeftThickness = attr.Measurement(
        title=u'Left Line Thickness',
        description=u'The thickness of the line left of the cell.',
        required=False)

    lineLeftColor = attr.Color(
        title=u'Left Line Color',
        description=u'The color of the line left of the cell.',
        required=False)

    lineLeftCap = attr.Choice(
        title=u'Line Left Cap',
        description=u'The cap at the end of the line left of the cell.',
        choices=interfaces.CAP_CHOICES,
        required=False)

    lineLeftCount = attr.Integer(
        title=u'Line Left Count',
        description=(u'Describes whether the left line is a single (1) or '
                     u'double (2) line.'),
        required=False)

    lineLeftSpace = attr.Measurement(
        title=u'Line Left Space',
        description=u'The space of the line left of the cell.',
        required=False)

    lineRightThickness = attr.Measurement(
        title=u'Right Line Thickness',
        description=u'The thickness of the line right of the cell.',
        required=False)

    lineRightColor = attr.Color(
        title=u'Right Line Color',
        description=u'The color of the line right of the cell.',
        required=False)

    lineRightCap = attr.Choice(
        title=u'Line Right Cap',
        description=u'The cap at the end of the line right of the cell.',
        choices=interfaces.CAP_CHOICES,
        required=False)

    lineRightCount = attr.Integer(
        title=u'Line Right Count',
        description=(u'Describes whether the right line is a single (1) or '
                     u'double (2) line.'),
        required=False)

    lineRightSpace = attr.Measurement(
        title=u'Line Right Space',
        description=u'The space of the line right of the cell.',
        required=False)

    href = attr.Text(
        title=u'Link URL',
        description=u'When specified, the cell becomes a link to that URL.',
        required=False)

    destination = attr.Text(
        title=u'Link Destination',
        description=(u'When specified, the cell becomes a link to that '
                     u'destination.'),
        required=False)
Пример #24
0
class IBaseParagraphStyle(ISpanStyle):

    leading = attr.Measurement(
        title=u'Leading',
        description=(u'The height of a single paragraph line. It includes '
                     u'character height.'),
        required=False)

    leftIndent = attr.Measurement(
        title=u'Left Indentation',
        description=u'General indentation on the left side.',
        required=False)

    rightIndent = attr.Measurement(
        title=u'Right Indentation',
        description=u'General indentation on the right side.',
        required=False)

    firstLineIndent = attr.Measurement(
        title=u'First Line Indentation',
        description=u'The indentation of the first line in the paragraph.',
        required=False)

    alignment = attr.Choice(title=u'Alignment',
                            description=u'The text alignment.',
                            choices=interfaces.ALIGN_CHOICES,
                            required=False)

    spaceBefore = attr.Measurement(
        title=u'Space Before',
        description=u'The vertical space before the paragraph.',
        required=False)

    spaceAfter = attr.Measurement(
        title=u'Space After',
        description=u'The vertical space after the paragraph.',
        required=False)

    bulletFontName = attr.String(
        title=u'Bullet Font Name',
        description=u'The font in which the bullet character will be rendered.',
        required=False)

    bulletFontSize = attr.Measurement(
        title=u'Bullet Font Size',
        description=u'The font size of the bullet character.',
        required=False)

    bulletIndent = attr.Measurement(
        title=u'Bullet Indentation',
        description=u'The indentation that is kept for a bullet point.',
        required=False)

    bulletColor = attr.Color(
        title=u'Bullet Color',
        description=u'The color in which the bullet will appear.',
        required=False)

    wordWrap = attr.Choice(
        title=u'Word Wrap Method',
        description=(
            u'When set to "CJK", invoke CJK word wrapping. LTR RTL use '
            u'left to right / right to left with support from pyfribi2 if '
            u'available'),
        choices=interfaces.WORD_WRAP_CHOICES,
        required=False)

    borderWidth = attr.Measurement(
        title=u'Paragraph Border Width',
        description=u'The width of the paragraph border.',
        required=False)

    borderPadding = attr.Padding(title=u'Paragraph Border Padding',
                                 description=u'Padding of the paragraph.',
                                 required=False)

    borderColor = attr.Color(
        title=u'Border Color',
        description=u'The color in which the paragraph border will appear.',
        required=False)

    borderRadius = attr.Measurement(
        title=u'Paragraph Border Radius',
        description=u'The radius of the paragraph border.',
        required=False)

    allowWidows = attr.Boolean(title=u'Allow Widows',
                               description=(u'Allow widows.'),
                               required=False)

    allowOrphans = attr.Boolean(title=u'Allow Orphans',
                                description=(u'Allow orphans.'),
                                required=False)

    endDots = attr.String(
        title=u'End Dots',
        description=u'Characters/Dots at the end of a paragraph.',
        required=False)

    splitLongWords = attr.Boolean(
        title=u'Split Long Words',
        description=(u'Try to split long words at the end of a line.'),
        default=True,
        required=False)

    justifyLastLine = attr.Integer(
        title=u'Justify Last Line',
        description=(
            u'Justify last line if there are more then this number of words. '
            u'Otherwise, don\'t bother.'),
        default=0,
        required=False)

    justifyBreaks = attr.Boolean(
        title=u'Justify Breaks',
        description=(
            u'A flag, when set indicates that a line with a break should be '
            u'justified as well.'),
        default=False,
        required=False)

    spaceShrinkage = attr.Float(
        title=u'Allowed Whitespace Shrinkage Fraction',
        description=(
            u'The fraction of the original whitespace by which the '
            u'whitespace is allowed to shrink to fit content on the same '
            u'line.'),
        required=False)

    bulletAnchor = attr.Choice(
        title=u'Bullet Anchor',
        description=u'The place at which the bullet is anchored.',
        choices=interfaces.BULLET_ANCHOR_CHOICES,
        default='start',
        required=False)

    # Attributes not part of the official style attributes, but are accessed
    # by the paragraph renderer.

    keepWithNext = attr.Boolean(
        title=u'Keep with Next',
        description=(u'When set, this paragraph will always be in the same '
                     u'frame as the following flowable.'),
        required=False)

    pageBreakBefore = attr.Boolean(
        title=u'Page Break Before',
        description=(u'Specifies whether a page break should be inserted '
                     u'before the directive.'),
        required=False)

    frameBreakBefore = attr.Boolean(
        title=u'Frame Break Before',
        description=(u'Specifies whether a frame break should be inserted '
                     u'before the directive.'),
        required=False)