src/pyams_content/shared/imagemap/interfaces/__init__.py
changeset 69 8c5bbc396670
child 139 99a481dc4c89
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_content/shared/imagemap/interfaces/__init__.py	Fri Jan 20 15:42:51 2017 +0100
@@ -0,0 +1,70 @@
+#
+# 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 pyams_content.shared.common.interfaces import ISharedTool, IWfSharedContent, ISharedContent
+from zope.annotation.interfaces import IAttributeAnnotatable
+
+# import packages
+from pyams_content.shared.imagemap.schema import MapArea
+from pyams_i18n.schema import I18nTextLineField, I18nImageField
+from pyams_utils.schema import PersistentDict
+from zope.schema import Object, Choice
+
+from pyams_content import _
+
+
+IMAGEMAP_CONTENT_TYPE = 'imagemap'
+IMAGEMAP_CONTENT_NAME = _("Image map")
+
+
+class IImageMapManager(ISharedTool):
+    """Image maps manager interface"""
+
+
+class IImageMapArea(IAttributeAnnotatable):
+    """Image map area interface"""
+
+    title = I18nTextLineField(title=_("Area title"),
+                              description=_("Label associated with this area"),
+                              required=True)
+
+    link = Choice(title=_("Link target"),
+                  description=_("Internal or external link associated with this map area"),
+                  vocabulary="PyAMS content links",
+                  required=True)
+
+    area = MapArea(title=_("Map area coordinates"),
+                   description=_("List of coordinates of image area"),
+                   required=True)
+
+
+class IWfImageMap(IWfSharedContent):
+    """Image map interface"""
+
+    image = I18nImageField(title=_("Image"),
+                           description=_("Image supporting map areas"),
+                           required=True)
+
+    areas = PersistentDict(title=_("Image map areas"),
+                           description=_("List of defined map areas"),
+                           value_type=Object(schema=IImageMapArea),
+                           required=False)
+
+
+class IImageMap(ISharedContent):
+    """Workflow managed image map interface"""