'Create TextBlock.
@param textStyle: The L{TextStyle} for this block.
@param blockStyle: The L{BlockStyle} for this block.
@param settings: C{dict} of extra settings to apply to this block.'

def __init__(self, textStyle=defaultTextStyle, blockStyle=defaultBlockStyle, **settings):

    LrsObject.__init__(self)
    LrsContainer.__init__(self, [Paragraph, CR])
    self.textSettings = {}
    self.blockSettings = {}
    for (name, value) in settings.items():
        if (name in TextStyle.validSettings):
            self.textSettings[name] = value
        elif (name in BlockStyle.validSettings):
            self.blockSettings[name] = value
        elif (name == 'toclabel'):
            self.tocLabel = value
        else:
            raise LrsError(('%s    not    a    valid    setting    for    TextBlock' % name))
    self.textStyle = textStyle
    self.blockStyle = blockStyle
    self.currentTextStyle = (textStyle.copy() if self.textSettings else textStyle)
    self.currentTextStyle.attrs.update(self.textSettings)
