src/pyams_content/features/menu/interfaces/__init__.py
changeset 635 ac6c59149f0d
child 688 22a501f58d06
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_content/features/menu/interfaces/__init__.py	Wed Jun 13 11:30:18 2018 +0200
@@ -0,0 +1,75 @@
+#
+# Copyright (c) 2008-2018 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.component.association.interfaces import IAssociationContainer, IAssociationContainerTarget
+from zope.annotation.interfaces import IAttributeAnnotatable
+
+# import packages
+from pyams_i18n.schema import I18nTextLineField
+from zope.container.constraints import containers, contains
+from zope.interface import Interface
+from zope.schema import Bool
+
+from pyams_content import _
+
+
+class IMenuLink(Interface):
+    """Menu link marker interface"""
+
+
+class IMenuInternalLink(IMenuLink):
+    """Menu internal link marker interface"""
+
+
+class IMenuExternalLink(IMenuLink):
+    """Menu external link marker interface"""
+
+
+class IMenuLinksContainer(IAssociationContainer):
+    """Menu links container interface"""
+
+    contains(IMenuLink)
+
+
+class IMenuLinksContainerTarget(IAssociationContainerTarget):
+    """Menu links container marker interface"""
+
+
+class IMenu(IMenuLinksContainer):
+    """Menu container interface"""
+
+    containers('.IMenusContainer')
+
+    visible = Bool(title=_("Visible?"),
+                   description=_("Is this item visible in front-office?"),
+                   required=True,
+                   default=True)
+
+    title = I18nTextLineField(title=_("Menu title"),
+                              description=_("Displayed menu label"),
+                              required=True)
+
+
+class IMenusContainer(IAssociationContainer):
+    """Menus container interface"""
+
+    contains(IMenu)
+
+
+class IMenusContainerTarget(IAttributeAnnotatable):
+    """Menus container target marker interface"""