--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/pyams_skin/interfaces/__init__.py Thu Feb 19 10:59:00 2015 +0100
@@ -0,0 +1,129 @@
+#
+# 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.component.interfaces import IObjectEvent, ObjectEvent
+
+# import packages
+from zope.interface import implementer, Interface, Attribute
+from zope.configuration.fields import GlobalInterface
+from zope.schema import Text, TextLine, Choice, Int
+
+from pyams_skin import _
+
+
+class ISkin(Interface):
+ """Skin interface
+
+ Skins are registered as utilities implementing this interface
+ and defining request layer as attribute
+ """
+
+ label = TextLine(title="Skin name")
+
+ layer = GlobalInterface(title="Request layer",
+ description="This interface will be used to tag request layer",
+ required=True)
+
+
+class ISkinChangedEvent(IObjectEvent):
+ """Skin changed event"""
+
+
+@implementer(ISkinChangedEvent)
+class SkinChangedEvent(ObjectEvent):
+ """Request skin changed event"""
+
+
+class ISkinnable(Interface):
+ """Skinnable content interface"""
+
+ def get_skin(self, request=None):
+ """Get skin matching this content"""
+
+
+class IUserSkinnable(ISkinnable):
+ """User skinnable content interface"""
+
+ skin = Choice(title=_("Presentation skin"),
+ description=_("This skin will be used to handle presentation templates"),
+ vocabulary='PyAMS skins')
+
+
+class IFullPage(Interface):
+ """Full page marker interface"""
+
+
+class IModalFullPage(IFullPage):
+ """Full page modal dialog marker interface"""
+
+ dialog_class = Attribute("Default dialog CSS class")
+
+
+class IInnerPage(Interface):
+ """Inner page marker interface"""
+
+
+class IModalPage(Interface):
+ """Modal page marker interface"""
+
+
+class IDialog(IModalPage):
+ """Modal dialog interface"""
+
+ modal_class = TextLine(title="Modal dialog CSS class",
+ default='modal-medium')
+
+
+class IPageHeader(Interface):
+ """Page header interface used by 'header' content provider"""
+
+ icon_class = TextLine(title='Icon CSS class')
+
+ title = TextLine(title='Page title')
+
+ subtitle = TextLine(title='Page sub-title')
+
+
+class IContentHelp(Interface):
+ """Content help block"""
+
+ outer_margin = Int(title='Outer margin size',
+ default=0)
+
+ status = TextLine(title='Help status',
+ default='info')
+
+ header = TextLine(title='Help header')
+
+ message = Text(title='Help message')
+
+ message_format = Choice(title='Help message format',
+ vocabulary='PyAMS HTML renderers')
+
+
+class IContentSearch(Interface):
+ """Content search interface"""
+
+ def get_search_results(self, data):
+ """Extract search results from given data
+
+ `data` is a dictionary containing search fields
+ """
+
+
+class ISearchPage(Interface):
+ """Search page marker interface"""