Esempio n. 1
0
class CT_NonVisualDrawingProps(BaseOxmlElement):
    """
    Used for ``<wp:docPr>`` element, and perhaps others. Specifies the id and
    name of a DrawingML drawing.
    """
    id = RequiredAttribute('id', ST_DrawingElementId)
    name = RequiredAttribute('name', XsdString)
Esempio n. 2
0
class CT_PivotCache(BaseOxmlElement):
    """
    Complex type (sml-workbook.xsd)
    
    """
    cacheId = RequiredAttribute('cacheId', XsdUnsignedInt)  # PivotCache Id
    rid = RequiredAttribute('r:id', ST_RelationshipId)  # Relationship Id
Esempio n. 3
0
class CT_CellSmartTagPr(BaseOxmlElement):
    """
    Complex type (sml-sheet.xsd)
    
    """
    key = RequiredAttribute('key', ST_Xstring)  # Key Name
    val = RequiredAttribute('val', ST_Xstring)  # Value
Esempio n. 4
0
class CT_Point2D(BaseOxmlElement):
    """
    Used for ``<a:off>`` element, and perhaps others. Specifies an x, y
    coordinate (point).
    """
    x = RequiredAttribute('x', ST_Coordinate)
    y = RequiredAttribute('y', ST_Coordinate)
Esempio n. 5
0
class CT_Comment(BaseOxmlElement):
    p = ZeroOrMore('w:p', successors=('w:altChunk', ))
    tbl = ZeroOrMore('w:tbl', successors=('w:altChunk', ))
    altChunk = ZeroOrMore('w:altChunk', successors=())

    id = RequiredAttribute('w:id', ST_DecimalNumber)
    author = RequiredAttribute('w:author', ST_String)
Esempio n. 6
0
class CT_TblWidth(BaseOxmlElement):
    """
    Used for ``<w:tblW>`` and ``<w:tcW>`` elements and many others, to
    specify a table-related width.
    """
    # the type for `w` attr is actually ST_MeasurementOrPercent, but using
    # XsdInt for now because only dxa (twips) values are being used. It's not
    # entirely clear what the semantics are for other values like -01.4mm
    w = RequiredAttribute('w:w', XsdInt)
    type = RequiredAttribute('w:type', ST_TblWidth)

    @property
    def width(self):
        """
        Return the EMU length value represented by the combined ``w:w`` and
        ``w:type`` attributes.
        """
        if self.type != 'dxa':
            return None
        return Twips(self.w)

    @width.setter
    def width(self, value):
        self.type = 'dxa'
        self.w = Emu(value).twips
Esempio n. 7
0
class CT_CustomProperty(BaseOxmlElement):
    """
    Complex type (sml-sheet.xsd)
    
    """
    name = RequiredAttribute('name', ST_Xstring)  # Custom Property Name
    rid = RequiredAttribute('r:id', ST_RelationshipId)  # Relationship Id
Esempio n. 8
0
class CT_PositiveSize2D(BaseOxmlElement):
    """
    Used for ``<wp:extent>`` element, and perhaps others later. Specifies the
    size of a DrawingML drawing.
    """
    cx = RequiredAttribute('cx', ST_PositiveCoordinate)
    cy = RequiredAttribute('cy', ST_PositiveCoordinate)
class CT_PhoneticRun(BaseOxmlElement):
    """
    Complex type: 
    """
    t = OneAndOnlyOne('ssml:t')  # Text

    sb = RequiredAttribute('sb', XsdUnsignedInt)  # Base Text Start Index
    eb = RequiredAttribute('eb', XsdUnsignedInt)  # Base Text End Index
Esempio n. 10
0
class CT_Control(BaseOxmlElement):
    """
    Complex type (sml-sheet.xsd)
    
    """
    shapeId = RequiredAttribute('shapeId', XsdUnsignedInt)  # Shape Id
    rid = RequiredAttribute('r:id', ST_RelationshipId)  # Relationship Id
    name = OptionalAttribute('name', XsdString)  # Control Name
Esempio n. 11
0
class CT_NumFmt(BaseOxmlElement):
    """
    Complex type (sml-styles.xsd)
    
    """
    numFmtId = RequiredAttribute('numFmtId', ST_NumFmtId)  # Number Format Id
    formatCode = RequiredAttribute('formatCode',
                                   ST_Xstring)  # Number Format Code
Esempio n. 12
0
class CT_TabStop(BaseOxmlElement):
    """
    ``<w:tab>`` element, representing an individual tab stop.
    """
    val = RequiredAttribute('w:val', WD_TAB_ALIGNMENT)
    leader = OptionalAttribute('w:leader',
                               WD_TAB_LEADER,
                               default=WD_TAB_LEADER.SPACES)
    pos = RequiredAttribute('w:pos', ST_SignedTwipsMeasure)
Esempio n. 13
0
class CT_ProtectedRange(BaseOxmlElement):
    """
    Complex type (sml-sheet.xsd)
    
    """
    password = OptionalAttribute('password', ST_UnsignedShortHex)  # Password
    sqref = RequiredAttribute('sqref', ST_Sqref)  # Sequence of References
    name = RequiredAttribute('name', ST_Xstring)  # Name
    securityDescriptor = OptionalAttribute('securityDescriptor',
                                           XsdString)  # Security Descriptor
Esempio n. 14
0
class CT_InputCells(BaseOxmlElement):
    """
    Complex type (sml-sheet.xsd)
    
    """
    r = RequiredAttribute('r', ST_CellRef)  # Reference
    deleted = OptionalAttribute('deleted', XsdBoolean, False)  # Deleted
    undone = OptionalAttribute('undone', XsdBoolean, False)  # Undone
    val = RequiredAttribute('val', ST_Xstring)  # Value
    numFmtId = OptionalAttribute('numFmtId', ST_NumFmtId)  # Number Format Id
Esempio n. 15
0
class CT_Sheet(BaseOxmlElement):
    """
    Complex type (sml-workbook.xsd)
    
    """
    name = RequiredAttribute('name', ST_Xstring)  # Sheet Name
    sheetId = RequiredAttribute('sheetId', XsdUnsignedInt)  # Sheet Tab Id
    state = OptionalAttribute('state', ST_SheetState,
                              'visible')  # Visible State
    rid = RequiredAttribute('r:id', ST_RelationshipId)  # Relationship Id
Esempio n. 16
0
class CT_CustomWorkbookView(BaseOxmlElement):
    """
    Complex type (sml-workbook.xsd)
    
    """
    extLst = ZeroOrMore('ssml:extLst')  # None

    name = RequiredAttribute('name', ST_Xstring)  # Custom View Name
    guid = RequiredAttribute('guid', ST_Guid)  # Custom View GUID
    autoUpdate = OptionalAttribute('autoUpdate', XsdBoolean,
                                   False)  # Auto Update
    mergeInterval = OptionalAttribute('mergeInterval',
                                      XsdUnsignedInt)  # Merge Interval
    changesSavedWin = OptionalAttribute('changesSavedWin', XsdBoolean,
                                        False)  # Changes Saved Win
    onlySync = OptionalAttribute('onlySync', XsdBoolean, False)  # Only Synch
    personalView = OptionalAttribute('personalView', XsdBoolean,
                                     False)  # Personal View
    includePrintSettings = OptionalAttribute('includePrintSettings',
                                             XsdBoolean,
                                             True)  # Include Print Settings
    includeHiddenRowCol = OptionalAttribute(
        'includeHiddenRowCol', XsdBoolean,
        True)  # Include Hidden Rows & Columns
    maximized = OptionalAttribute('maximized', XsdBoolean, False)  # Maximized
    minimized = OptionalAttribute('minimized', XsdBoolean, False)  # Minimized
    showHorizontalScroll = OptionalAttribute('showHorizontalScroll',
                                             XsdBoolean,
                                             True)  # Show Horizontal Scroll
    showVerticalScroll = OptionalAttribute('showVerticalScroll', XsdBoolean,
                                           True)  # Show Vertical Scroll
    showSheetTabs = OptionalAttribute('showSheetTabs', XsdBoolean,
                                      True)  # Show Sheet Tabs
    xWindow = OptionalAttribute('xWindow', XsdInt,
                                0)  # Top Left Corner (X Coordinate)
    yWindow = OptionalAttribute('yWindow', XsdInt,
                                0)  # Top Left Corner (Y Coordinate)
    windowWidth = RequiredAttribute('windowWidth',
                                    XsdUnsignedInt)  # Window Width
    windowHeight = RequiredAttribute('windowHeight',
                                     XsdUnsignedInt)  # Window Height
    tabRatio = OptionalAttribute('tabRatio', XsdUnsignedInt,
                                 600)  # Sheet Tab Ratio
    activeSheetId = RequiredAttribute(
        'activeSheetId', XsdUnsignedInt)  # Active Sheet in Book View
    showFormulaBar = OptionalAttribute('showFormulaBar', XsdBoolean,
                                       True)  # Show Formula Bar
    showStatusbar = OptionalAttribute('showStatusbar', XsdBoolean,
                                      True)  # Show Status Bar
    showComments = OptionalAttribute('showComments', ST_Comments,
                                     'commIndicator')  # Show Comments
    showObjects = OptionalAttribute('showObjects', ST_Objects,
                                    'all')  # Show Objects
Esempio n. 17
0
class CT_DateGroupItem(BaseOxmlElement):
    """
    Complex type (sml-autoFilter.xsd)
    
    """
    year = RequiredAttribute('year', XsdUnsignedShort) # Year
    month = OptionalAttribute('month', XsdUnsignedShort) # Month
    day = OptionalAttribute('day', XsdUnsignedShort) # Day
    hour = OptionalAttribute('hour', XsdUnsignedShort) # Hour
    minute = OptionalAttribute('minute', XsdUnsignedShort) # Minute
    second = OptionalAttribute('second', XsdUnsignedShort) # Second
    dateTimeGrouping = RequiredAttribute('dateTimeGrouping', ST_DateTimeGrouping) # Date Time Grouping
Esempio n. 18
0
class CT_WebPublishObject(BaseOxmlElement):
    """
    Complex type (sml-workbook.xsd)
    
    """
    id = RequiredAttribute('id', XsdUnsignedInt)  # Id
    divId = RequiredAttribute('divId', ST_Xstring)  # Div Id
    sourceObject = OptionalAttribute('sourceObject',
                                     ST_Xstring)  # Source Object
    destinationFile = RequiredAttribute('destinationFile',
                                        ST_Xstring)  # Destination File
    title = OptionalAttribute('title', ST_Xstring)  # Title
    autoRepublish = OptionalAttribute('autoRepublish', XsdBoolean,
                                      False)  # Auto Republish
Esempio n. 19
0
class CT_IconFilter(BaseOxmlElement):
    """
    Complex type (sml-autoFilter.xsd)
    
    """
    iconSet = RequiredAttribute('iconSet', ST_IconSetType) # Icon Set
    iconId = OptionalAttribute('iconId', XsdUnsignedInt) # Icon Id
Esempio n. 20
0
class CT_DataValidation(BaseOxmlElement):
    """
    Complex type (sml-sheet.xsd)
    
    """
    formula1 = ZeroOrOne('ssml:formula1')  # Formula 1
    formula2 = ZeroOrOne('ssml:formula2')  # Formula 2

    type = OptionalAttribute('type', ST_DataValidationType,
                             'none')  # Data Validation Type
    errorStyle = OptionalAttribute('errorStyle', ST_DataValidationErrorStyle,
                                   'stop')  # Data Validation Error Style
    imeMode = OptionalAttribute('imeMode', ST_DataValidationImeMode,
                                'noControl')  # IME Mode Enforced
    operator = OptionalAttribute('operator', ST_DataValidationOperator,
                                 'between')  # Operator
    allowBlank = OptionalAttribute('allowBlank', XsdBoolean,
                                   False)  # Allow Blank
    showDropDown = OptionalAttribute('showDropDown', XsdBoolean,
                                     False)  # Show Drop Down
    showInputMessage = OptionalAttribute('showInputMessage', XsdBoolean,
                                         False)  # Show Input Message
    showErrorMessage = OptionalAttribute('showErrorMessage', XsdBoolean,
                                         False)  # Show Error Message
    errorTitle = OptionalAttribute('errorTitle',
                                   ST_Xstring)  # Error Alert Text
    error = OptionalAttribute('error', ST_Xstring)  # Error Message
    promptTitle = OptionalAttribute('promptTitle', ST_Xstring)  # Prompt Title
    prompt = OptionalAttribute('prompt', ST_Xstring)  # Input Prompt
    sqref = RequiredAttribute('sqref', ST_Sqref)  # Sequence of References
Esempio n. 21
0
class CT_CfRule(BaseOxmlElement):
    """
    Complex type (sml-sheet.xsd)
    
    """
    formula = ZeroOrMore('ssml:formula')  # Formula
    colorScale = ZeroOrOne('ssml:colorScale')  # Color Scale
    dataBar = ZeroOrOne('ssml:dataBar')  # Data Bar
    iconSet = ZeroOrOne('ssml:iconSet')  # Icon Set
    extLst = ZeroOrMore('ssml:extLst')  # None

    type = OptionalAttribute('type', ST_CfType)  # Type
    dxfId = OptionalAttribute('dxfId', ST_DxfId)  # Differential Formatting Id
    priority = RequiredAttribute('priority', XsdInt)  # Priority
    stopIfTrue = OptionalAttribute('stopIfTrue', XsdBoolean,
                                   False)  # Stop If True
    aboveAverage = OptionalAttribute('aboveAverage', XsdBoolean,
                                     True)  # Above Or Below Average
    percent = OptionalAttribute('percent', XsdBoolean, False)  # Top 10 Percent
    bottom = OptionalAttribute('bottom', XsdBoolean, False)  # Bottom N
    operator = OptionalAttribute('operator',
                                 ST_ConditionalFormattingOperator)  # Operator
    text = OptionalAttribute('text', XsdString)  # Text
    timePeriod = OptionalAttribute('timePeriod', ST_TimePeriod)  # Time Period
    rank = OptionalAttribute('rank', XsdUnsignedInt)  # Rank
    stdDev = OptionalAttribute('stdDev', XsdInt)  # StdDev
    equalAverage = OptionalAttribute('equalAverage', XsdBoolean,
                                     False)  # Equal Average
Esempio n. 22
0
class CT_Color(BaseOxmlElement):
    """
    `w:color` element, specifying the color of a font and perhaps other
    objects.
    """
    val = RequiredAttribute('w:val', ST_HexColor)
    themeColor = OptionalAttribute('w:themeColor', MSO_THEME_COLOR)
Esempio n. 23
0
class CT_FtnEdn(BaseOxmlElement):
    p = ZeroOrMore('w:p', successors=('w:altChunk', ))
    tbl = ZeroOrMore('w:tbl', successors=('w:altChunk', ))
    altChunk = ZeroOrMore('w:altChunk', successors=())

    type = OptionalAttribute('w:type', ST_FtnEdn)
    id = RequiredAttribute('w:id', ST_DecimalNumber)
Esempio n. 24
0
class CT_Num(BaseOxmlElement):
    """
    ``<w:num>`` element, which represents a concrete list definition
    instance, having a required child <w:abstractNumId> that references an
    abstract numbering definition that defines most of the formatting details.
    """
    abstractNumId = OneAndOnlyOne('w:abstractNumId')
    lvlOverride = ZeroOrMore('w:lvlOverride')
    numId = RequiredAttribute('w:numId', ST_DecimalNumber)

    def add_lvlOverride(self, ilvl):
        """
        Return a newly added CT_NumLvl (<w:lvlOverride>) element having its
        ``ilvl`` attribute set to *ilvl*.
        """
        return self._add_lvlOverride(ilvl=ilvl)

    @classmethod
    def new(cls, num_id, abstractNum_id):
        """
        Return a new ``<w:num>`` element having numId of *num_id* and having
        a ``<w:abstractNumId>`` child with val attribute set to
        *abstractNum_id*.
        """
        num = OxmlElement('w:num')
        num.numId = num_id
        abstractNumId = CT_DecimalNumber.new('w:abstractNumId', abstractNum_id)
        num.append(abstractNumId)
        return num
Esempio n. 25
0
class CT_TableStyleElement(BaseOxmlElement):
    """
    Complex type (sml-styles.xsd)
    
    """
    type = RequiredAttribute('type', ST_TableStyleType)  # Table Style Type
    size = OptionalAttribute('size', XsdUnsignedInt, 1)  # Band Size
    dxfId = OptionalAttribute('dxfId', ST_DxfId)  # Formatting Id
class CT_PhoneticPr(BaseOxmlElement):
    """
    Complex type: 
    """
    fontId = RequiredAttribute('fontId', ST_FontId)  # Font Id
    type = OptionalAttribute('type', ST_PhoneticType)  # Character Type
    alignment = OptionalAttribute('alignment',
                                  ST_PhoneticAlignment)  # Alignment
Esempio n. 27
0
class CT_WebPublishItem(BaseOxmlElement):
    """
    Complex type (sml-sheet.xsd)
    
    """
    id = RequiredAttribute('id', XsdUnsignedInt)  # Id
    divId = RequiredAttribute('divId', ST_Xstring)  # Destination Bookmark
    sourceType = RequiredAttribute('sourceType',
                                   ST_WebSourceType)  # Web Source Type
    sourceRef = OptionalAttribute('sourceRef', ST_Ref)  # Source Id
    sourceObject = OptionalAttribute('sourceObject',
                                     ST_Xstring)  # Source Object Name
    destinationFile = RequiredAttribute('destinationFile',
                                        ST_Xstring)  # Destination File Name
    title = OptionalAttribute('title', ST_Xstring)  # Title
    autoRepublish = OptionalAttribute('autoRepublish', XsdBoolean,
                                      False)  # Automatically Publish
Esempio n. 28
0
class CT_CellSmartTags(BaseOxmlElement):
    """
    Complex type (sml-sheet.xsd)
    
    """
    cellSmartTag = OneOrMore('ssml:cellSmartTag')  # Cell Smart Tag

    r = RequiredAttribute('r', ST_CellRef)  # Reference
Esempio n. 29
0
class CT_DynamicFilter(BaseOxmlElement):
    """
    Complex type (sml-autoFilter.xsd)
    
    """
    type = RequiredAttribute('type', ST_DynamicFilterType) # Dynamic filter type
    val = OptionalAttribute('val', XsdDouble) # Value
    maxVal = OptionalAttribute('maxVal', XsdDouble) # Max Value
Esempio n. 30
0
class CT_GradientStop(BaseOxmlElement):
    """
    Complex type (sml-styles.xsd)
    
    """
    color = OneAndOnlyOne('ssml:color')  # Color

    position = RequiredAttribute('position',
                                 XsdDouble)  # Gradient Stop Position