src/pyams_content/features/renderer/interfaces.py
changeset 1059 34e6d07ea2e9
parent 867 17c1149151aa
child 1068 71efa4864cce
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_content/features/renderer/interfaces.py	Tue Nov 06 14:40:22 2018 +0100
@@ -0,0 +1,57 @@
+#
+# Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
+# 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 zope.annotation import IAttributeAnnotatable
+from zope.contentprovider.interfaces import IContentProvider
+
+# import packages
+from zope.interface import Interface, Attribute
+
+
+HIDDEN_RENDERER_NAME = 'hidden'
+
+
+class IRenderedContent(IAttributeAnnotatable):
+    """Generic interface for any rendered content"""
+
+    renderer = Attribute("Selected renderer name")
+
+    def get_renderer(self, request=None):
+        """Get selected renderer implementation"""
+
+
+class IContentRenderer(IContentProvider):
+    """Content renderer interface"""
+
+    label = Attribute("Renderer label")
+    weight = Attribute("Renderer weight, used for ordering")
+
+    settings_interface = Attribute("Renderer settings interface")
+    resources = Attribute("Iterable of needed Fanstatic resources")
+
+    language = Attribute("Renderer language (if forced)")
+    context_attrs = Attribute("Context attributes defined into renderer")
+    i18n_context_attrs = Attribute("I18n context attributes defined into renderer")
+
+
+class ISharedContentRenderer(IContentRenderer):
+    """Shared content renderer interface"""
+
+
+class IRendererSettings(Interface):
+    """Base renderer settings interface"""