src/pyams_content/component/illustration/interfaces/__init__.py
changeset 395 2a39b333a585
parent 393 23596d06c24a
child 397 fe989328a54f
equal deleted inserted replaced
394:1ebcb03e9bff 395:2a39b333a585
    15 
    15 
    16 # import standard library
    16 # import standard library
    17 
    17 
    18 # import interfaces
    18 # import interfaces
    19 from pyams_content.component.paragraph.interfaces import IBaseParagraph
    19 from pyams_content.component.paragraph.interfaces import IBaseParagraph
       
    20 from pyams_content.features.renderer.interfaces import IRenderedContent
    20 from pyams_i18n.schema import I18nTextLineField, I18nTextField, I18nThumbnailMediaField
    21 from pyams_i18n.schema import I18nTextLineField, I18nTextField, I18nThumbnailMediaField
    21 from zope.annotation.interfaces import IAttributeAnnotatable
    22 from zope.annotation.interfaces import IAttributeAnnotatable
    22 from zope.contentprovider.interfaces import IContentProvider
       
    23 
    23 
    24 # import packages
    24 # import packages
    25 from zope.interface import Interface, Attribute
       
    26 from zope.schema import Choice, TextLine
    25 from zope.schema import Choice, TextLine
    27 
    26 
    28 from pyams_content import _
    27 from pyams_content import _
    29 
    28 
    30 
    29 
    33 #
    32 #
    34 
    33 
    35 ILLUSTRATION_KEY = 'pyams_content.illustration'
    34 ILLUSTRATION_KEY = 'pyams_content.illustration'
    36 
    35 
    37 
    36 
    38 class IIllustration(Interface):
    37 class IIllustration(IRenderedContent):
    39     """Illustration paragraph"""
    38     """Illustration paragraph"""
    40 
    39 
    41     title = I18nTextLineField(title=_("Legend"),
    40     title = I18nTextLineField(title=_("Legend"),
    42                               required=False)
    41                               required=False)
    43 
    42 
    61                         description=_("Name under which the file will be saved"),
    60                         description=_("Name under which the file will be saved"),
    62                         required=False)
    61                         required=False)
    63 
    62 
    64     renderer = Choice(title=_("Illustration template"),
    63     renderer = Choice(title=_("Illustration template"),
    65                       description=_("Presentation template used for illustration"),
    64                       description=_("Presentation template used for illustration"),
    66                       vocabulary='PyAMS illustration renderers')
    65                       vocabulary='PyAMS illustration renderers',
       
    66                       default='hidden')
    67 
    67 
    68     language = Choice(title=_("Language"),
    68     language = Choice(title=_("Language"),
    69                       description=_("File's content language"),
    69                       description=_("File's content language"),
    70                       vocabulary="PyAMS base languages",
    70                       vocabulary="PyAMS base languages",
    71                       required=False)
    71                       required=False)
    72 
    72 
    73 
    73 
    74 class IIllustrationTarget(IAttributeAnnotatable):
    74 class IIllustrationTarget(IAttributeAnnotatable):
    75     """Illustration target marker interface"""
    75     """Illustration target marker interface"""
    76 
       
    77 
       
    78 class IIllustrationRenderer(IContentProvider):
       
    79     """Illustration renderer utility interface"""
       
    80 
       
    81     label = Attribute("Renderer label")
       
    82 
    76 
    83 
    77 
    84 class IIllustrationParagraph(IIllustration, IBaseParagraph):
    78 class IIllustrationParagraph(IIllustration, IBaseParagraph):
    85     """Illustration paragraph"""
    79     """Illustration paragraph"""
    86 
    80