Exemplo n.º 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)
Exemplo n.º 2
0
class ILogConfig(interfaces.IRMLDirectiveSignature):
    """Configure the render logger."""

    level = attr.Choice(
        title=u'Level',
        description=u'The default log level.',
        choices=interfaces.LOG_LEVELS,
        doLower=False,
        required=False)

    format = attr.String(
        title=u'Format',
        description=u'The format of the log messages.',
        required=False)

    filename = attr.File(
        title=u'File Name',
        description=u'The path to the file that is being logged.',
        doNotOpen=True,
        required=True)

    filemode = attr.Choice(
        title=u'File Mode',
        description=u'The mode to open the file in.',
        choices={'WRITE': 'w', 'APPEND': 'a'},
        default='a',
        required=False)

    datefmt = attr.String(
        title=u'Date Format',
        description=u'The format of the log message date.',
        required=False)
Exemplo n.º 3
0
class ILineMode(interfaces.IRMLDirectiveSignature):
    """Set the line mode for the following graphics elements."""

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

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

    miterLimit = attr.Measurement(title=u'Miter Limit',
                                  description=(u'The ???.'),
                                  required=False)

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

    cap = attr.Choice(
        title=u'Cap',
        description=u'The cap is the desciption of how the line-endings look.',
        choices=interfaces.CAP_CHOICES,
        required=False)
Exemplo n.º 4
0
class IMinimalListStyle(interfaces.IRMLDirectiveSignature):

    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)

    bulletColor = attr.Color(
        title=u'Bullet Color',
        description=u'The color in which the bullet will appear.',
        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)

    bulletOffsetY = attr.Measurement(
        title=u'Bullet Y-Offset',
        description=u'The vertical offset of the bullet.',
        required=False)

    bulletDedent = attr.StringOrInt(
        title=u'Bullet Dedent',
        description=u'Either pixels of dedent or auto (default).',
        required=False)

    bulletDir = attr.Choice(
        title=u'Bullet Layout Direction',
        description=u'The layout direction of the bullet.',
        choices=('ltr', 'rtl'),
        required=False)

    bulletFormat = attr.String(
        title=u'Bullet Format',
        description=u'A formatting expression for the bullet text.',
        required=False)

    bulletType = attr.Choice(
        title=u'Bullet Type',
        description=u'The type of number to display.',
        choices=interfaces.ORDERED_LIST_TYPES + \
                interfaces.UNORDERED_BULLET_VALUES,
        doLower=False,
        required=False)
Exemplo n.º 5
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)
Exemplo n.º 6
0
class IHorizontalRow(interfaces.IRMLDirectiveSignature):
    """Create a horizontal line on the page."""

    width = attr.Measurement(
        title=u'Width',
        description=u'The width of the line on the page.',
        allowPercentage=True,
        required=False)

    thickness = attr.Measurement(
        title=u'Thickness',
        description=u'Line Thickness',
        required=False)

    color = attr.Color(
        title=u'Color',
        description=u'The color of the line.',
        required=False)

    lineCap = attr.Choice(
        title=u'Cap',
        description=u'The cap at the end of the line.',
        choices=interfaces.CAP_CHOICES.keys(),
        required=False)

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

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

    align = attr.Choice(
        title=u'Alignment',
        description=u'The alignment of the line within the frame.',
        choices=interfaces.ALIGN_TEXT_CHOICES,
        required=False)

    valign = attr.Choice(
        title=u'Vertical Alignment',
        description=u'The vertical alignment of the line.',
        choices=interfaces.VALIGN_TEXT_CHOICES,
        required=False)

    dash = attr.Sequence(
        title=u'Dash-Pattern',
        description=u'The dash-pattern of a line.',
        value_type=attr.Measurement(),
        default=None,
        required=False)
Exemplo n.º 7
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)
Exemplo n.º 8
0
class IUnorderedListItem(IListItem):
    """An ordered list item."""

    value = attr.Choice(title=u'Bullet Value',
                        description=u'The type of bullet character.',
                        choices=interfaces.UNORDERED_BULLET_VALUES,
                        required=False)
Exemplo n.º 9
0
class IStoryPlace(interfaces.IRMLDirectiveSignature):
    """Draws a set of flowables on the canvas within a given region."""

    x = attr.Measurement(
        title='X-Coordinate',
        description=('The X-coordinate of the lower-left position of the '
                     'place.'),
        required=True)

    y = attr.Measurement(
        title='Y-Coordinate',
        description=('The Y-coordinate of the lower-left position of the '
                     'place.'),
        required=True)

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

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

    origin = attr.Choice(
        title='Origin',
        description='The origin of the coordinate system for the story.',
        choices=('page', 'frame', 'local'),
        default = 'page',
        required=False)
Exemplo n.º 10
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)
Exemplo n.º 11
0
class IBookmark(interfaces.IRMLDirectiveSignature):
    """
    This creates a bookmark to the current page which can be referred to with
    the given key elsewhere. (Used inside a page drawing.)
    """

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

    fit = attr.Choice(title=u'Fit',
                      description=u'The Fit Type.',
                      choices=('XYZ', 'Fit', 'FitH', 'FitV', 'FitR'),
                      required=False)

    zoom = attr.Float(
        title=u'Zoom',
        description=u'The zoom level when clicking on the bookmark.',
        required=False)

    x = attr.Measurement(title=u'X-Position',
                         description=u'The x-position.',
                         required=False)

    y = attr.Measurement(title=u'Y-Position',
                         description=u'The y-position.',
                         required=False)
Exemplo n.º 12
0
class IYValueAxis(IValueAxis):
    """Y-Value Axis"""

    tickLeft = attr.Measurement(
        title='Tick Left',
        description='Length of tick left to the axis line.',
        required=False)

    tickRight = attr.Measurement(
        title='Tick Right',
        description='Length of tick right to the axis line.',
        required=False)

    joinAxis = attr.Boolean(title='Join Axis',
                            description='Whether to join the axes.',
                            required=False)

    joinAxisMode = attr.Choice(title='Join Axis Mode',
                               description='Mode for connecting axes.',
                               choices=('bottom', 'top', 'value', 'points',
                                        'None'),
                               required=False)

    joinAxisPos = attr.Measurement(
        title='Join Axis Position',
        description='The position in the plot at which to join the axes.',
        required=False)
Exemplo n.º 13
0
class IKeepInFrame(interfaces.IRMLDirectiveSignature):
    """Ask a flowable to stay within the frame."""

    maxWidth = attr.Measurement(
        title=u'Maximum Width',
        description=u'The maximum width the flowables are allotted.',
        default=None,
        required=False)

    maxHeight = attr.Measurement(
        title=u'Maximum Height',
        description=u'The maximum height the flowables are allotted.',
        default=None,
        required=False)

    mergeSpace = attr.Boolean(
        title=u'Merge Space',
        description=u'A flag to set whether the space should be merged.',
        required=False)

    onOverflow = attr.Choice(
        title=u'On Overflow',
        description=u'Defines what has to be done, if an overflow is detected.',
        choices=('error', 'overflow', 'shrink', 'truncate'),
        required=False)

    id = attr.Text(title=u'Name/Id',
                   description=u'The name/id of the flowable.',
                   required=False)

    frame = attr.StringOrInt(
        title=u'Frame',
        description=u'The frame to which the flowable should be fitted.',
        required=False)
Exemplo n.º 14
0
class IBlockAlignment(ITableStyleCommand):
    """Set the text alignment."""

    value = attr.Choice(title=u'Text Alignment',
                        description=u'The text alignment within the cell.',
                        choices=interfaces.ALIGN_TEXT_CHOICES,
                        required=True)
Exemplo n.º 15
0
class IImage(interfaces.IRMLDirectiveSignature):
    """An image."""

    src = attr.Image(
        title=u'Image Source',
        description=u'The file that is used to extract the image data.',
        onlyOpen=True,
        required=True)

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

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

    mask = attr.Color(title=u'Mask',
                      description=u'The color mask used to render the image.',
                      required=False)

    vAlign = attr.Choice(title=u'Vertical Alignment',
                         description=u'The vertical alignment of the image.',
                         choices=interfaces.VALIGN_TEXT_CHOICES,
                         required=False)
Exemplo n.º 16
0
class IButtonField(IField):
    """A button field within the PDF"""

    value = attr.Choice(title=u'Value',
                        description=u'The value of the button.',
                        choices=('Yes', 'Off'),
                        required=True)
Exemplo n.º 17
0
class IXValueAxis(IValueAxis):
    """X-Value Axis"""

    tickUp = attr.Measurement(
        title='Tick Up',
        description='Length of tick above the axis line.',
        required=False)

    tickDown = attr.Measurement(
        title='Tick Down',
        description='Length of tick below the axis line.',
        required=False)

    joinAxis = attr.Boolean(title='Join Axis',
                            description='Whether to join the axes.',
                            required=False)

    joinAxisMode = attr.Choice(title='Join Axis Mode',
                               description='Mode for connecting axes.',
                               choices=('bottom', 'top', 'value', 'points',
                                        'None'),
                               required=False)

    joinAxisPos = attr.Measurement(
        title='Join Axis Position',
        description='The position in the plot at which to join the axes.',
        required=False)
Exemplo n.º 18
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)
Exemplo n.º 19
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)
Exemplo n.º 20
0
class IBlockValign(ITableStyleCommand):
    """Define the vertical alignment of the cells."""

    value = attr.Choice(
        title=u'Vertical Alignment',
        description=u'The vertical alignment of the text with the cells.',
        choices=interfaces.VALIGN_TEXT_CHOICES,
        required=True)
Exemplo n.º 21
0
class IOrderedList(IListBase):
    """An ordered list."""
    occurence.containing(occurence.ZeroOrMore('li', IOrderedListItem), )

    bulletType = attr.Choice(title=u'Bullet Type',
                             description=u'The type of bullet formatting.',
                             choices=interfaces.ORDERED_LIST_TYPES,
                             doLower=False,
                             required=False)
Exemplo n.º 22
0
class IUnorderedList(IListBase):
    """And unordered list."""
    occurence.containing(occurence.ZeroOrMore('li', IUnorderedListItem), )

    value = attr.Choice(title=u'Bullet Value',
                        description=u'The type of bullet character.',
                        choices=interfaces.UNORDERED_BULLET_VALUES,
                        default='disc',
                        required=False)
Exemplo n.º 23
0
class ILog(IBaseLogCall):
    """Log message at DEBUG level."""

    level = attr.Choice(title=u'Level',
                        description=u'The default log level.',
                        choices=interfaces.LOG_LEVELS,
                        doLower=False,
                        default=logging.INFO,
                        required=True)
Exemplo n.º 24
0
class IImage(interfaces.IRMLDirectiveSignature):
    """An image."""

    src = attr.Image(
        title=u'Image Source',
        description=u'The file that is used to extract the image data.',
        onlyOpen=True,
        required=True)

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

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

    preserveAspectRatio = attr.Boolean(
        title=u'Preserve Aspect Ratio',
        description=(u'If set, the aspect ratio of the image is kept. When '
                     u'both, width and height, are specified, the image '
                     u'will be fitted into that bounding box.'),
        default=False,
        required=False)

    mask = attr.Color(
        title=u'Mask',
        description=u'The color mask used to render the image.',
        required=False)

    align = attr.Choice(
        title=u'Alignment',
        description=u'The alignment of the image within the frame.',
        choices=interfaces.ALIGN_TEXT_CHOICES,
        required=False)

    vAlign = attr.Choice(
        title=u'Vertical Alignment',
        description=u'The vertical alignment of the image.',
        choices=interfaces.VALIGN_TEXT_CHOICES,
        required=False)
Exemplo n.º 25
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)
Exemplo n.º 26
0
class IImageAndFlowables(interfaces.IRMLDirectiveSignature):
    """An image with flowables around it."""

    imageName = attr.Image(
        title=u'Image',
        description=u'The file that is used to extract the image data.',
        onlyOpen=True,
        required=True)

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

    imageHeight = attr.Measurement(
        title=u'Image Height',
        description=u'The height the image.',
        required=False)

    imageMask = attr.Color(
        title=u'Mask',
        description=u'The height the image.',
        required=False)

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

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

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

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

    imageSide = attr.Choice(
        title=u'Image Side',
        description=u'The side at which the image will be placed.',
        choices=('left', 'right'),
        required=False)
Exemplo n.º 27
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)
Exemplo n.º 28
0
class IBookmark(interfaces.IRMLDirectiveSignature):
    """
    This creates a bookmark to the current page which can be referred to with
    the given key elsewhere.

    PDF offers very fine grained control over how Acrobat reader is zoomed
    when people link to this. The default is to keep the user's current zoom
    settings. the last arguments may or may not be needed depending on the
    choice of 'fitType'.
    """

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

    fitType = attr.Choice(
        title=u'Fit Type',
        description=u'The Fit Type.',
        choices=('Fit', 'FitH', 'FitV', 'FitR'),
        required=False)

    left = attr.Measurement(
        title=u'Left',
        description=u'The left position.',
        required=False)

    right = attr.Measurement(
        title=u'Right',
        description=u'The right position.',
        required=False)

    top = attr.Measurement(
        title=u'Top',
        description=u'The top position.',
        required=False)

    right = attr.Measurement(
        title=u'Right',
        description=u'The right position.',
        required=False)

    zoom = attr.Float(
        title=u'Zoom',
        description=u'The zoom level when clicking on the bookmark.',
        required=False)
Exemplo n.º 29
0
class IXCategoryAxis(ICategoryAxis):
    """X-Category Axis"""

    tickUp = attr.Measurement(
        title='Tick Up',
        description='Length of tick above the axis line.',
        required=False)

    tickDown = attr.Measurement(
        title='Tick Down',
        description='Length of tick below the axis line.',
        required=False)

    joinAxisMode = attr.Choice(title='Join Axis Mode',
                               description='Mode for connecting axes.',
                               choices=('bottom', 'top', 'value', 'points',
                                        'None'),
                               required=False)
Exemplo n.º 30
0
class IYCategoryAxis(ICategoryAxis):
    """Y-Category Axis"""

    tickLeft = attr.Measurement(
        title='Tick Left',
        description='Length of tick left to the axis line.',
        required=False)

    tickRight = attr.Measurement(
        title='Tick Right',
        description='Length of tick right to the axis line.',
        required=False)

    joinAxisMode = attr.Choice(title='Join Axis Mode',
                               description='Mode for connecting axes.',
                               choices=('bottom', 'top', 'value', 'points',
                                        'None'),
                               required=False)