diff -r 99a481dc4c89 -r 67bad9f880ee src/pyams_content/component/illustration/interfaces/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/pyams_content/component/illustration/interfaces/__init__.py Mon Sep 11 14:54:30 2017 +0200 @@ -0,0 +1,76 @@ +# +# Copyright (c) 2008-2015 Thierry Florac +# All Rights Reserved. +# +# This software is subject to the provisions of the Zope Public License, +# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. +# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED +# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS +# FOR A PARTICULAR PURPOSE. +# + +__docformat__ = 'restructuredtext' + + +# import standard library + +# import interfaces +from pyams_content.component.paragraph.interfaces import IBaseParagraph +from pyams_i18n.schema import I18nTextLineField, I18nThumbnailImageField, I18nTextField +from zope.annotation.interfaces import IAttributeAnnotatable +from zope.contentprovider.interfaces import IContentProvider + +# import packages +from zope.interface import Interface, Attribute +from zope.schema import Choice, TextLine + +from pyams_content import _ + + +# +# Illustration +# + +ILLUSTRATION_KEY = 'pyams_content.illustration' + + +class IIllustration(Interface): + """Illustration paragraph""" + + title = I18nTextLineField(title=_("Legend"), + description=_("Illustration title"), + required=False) + + alt_title = I18nTextLineField(title=_("Accessibility title"), + description=_("Alternate title used to describe image content"), + required=False) + + description = I18nTextField(title=_("Description"), + description=_(""), + required=False) + + author = TextLine(title=_("Author"), + description=_("Name of picture's author"), + required=False) + + data = I18nThumbnailImageField(title=_("Image data"), + description=_("Image content"), + required=True) + + renderer = Choice(title=_("Image style"), + vocabulary='PyAMS illustration renderers') + + +class IIllustrationTarget(IAttributeAnnotatable): + """Illustration target marker interface""" + + +class IIllustrationRenderer(IContentProvider): + """Illustration renderer utility interface""" + + label = Attribute("Renderer label") + + +class IIllustrationParagraph(IIllustration, IBaseParagraph): + """Illustration paragraph"""