Exemplo n.º 1
0
class ISkew(interfaces.IRMLDirectiveSignature):
    """Skew the drawing."""

    alpha = attr.Measurement(
        title=u'Alpha',
        description=(u'The amount to skew the drawing in the horizontal.'),
        required=True)

    beta = attr.Measurement(
        title=u'Beta',
        description=(u'The amount to skew the drawing in the vertical.'),
        required=True)
Exemplo n.º 2
0
class ITranslate(interfaces.IRMLDirectiveSignature):
    """Translate the drawing coordinates by the specified x and y offset."""

    dx = attr.Measurement(
        title=u'X-Offset',
        description=(u'The amount to move the drawing to the right.'),
        required=True)

    dy = attr.Measurement(
        title=u'Y-Offset',
        description=(u'The amount to move the drawing upward.'),
        required=True)
Exemplo n.º 3
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='Start Angle',
        description='The start angle in the chart of the first slice '
        'in degrees.',
        required=False)

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

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

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

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

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

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

    yradius = attr.Measurement(title='Y-Radius',
                               description='The radius of the Y-directions',
                               required=False)
Exemplo n.º 4
0
class IPositionLabelBase(ILabelBase):

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

    y = attr.Measurement(
        title='Y-Coordinate',
        description=('The Y-coordinate of the lower-left position of the '
                     'label.'),
        required=False)
Exemplo n.º 5
0
class IIllustration(interfaces.IRMLDirectiveSignature):
    """Inserts an illustration with graphics elements."""

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

    height = attr.Measurement(
        title=u'Height',
        description=u'The height of the illustration.',
        default=100,
        required=True)
Exemplo n.º 6
0
class ISpacer(interfaces.IRMLDirectiveSignature):
    """Creates a vertical space in the flow."""

    width = attr.Measurement(
        title=u'Width',
        description=u'The width of the spacer. Currently not implemented.',
        default=100,
        required=False)

    length = attr.Measurement(
        title=u'Length',
        description=u'The height of the spacer.',
        required=True)
Exemplo n.º 7
0
class IBarCode(IBarCodeBase):
    """A barcode graphic."""

    x = attr.Measurement(
        title=u'X-Position',
        description=u'The x-position of the lower-left corner of the barcode.',
        default=0,
        required=False)

    y = attr.Measurement(
        title=u'Y-Position',
        description=u'The y-position of the lower-left corner of the barcode.',
        default=0,
        required=False)
Exemplo n.º 8
0
class IRectangle(IShape):
    """Draws an ellipse on the canvas."""

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

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

    round = attr.Measurement(title=u'Corner Radius',
                             description=u'The radius of the rounded corners.',
                             required=False)
Exemplo n.º 9
0
class IImage(interfaces.IRMLDirectiveSignature):
    """Draws an external image on the canvas."""

    file = attr.Image(
        title='File',
        description=('Reference to the external file of the iamge.'),
        required=True)

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

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

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

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

    showBoundary = attr.Boolean(
        title='Show Boundary',
        description=('A flag determining whether a border should be drawn '
                     'around the image.'),
        default=False,
        required=False)

    preserveAspectRatio = attr.Boolean(
        title='Preserve Aspect Ratio',
        description=("A flag determining whether the image's aspect ration "
                     "should be conserved under any circumstances."),
        default=False,
        required=False)

    mask = attr.Color(
        title='Mask',
        description=
        'The color mask used to render the image, or "auto" to use the alpha channel if available.',
        default='auto',
        required=False,
        acceptAuto=True)
Exemplo n.º 10
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.º 11
0
class ISelectField(IField):
    """A selection field within the PDF"""
    occurence.containing(occurence.ZeroOrMore('option', IOption))

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

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

    value = attr.Text(title=u'Value',
                      description=u'The default value of the field.',
                      required=False)
Exemplo n.º 12
0
class ISetFont(interfaces.IRMLDirectiveSignature):
    """Set the font name and/or size."""

    name = attr.String(
        title=u'Font Name',
        description=(u'The name of the font as it was registered.'),
        required=True)

    size = attr.Measurement(title=u'Size',
                            description=(u'The font size.'),
                            required=True)

    leading = attr.Measurement(title=u'Leading',
                               description=(u'The font leading.'),
                               required=False)
Exemplo n.º 13
0
class ILink(interfaces.IRMLDirectiveSignature):
    """Place an internal link around a set of flowables."""

    destination = attr.Text(
        title=u'Destination',
        description=u'The name of the destination to link to.',
        required=False)

    url = attr.Text(title=u'URL',
                    description=u'The URL to link to.',
                    required=False)

    boxStrokeWidth = attr.Measurement(
        title=u'Box Stroke Width',
        description=u'The width of the box border line.',
        required=False)

    boxStrokeDashArray = attr.Sequence(
        title=u'Box Stroke Dash Array',
        description=u'The dash array of the box border line.',
        value_type=attr.Float(),
        required=False)

    boxStrokeColor = attr.Color(
        title=u'Box Stroke Color',
        description=(u'The color in which the box border is drawn.'),
        required=False)
Exemplo n.º 14
0
class ISpanStyle(interfaces.IRMLDirectiveSignature):
    """Defines a span style and gives it a name."""

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

    alias = attr.String(
        title=u'Alias',
        description=u'An alias under which the style will also be known as.',
        required=False)

    parent = attr.Style(
        title=u'Parent',
        description=(u'The apragraph style that will be used as a base for '
                     u'this one.'),
        required=False)

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

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

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

    backColor = attr.Color(title=u'Background Color',
                           description=u'The background color of the span.',
                           required=False)
Exemplo n.º 15
0
class IBlockTopPadding(ITableStyleCommand):
    """Set the top padding of the cells."""

    length = attr.Measurement(
        title=u'Length',
        description=u'The size of the padding.',
        required=True)
Exemplo n.º 16
0
class IPath(IShape):
    """Create a line path."""
    occurence.containing(
        occurence.ZeroOrMore('moveto', IMoveTo),
        occurence.ZeroOrMore('curveto', ICurveTo),
        occurence.ZeroOrMore('curvesto', ICurvesTo),
    )

    points = attr.TextNodeGrid(
        title=u'Points',
        description=(u'A list of coordinate points that define th path.'),
        value_type=attr.Measurement(),
        columns=2,
        required=True)

    close = attr.Boolean(
        title=u'Close Path',
        description=(u"A flag specifying whether the path should be closed."),
        default=False,
        required=False)

    clip = attr.Boolean(
        title=u'Clip Path',
        description=(u"A flag specifying whether the path should clip "
                     u"overlapping elements."),
        default=False,
        required=False)
Exemplo n.º 17
0
class ILinePlot(IChart):
    """A line plot."""
    occurence.containing(occurence.One('data', IData2D),
                         occurence.ZeroOrOne('lines', ILines),
                         occurence.ZeroOrOne('xValueAxis', IXValueAxis),
                         occurence.ZeroOrOne('yValueAxis', IYValueAxis),
                         occurence.ZeroOrOne('lineLabels', ILineLabels),
                         *IChart.queryTaggedValue('directives', ()))

    reversePlotOrder = attr.Boolean(
        title='Reverse Plot Order',
        description='When true, the coordinate system is reversed.',
        required=False)

    lineLabelNudge = attr.Measurement(
        title='Line Label Nudge',
        description='The distance between the data point and its label.',
        required=False)

    lineLabelFormat = attr.Text(
        title='Line Label Format',
        description='Formatting string for data point labels.',
        required=False)

    joinedLines = attr.Boolean(
        title='Joined Lines',
        description='When true, connect all data points with lines.',
        required=False)

    inFill = attr.Boolean(
        title='Name',
        description=('Flag indicating whether the line plot should be filled, '
                     'in other words converted to an area chart.'),
        required=False)
Exemplo n.º 18
0
class IGrid(interfaces.IRMLDirectiveSignature):
    """A shape to be drawn on the canvas."""

    xs = attr.Sequence(
        title=u'X-Coordinates',
        description=(u'A sequence x-coordinates that represent the vertical '
                     u'line positions.'),
        value_type=attr.Measurement(),
        required=True)

    ys = attr.Sequence(
        title=u'Y-Coordinates',
        description=(u'A sequence y-coordinates that represent the horizontal '
                     u'line positions.'),
        value_type=attr.Measurement(),
        required=True)
Exemplo n.º 19
0
class ILinePlot(IChart):
    """A line plot."""
    occurence.containing(occurence.One('data', IData2D),
                         occurence.ZeroOrOne('lines', ILines),
                         occurence.ZeroOrOne('xValueAxis', IXValueAxis),
                         occurence.ZeroOrOne('yValueAxis', IYValueAxis),
                         occurence.ZeroOrOne('lineLabels', ILineLabels),
                         *IChart.queryTaggedValue('directives', ()))

    reversePlotOrder = attr.Boolean(
        title=u'Reverse Plot Order',
        description=u'When true, the coordinate system is reversed.',
        required=False)

    lineLabelNudge = attr.Measurement(
        title=u'Line Label Nudge',
        description=u'The distance between the data point and its label.',
        required=False)

    lineLabelFormat = attr.String(
        title=u'Line Label Format',
        description=u'Formatting string for data point labels.',
        required=False)

    joinedLines = attr.Boolean(
        title=u'Joined Lines',
        description=u'When true, connect all data points with lines.',
        required=False)
Exemplo n.º 20
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.º 21
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.º 22
0
class IBlockLeading(ITableStyleCommand):
    """Set the text leading."""

    length = attr.Measurement(
        title=u'Length',
        description=(u'The height of a single text line. It includes '
                     u'character height.'),
        required=True)
Exemplo n.º 23
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)
Exemplo n.º 24
0
class IFrame(interfaces.IRMLDirectiveSignature):
    """A frame on a page."""

    x1 = attr.Measurement(
        title=u'X-Position',
        description=u'The X-Position of the lower-left corner of the frame.',
        allowPercentage=True,
        required=True)

    y1 = attr.Measurement(
        title=u'Y-Position',
        description=u'The Y-Position of the lower-left corner of the frame.',
        allowPercentage=True,
        required=True)

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

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

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

    leftPadding = attr.Measurement(
        title=u'Left Padding',
        description=u'The left padding of the frame.',
        default=0,
        required=False)

    rightPadding = attr.Measurement(
        title=u'Right Padding',
        description=u'The right padding of the frame.',
        default=0,
        required=False)

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

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

    showBoundary = attr.Boolean(
        title=u'Show Boundary',
        description=u'A flag to show the boundary of the frame.',
        required=False)
Exemplo n.º 25
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.º 26
0
class IBlockFont(ITableStyleCommand):
    """Set the font properties for the texts."""

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

    size = 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)
Exemplo n.º 27
0
class ICurveTo(interfaces.IRMLDirectiveSignature):
    """Create a bezier curve from the current location to the specified one."""

    curvelist = attr.TextNodeGrid(
        title=u'Curve Specification',
        description=u'Describes the end position and the curve properties.',
        value_type=attr.Measurement(),
        columns=6,
        required=True)
Exemplo n.º 28
0
class ICurves(interfaces.IRMLDirectiveSignature):
    """A path of connected bezier curves drawn on the canvas."""

    curvelist = attr.TextNodeGrid(
        title=u'Curve List',
        description=(u'A list of curve coordinates to draw.'),
        value_type=attr.Measurement(),
        columns=8,
        required=True)
Exemplo n.º 29
0
class ILines(interfaces.IRMLDirectiveSignature):
    """A path of connected lines drawn on the canvas."""

    linelist = attr.TextNodeGrid(
        title='Line List',
        description=('A list of lines coordinates to draw.'),
        value_type=attr.Measurement(),
        columns=4,
        required=True)
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)