|
1 # |
|
2 # Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net> |
|
3 # All Rights Reserved. |
|
4 # |
|
5 # This software is subject to the provisions of the Zope Public License, |
|
6 # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. |
|
7 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED |
|
8 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
|
9 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS |
|
10 # FOR A PARTICULAR PURPOSE. |
|
11 # |
|
12 |
|
13 __docformat__ = 'restructuredtext' |
|
14 |
|
15 |
|
16 # import standard library |
|
17 |
|
18 # import interfaces |
|
19 from zope.annotation import IAttributeAnnotatable |
|
20 from zope.contentprovider.interfaces import IContentProvider |
|
21 |
|
22 # import packages |
|
23 from zope.interface import Interface, Attribute |
|
24 |
|
25 |
|
26 class IRenderedContent(IAttributeAnnotatable): |
|
27 """Generic interface for any rendered content""" |
|
28 |
|
29 renderer = Attribute("Selected renderer name") |
|
30 |
|
31 def get_renderer(self, request=None): |
|
32 """Get selected renderer implementation""" |
|
33 |
|
34 |
|
35 class IContentRenderer(IContentProvider): |
|
36 """Content renderer interface""" |
|
37 |
|
38 label = Attribute("Renderer label") |
|
39 |
|
40 target_interface = Attribute("Renderer target interface") |
|
41 |
|
42 |
|
43 class IRendererSettings(Interface): |
|
44 """Base renderer settings interface""" |